error to show pdf on dialog

error to show pdf on dialog

Postby Silvio.Falconi » Thu Dec 03, 2020 10:16 am

Error description: Error BASE/1004 No exported method: LOADFILE
Args:
[ 1] = U
[ 2] = C Fattura_n_000246-2018_del_02-10-2018.pdf

Stack Calls
===========
Called from: => LOADFILE( 0 )
Called from: => __OBJSENDMSG( 0 )
Called from: .\source\classes\ACTIVEX.PRG => TACTIVEX:DO( 96 )
Called from: test.prg => VISUALIZZAFILEPDF( 331 )
Called from: test.prg => XMLREADER( 232 )
Called from: test.prg => IMPORTXML( 28 )
Called from: test.prg => MAIN( 11 )



Code: Select all  Expand view  RUN
DEFINE DIALOG oDlgPdfFile  SIZE nWidth, nHeight TRANSPARENT ;
   TITLE cTitle COLOR CLR_BLACK,  nRgb( 245,244,234) ;
   STYLE nOr( DS_MODALFRAME, WS_POPUP, WS_CAPTION,  4 )

   oActiveX = TActiveX():New( oDlgPdfFile, "AcroPDF.PDF.1" )

   oDlgPdfFile:oClient = oActiveX // To fill the entire window surface

   oActiveX:Do( "LoadFile", cFile )
   oActiveX:Do( "SetCurrentPage", 1 )

    ACTIVATE DIALOG oDlgPdfFile CENTER








exist another method to show a pdf on a dialog ?
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
User avatar
Silvio.Falconi
 
Posts: 7068
Joined: Thu Oct 18, 2012 7:17 pm

Re: error to show pdf on dialog

Postby nageswaragunupudi » Sun Dec 06, 2020 6:02 pm

Please try if this works for you.

Code: Select all  Expand view  RUN
  local cPdfFile := "c:\fwh\samples\pdfharu1h.pdf" // your pdf file name
   local nDlgWidth   := 420
   local nDlgHeight  := 600

   if File( cPdfFile )
      HtmlView( TrueName( cPdfFile ), "TITLE", nil, nil, nil, nDlgWidth, nDlgHeight )
   else
      ? cPdfFile + " not found"
   endif
 


Image
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10646
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: error to show pdf on dialog

Postby richard-service » Thu Apr 18, 2024 9:36 am

nageswaragunupudi wrote:Please try if this works for you.

Code: Select all  Expand view  RUN
  local cPdfFile := "c:\fwh\samples\pdfharu1h.pdf" // your pdf file name
   local nDlgWidth   := 420
   local nDlgHeight  := 600

   if File( cPdfFile )
      HtmlView( TrueName( cPdfFile ), "TITLE", nil, nil, nil, nDlgWidth, nDlgHeight )
   else
      ? cPdfFile + " not found"
   endif
 


Image


Dear Rao,
Yes, but I need to open Max Window can see it not direct look.
But I need to open PDF into Resource Dialog. but not open it. not error message.
Code: Select all  Expand view  RUN

#INCLUDE "FIVEWIN.CH"

FUNCTION MAIN()
PUBLIC oActiveX

PUBLIC oDlg

DEFINE DIALOG oDlg RESOURCE "DIALOG_1"
       oActiveX=TActiveX():ReDefine( 101, oDlg, "AcroPDF.PDF.1" )
       
ACTIVATE DIALOG oDlg CENTERED ON INIT SHOWPDF(oDlg)

RETURN Nil

function ShowPDF(oDlg)
   oActiveX:Do( "LoadFile","TP10.pdf" )
return nil  
 


Any solution for it?
Best Regards,

Richard

Harbour 3.2.0dev (r2402101027) => Borland C++ v7.7 32bit
MySQL v8.0 /ADS v10
Harbour 3.2.0dev (r2011030937) => Borland C++ v7.4 64bit
User avatar
richard-service
 
Posts: 804
Joined: Tue Oct 16, 2007 8:57 am
Location: New Taipei City, Taiwan

Re: error to show pdf on dialog

Postby karinha » Thu Apr 18, 2024 1:04 pm

Yo hago asi:

Code: Select all  Expand view  RUN

// C:\FWH\SAMPLES\SHOWPDF.PRG

#Include "FiveWin.ch"

STATIC oWnd

FUNCTION Main()

   LOCAL oBar, oIco

   HB_GCALL( .F. )

   DEFINE ICON oIco FILE "..\icons\person.ico"

   DEFINE WINDOW oWnd TITLE "ShowPdf Acrobat" COLOR "B/W" ICON oIco

   DEFINE BUTTONBAR oBar _3D OF oWnd

   DEFINE BUTTON OF oBar FILENAME "..\bitmaps\16x16\printer.bmp" FLAT GROUP  ;
      ACTION( ShowPDF_READER() )

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

   SET MESSAGE OF oWnd TO "ShowPdf Acrobat" NOINSET CLOCK DATE KEYBOARD

   ACTIVATE WINDOW oWnd

RETURN NIL

