bb.donnay-software.com

Donnay Software Web Forums
It is currently Wed May 27, 2020 10:16 pm

All times are UTC - 7 hours




Post new topic Reply to topic  [ 45 posts ]  Go to page Previous  1, 2, 3, 4, 5  Next
Author Message
PostPosted: Sat Feb 22, 2020 12:12 am 
Offline
User avatar

Joined: Wed Feb 24, 2010 3:44 pm
Posts: 1183
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/Command-line-arguments.html
Quote:
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:
#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

Attachment:
Hb_Pdf.jpg
Hb_Pdf.jpg [ 97.09 KiB | Viewed 1614 times ]

Attach Code as EXE ( no Runtime need ) but you need SumatraPDF.exe (recommend Portable Version)
Attachment:
HBPDF.zip [1.26 MiB]
Downloaded 165 times

_________________
greetings by OHR
Jimmy


Top
 Profile  
 
PostPosted: Sat Feb 22, 2020 6:41 am 
Offline

Joined: Thu Jan 28, 2010 1:22 am
Posts: 863
Location: Sijsele, Belgium
Hi Roger,

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

_________________
Best regards,

Chris.
www.aboservice.be


Top
 Profile  
 
PostPosted: Sat Feb 22, 2020 8:52 am 
Offline

Joined: Thu Jan 28, 2010 1:22 am
Posts: 863
Location: Sijsele, Belgium
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:
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


Top
 Profile  
 
PostPosted: Sat Feb 22, 2020 11:39 am 
Offline
Site Admin
User avatar

Joined: Wed Jan 27, 2010 6:58 pm
Posts: 4124
Location: Boise, Idaho USA
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.


Top
 Profile  
 
PostPosted: Mon Feb 24, 2020 9:39 am 
Offline

Joined: Thu Jan 28, 2010 1:22 am
Posts: 863
Location: Sijsele, Belgium
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 147 times

_________________
Best regards,

Chris.
www.aboservice.be
Top
 Profile  
 
PostPosted: Tue Mar 03, 2020 7:16 am 
Offline

Joined: Thu Jan 28, 2010 1:22 am
Posts: 863
Location: Sijsele, Belgium
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


Top
 Profile  
 
PostPosted: Tue Mar 03, 2020 8:01 am 
Offline
Site Admin
User avatar

Joined: Wed Jan 27, 2010 6:58 pm
Posts: 4124
Location: Boise, Idaho USA
Quote:
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.


Top
 Profile  
 
PostPosted: Tue Mar 03, 2020 8:43 am 
Offline

Joined: Thu Jan 28, 2010 1:22 am
Posts: 863
Location: Sijsele, Belgium
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


Top
 Profile  
 
PostPosted: Tue Mar 03, 2020 9:31 am 
Offline
Site Admin
User avatar

Joined: Wed Jan 27, 2010 6:58 pm
Posts: 4124
Location: Boise, Idaho USA
Quote:
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.


Top
 Profile  
 
PostPosted: Tue Mar 03, 2020 3:02 pm 
Offline
User avatar

Joined: Wed Feb 24, 2010 3:44 pm
Posts: 1183
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


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 45 posts ]  Go to page Previous  1, 2, 3, 4, 5  Next

All times are UTC - 7 hours


Who is online

Users browsing this forum: No registered users and 6 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group