FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin para Harbour/xHarbour GENERAR ARCHIVO PDF
Posts: 109
Joined: Fri May 09, 2008 08:19 PM

GENERAR ARCHIVO PDF

Posted: Mon Jun 08, 2026 07:10 PM
Static Function PriDeskjet(arcimp)
    Local  Oprn, cText:= MemoRead(arcimp), nlines, nRow:= 0, x, Ofont, a1
    DEFINE FONT oFont NAME "ARIAL"  SIZE  20,120 OF Oprn   
	
PRINT Oprn NAME "EGRESOS" Preview 
Oprn:SetPortrait()
nLines:= MLCOUNT(cText,110) 
	
      PAGE
          If !Empty(cText)
		  
             FOR x:= 1 TO nLines
                 nRow += 0.68
                 a1 = MEMOLINE(cText,110,x)
                 Oprn:cmSAY(nrow,0,a1,ofont)
             NEXT
          Endif
      ENDPAGE
ENDPRINT

Oprn:End()
oFont:End()
Return (nil)

CUANDO SALE EL PREVIEW, EL BOTON DEL PDF no genera el archivo, dice que lo va a grabar y no lo hace,

agradeciendo sus comentarios.

Posts: 8716
Joined: Tue Dec 20, 2005 07:36 PM

Re: GENERAR ARCHIVO PDF

Posted: Mon Jun 08, 2026 09:07 PM

Normal con FWH2603.

// C:\FWH2603\SAMPLES\IMPDESK.PRG

#Include "FiveWin.ch"

FUNCTION Main()

   LOCAL arcimp := "JUAN.TXT"

   PriDeskjet( arcimp )

RETURN NIL

STATIC FUNCTION PriDeskjet( arcimp )

   LOCAL  oPrn, cText := MemoRead(arcimp), nlines, nRow:= 0, x, oFont, a1

   PRINT Oprn NAME "EGRESOS" PREVIEW MODAL

  // DEFINE FONT oFont NAME "ARIAL" SIZE 20, 120 OF Oprn  //??
  // DEFINE FONT oFont NAME "Arial" SIZE 0, -16 BOLD OF oPrn
  DEFINE FONT oFont NAME "COURIER NEW" SIZE 0, -10 OF oPrn  // Super rapido.

  oPrn:SetPage(9)    // A4
  oPrn:SetPortrait() //Vertical

  nLines := MLCOUNT( cText, 100 ) // 110?

  PAGE

     If .NOT. Empty( cText )

        FOR x:= 1 TO nLines

           nRow += 0.68

           // A1 := MEMOLINE( cText, 110, x )
           A1 := MEMOLINE( cText, 100, x )

           oPrn:cmSAY( nrow, 0, a1, ofont )

         NEXT

      Endif

  ENDPAGE

   ENDPRINT

   oFont:End()

RETURN NIL

// FIN / END

Regards, saludos.

João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
Posts: 109
Joined: Fri May 09, 2008 08:19 PM

Re: GENERAR ARCHIVO PDF

Posted: Tue Jun 09, 2026 02:23 PM

Gracias Bella Alma por tu empatia, me hacia falta ese parámetro MODAL

Continue the discussion