Respuesta: FPDF problema con chrome al guardar un archivo pdf Estimados este es el codigo
<%
Set pdf = CreateJsObject ("FPDF")
pdf.CreatePDF "P", "mm", "A4"
pdf.SetPath ("FPDF/")
pdf.Open ()
pdf.AddPage ()
pdf.SetFont "Arial","B",7
pdf.SetXY 0,0
pdf.Cell 0,14,N_EMPRESA
pdf.SetXY 0,0
pdf.Cell 0,20,rut_empresa
pdf.SetXY 0,0
pdf.Cell 0,25,direccion
pdf.Image "logomelon.jpg",170,0,30,20
pdf.SetFont "Arial","B",16
pdf.SetXY 50,20
pdf.Cell 0,0,"LIQUIDACION DE REMUNERACIONES"
pdf.SetFont "Arial","B",10
pdf.SetXY 90,28
pdf.Cell 0,0,MES_ANIO
pdf.rect 2,35,198,40
pdf.SetFont "Arial","B",6
pdf.SetXY 10,0
pdf.Cell 0,80,"RUT"
pdf.SetFont "Arial","B",6
pdf.SetXY 100,0
pdf.Cell 0,80,rut
pdf.SetXY 70,0
pdf.Cell 0,80,":"
pdf.SetXY 70,3
pdf.Cell 0,80,":"
pdf.SetXY 70,6
pdf.Cell 0,80,":"
pdf.SetXY 70,9
pdf.Cell 0,80,":"
pdf.SetXY 70,12
pdf.Cell 0,80,":"
pdf.SetXY 70,15
pdf.Cell 0,80,":"
pdf.SetXY 70,18
pdf.Cell 0,80,":"
pdf.SetXY 70,21
pdf.Cell 0,80,":"
pdf.SetXY 70,24
pdf.Cell 0,80,":"
pdf.SetXY 70,27
pdf.Cell 0,80,":"
pdf.SetXY 70,30
pdf.Cell 0,80,":"
pdf.SetFont "Arial","B",6
pdf.SetXY 10,3
pdf.Cell 0,80,"NOMBRE"
pdf.SetFont "Arial","B",6
pdf.SetXY 100,3
pdf.Cell 0,80,nombre
pdf.SetFont "Arial","B",6
pdf.SetXY 10,6
pdf.Cell 0,80,"CARGO"
pdf.SetFont "Arial","B",6
pdf.SetXY 100,6
pdf.Cell 0,80,cargo
pdf.SetFont "Arial","B",6
pdf.SetXY 10,9
pdf.Cell 0,80,"C. DE COSTO"
pdf.SetFont "Arial","B",6
pdf.SetXY 100,9
pdf.Cell 0,80,c_costo
pdf.SetFont "Arial","B",6
pdf.SetXY 10,12
pdf.Cell 0,80,"F.CONTRATO"
pdf.SetFont "Arial","B",6
pdf.SetXY 100,12
pdf.Cell 0,80,fec_alta
pdf.SetFont "Arial","B",6
pdf.SetXY 10,15
pdf.Cell 0,80,"F.ANTIGUEDAD"
pdf.SetFont "Arial","B",6
pdf.SetXY 100,15
pdf.Cell 0,80,fec_antiguedad
pdf.SetFont "Arial","B",6
pdf.SetXY 10,18
pdf.Cell 0,80,"ISAPRE"
pdf.SetFont "Arial","B",6
pdf.SetXY 100,18
pdf.Cell 0,80,isapre
pdf.SetFont "Arial","B",6
pdf.SetXY 10,21
pdf.Cell 0,80,"AFP"
pdf.SetFont "Arial","B",6
pdf.SetXY 100,21
pdf.Cell 0,80,afp
pdf.SetFont "Arial","B",6
pdf.SetXY 10,24
pdf.Cell 0,80,"UF"
pdf.SetFont "Arial","B",6
pdf.SetXY 100,24
pdf.Cell 0,80,uf_mes
pdf.SetFont "Arial","B",6
pdf.SetXY 10,27
pdf.Cell 0,80,"DIAS TRABAJADOS"
pdf.SetFont "Arial","B",6
pdf.SetXY 100,27
pdf.Cell 0,80,dias_altas
pdf.SetFont "Arial","B",6
pdf.SetXY 10,30
pdf.Cell 0,80,"SUELDO BASE"
pdf.SetFont "Arial","B",6
pdf.SetXY 100,30
pdf.Cell 0,80,sueldo_base
'HABERES
pdf.rect 2,95,95,100
pdf.rect 2,95,95,8
pdf.SetFont "Arial","B",10
pdf.SetXY 25,100
pdf.Cell 0,0,"DETALLES DE HABERES"
pdf.SetFont "Arial","B",6
contglo=65
conthaber=65
IF qryHaber.EOF then
pdf.SetFont "Arial","B",6
pdf.SetXY 15,100
pdf.Cell 0,0,"SIN HABERES"
ELSE
Do while not qryHaber.EOF
contglo = contglo + 5
conthaber = conthaber + 5
glosa=qryHaber("GLOSA")
haber=FormatNumber(qryHaber("HABER"),0)
pdf.SetXY 3,contglo
pdf.Cell 0,80,GLOSA
pdf.SetXY 83,conthaber
pdf.Cell 0,80,haber
qryHaber.movenext
loop
END IF
qryHaber.close
' DESCUENTOS
pdf.rect 100,95,100,100
pdf.rect 100,95,100,8
pdf.SetFont "Arial","B",10
pdf.SetXY 125,100
pdf.Cell 0,0,"DETALLES DE DESCUENTOS"
pdf.SetFont "Arial","B",6
contglo=65
conthaber=65
IF qryDesc.EOF then
pdf.SetFont "Arial","B",6
pdf.SetXY 15,100
pdf.Cell 0,0,"SIN DESCUENTOS"
ELSE
Do while not qryDesc.EOF
contglo = contglo + 5
conthaber = conthaber + 5
glosa=qryDesc("GLOSA")
haber=FormatNumber(qryDesc("DESCUENTO"),0)
pdf.SetXY 100,contglo
pdf.Cell 0,80,GLOSA
pdf.SetXY 187,conthaber
pdf.Cell 0,80,haber,0,0,"R"
qryDesc.movenext
loop
END IF
qryDesc.close
pdf.rect 2,198,95,4
pdf.SetFont "Arial","B",6
pdf.SetXY 3,200
pdf.Cell 0,0,"TOT.HABERES"
pdf.SetFont "Arial","B",6
pdf.SetXY 83,200
pdf.Cell 0,0, tot_haberes
pdf.rect 100,198,100,4
pdf.SetFont "Arial","B",6
pdf.SetXY 100,200
pdf.Cell 0,0,"TOTAL DESCUENTO"
pdf.SetFont "Arial","B",6
pdf.SetXY 185,200
pdf.Cell 0,0,tot_descuentos
pdf.rect 3,207,25,7
pdf.SetFont "Arial","B",6
pdf.SetXY 3,210
pdf.Cell 0,0,"IMPONIBLE AFECTO"
pdf.SetFont "Arial","B",6
pdf.SetXY 7,212
pdf.Cell 0,0,base_cot_top
pdf.rect 40,207,25,7
pdf.SetFont "Arial","B",6
pdf.SetXY 45,210
pdf.Cell 0,0,"TRIBUTABLE"
pdf.SetFont "Arial","B",6
pdf.SetXY 45,212
pdf.Cell 0,0,base_tributable
pdf.rect 76,207,20,6
pdf.SetFont "Arial","B",6
pdf.SetXY 78,210
pdf.Cell 0,0,"DES.LEGALES"
pdf.SetFont "Arial","B",6
pdf.SetXY 82,212
pdf.Cell 0,0,dlegal
pdf.rect 106,207,20,6
pdf.SetFont "Arial","B",6
pdf.SetXY 108,210
pdf.Cell 0,0,"ALC.LIQUIDO"
pdf.SetFont "Arial","B",6
pdf.SetXY 110,212
pdf.Cell 0,0,alliquido
pdf.rect 139,207,20,6
pdf.SetFont "Arial","B",6
pdf.SetXY 141,210
pdf.Cell 0,0,"DESC.VARIOS"
pdf.SetFont "Arial","B",6
pdf.SetXY 142,212
pdf.Cell 0,0,otros_descuentos
pdf.rect 180,207,20,6
pdf.SetFont "Arial","B",6
pdf.SetXY 180,210
pdf.Cell 0,0,"LIQUIDO A PAGO"
pdf.SetFont "Arial","B",6
pdf.SetXY 183,212
pdf.Cell 0,0,liquido
mensaje="Se ha cancelado la suma de "&LIQUIDO_TEXTO&" Por concepto de Renumeracion de "&MES_ANIO
pdf.SetFont "Arial","B",6
pdf.SetXY 9,225
pdf.Cell 0,0,mensaje
'info="APV 1(Institucion) : $UF"
'info2="APV 1(Institucion) : "&"falta UF"
forma="FORMAS DE PAGO : "& FORMA_PAGO
banco="BANCO : "&banco
cuenta="Nº CUENTA : "&num_cuenta
'pdf.SetFont "Arial","B",6
'pdf.SetXY 9,230
'pdf.Cell 0,0,info
'pdf.SetFont "Arial","B",6
'pdf.SetXY 9,232
'pdf.Cell 0,0,info2
pdf.SetFont "Arial","B",6
pdf.SetXY 9,237
pdf.Cell 0,0,forma
pdf.SetFont "Arial","B",6
pdf.SetXY 9,239
pdf.Cell 0,0,banco
pdf.SetFont "Arial","B",6
pdf.SetXY 9,241
pdf.Cell 0,0,cuenta
pdf.Line 160,239,190,239 ' horizontal
pdf.SetFont "Arial","B",8
pdf.SetXY 160,241
pdf.Cell 0,0,"FIRMA TRABAJADOR"
pdf.Close()
'filename="name.pdf"
'pdf.Output "filename","D"
pdf.Output()
'pdf.output"archivo.pdf","D"
Set pdf=nothing
%> |