Imprimir PDF con HMG 3.0.46

HMG en Español

Moderator: Rathinagiri

Post Reply
User avatar
edufloriv
Posts: 247
Joined: Thu Nov 08, 2012 3:42 am
DBs Used: DBF, MariaDB, MySQL, MSSQL, MariaDB
Location: PERU

Imprimir PDF con HMG 3.0.46

Post 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

Eduardo Flores Rivas


LIMA - PERU
User avatar
Pablo César
Posts: 4059
Joined: Wed Sep 08, 2010 1:18 pm
Location: Curitiba - Brasil

Imprimir PDF con HMG 3.0.46

Post 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.
HMGing a better world
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein
User avatar
andyglezl
Posts: 1461
Joined: Fri Oct 26, 2012 7:58 pm
Location: Guadalajara Jalisco, MX
Contact:

Re: Imprimir PDF con HMG 3.0.46

Post 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
Andrés González López
Desde Guadalajara, Jalisco. México.
User avatar
Pablo César
Posts: 4059
Joined: Wed Sep 08, 2010 1:18 pm
Location: Curitiba - Brasil

Re: Imprimir PDF con HMG 3.0.46

Post by Pablo César »

Bien Andrés, no me acordaba. Gracias por tu indicacion.
HMGing a better world
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein
User avatar
edufloriv
Posts: 247
Joined: Thu Nov 08, 2012 3:42 am
DBs Used: DBF, MariaDB, MySQL, MSSQL, MariaDB
Location: PERU

Re: Imprimir PDF con HMG 3.0.46

Post by edufloriv »

Amigos,

Genial, funciona perfecto. Mil gracias de verdad.


Saludos,


:D

Eduardo Flores Rivas


LIMA - PERU
User avatar
Amarante
Posts: 182
Joined: Fri Apr 27, 2012 9:44 pm
DBs Used: DBF, MySQL, MariaDB, SQLite, PostgreSQL
Location: Araruama-RJ, Brazil

Re: Imprimir PDF con HMG 3.0.46

Post 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
Last edited by Amarante on Mon Jun 02, 2014 2:41 pm, edited 1 time in total.
User avatar
danielmaximiliano
Posts: 2763
Joined: Fri Apr 09, 2010 4:53 pm
DBs Used: DBF
Location: Argentina
Contact:

Re: Imprimir PDF con HMG 3.0.46

Post by danielmaximiliano »

Amarante wrote:
Espero ter ajudado
Gracias por compartir Amarante
*´¨)
¸.·´¸.·*´¨) ¸.·*¨)
(¸.·´. (¸.·` *
.·`. Harbour/HMG : It's magic !
(¸.·``··*

Saludos / Regards
DaNiElMaXiMiLiAnO

Whatsapp. := +54901169026142
Telegram Name := DaNiElMaXiMiLiAnO
Telegram invitation https://t.me/HMGWorkspace
User avatar
Pablo César
Posts: 4059
Joined: Wed Sep 08, 2010 1:18 pm
Location: Curitiba - Brasil

Imprimir PDF con HMG 3.0.46

Post by Pablo César »

Amarante wrote:cParameters := [-print-to "] + ALLTRIM( cImpressora ) + [" "] + cArq_Pdf + ["]
ShellExecute( 0, "open", "SumatraPDF.exe", cParameters )
Legal ! Obrigado por compartilhar :)
HMGing a better world
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein
Javier Tovar
Posts: 1275
Joined: Tue Sep 03, 2013 4:22 am
Location: Tecámac, México

Re: Imprimir PDF con HMG 3.0.46

Post by Javier Tovar »

Gracias por compartir Amarante!

Saludos
Post Reply