Imprimir pdf sin intervención del usuario

Imprimir pdf sin intervención del usuario

Postby miarcod » Thu Jul 11, 2019 6:24 pm

Alguna idea para imprimir un fichero PDF que genero desde haru sin que el usuario tenga que intervenir y si es posible sin que se abra acrobat o similar
Gracias
miarcod
 
Posts: 199
Joined: Tue Oct 11, 2005 2:17 pm

Re: Imprimir pdf sin intervención del usuario

Postby karinha » Thu Jul 11, 2019 7:00 pm

João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
User avatar
karinha
 
Posts: 7794
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil

Re: Imprimir pdf sin intervención del usuario

Postby cnavarro » Thu Jul 11, 2019 7:21 pm

miarcod wrote:Alguna idea para imprimir un fichero PDF que genero desde haru sin que el usuario tenga que intervenir y si es posible sin que se abra acrobat o similar
Gracias


https://docs.microsoft.com/en-us/window ... llexecutea
ShellExecute(,"Print","File.pdf",,,3)
Cristobal Navarro
Hay dos tipos de personas: las que te hacen perder el tiempo y las que te hacen perder la noción del tiempo
El secreto de la felicidad no está en hacer lo que te gusta, sino en que te guste lo que haces
User avatar
cnavarro
 
Posts: 6541
Joined: Wed Feb 15, 2012 8:25 pm
Location: España

Re: Imprimir pdf sin intervención del usuario

Postby karinha » Fri Jul 12, 2019 1:12 pm

Code: Select all  Expand view

#include "FiveWin.ch"

static oWnd

FUNCTION Main()

   local oBar

   DEFINE WINDOW oWnd TITLE "Imprimir PDF"

   DEFINE BUTTONBAR oBar _3D OF oWnd

   DEFINE BUTTON OF oBar FILENAME "..\bitmaps\16x16\printer.bmp" FLAT ;
      ACTION( IMPRIMIR_PDF() ) TOOLTIP "Imprimir PDF" GROUP

   DEFINE BUTTON OF oBar FILENAME "..\bitmaps\16x16\Exit.bmp" FLAT    ;
      ACTION oWnd:End() TOOLTIP "Exit this app" GROUP

   SET MESSAGE OF oWnd TO "Imprimir PDF" NOINSET CLOCK DATE KEYBOARD

   ACTIVATE WINDOW oWnd

RETURN NIL

FUNCTION IMPRIMIR_PDF()

   // ASI, LLAMA EL ADOBE... 3
   ShellExecute(, "Print", "PROP15.PDF",,, 3 )  // Navarro

   // Con el SUMATRAPDF, no llama el adobe, es directo en la impresora.
   // Invisible para el usuario.

RETURN NIL

// FIN
 


Saludos.
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
User avatar
karinha
 
Posts: 7794
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil

Re: Imprimir pdf sin intervención del usuario

Postby karinha » Fri Jul 12, 2019 1:29 pm

Code: Select all  Expand view

   LOCAL cArchivoPDF := "PROP15.PDF"

   // ASI, TAMBIEN LLAMA EL ADOBE.
   ShellExecute(GetActiveWindow(),"Print",'"'+cArchivoPDF+'"', 3 )
 


Saludos.
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
User avatar
karinha
 
Posts: 7794
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil

Re: Imprimir pdf sin intervención del usuario

Postby miarcod » Fri Jul 12, 2019 3:09 pm

Gracias
voy a probar
miarcod
 
Posts: 199
Joined: Tue Oct 11, 2005 2:17 pm

Re: Imprimir pdf sin intervención del usuario

Postby leandro » Fri Jul 19, 2019 8:49 pm

Buenas tardes para todos

Estoy tratando de compilar harupdf,

Inclui todo el código fuente, pero me salen errores al momento de compilar.
Code: Select all  Expand view

3=C:\BASCULADO\PRG\HARUFONTS.PRG
4=C:\BASCULADO\PRG\HARUPRINTMGR.PRG
5=C:\BASCULADO\PRG\HARUUTILS.PRG
6=C:\BASCULADO\PRG\THARUPDF.PRG
7=C:\BASCULADO\PRG\THARUPDFBASE.PRG
 


Code: Select all  Expand view

