Need ActiveX PDF Reader

Xbase++ 2.0 Build 554 or later
Message
Author
User avatar
Auge_Ohr
Posts: 1405
Joined: Wed Feb 24, 2010 3:44 pm

Re: Need ActiveX PDF Reader

#21 Post by Auge_Ohr »

hi

i´m not sure if XbpHTMLViewer() or Acrobat Reader will work in Future ...

XbpHTMLViewer() are based on ieFrame.DLL which come with Internet Explorer and is not supported any more.
Arcobat Reader Support will stop this Year ...

---

do you know SumatraPDF reader http://www.sumatrapdfreader.org

it is Open Source which you can get here
https://github.com/sumatrapdfreader/sumatrapdf


you can run it from Command Line ( better ShellOpenFile() ) as "Server" and there is a Portable Version (no install)
it does support "plugin" and with a "Trick" it can be used as Viewer "in a Window" ( hWnd ) :whistle:

good news : i have a working xBase Sample
bad new : it is not Xbase++

but what i can see in Source Code seems "simple" as it use SendMessage()
to translate it for Xbase++ i got other Problem : Unicode

i don´t know if Xbase++ v2.x support Unicode String Function like AT(), TRIM(), SUBSTR() etc.
also Ot4xb seems not to have Unicode Sring Function so i´m not sure if it will work correct with Xbase++ when send/receive String


---

the Trick you find here https://www.sumatrapdfreader.org/docs/C ... ments.html
Developer options

-console : Opens a console window alongside SumatraPDF for accessing (MuPDF) debug output.
-stress-test <path> [file-filter] [range] [cycle-count]
Renders all pages of the indicated file/directory for stability and performance testing. E.g.:

-stress-test file1.pdf 25x
-stress-test file2.pdf 1-3
-stress-test dir *.pdf;*.xps 15- 3x

renders file1.pdf 25 times,
renders pages 1 to 3 of file2.pdf and renders all but the first 14 PDF and XPS files from dir 3 times.
-bench <filepath> [page-range] : Renders all pages (or just the indicated ones) for the given file
and then outputs the required rendering times for performance testing and comparisons.
Often used together with -console.
to show a PDF this is all what User need

Code: Select all

#include "HMG.CH"

PROCEDURE MAIN(cFile)
LOCAL cHwnd

   IF .NOT. FILE(cFile)
      MsgInfo("need PDF")
      RETURN
   ENDIF

   DEFINE WINDOW ShowPDF ;
      ROW 10 ;
      COL 10 ;
      WIDTH 1024 ;
      HEIGHT 1024 ;
      MAIN ;
      TITLE cFile ;
      ICON "MYICO" ; 
      NOSIZE ;
      BACKCOLOR { 250,241,228 }

      DEFINE WINDOW PdfView ;
         ROW 10 ;
         COL 10 ;
         WIDTH 1000 ;
         HEIGHT 960 ;
         PANEL ;
         BACKCOLOR { 250,241,228 }
      END WINDOW
   END WINDOW

   cHwnd := ALLTRIM( STR( GETFORMHANDLE( 'PdfView' ) ) )
   EXECUTE FILE 'SumatraPDF.exe' PARAMETERS '-lang en -plugin ' + cHwnd + ' ' + cfile

   ON KEY ESCAPE OF ShowPDF ACTION ShowPDF.Release
   CENTER WINDOW ShowPDF
   Activate Window ShowPDF

RETURN
Hb_Pdf.jpg
Hb_Pdf.jpg (97.09 KiB) Viewed 13080 times
Attach Code as EXE ( no Runtime need ) but you need SumatraPDF.exe (recommend Portable Version)
HBPDF.zip
(1.26 MiB) Downloaded 800 times
greetings by OHR
Jimmy

skiman
Posts: 1183
Joined: Thu Jan 28, 2010 1:22 am
Location: Sijsele, Belgium
Contact:

Re: Need ActiveX PDF Reader

#22 Post by skiman »

Hi Roger,

Thanks for the sample. That viewer.aapp solves that annoying toolbar. :dance:
Best regards,

Chris.
www.aboservice.be

skiman
Posts: 1183
Joined: Thu Jan 28, 2010 1:22 am
Location: Sijsele, Belgium
Contact:

Re: Need ActiveX PDF Reader

#23 Post by skiman »

Hi Roger,

I have created a little class to show a PDF in a separate thread. It is working fine as a test, but I don't succeed to resize.

Code: Select all

CLASS ABOFileViewer FROM Thread
   EXPORTED:
   VAR File , oViewer , oPdfDlg

   METHOD init	
