try
opdf := tpdf():new( cPath )
titpdef( oPdf ) // creopdf están los titulos
oPdf:Pdfatsay( "CUIT 30-65485547-8",cm2dpi( 2.4 ), 100, .T. )
oPdf:Pdfatsay( ( "Agente de Retención: " + oApp:nroBruto ), cm2dpi( 2.4 ), 350, .T. )
oPdf:Pdfsetfont( "COURIER", NORMAL, 10 )
oPdf:Pdfatsay( "Retención de Ingresos Brutos", cm2dpi( nrow += .8 ), cmancho( 8 ) )
oPdf:Pdfatsay( cTitulo, cm2dpi( nrow += .5 ), cmancho( 8.4 ) )
oPdf:Pdfatsay( "Fecha: " + DToC( oVar:dfecha ), cm2dpi( nrow += .7 ), cmancho( 1.5 ) )
oPdf:Pdfatsay( "Constancia N° " + valstr( nComproba ), cm2dpi( nrow += .5 ), cmancho( 1.5 ) )
oPdf:Pdfatsay( ( "Rentenido a: " + aMae[ 2 ] ), cm2dpi( nrow += .5 ), cmancho( 1.5 ) )
oPdf:Pdfatsay( ( "CUIT " + aMae[ 7 ] ), cm2dpi( nrow += .5 ), cmancho( 1.5 ) )
oPdf:Pdfatsay( ( "Domicilio: " + AllTrim(aMae[ 3 ] ) + Space(2 ) + AllTrim(aMae[ 4 ] ) ), cm2dpi( nrow += .5 ), cmancho( 1.5 ) )
oPdf:Pdfatsay( aMae[ 5 ], cm2dpi( nrow += .5 ), cmancho( 1.5 ) )
oPdf:Pdfatsay( ( "Número de IIBB: " + aMae[ 17 ] ), cm2dpi( nrow += .5 ), cmancho( 1.5 ) )
oPdf:Pdfatsay( "Pago efectuado: $" + Transform( oVar:totalre,"@e 99,999,999.99" ), cm2dpi( nrow += .5 ), cmancho( 1.5 ) )
oPdf:Pdfatsay( "Importe retenido: $" + Transform( iif(lPcia,oVar:nRetib,oVar:nRetibcap ),"@e 999,999,999.99" ), cm2dpi( nrow += .5 ), cmancho( 1.5 ) )
oPdf:Pdfatsay( "Alícuota aplicada: %" + iif( lPcia,Transform(oVar:nPorIB, "@e 99.99" ),Transform(oVar:Ibrecap, "@e 99.99" ) ), cm2dpi( nrow += .5 ), cmancho( 1.5 ) )
FOR x = 1 TO Len( oVar:adeta )
IF oVar:adeta[ x, 5 ] >= oApp:minibru
oPdf:Pdfatsay( ( "Afecta a comprobante Nº " + oVar:adeta[ x,2 ] + " Base Imp. " + Transform(oVar:adeta[ x,5 ],"@e 999,999,999.99" ) ), cm2dpi( nrow += .5 ), cmancho( 1.5 ) )
ENDIF
NEXT
oPdf:Pdfatsay( "Importe que será depositado por declaración jurada correspondiente al mes de", cm2dpi( nrow += 1.2 ), cmancho( 1.5 ) )
oPdf:Pdfatsay( ( mes(Month(oVar:dfecha ) ) + " de " + valstr(Year(oVar:dFecha ) ) ), cm2dpi( nrow += .5 ), cmancho( 1.5 ) )
opdf:Pdfimage( oApp:curproga + "firma1.jpg", cm2dpi( nrow += 3.5 ), cmancho( 9.5 ), 158, 100 )
opdf:Pdfclosepage()
oPdf:pdfclose()
catch