Turbo Incremental Link 6.80 Copyright (c) 1997-2017 Embarcadero Technologies, Inc.
Error: Unresolved external '_HB_FUN_HPDF_SETCOMPRESSIONMODE' referenced from C:\FIVEDIT\THARUPDFBASE.OBJ
Error: Unresolved external '_HB_FUN_HPDF_PAGE_GETHEIGHT' referenced from C:\FIVEDIT\THARUPDFBASE.OBJ
Error: Unresolved external '_HB_FUN_HPDF_PAGE_GETWIDTH' referenced from C:\FIVEDIT\THARUPDFBASE.OBJ
Error: Unresolved external '_HB_FUN_HPDF_NEW' referenced from C:\FIVEDIT\THARUPDFBASE.OBJ
Error: Unresolved external '_HB_FUN_HPDF_PAGE_SETSIZE' referenced from C:\FIVEDIT\THARUPDFBASE.OBJ
Error: Unresolved external '_HB_FUN_HPDF_ADDPAGE' referenced from C:\FIVEDIT\THARUPDFBASE.OBJ
Error: Unresolved external '_HB_FUN_HPDF_PAGE_BEGINTEXT' referenced from C:\FIVEDIT\THARUPDFBASE.OBJ
Error: Unresolved external '_HB_FUN_HPDF_PAGE_GETCURRENTFONTSIZE' referenced from C:\FIVEDIT\THARUPDFBASE.OBJ
Error: Unresolved external '_HB_FUN_HPDF_PAGE_SETFONTANDSIZE' referenced from C:\FIVEDIT\THARUPDFBASE.OBJ
Error: Unresolved external '_HB_FUN_HPDF_PAGE_GETRGBFILL' referenced from C:\FIVEDIT\THARUPDFBASE.OBJ
Error: Unresolved external '_HB_FUN_HPDF_PAGE_SETRGBFILL' referenced from C:\FIVEDIT\THARUPDFBASE.OBJ
Error: Unresolved external '_HB_FUN_HPDF_PAGE_TEXTOUT' referenced from C:\FIVEDIT\THARUPDFBASE.OBJ
Error: Unresolved external '_HB_FUN_HPDF_PAGE_TEXTWIDTH' referenced from C:\FIVEDIT\THARUPDFBASE.OBJ
Error: Unresolved external '_HB_FUN_HPDF_PAGE_ENDTEXT' referenced from C:\FIVEDIT\THARUPDFBASE.OBJ
Error: Unresolved external '_HB_FUN_WAPI_OUTPUTDEBUGSTRING' referenced from C:\FIVEDIT\THARUPDFBASE.OBJ
Error: Unresolved external '_HB_FUN_HPDF_LOADTTFONTFROMFILE' referenced from C:\FIVEDIT\THARUPDFBASE.OBJ
Error: Unresolved external '_HB_FUN_HPDF_GETFONT' referenced from C:\FIVEDIT\THARUPDFBASE.OBJ
Error: Unresolved external '_HB_FUN_HB_HHASKEY' referenced from C:\FIVEDIT\THARUPDFBASE.OBJ
Error: Unresolved external '_HB_FUN_HPDF_LOADPNGIMAGEFROMFILE' referenced from C:\FIVEDIT\THARUPDFBASE.OBJ
Error: Unresolved external '_HB_FUN_HPDF_LOADJPEGIMAGEFROMFILE' referenced from C:\FIVEDIT\THARUPDFBASE.OBJ
Error: Unresolved external '_HB_FUN_HPDF_PAGE_DRAWIMAGE' referenced from C:\FIVEDIT\THARUPDFBASE.OBJ
Error: Unresolved external '_HB_FUN_HPDF_PAGE_MOVETO' referenced from C:\FIVEDIT\THARUPDFBASE.OBJ
Error: Unresolved external '_HB_FUN_HPDF_PAGE_LINETO' referenced from C:\FIVEDIT\THARUPDFBASE.OBJ
Error: Unresolved external '_HB_FUN_HPDF_PAGE_STROKE' referenced from C:\FIVEDIT\THARUPDFBASE.OBJ
Error: Unresolved external '_HB_FUN_HPDF_SETPASSWORD' referenced from C:\FIVEDIT\THARUPDFBASE.OBJ
Error: Unresolved external '_HB_FUN_HPDF_SETPERMISSION' referenced from C:\FIVEDIT\THARUPDFBASE.OBJ
Error: Unresolved external '_HB_FUN_HPDF_SAVETOFILE' referenced from C:\FIVEDIT\THARUPDFBASE.OBJ
Error: Unresolved external '_HB_FUN_HPDF_FREE' referenced from C:\FIVEDIT\THARUPDFBASE.OBJ
Error: Unresolved external '_HB_FUN_HPDF_PAGE_GSAVE' referenced from C:\FIVEDIT\THARUPDFBASE.OBJ
Error: Unresolved external '_HB_FUN_HPDF_PAGE_RECTANGLE' referenced from C:\FIVEDIT\THARUPDFBASE.OBJ
Error: Unresolved external '_HB_FUN_HPDF_PAGE_GRESTORE' referenced from C:\FIVEDIT\THARUPDFBASE.OBJ
Error: Unresolved external '_HB_FUN_HPDF_PAGE_SETDASH' referenced from C:\FIVEDIT\THARUPDFBASE.OBJ
Error: Unresolved external '_HB_FUN_HPDF_PAGE_CURVETO' referenced from C:\FIVEDIT\THARUPDFBASE.OBJ
Error: Unresolved external '_HB_FUN_HPDF_PAGE_FILLSTROKE' referenced from C:\FIVEDIT\THARUPDFBASE.OBJ
Error: Unresolved external '_HB_FUN_HPDF_PAGE_SETLINEWIDTH' referenced from C:\FIVEDIT\THARUPDFBASE.OBJ
Error: Unresolved external '_HB_FUN_HPDF_PAGE_SETRGBSTROKE' referenced from C:\FIVEDIT\THARUPDFBASE.OBJ
Error: Unresolved external '_HB_FUN_HPDF_PAGE_SETTEXTMATRIX' referenced from C:\FIVEDIT\THARUPDFBASE.OBJ
Error: Unresolved external '_HB_FUN_HPDF_PAGE_SHOWTEXT' referenced from C:\FIVEDIT\THARUPDFBASE.OBJ
Error: Unable to perform link
Link Error
 