FUNCTION ShowPDF_READER()

   LOCAL oWndPdf, oPdf, cTmp, VisualPDF

   VisualPDF := "C:\TEMP\FWINTRO.PDF"

   IF .NOT. File( VisualPDF )

      ? "OOOPPSS!!"

      RETURN NIL

   ENDIF

   DEFINE WINDOW oWndPdf TITLE "FiveWin ActiveX Support"

   oPdf = TActiveX():New( oWndPdf, "AcroPDF.PDF.1", 1, 1, 20, 50 )

   oWndPdf:oClient := oPdf

   oPdf : src = VisualPDF

   // Mostra Preview Pequeno no lado esquerdo da tela...
   // oPdf:Do( "SetPageMode", "thumbnail and pages" )

   oPdf:SetProp( "Src", cTmp )

   oPdf:Do( "LoadFile", Lfn2Sfn( cTmp ) )

   oPdf:Do( "GetVersions" )

   oPdf:Do( "SetCurrentPage", 1 )

   // oPdf:Do( "PrintAll" )  // Assim funciona. pede a impressao

   // Mostra a Barra de Botoes do ADOBE READER
   oPdf:Do( "SetShowToolbar", .T. )

   oPdf:Do( "SetShowScrollbars", .T. )  // Liga/Desliga Scroll

   ACTIVATE WINDOW oWndPdf MAXIMIZED ;
      ON INIT( PDFActivex( oPdf ) )  ;
      VALID( oWndPdf := NIL, oPdf:End(), .T. )

RETURN NIL

FUNCTION PDFActivex( MyProgID )

   LOCAL aDretor := .T.

   IF IsActivex( "PDF.PdfCtrl.1" ); MyProgID := "PDF.PdfCtrl.1"; ENDIF
   IF IsActivex( "PDF.PdfCtrl.2" ); MyProgID := "PDF.PdfCtrl.2"; ENDIF
   IF IsActivex( "PDF.PdfCtrl.3" ); MyProgID := "PDF.PdfCtrl.3"; ENDIF
   IF IsActivex( "PDF.PdfCtrl.4" ); MyProgID := "PDF.PdfCtrl.4"; ENDIF
   IF IsActivex( "PDF.PdfCtrl.5" ); MyProgID := "PDF.PdfCtrl.5"; ENDIF
   IF IsActivex( "PDF.PdfCtrl.6" ); MyProgID := "PDF.PdfCtrl.6"; ENDIF
   IF IsActivex( "PDF.PdfCtrl.7" ); MyProgID := "PDF.PdfCtrl.7"; ENDIF
   IF IsActivex( "acroPDF.PDF.1" ); MyProgID := "acroPDF.PDF.1"; ENDIF
   IF IsActivex( "acroPDF.PDF.2" ); MyProgID := "acroPDF.PDF.2"; ENDIF

   IF Empty( MyProgID )

      MsgInfo( "PDF Activex não instalado!" + CRLF + " É necessário que seja instalado o programa ADOBE READER, consulte o suporte do sistema.", .F. )

      aDretor := .F.

   ENDIF

RETURN( aDretor )

FUNCTION LIBERA_TUDO()

   /*
   DbCommitAll()
   DbUnLockAll()
   DbCloseAll()
   FreeResources()
   */

   Release All
   SysRefresh()

   HB_GCALL( .T. )

   CLEAR MEMORY

   PostQuitMessage( 0 )

   QUIT

RETURN NIL

// FIN / END - kapiabafwh@gmail.com
 


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

Re: error to show pdf on dialog

Postby Marc Venken » Fri Apr 19, 2024 8:49 am

Karinha,

Interesting sample !

Is there a command that the pdf will be opened in full page layout in stead of full width

Maybe a command link ? or overview ?
Marc Venken
Using: FWH 23.04 with Harbour
User avatar
Marc Venken
 
Posts: 1438
Joined: Tue Jun 14, 2016 7:51 am
Location: Belgium

Re: error to show pdf on dialog

Postby Otto » Fri Apr 19, 2024 9:37 am

Hello Mark,
you can call

Code: Select all  Expand view  RUN
@echo off
start msedge --app="file:///path/to/your/file.pdf"
 


Best regards,
Otto
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
User avatar
Otto
 
Posts: 6336
Joined: Fri Oct 07, 2005 7:07 pm

Re: error to show pdf on dialog

Postby karinha » Fri Apr 19, 2024 12:10 pm

Sorry Marc, I didn't understand the question. Do you want to open an HTML?

Tks.

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

Re: error to show pdf on dialog

Postby richard-service » Sat Apr 20, 2024 3:05 am

karinha wrote:Yo hago asi:

Code: Select all  Expand view  RUN

// C:\FWH\SAMPLES\SHOWPDF.PRG

#Include "FiveWin.ch"

STATIC oWnd

FUNCTION Main()

   LOCAL oBar, oIco

   HB_GCALL( .F. )

   DEFINE ICON oIco FILE "..\icons\person.ico"

   DEFINE WINDOW oWnd TITLE "ShowPdf Acrobat" COLOR "B/W" ICON oIco

   DEFINE BUTTONBAR oBar _3D OF oWnd

   DEFINE BUTTON OF oBar FILENAME "..\bitmaps\16x16\printer.bmp" FLAT GROUP  ;
      ACTION( ShowPDF_READER() )

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

   SET MESSAGE OF oWnd TO "ShowPdf Acrobat" NOINSET CLOCK DATE KEYBOARD

   ACTIVATE WINDOW oWnd

RETURN NIL