ENDCLASS

METHOD ABOFileViewer:init( cFile )

local getlist := {} , getoptions := {} , oPdfDlg
   ::thread:init()
   ::File := cFile
   ::oPdfDlg := ""
 
@ 1,1 DCHTMLVIEWER ::oViewer SIZE 800,600 pixel RESIZE DCGUI_RESIZE_RESIZEONLY

DCGETOPTIONS RESIZE 

DCREAD GUI FIT OPTIONS GetOptions SETAPPWINDOW exit PARENT @oPdfDlg

::oPdfDlg := oPdfDlg

return self
The goal of this class is to open a separate dialog that contains the fileviewer. This way I can use oPdfDialog:oViewer:navigate( cFile). A user can put this dialog on another monitor, and it should be possible to maximize that dialog.

In the webbrow.prg sample, the dialog is resizing without any problem. I don't succeed to get this done.

What am I doing wrong?
Best regards,

Chris.
www.aboservice.be

User avatar
rdonnay
Site Admin
Posts: 4722
Joined: Wed Jan 27, 2010 6:58 pm
Location: Boise, Idaho USA
Contact:

Re: Need ActiveX PDF Reader

#24 Post by rdonnay »

I see that you are doing a dcread gui exit.

Give me your entire test program.
The eXpress train is coming - and it has more cars.

skiman
Posts: 1183
Joined: Thu Jan 28, 2010 1:22 am
Location: Sijsele, Belgium
Contact:

Re: Need ActiveX PDF Reader

#25 Post by skiman »

Hi Roger,

In attachment my modified fileviewer.prg. It contains the little class, to have the htmlviewer in a separate thread.
Attachments
FileViewer.zip
(2.29 KiB) Downloaded 711 times
Best regards,

Chris.
www.aboservice.be

skiman
Posts: 1183
Joined: Thu Jan 28, 2010 1:22 am
Location: Sijsele, Belgium
Contact:

Re: Need ActiveX PDF Reader

#26 Post by skiman »

Hi Jimmy,

I'm afraid you are right. I tried the dchtmlviewer on a server 2016, and it seems that it isn't working. It asks to open the file, and it starts Chrome.

I checked your sample for that SumatraPDF and I read the info on the website. It supports also JPG which is important for me. Have you ever tried to load another document in the open window?
Best regards,

Chris.
www.aboservice.be

User avatar
rdonnay
Site Admin
Posts: 4722
Joined: Wed Jan 27, 2010 6:58 pm
Location: Boise, Idaho USA
Contact:

Re: Need ActiveX PDF Reader

#27 Post by rdonnay »

It asks to open the file, and it starts Chrome
Which file? All files or just PDF?

If only PDF, then maybe you need to install Acrobat.
The eXpress train is coming - and it has more cars.

skiman
Posts: 1183
Joined: Thu Jan 28, 2010 1:22 am
Location: Sijsele, Belgium
Contact:

Re: Need ActiveX PDF Reader

#28 Post by skiman »

Hi Roger,

Yes, after installing de Adobe Reader it is working. :dance: I didn't knew this is also needed when using the htmlviewer.
Best regards,

Chris.
www.aboservice.be

User avatar
rdonnay
Site Admin
Posts: 4722
Joined: Wed Jan 27, 2010 6:58 pm
Location: Boise, Idaho USA
Contact:

Re: Need ActiveX PDF Reader

#29 Post by rdonnay »

I didn't knew this is also needed when using the htmlviewer.
HtmlViewer inherits from the Internet Explorer ActiveX control.

IE automatically invokes the Acrobat ActiveX control when it is installed.
The eXpress train is coming - and it has more cars.

User avatar
Auge_Ohr
Posts: 1405
Joined: Wed Feb 24, 2010 3:44 pm

Re: Need ActiveX PDF Reader

#30 Post by Auge_Ohr »

hi,
skiman wrote:I'm afraid you are right. I tried the dchtmlviewer on a server 2016, and it seems that it isn't working. It asks to open the file, and it starts Chrome.
modern Browser have build-in PDF Support so Acrobat will not support in Future.
skiman wrote:I checked your sample for that SumatraPDF and I read the info on the website. It supports also JPG which is important for me. Have you ever tried to load another document in the open window?
you mean to use TAB :?:
i have a "full Sample" which can do that and much more ... but i have not "explore" it yet.

---

to use old IE ActiveX and Acrobat are 2 x Security hole ...

so i´m looking for other Solution and SumatraPDF seem me a good Way.
it does show PDF i want and is much faster on my TablePC (Atom CPU)
greetings by OHR
Jimmy

Post Reply