Esta clase funciona con xharbour?

De antemano gracielas
Saludos
LEANDRO AREVALO
Bogotá (Colombia)
https://hymlyma.com
https://hymplus.com/
leandroalfonso111@gmail.com
leandroalfonso111@hotmail.com

[ Embarcadero C++ 7.60 for Win32 ] [ FiveWin 23.07 ] [ xHarbour 1.3.0 Intl. (SimpLex) (Build 20230914) ]
User avatar
leandro
 
Posts: 1669
Joined: Wed Oct 26, 2005 2:49 pm
Location: Colombia

Re: Imprimir pdf sin intervención del usuario

Postby cnavarro » Fri Jul 19, 2019 9:00 pm

Creo que te falta añadir la libreria LIBHPDF.LIB de harbour
No lo sé si funciona con xHarbour
Cristobal Navarro
Hay dos tipos de personas: las que te hacen perder el tiempo y las que te hacen perder la noción del tiempo
El secreto de la felicidad no está en hacer lo que te gusta, sino en que te guste lo que haces
User avatar
cnavarro
 
Posts: 6541
Joined: Wed Feb 15, 2012 8:25 pm
Location: España

Re: Imprimir pdf sin intervención del usuario

Postby karinha » Mon Jul 22, 2019 12:08 pm

João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
User avatar
karinha
 
Posts: 7794
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil

Re: Imprimir pdf sin intervención del usuario

Postby jacgsoft » Wed Jul 31, 2019 9:53 pm

Con Harbour, tienes que enlazar las librerias hbhpdf.lib y libhpdf.lib


#include "FiveWin.ch"
#include "harupdf.ch"

Function Main()
Local oPdf,Page,oImage,oFont,Font1,Font2,Font3

oPdf:=HPDF_New()

HPDF_SetCompressionMode( oPdf, HPDF_COMP_ALL )

**HPDF_SetPassword( oPdf, 'jaime', 'alberto' )

page:=HPDF_AddPage(oPdf)

HPDF_Page_SetSize(page, 3, 0) //** 3 = A4

***oImage:=HPDF_LoadJpegImageFromFile (oPdf,'png\Qr_demo.jpg')
***HPDF_Page_DrawImage(page, oImage, 100, 700, 100, 100)


*HPDF_Page_SetRGBFill(page, 0.80, 0.80, 0.80) //** Para rellenar
HPDF_Page_SetLineWidth(page, 0.5 ) // ** Grosor
HPDF_Page_SetRGBStroke(page,0.2,0.6,1.0) // ** Color
HPDF_Page_Rectangle(page, 20,760,560,70)
HPDF_Page_Stroke (page) //** Muestra el cuadro

HPDF_Page_BeginText (page)
Font1:=HPDF_LoadTTFontFromFile(oPdf,'C:\Windows\Fonts\Verdana.ttf',HPDF_TRUE)
Font2:=HPDF_LoadTTFontFromFile(oPdf,'C:\Windows\Fonts\Lucon.ttf',HPDF_TRUE)

oFont:=HPDF_GetFont(oPdf, Font1, "WinAnsiEncoding" )
HPDF_Page_SetFontAndSize(page, oFont, 12)
HPDF_Page_TextOut(page,100,640,"Jaime Coronado 1")

oFont:=HPDF_GetFont(oPdf, Font2, "WinAnsiEncoding" )
HPDF_Page_SetFontAndSize(page, oFont, 9)
HPDF_Page_TextOut(page, 100, 700, "Jaime Coronado 2")
HPDF_Page_TextOut(page, 100, 670, "Programador")
HPDF_Page_EndText(page)

HPDF_SaveToFile( oPdf, 'Prueba.pdf' )

HPDF_Free( oPdf )

Return(nil)
User avatar
jacgsoft
 
Posts: 104
Joined: Fri Nov 24, 2006 9:03 pm
Location: Lima - Peru


Return to FiveWin para Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot], russimicro and 71 guests