FUNCTION ShowPDF_READER()

   LOCAL oWndPdf, oPdf, cTmp, VisualPDF

   VisualPDF := "C:\TEMP\FWINTRO.PDF"

   IF .NOT. File( VisualPDF )

      ? "OOOPPSS!!"

      RETURN NIL

   ENDIF

   DEFINE WINDOW oWndPdf TITLE "FiveWin ActiveX Support"

   oPdf = TActiveX():New( oWndPdf, "AcroPDF.PDF.1", 1, 1, 20, 50 )

   oWndPdf:oClient := oPdf

   oPdf : src = VisualPDF

   // Mostra Preview Pequeno no lado esquerdo da tela...
   // oPdf:Do( "SetPageMode", "thumbnail and pages" )

   oPdf:SetProp( "Src", cTmp )

   oPdf:Do( "LoadFile", Lfn2Sfn( cTmp ) )

   oPdf:Do( "GetVersions" )

   oPdf:Do( "SetCurrentPage", 1 )

   // oPdf:Do( "PrintAll" )  // Assim funciona. pede a impressao

   // Mostra a Barra de Botoes do ADOBE READER
   oPdf:Do( "SetShowToolbar", .T. )

   oPdf:Do( "SetShowScrollbars", .T. )  // Liga/Desliga Scroll

   ACTIVATE WINDOW oWndPdf MAXIMIZED ;
      ON INIT( PDFActivex( oPdf ) )  ;
      VALID( oWndPdf := NIL, oPdf:End(), .T. )

RETURN NIL

FUNCTION PDFActivex( MyProgID )

   LOCAL aDretor := .T.

   IF IsActivex( "PDF.PdfCtrl.1" ); MyProgID := "PDF.PdfCtrl.1"; ENDIF
   IF IsActivex( "PDF.PdfCtrl.2" ); MyProgID := "PDF.PdfCtrl.2"; ENDIF
   IF IsActivex( "PDF.PdfCtrl.3" ); MyProgID := "PDF.PdfCtrl.3"; ENDIF
   IF IsActivex( "PDF.PdfCtrl.4" ); MyProgID := "PDF.PdfCtrl.4"; ENDIF
   IF IsActivex( "PDF.PdfCtrl.5" ); MyProgID := "PDF.PdfCtrl.5"; ENDIF
   IF IsActivex( "PDF.PdfCtrl.6" ); MyProgID := "PDF.PdfCtrl.6"; ENDIF
   IF IsActivex( "PDF.PdfCtrl.7" ); MyProgID := "PDF.PdfCtrl.7"; ENDIF
   IF IsActivex( "acroPDF.PDF.1" ); MyProgID := "acroPDF.PDF.1"; ENDIF
   IF IsActivex( "acroPDF.PDF.2" ); MyProgID := "acroPDF.PDF.2"; ENDIF

   IF Empty( MyProgID )

      MsgInfo( "PDF Activex não instalado!" + CRLF + " É necessário que seja instalado o programa ADOBE READER, consulte o suporte do sistema.", .F. )

      aDretor := .F.

   ENDIF

RETURN( aDretor )

FUNCTION LIBERA_TUDO()

   /*
   DbCommitAll()
   DbUnLockAll()
   DbCloseAll()
   FreeResources()
   */

   Release All
   SysRefresh()

   HB_GCALL( .T. )

   CLEAR MEMORY

   PostQuitMessage( 0 )

   QUIT

RETURN NIL

// FIN / END - kapiabafwh@gmail.com
 


Regards, Saludos.


Dear Karinha,

Thanks a lot. Your sample look good. let's think inside of resource dialog back.
Best Regards,

Richard

Harbour 3.2.0dev (r2402101027) => Borland C++ v7.7 32bit
MySQL v8.0 /ADS v10
Harbour 3.2.0dev (r2011030937) => Borland C++ v7.4 64bit
User avatar
richard-service
 
Posts: 804
Joined: Tue Oct 16, 2007 8:57 am
Location: New Taipei City, Taiwan

Re: error to show pdf on dialog

Postby karinha » Sat Apr 20, 2024 2:12 pm

Unfortunately I couldn't make it work with RESOURCES. I don't know what the FiveTech team did with ACTIVEX.

Lamentablemente no pude hacerlo funcionar con RECURSOS. No sé qué hizo el equipo de FiveTech con ACTIVEX.

Code: Select all  Expand view  RUN

// C:\FWH\SAMPLES\SHOWPDF2.PRG - NO FUNCIONA con RESOURCE.

#include "FiveWin.ch"

FUNCTION Main()

   LOCAL oDlg, oActiveX, oSaida, oFnt, oFont, VisualPDF, cArqPdf

   VisualPDF := "C:\TEMP\FWINTRO.PDF"
   cArqPdf   := VisualPDF

   IF .NOT. File( cArqPdf )

      ? "OOOPPSS!!"

      RETURN NIL

   ENDIF

   DEFINE FONT oFnt  NAME "Ms Sans Serif" SIZE 00, - 12 BOLD
   DEFINE FONT oFont NAME "Ms Sans Serif" SIZE 00, - 14 BOLD

   DEFINE DIALOG oDlg RESOURCE "ACTIVEX" ICON "ICONE" FONT oFont TRANSPARENT ;
      COLORS CLR_BLACK, CLR_WHITE

   oDlg:lHelpIcon    := .F.

   REDEFINE ACTIVEX oActiveX ID 101 OF oDlg PROGID "AcroPDF.PDF.1"

   REDEFINE BUTTON oSaida ID 520 OF oDlg PROMPT "&Saida" ;
      ACTION( oDlg:End(), LIBERA_TUDO() ) CANCEL

   oSaida:cToolTip := "Saida - Exit - Cancelar"

   SET FONT OF oSaida TO oFont

   ACTIVATE DIALOG oDlg CENTERED ;
      ON INIT ( oActiveX:Do( "LoadFile", ALLTRIM( cArqPdf ) ), ;
                oActiveX:Do( "SetCurrentPage", 1 )  )

   //      ON INIT( oActiveX:Do( "LoadFile", Lfn2Sfn( cArqPdf ) ) )

   oFnt:End()
   oFont:End()

