Imprimir pdf sin intervención del usuario

Post Reply
miarcod
Posts: 172
Joined: Tue Oct 11, 2005 2:17 pm

Imprimir pdf sin intervención del usuario

Post by miarcod »

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
User avatar
karinha
Posts: 4882
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil

Re: Imprimir pdf sin intervención del usuario

Post by karinha »

João Santos - São Paulo - Brasil
User avatar
cnavarro
Posts: 5792
Joined: Wed Feb 15, 2012 8:25 pm
Location: España

Re: Imprimir pdf sin intervención del usuario

Post by cnavarro »

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)
C. Navarro
Hay dos tipos de personas: las que te hacen perder el tiempo y las que te hacen perder la noción del tiempo
Si alguien te dice que algo no se puede hacer, recuerda que esta hablando de sus limitaciones, no de las tuyas.
User avatar
karinha
Posts: 4882
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil

Re: Imprimir pdf sin intervención del usuario

Post by karinha »

Code: Select all

#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
User avatar
karinha
Posts: 4882
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil

Re: Imprimir pdf sin intervención del usuario

Post by karinha »

Code: Select all

   LOCAL cArchivoPDF := "PROP15.PDF"

   // ASI, TAMBIEN LLAMA EL ADOBE.
   ShellExecute(GetActiveWindow(),"Print",'"'+cArchivoPDF+'"', 3 )
 
Saludos.
João Santos - São Paulo - Brasil
miarcod
Posts: 172
Joined: Tue Oct 11, 2005 2:17 pm

Re: Imprimir pdf sin intervención del usuario

Post by miarcod »

Gracias
voy a probar
User avatar
leandro
Posts: 958
Joined: Wed Oct 26, 2005 2:49 pm
Location: Colombia
Contact:

Re: Imprimir pdf sin intervención del usuario

Post by leandro »

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

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

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 ALFONSO
SISTEMAS LYMA - BASE
Bogotá (Colombia)
[ FWH 19.09 ] [ xHarbour 1.2.3 Intl. (SimpLex) (Build 20190613) ] [ Embarcadero C++ 7.30 for Win32 ]
User avatar
cnavarro
Posts: 5792
Joined: Wed Feb 15, 2012 8:25 pm
Location: España

Re: Imprimir pdf sin intervención del usuario

Post by cnavarro »

Creo que te falta añadir la libreria LIBHPDF.LIB de harbour
No lo sé si funciona con xHarbour
C. Navarro
Hay dos tipos de personas: las que te hacen perder el tiempo y las que te hacen perder la noción del tiempo
Si alguien te dice que algo no se puede hacer, recuerda que esta hablando de sus limitaciones, no de las tuyas.
User avatar
karinha
Posts: 4882
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil

Re: Imprimir pdf sin intervención del usuario

Post by karinha »

João Santos - São Paulo - Brasil
User avatar
jacgsoft
Posts: 96
Joined: Fri Nov 24, 2006 9:03 pm
Location: Lima - Peru

Re: Imprimir pdf sin intervención del usuario

Post by jacgsoft »

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)
Post Reply