Page 1 of 1

Impresion en BMP, JPG o PDF

PostPosted: Tue Feb 11, 2020 12:54 pm
by Jorge Jaurena
Buen dia.

Necesito sacar un reporte en formato BMP, JPG o PDF, cualquiera de los tres me serviria.
Cualquier ayuda es bienvenida.
Gracias.

Jorge Jaurena

Re: Impresion en BMP, JPG o PDF

PostPosted: Tue Feb 11, 2020 8:06 pm
by armando.lagunas
hola
para mi es mas practico archivo PDF generado directo y abierto con el acro..., lo defino de esta forma:

Code: Select all  Expand view

QuitProgamLoad( "AcroRd32.EXE" )  // Verifica si esta abierto el Acro...
 cFile := ".\Informes\Cierre Productor CSG N° "+AllTrim(PA18->CCSG)+".PDF"

 SET 3DLOOK OFF
 PRINTER oPrn TO cPrintPDF FILE cFile  PREVIEW      // <-- cPrintPDF es una variable que contiene el nombre de una impresora virtual PDF (doPDF v7)

 IF EMPTY( oPrn:hDC )
     RETURN NIL
 ENDIF
...
...
...
    construyes tu report
...
...

 


mi resultado:

Imagegas stations new york ny

Code: Select all  Expand view

Function QuitProgamLoad( cProceso )
 LOCAL oBj, oServ, aProcess, objProcess

 TRY
    oBj := CreateObject( "wbemScripting.SwbemLocator" )
 CATCH
    Return nil
 END

 oServ     := oBj:ConnectServer()
 aProcess  := oServ:ExecQuery( "Select * from Win32_Process" )
     For Each objProcess in aProcess
         If UPPER(objProcess:Name) = UPPER(cProceso)
            objProcess:Terminate()
         ENDIF
     next

 Return nil

 

Re: Impresion en BMP, JPG o PDF

PostPosted: Fri Feb 14, 2020 1:25 pm
by karinha
Code: Select all  Expand view

#include "FiveWin.ch"

FUNCTION Main()

   LOCAL oPrn, oFont

   PRINT oPrn NAME "impresion de JPG" PREVIEW MODAL

   IF Empty( oPrn:hDC )
      RETURN nil          // Printer was not installed or ready
   ENDIF

   DEFINE FONT oFont NAME "Ms Sans Serif" SIZE 0, - 12 OF oPrn

   PAGE

   oPrn:SayImage( 0, 0, "cifrao.jpg", oPrn:nHorzRes(), oPrn:nVertRes() , NIL, .T. )

   ENDPAGE

   ENDPRINT

   oFont:End()      // Destroy the font object

RETURN nil
 

Re: Impresion en BMP, JPG o PDF

PostPosted: Mon Feb 17, 2020 2:18 pm
by Jorge Jaurena
Buen dia y muchas gracias por la ayuda.

La opcion de usar la impresora virtual me resuelve en parte el problema ya que cuando mando la impresion siempre me muestra el dialogo de la aplicacion doPDF y mi necesidad
es generar un archivo PDF o BMP o JPG (cualquiera serviria) directamente en una carpeta con el nombre que necesito sin que levante ningun dialogo y sin intervencion del operador
ya que tendria que realizar una impresion en lote.

Gracias
Jorge Jaurena

Re: Impresion en BMP, JPG o PDF

PostPosted: Mon Feb 17, 2020 3:27 pm
by karinha

Re: Impresion en BMP, JPG o PDF

PostPosted: Thu Feb 27, 2020 1:15 am
by nageswaragunupudi
Code: Select all  Expand view

PRINT oPrn FILE "filename.PDF"
PAGE
<print ............>
ENDPAGE
ENDPRINT
 


This saves the output to the "filename.pdf" silently.
We do not need any external drivers.