RETURN NIL

FUNCTION LIBERA_TUDO()

   /*
   DbCommitAll()
   DbUnLockAll()
   DbCloseAll()
   FreeResources()
   */

   Release All
   SysRefresh()

   HB_GCALL( .T. )

   CLEAR MEMORY

   PostQuitMessage( 0 )

   QUIT

RETURN NIL

// FIN / END
 


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

Re: error to show pdf on dialog

Postby karinha » Sat Apr 20, 2024 2:14 pm

SHOWPDF2.RC

Code: Select all  Expand view  RUN

/****************************************************************************


nfe.rc

produced by Borland Resource Workshop


*****************************************************************************/


ACTIVEX DIALOG 5, 83, 600, 278
STYLE DS_ABSALIGN | DS_MODALFRAME | 0x4L | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
CAPTION "Fivewin: Activex With Acrobat PDF."
FONT 8, "MS Sans Serif"
{
 CONTROL "", 101, "TActiveX", 0 | WS_CHILD | WS_VISIBLE, 10, 24, 580, 248
 PUSHBUTTON "Button", 520, 10, 6, 60, 14
}

DEDO CURSOR
{
 '00 00 02 00 01 00 20 20 00 00 06 00 00 00 30 01'
 '00 00 16 00 00 00 28 00 00 00 20 00 00 00 40 00'
 '00 00 01 00 01 00 00 00 00 00 80 00 00 00 00 00'
 '00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00'
 '00 00 FF FF FF 00 00 00 00 00 00 00 00 00 00 00'
 '00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00'
 '00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00'
 '00 00 00 00 00 00 00 00 00 00 00 00 00 00 03 FF'
 '00 00 03 FF 00 00 07 FF 00 00 0F FF 80 00 1F FF'
 '80 00 1F FF 80 00 1B FF 80 00 1B FF 80 00 1B 6D'
 '80 00 03 6D 80 00 03 6D 80 00 03 6D 80 00 03 00'
 '00 00 03 00 00 00 03 00 00 00 03 00 00 00 03 00'
 '00 00 00 00 00 00 FF FF FF FF FF FF FF FF FF FF'
 'FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF'
 'FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF'
 'FF FF FF FF FF FF FF FF FF FF F8 00 7F FF F8 00'
 '7F FF F8 00 7F FF F0 00 7F FF E0 00 3F FF C0 00'
 '3F FF C0 00 3F FF C0 00 3F FF C0 00 3F FF C0 00'
 '3F FF C0 00 3F FF F8 00 3F FF F8 00 3F FF F8 12'
 '7F FF F8 7F FF FF F8 7F FF FF F8 7F FF FF F8 7F'
 'FF FF FC FF FF FF'
}


