RESUELTO - Ver PDF
![Post Post](./styles/prosilver/imageset/icon_post_target.gif)
Posted:
Fri May 31, 2024 8:15 pm
by Male
muestro mi PDF con TACTIVEX(), y al querer ver PDF, se cierra el programa. antes funcionaba bien, tengo FWH 18.11
- Code: Select all Expand view
Static Function ShowPDF1 oBrw )
local oPdf,oWnd
local nOpc := 0
local lText := .F.
local cFile := if( Len( oBrw:aArrayData ) > 0, AllTrim( oBrw:aRow[ 2 ] ), "" )
local hWebView,arq,cReport
DEFINE WINDOW oWnd
oWnd:oClient = oPdf
oPdf := TActiveX():New( oWnd, "acroPDF.PDF.1" )
oWnd:oClient := oPdf
oPdf:Do( "LoadFile", cFile )
//oPdf:Do( "SetCurrentPage", 1 )
oPdf:SetZoom( 80 )
ACTIVATE WINDOW oWnd;
MAXIMIZED
Return //oPdf
//----------------------------------------------------------------------------//
Re: Ver PDF
![Post Post](./styles/prosilver/imageset/icon_post_target.gif)
Posted:
Sat Jun 01, 2024 1:09 pm
by karinha
Mira, se ayuda:
// C:\FWH\SAMPLES\SHOWPDF3.PRG
#include "FiveWin.ch"
STATIC oWnd
FUNCTION Main()
LOCAL oActiveX, oPdf, oIco, oBar, oBmp, cFile
cFile := "C:\TEMP\MODELO.PDF"
SkinButtons()
DEFINE ICON oIco FILE "..\icons\fax.ico"
// mdichild ...no puede ser mdichild sin pertenecer a una ventana mdi
DEFINE WINDOW oWnd TITLE "Abrir un archivo *.pdf" COLOR "B/W" ICON oIco
DEFINE BUTTONBAR oBar _3D SIZE 26, 27 OF oWnd 2007
oActiveX := TActiveX():New( oWnd, "AcroPDF.PDF.1" )
oWnd:oClient := oActiveX
// oActiveX:Do( "LoadFile", "Prueba.pdf" )
oActiveX:Do( "LoadFile", cFile )
oActiveX:Do( "SetCurrentPage", 1 )
DEFINE BUTTON OF oBar FILENAME "..\bitmaps\16x16\printer.bmp" FLAT ;
ACTION MsgInfo( "Prints this document" ) TOOLTIP "Print this document" GROUP
DEFINE BUTTON OF oBar FILENAME "..\bitmaps\16x16\Exit.bmp" FLAT ;
ACTION( oWnd:End() ) TOOLTIP "Exit this app" GROUP
DEFINE MESSAGE OF oWnd PROMPT FWVERSION + " <-kapiabafwh@gmail.com-> " + ;
FWCOPYRIGHT NOINSET CENTERED KEYBOARD DATE CLOCK 2007
ACTIVATE WINDOW oWnd MAXIMIZED
RETURN NIL
/* O:
ShellExecute( ,"open", cFicheroPdf,,,1 )
*/
// FIN / END
Regards, saludos.
Re: Ver PDF
![Post Post](./styles/prosilver/imageset/icon_post_target.gif)
Posted:
Sat Jun 01, 2024 1:14 pm
by cnavarro
Lo más sencillo actualmente es "montar" un webview, y abrir ese fichero "file:///....." en el webview
Re: Ver PDF
![Post Post](./styles/prosilver/imageset/icon_post_target.gif)
Posted:
Mon Jun 03, 2024 6:26 pm
by Male
karina: realice las dos pruebas que me dices pero no me funcionaron se sigue cerrando el programa.
Cristóbal: probé con la opción WebView y me marca el siguiente error:
Error: Unresolved external '_HB_FUN_TWEBVIEW' referenced from C:\USERS\SYDEL\ONEDRIVE\PROGRAMA\FIVEWIN\PROTOTIPO\OBJ\CLIENTES.OBJ
https://1drv.ms/i/s!Ar6Rcd8ROBAs4jwbldi ... E?e=7VGqID
Re: Ver PDF
![Post Post](./styles/prosilver/imageset/icon_post_target.gif)
Posted:
Wed Jun 05, 2024 2:04 pm
by karinha
Buen día. Todo indica que la versión FIVEWIN está obsoleta. Desafortunadamente, no tengo esta versión de FWH18.11 para probarla y estar seguro. Ahora bien, ciertamente no es compatible con WEBVIEW.
Regards, saludos.
Re: Ver PDF
![Post Post](./styles/prosilver/imageset/icon_post_target.gif)
Posted:
Wed Jun 05, 2024 2:09 pm
by karinha
Probé con FWH1701 y SHOWPDF.PRG funciona bien. ¿Tiene ADOBE READER instalado en su máquina?
https://get.adobe.com/br/reader/Regards, saludos.
Re: RESUELTO - Ver PDF
![Post Post](./styles/prosilver/imageset/icon_post_target.gif)
Posted:
Wed Jun 05, 2024 7:23 pm
by Male
Karina: gracias por tu ayuda, listo quedo resuelto, desinstale el acrobatreader y lo reinstale, listo volvioa funcionar
![Image](https://i.postimg.cc/G48Gkk2H/VER-PDF-2024-06-05-131735.png)
Re: RESUELTO - Ver PDF
![Post Post](./styles/prosilver/imageset/icon_post_target.gif)
Posted:
Wed Jun 05, 2024 7:42 pm
by karinha
¡Muy bien! Hermoso trabajo, con código de barras y todo. ¡Felicidades!
Regards, saludos.