Page 1 of 1

Imprimir PDF con HMG 3.0.46

Posted: Thu May 29, 2014 3:48 pm
by edufloriv
Saludos amigos,

Puedo imprimir un .PDF directamente a la impresora con HMG 3.0.46 ? Me interesa imprimirlo directamente a la impresora sin pre-visualizarlo.

Actualmente sé que puedo hacer esto :

Code: Select all

* ------------------------------------------------------ *

PROC ProtocoloMostrarPDF
PARA cArchivo

	DEFINE WINDOW Win_ShowPDF ;
		AT 0,0 ;
		WIDTH 900 ;
		HEIGHT 700 ;
		TITLE 'Protocolo PDF' ;
		CHILD ;
                ON INIT PdfIniciar()

		DEFINE ACTIVEX XPdf
			ROW 10
			COL 50
			WIDTH 800
			HEIGHT 650
			PROGID "AcroPDF.PDF.1"
		END ACTIVEX

	END WINDOW

	Center Window Win_ShowPDF

	Activate Window Win_ShowPDF


RETURN

*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------

PROC PdfIniciar()

	Win_ShowPDF.XPdf.Object:src := cPathJpgs+cArchivo

Return

*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------

PROC ProtocoloMostrarJpg
PARA cQueFile

Local i

   // Measure Units Are Millimeters

   cQueFile := '\\Serverfiles\publica\Protocolos\Protocolos\'+cQueFile

   SELECT PRINTER DEFAULT ;
         ORIENTATION PRINTER_ORIENT_PORTRAIT ;
         PAPERSIZE PRINTER_PAPER_A4 ;
         QUALITY     PRINTER_RES_HIGH ;
         PREVIEW

   START PRINTDOC

         START PRINTPAGE

            @ 10,10 PRINT IMAGE cQueFile ;
               WIDTH 160 ;
               HEIGHT 280

         END PRINTPAGE

   END PRINTDOC

RETURN

En el caso de imagenes .jpg simplemente quito el PREVIEW y ya está. Pero no sé como hacer para una impresión directa con un .PDF

Recuerden por favor que estoy usando HMG 3.0.46



Mil gracias por su gentil ayuda.


Att

Imprimir PDF con HMG 3.0.46

Posted: Thu May 29, 2014 5:56 pm
by Pablo César
En internet vi este articulo: http://www.robvanderwoude.com/printfiles.php#PrintPDF

Y vi este comando:

CALL START /MIN AcroRd32.exe /h /p [filename]

Talvez esto te ayude.

Re: Imprimir PDF con HMG 3.0.46

Posted: Thu May 29, 2014 8:49 pm
by andyglezl
Hola

Yo lo utilizo de esta forma, espero te sirva
-----------------------------------------
Hello

I use it in this way, I hope you serve

Code: Select all

        IF FILE( cNomArc )
            SHELLEXECUTE( 0, "print", cNomArc,,0 )
        ENDIF

Re: Imprimir PDF con HMG 3.0.46

Posted: Thu May 29, 2014 11:10 pm
by Pablo César
Bien Andrés, no me acordaba. Gracias por tu indicacion.

Re: Imprimir PDF con HMG 3.0.46

Posted: Sat May 31, 2014 7:44 pm
by edufloriv
Amigos,

Genial, funciona perfecto. Mil gracias de verdad.


Saludos,


:D

Re: Imprimir PDF con HMG 3.0.46

Posted: Mon Jun 02, 2014 2:19 pm
by Amarante
[English - google translate]--------------------------------------------------------
I'm using portable SumatraPDF which is free and there is no need to be installed on the client computer, so I put the SumatraPDF.exe file in the same folder as my executable.
* ------------------------------------------------- --------------------------
* Using SumatraPDF to send to printer
* Sintax: SumatraPDFPortable.exe-print-to <printer-name> <filename>
* ------------------------------------------------- --------------------------
cArq_Pdf := "mydoc.pdf"
cImpressora := GetDefaultPrinter()
cParameters := [-print-to "] + ALLTRIM( cImpressora ) + [" "] + cArq_Pdf + ["]
ShellExecute( 0, "open", "SumatraPDF.exe", cParameters )
* ------------------------------------------------- --------------------------
Hope this helps

[Portuguese - eu mesmo traduzi :lol: ]--------------------------------------------------------
Eu estou usando SumatraPDF portable que é gratuito e não há a necessidade de estar instalado no computador do cliente, então eu coloco o arquivo SumatraPDF.exe na mesma pasta do meu executável.
*---------------------------------------------------------------------------
* Usando SumatraPDF para enviar para impressora
* Sintax: SumatraPDFPortable.exe -print-to <printer-name> <filename>
* ------------------------------------------------- --------------------------
cArq_Pdf := "mydoc.pdf"
cImpressora := GetDefaultPrinter()
cParameters := [-print-to "] + ALLTRIM( cImpressora ) + [" "] + cArq_Pdf + ["]
ShellExecute( 0, "open", "SumatraPDF.exe", cParameters )
* ------------------------------------------------- --------------------------
Espero ter ajudado

Re: Imprimir PDF con HMG 3.0.46

Posted: Mon Jun 02, 2014 2:30 pm
by danielmaximiliano
Amarante wrote:
Espero ter ajudado
Gracias por compartir Amarante

Imprimir PDF con HMG 3.0.46

Posted: Mon Jun 02, 2014 3:23 pm
by Pablo César
Amarante wrote:cParameters := [-print-to "] + ALLTRIM( cImpressora ) + [" "] + cArq_Pdf + ["]
ShellExecute( 0, "open", "SumatraPDF.exe", cParameters )
Legal ! Obrigado por compartilhar :)

Re: Imprimir PDF con HMG 3.0.46

Posted: Mon Jun 02, 2014 3:30 pm
by Javier Tovar
Gracias por compartir Amarante!

Saludos