ICONE ICON
{
 '00 00 01 00 01 00 32 26 00 01 00 00 00 00 10 0D'
 '00 00 16 00 00 00 28 00 00 00 32 00 00 00 4C 00'
 '00 00 01 00 08 00 00 00 00 00 B8 07 00 00 00 00'
 '00 00 00 00 00 00 00 01 00 00 00 00 00 00 EF EF'
 'EF 00 A6 AC AA 00 FF FF FF 00 3D 2B 23 00 47 2A'
 '1E 00 45 2B 20 00 81 5E 4F 00 00 C6 FF 00 49 32'
 '25 00 5D 43 36 00 50 43 3C 00 63 48 3A 00 FF FE'
 'FE 00 52 3B 31 00 35 24 18 00 7E 5D 52 00 9B 8B'
 '82 00 82 66 4E 00 A0 8A 7E 00 67 4D 3C 00 4E 3D'
 '34 00 92 71 55 00 86 6A 52 00 C7 BC 8C 00 7E 5E'
 '4F 00 5A 6F 63 00 9C 7E 5E 00 6B 4A 36 00 5B 3E'
 '2E 00 75 58 45 00 7B 63 50 00 6A 50 41 00 9E 95'
 '91 00 70 50 39 00 CF CA C7 00 BE A2 7C 00 5B 4C'
 '44 00 CB BC AC 00 7F 63 4B 00 8A 6E 56 00 56 3A'
 '2A 00 6E 5A 4A 00 61 43 33 00 E5 DE D6 00 C1 AC'
 '99 00 74 53 3B 00 4C 88 96 00 C8 A9 85 00 66 46'
 '32 00 63 40 2F 00 7B 59 40 00 80 62 4E 00 BA A2'
 '89 00 A3 84 61 00 C3 A6 83 00 A7 84 5C 00 7D 55'
 '45 00 31 9C B9 00 8A 6A 50 00 8E 72 59 00 82 62'
 '4B 00 A4 80 5C 00 59 94 45 00 6F 51 3E 00 D1 CC'
 'C9 00 95 75 57 00 B8 B1 AC 00 86 64 4D 00 72 59'
 '48 00 8A 74 66 00 B9 9B 78 00 F8 F6 F3 00 99 83'
 '73 00 9E 82 62 00 8F 6C 52 00 D4 B9 94 00 B0 9A'
 '83 00 8D 65 43 00 F3 F2 F1 00 78 55 46 00 CF C2'
 'B2 00 E7 E4 E3 00 AA 88 60 00 B0 89 58 00 EA E2'
 'D8 00 EE E8 E1 00 A1 7C 59 00 71 60 58 00 C7 B2'
 '9B 00 2F 5F 1F 00 86 7A 74 00 AC 95 81 00 E9 D5'
 'B2 00 B6 9D 84 00 D7 C9 BB 00 CB AE 8B 00 8D 6E'
 '54 00 DC C3 A1 00 D9 C2 9D 00 BB A8 96 00 AC 88'
 '5D 00 97 79 59 00 E3 D7 C9 00 F0 DC BC 00 9E 83'
 '6B 00 FE FE FE 00 D7 BD 9B 00 D1 BA 9C 00 D1 BD'
 'A3 00 68 A2 54 00 8A 6B 5B 00 92 A6 9B 00 E7 D2'
 'AD 00 F2 ED E9 00 6B 98 4B 00 F5 F0 EB 00 22 AA'
 'D1 00 EE DA B9 00 EB E6 E2 00 AB 8D 6A 00 6C 60'
 '5C 00 E0 C8 A3 00 7E 9F 56 00 A6 91 82 00 A1 95'
 '8F 00 D4 C1 A5 00 A1 9B 94 00 3D 73 28 00 9C 77'
 '59 00 AE 9C 8B 00 A2 8D 81 00 94 8A 84 00 EC D7'
 'B6 00 D8 D1 CB 00 A9 A1 9A 00 D0 B3 91 00 B1 94'
 '70 00 C1 AB 90 00 4D 88 33 00 E1 CC A7 00 D0 B4'
 '88 00 8B 68 4F 00 F2 E0 BE 00 C3 B3 A3 00 D5 C3'
 'AB 00 FF FF FE 00 AD A6 A1 00 DD D9 D6 00 A4 8A'
 '6F 00 7E 6D 64 00 95 7C 6A 00 BB 98 6B 00 E3 CE'
 'AF 00 DB CE C1 00 B5 A9 A1 00 54 B1 B6 00 80 A9'
 '5C 00 A1 B7 76 00 78 6F 6A 00 64 53 4C 00 DE C8'
 'AB 00 FE FD FD 00 43 8F A2 00 9B 74 4D 00 A7 7D'
 '52 00 8B 81 7A 00 FB F9 F6 00 9A 9E 67 00 95 6C'
 '4B 00 AD 92 74 00 18 B1 DC 00 F5 DE C0 00 3F 7A'
 '40 00 A6 88 67 00 84 62 4B 00 84 60 4F 00 A9 95'
 '8B 00 C5 C6 95 00 92 AA 68 00 FC FB F9 00 36 81'
 '29 00 9A 8E 86 00 11 B8 E8 00 DF D2 AB 00 C3 BE'
 'B9 00 AF A5 8D 00 7F 9B 96 00 CA B5 A0 00 CC BA'
 'A6 00 DB C4 A8 00 A8 C8 C8 00 9D B4 67 00 71 AA'
 '99 00 8A 99 79 00 CE CD A1 00 62 AB AA 00 83 6C'
 '5C 00 9A 76 52 00 A9 B5 B1 00 91 B1 AB 00 6C 84'
 '4B 00 85 5E 41 00 D9 BD 96 00 08 BF F3 00 95 93'
 '7F 00 B9 AE 80 00 60 5A 3D 00 6F 4A 30 00 2A A4'
 'C4 00 8C DB DF 00 71 66 5E 00 84 62 47 00 52 6E'
 '46 00 B3 90 67 00 69 55 49 00 72 5F 53 00 A4 B3'
 'A8 00 8A BF BC 00 A9 87 65 00 6E 70 63 00 78 66'
 '5C 00 7E 68 58 00 A5 98 89 00 E0 D1 BD 00 7F D3'
 'D6 00 C4 B5 A8 00 C6 B8 AB 00 B0 AE AA 00 E5 D2'
 'B2 00 5C 7A 80 00 EC E1 CD 00 8A CD CD 00 6D 6B'
 '69 00 9B 99 88 00 81 75 59 00 66 50 45 00 FA FA'
 'FA 00 87 64 4B 00 AE B0 7F 00 72 B8 BB 00 8C 92'
 '88 00 68 5C 56 00 F7 E0 C2 00 77 8A 8B 00 8F 64'
 '49 00 86 68 4F 00 F1 E7 D5 00 BD B9 7F 00 5E AC'
 '74 00 AE A4 72 00 FD FC FB 00 FB FC FC 00 B2 BB'
 'B7 00 94 E1 E8 00 FD FC FC 00 79 85 60 00 14 14'
 '14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14'
 '14 14 14 14 14 14 14 14 14 14 14 14 57 9F 14 14'
 '14 14 14 14 0D 0D 0D 0D 0D 0D 0D 0D 0D 0D 0D 0D'
 '00 00 04 04 04 04 04 04 04 04 04 04 04 04 04 04'
 '04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 EB'
 '48 E9 08 04 04 04 04 04 04 04 04 04 04 04 04 04'
 '04 04 04 04 00 00 04 04 04 04 04 04 04 04 04 04'
 '04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04'
 '04 04 A5 DE 4B 4C A5 08 04 04 04 04 04 05 05 05'
 '05 05 05 05 05 05 05 05 00 00 05 05 05 05 05 05'
 '05 04 04 04 04 04 04 04 04 04 04 04 04 04 08 05'
 '05 05 08 08 08 DD 5B 62 5C 6B 82 5A 08 04 04 04'
 '04 04 04 04 04 04 04 04 04 04 04 04 00 00 05 05'
 '05 05 05 05 05 04 04 04 04 04 04 04 04 04 04 04'
 '04 04 05 05 05 05 05 08 0A 44 46 4B 61 70 6A 5B'
 'A5 05 04 04 04 04 04 04 04 04 04 04 04 04 04 04'
 '00 00 04 04 05 05 05 05 05 04 04 04 04 04 04 04'
 '04 04 04 04 04 05 78 5A F3 F3 5A 78 24 0A 21 49'
 '36 4B 79 62 5B 09 04 04 04 04 04 04 04 04 04 04'
 '04 04 04 04 00 00 04 04 04 05 05 05 05 04 04 04'
 '04 04 04 04 04 04 04 05 0A 19 59 7F AC 59 59 59'
 '19 9E 78 1F 3A 77 36 61 34 0D 04 04 04 04 04 04'
 '04 04 04 04 04 04 04 04 00 00 04 04 04 04 05 05'
 '05 05 05 05 05 05 05 05 05 05 05 14 D4 59 59 AC'
 'AC AC B4 59 59 AC F3 5A 18 65 35 23 12 9E 05 05'
 '04 04 04 04 04 04 04 04 04 04 04 04 00 00 04 04'
 '04 05 05 05 05 05 05 05 05 05 05 05 05 05 09 CE'
 '59 AC C6 C7 9B 9B EF D1 C0 B4 59 D4 A9 23 3D 35'
 'AD 45 D2 08 08 05 05 05 05 05 05 05 05 05 05 05'
 '00 00 08 08 08 08 08 08 08 08 08 08 08 08 08 08'
 '08 08 09 7F 59 9A B8 9B 9B 7E 95 13 0B D7 6D 59'
 '7F CD 2F 35 49 77 68 96 D7 08 08 08 08 08 08 08'
 '08 08 08 08 00 00 08 08 08 08 08 08 08 08 08 08'
 '08 08 08 08 08 09 FF 59 D4 7B C3 9B CC 28 28 28'
 '28 28 81 EE B4 7F A7 2F 77 AD 46 34 4C 81 C4 28'
 '28 28 28 28 28 28 28 28 00 00 28 28 28 28 28 28'
 '28 28 28 28 28 28 28 28 28 CE 8A 59 EA F0 9B BA'
 'DD 1C 1C 0B 0B C4 58 75 8B 3E 7F A7 87 88 AD 23'
 '6A 61 8B 89 45 1C 28 28 28 28 28 28 00 00 1C 1C'
 '1C 1C 1C 1C 1C 1C 1C 1C 1C 1C 1C 1C 1C CE B4 7F'
 '96 BA 9B F0 18 31 0B 44 18 8B 5C 5C 84 70 9C 7F'
 'A7 87 77 77 5F 8B 70 70 34 12 1C 1C 1C 1C 1C 1C'
 '00 00 31 31 31 31 31 31 31 31 31 31 31 31 31 31'
 '31 CE 8A 7F 12 BA C3 B5 21 1B 1B 3F A9 79 6A 6A'
 '6A 61 61 9C 7F A7 5F 88 88 87 8B 5C 61 B9 DD 2A'
 '2A 2A 2A 2A 00 00 30 30 30 30 30 30 30 30 30 30'
 '30 30 30 30 30 26 3E 8A 4C BA C3 E9 33 1B 30 45'
 '68 52 C5 C5 A3 56 88 87 7A B4 CD 5F 88 23 62 70'
 '70 89 12 1B 1B 1B 1B 1B 00 00 1B 1B 1B 1B 1B 1B'
 '1B 1B 1B 1B 1B 1B 1B 1B 1B 26 9D 8A B9 6F C3 86'
 '16 2D 45 5B CF 30 1C 1C 1C 31 CF A3 23 72 8A 87'
 '2F 88 2F 79 70 6B 81 1D 1B 1B 21 21 00 00 21 21'
 '21 21 21 21 21 21 21 21 21 21 21 21 21 21 EA 3E'
 'B2 92 C0 6F 68 27 81 12 8F 5E 50 50 E2 68 CF 30'
 '4D 46 8A 72 4B 23 46 4B 70 B7 89 12 21 21 21 21'
 '00 00 2D 2D 2D 2D 2D 2D 2D 2D 2D 2D 2D 2D 2D 2D'
 '2D 2D 16 6D 7A 8F C0 6F 63 4C 4C 76 69 69 69 69'
 '69 69 99 C9 CF 56 F9 8A B2 4B 46 23 62 70 58 8F'
 '3B 2D 2D 2D 00 00 32 32 32 32 32 32 32 32 32 32'
 '32 32 32 32 32 32 ED B2 3E 25 6F C0 63 5D 2B 69'
 '69 69 2B 66 47 69 69 55 A9 52 4B 9D 8A CD 36 46'
 '87 70 58 2C 8F 32 32 32 00 00 64 64 64 64 52 52'
 '52 52 52 52 52 52 52 52 52 52 52 23 9C B1 50 B9'
 '89 7D A6 91 91 66 97 8C 8B F6 91 91 73 62 62 70'
 'BF BF 79 4B CA 5C BD 6B DF 23 64 64 00 00 37 37'
 '37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 77'
 '9D 9C 5F 23 8C E4 B3 91 91 5F 4D 53 D5 97 6B 6B'
 '2F 97 97 8C B1 6D 17 62 8C 79 5C 7D 7D 90 37 37'
 '00 00 3D 3D 3D 3D 3D 3D 3D 3D 3D 3D 3D 3D 77 6C'
 '6C 23 DA D5 17 6D 17 CA 8C 79 73 91 91 90 4D A3'
 'A4 A4 A4 A4 A4 A4 A3 53 4B BF 9C 62 8C CA 5C 67'
 '6C 90 46 3D 00 00 56 56 56 56 56 56 56 56 56 56'
 '35 5D BB 6C 98 A0 7D 6C 7D BF BF 79 5F 8C E6 0C'
 '0C 47 2B 2B 54 54 54 54 54 54 89 4D 97 17 6D F7'
 '4B 8C 8B 8E 75 6B 6C DA 00 00 80 80 58 BB AD 35'
 '80 94 58 58 58 6B 7D 6A 8B 5C E4 7D A0 C2 6D 17'
 'CA 2F 61 A6 0C 0C 0C 0C 0C 0C 0C 0C 0C 0C 55 A8'
 'A3 4B B2 7A 4B 2F 6A 5C 8E 84 6B BC 00 00 41 41'
 '25 34 58 99 34 5E 2C 94 35 4B 4B 46 97 4B 84 8E'
 '8E 8E 9D 7A 61 5F 2F E6 0C 0C 73 34 34 90 66 E6'
 '47 0C A1 89 A8 5F B1 72 CD 2F 87 98 75 67 A0 63'
 '00 00 15 15 58 1A 35 25 66 BC AD D3 4D 23 5F 37'
 'A8 97 8B 8E 8E F2 B7 6D 9D 79 2F 4B 47 0C B3 5D'
 '2D A8 97 2F DF 0C 0C 54 A3 23 B7 6D A7 2F 2F 61'
 '5C 67 98 34 00 00 4A 63 2B 50 4A 34 5E 55 71 5E'
 '2D 46 47 71 3D A4 6A 75 67 67 F2 B1 72 17 6A 23'
 'A0 A1 0C 47 A9 2D C9 4D 58 0C 0C 71 3D 2F 5C B2'
 '72 2F 36 4B 5C 67 BD 34 00 00 8D E1 71 55 60 68'
 '50 0C 0C EC ED A8 B3 0C 4C 4D 46 4B 62 79 84 AB'
 '9D 72 62 87 23 DF A1 0C A6 2C C5 49 2B 0C 0C 73'
 '46 6A 67 9D 3E 23 46 87 BD BB 2C BB 00 00 43 63'
 'B3 A6 68 8D 85 0C 0C 0C 5B D3 2B 0C BB 1B 4D A3'
 '52 23 79 67 75 9C 7A 61 5F 23 5E A6 0C 0C 47 B3'
 '0C 0C 0C 55 6A E4 AB B1 3E A7 46 46 B9 63 2C 8F'
 '00 00 3C 96 A1 0C 81 F5 73 47 71 0C 25 16 85 0C'
 '66 C9 D3 C5 56 88 62 84 AB B7 72 7A 61 5F 46 6C'
 '55 0C 0C 0C 0C FA 55 98 5C 7D A0 B1 3E C8 1A DE'
 'D9 D8 E1 81 00 00 06 AF 51 0C 9A 12 0C 22 22 0C'
 '93 29 42 0C FE 4E 47 A6 66 36 62 84 67 AB C2 3E'
 '7A 61 87 46 36 90 66 99 5E 66 75 84 98 63 63 B9'
 '3E C8 DE BE E0 6F 86 7E 00 00 06 06 42 0C 2B 85'
 'A1 7E 42 0C 00 C4 B5 69 0C 2B 5E 66 5E 46 5F A0'
 '84 75 AB C2 3E 7A 62 6B 23 DA 96 7B 45 4C 7D 6C'
 '2C 81 43 48 3E 72 42 BE E0 6F E3 3B 00 00 06 06'
 '82 A1 0C 0C 51 6E 6E FB A1 82 5A 4E 0C 2C 2D C9'
 'F4 A8 77 6B 5C 75 75 AB C2 72 72 6B 61 36 1A 48'
 '5A AF AF 6E 3B 16 3B E9 3E C1 E3 BE E0 D8 42 43'
 '00 00 06 06 82 EC 0C 0C B8 6E 6E 5E 0C 22 7E 2B'
 '0C 55 2C 63 2C 34 46 6A 84 67 98 BD 67 B7 9C 3E'
 'EE BD 87 68 48 45 AF AF 43 16 6E C8 3E CC 86 E7'
 'E7 FC 16 AE 00 00 06 06 6E 51 0C 73 96 6E AF B8'
 '0C 00 E3 2B 0C 0C 0C 0C 0C 73 58 98 67 98 2C 63'
 '2C 2C 6C B2 3E 7A 87 5D 6F BA 83 6E 6E 6E EA 8A'
 'C8 B5 C7 D1 BE 96 AE AE 00 00 33 3C 3C 48 7B 48'
 '3C 3C 3C 48 7B 48 33 48 7B 7B 7B 7B 5B 50 7D 75'
 '8E 6C 81 45 3B 27 48 9A D8 6D 3E 72 C7 D9 EF 6F'
 '6F C1 3E 3E 6F D9 D1 BE 96 3C 3C 3C 00 00 4F 4F'
 '38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38'
 '45 12 34 58 A0 6B 81 38 38 38 38 38 38 45 94 7A'
 '3E 3E 6D 6D 3E 3E F8 E7 D1 FD C7 06 38 38 38 38'
 '00 00 12 12 12 12 12 12 12 12 12 12 12 12 12 12'
 '12 12 12 12 82 B0 7B 82 B0 B0 82 12 12 12 12 12'
 '12 12 B0 B0 7B CC CC C1 C1 6F C6 C6 C6 42 82 12'
 '12 12 12 12 00 00 00 00 00 00 00 00 00 00 00 00'
 '00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00'
 '00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00'
 '00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00'
 '00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00'
 '00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00'
 '00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00'
 '00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00'
 '00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00'
 '00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00'
 '00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00'
 '00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00'
 '00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00'
 '00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00'
 '00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00'
 '00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00'
 '00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00'
 '00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00'
 '00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00'
 '00 00 00 00 00 00'
}








1 VERSIONINFO LOADONCALL MOVEABLE DISCARDABLE IMPURE
FILEVERSION 1, 0, 2, 0
PRODUCTVERSION 1, 0, 2, 0
FILEFLAGSMASK VS_FFI_FILEFLAGSMASK
FILEOS VOS__WINDOWS32
FILETYPE VFT_APP
{
 BLOCK "StringFileInfo"
 {
  BLOCK "080904E4"
  {
   VALUE "CompanyName", "Contato Sistemas\000"
   VALUE "FileDescription", "PlenoWin - Cesta Básica\000"
   VALUE "FileVersion", "1.0200\000"
   VALUE "InternalName", "SHOWPDF2.exe\000"
   VALUE "LegalCopyright", "\251Contato Sistemas e Proc. Ltda\000"
   VALUE "LegalTrademarks", "\256Contato Sistemas e Proc. Ltda\000"
   VALUE "OriginalFilename", "SHOWPDF2.EXE\000"
   VALUE "ProductName", "SHOWPDF2\000"
   VALUE "ProductVersion", "1.02\000"
   VALUE "Comments", "by Joao Santos - 2024\000"
  }

 }

 BLOCK "VarFileInfo"
 {
  VALUE "Translation", 2057, 1252
 }

}
 


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

Re: error to show pdf on dialog

Postby richard-service » Sat Apr 20, 2024 4:02 pm

karinha wrote:Unfortunately I couldn't make it work with RESOURCES. I don't know what the FiveTech team did with ACTIVEX.

Lamentablemente no pude hacerlo funcionar con RECURSOS. No sé qué hizo el equipo de FiveTech con ACTIVEX.

Code: Select all  Expand view  RUN

// C:\FWH\SAMPLES\SHOWPDF2.PRG - NO FUNCIONA con RESOURCE.

#include "FiveWin.ch"

FUNCTION Main()

   LOCAL oDlg, oActiveX, oSaida, oFnt, oFont, VisualPDF, cArqPdf

   VisualPDF := "C:\TEMP\FWINTRO.PDF"
   cArqPdf   := VisualPDF

   IF .NOT. File( cArqPdf )

      ? "OOOPPSS!!"

      RETURN NIL

   ENDIF

   DEFINE FONT oFnt  NAME "Ms Sans Serif" SIZE 00, - 12 BOLD
   DEFINE FONT oFont NAME "Ms Sans Serif" SIZE 00, - 14 BOLD

   DEFINE DIALOG oDlg RESOURCE "ACTIVEX" ICON "ICONE" FONT oFont TRANSPARENT ;
      COLORS CLR_BLACK, CLR_WHITE

   oDlg:lHelpIcon    := .F.

   REDEFINE ACTIVEX oActiveX ID 101 OF oDlg PROGID "AcroPDF.PDF.1"

   REDEFINE BUTTON oSaida ID 520 OF oDlg PROMPT "&Saida" ;
      ACTION( oDlg:End(), LIBERA_TUDO() ) CANCEL

   oSaida:cToolTip := "Saida - Exit - Cancelar"

   SET FONT OF oSaida TO oFont

   ACTIVATE DIALOG oDlg CENTERED ;
      ON INIT ( oActiveX:Do( "LoadFile", ALLTRIM( cArqPdf ) ), ;
                oActiveX:Do( "SetCurrentPage", 1 )  )

   //      ON INIT( oActiveX:Do( "LoadFile", Lfn2Sfn( cArqPdf ) ) )

   oFnt:End()
   oFont:End()

RETURN NIL

FUNCTION LIBERA_TUDO()

   /*
   DbCommitAll()
   DbUnLockAll()
   DbCloseAll()
   FreeResources()
   */

   Release All
   SysRefresh()

   HB_GCALL( .T. )

   CLEAR MEMORY

   PostQuitMessage( 0 )

   QUIT

RETURN NIL

// FIN / END
 


Regards, Saludos.


Dear Karinha,
Thanks a lot for your make sample. We wait it any solution.
Best Regards,

Richard

Harbour 3.2.0dev (r2402101027) => Borland C++ v7.7 32bit
MySQL v8.0 /ADS v10
Harbour 3.2.0dev (r2011030937) => Borland C++ v7.4 64bit
User avatar
richard-service
 
Posts: 804
Joined: Tue Oct 16, 2007 8:57 am
Location: New Taipei City, Taiwan


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot], Otto and 61 guests