Page 4 of 5

Re: Need ActiveX PDF Reader

Posted: Wed Mar 04, 2020 1:46 am
by skiman
Hi Jimmy,

With loading a new document I mean the following. I f have 5 PDF documents. I have buttons previous / next. When a user click on next; the next pdf sshould be loaded and shown.

Re: Need ActiveX PDF Reader

Posted: Wed Mar 04, 2020 5:06 pm
by Auge_Ohr
skiman wrote:With loading a new document I mean the following. I f have 5 PDF documents. I have buttons previous / next. When a user click on next; the next pdf sshould be loaded and shown.
a PDF is like a Image so i see no Problem when have a PDF Viewer.

when talk about ActiveX it include to receive Event. this is not possible with "normal" PDF Viewer.
SumatraPDF have a API to "communicate". it also have Addon for merge,split, extract page.

Re: Need ActiveX PDF Reader

Posted: Fri Mar 06, 2020 3:43 am
by skiman
Hi Jimmy,

i think you don't understand the question.

In a dchtmlviewer there is the method ::navigate(newfile) which will load the new file in the viewer. This way it is easily to add the previous/next functionality to 'scroll' through documents.

I didn't see a command line parameter to do this with sumatrapdf. There is a load to start, but I don't see some 'reload' parameter.

Re: Need ActiveX PDF Reader

Posted: Fri Mar 06, 2020 2:51 pm
by Auge_Ohr
hi,

i´m talking about a Function or CLASS to use SumatraPDF on which i work.
it does NOT use XbpHtmlViewer() :naughty:

you can call SumatraPDF from Command-line but when maximize you can see that you need "more".
so i begin to write a Class as Wrapper using Ot4Xb for DLL Call

Code: Select all

METHOD Sumatra_FileOpen( oPanel, cPdfFile, nPage, nZoom, nView, lBookmarks, lToolbar, cLang, cExeFile )

METHOD Sumatra_FrameAdjust( oPanel )

METHOD Sumatra_FileClose( oPanel, lRedraw )
so you load it like a Image.
if you want to load next you have to add a "next" Button.

---

if Express++ User like SumatraPDF i can send Roger Source Code so he can make a DC_Class of it.

Re: Need ActiveX PDF Reader

Posted: Fri Mar 06, 2020 8:05 pm
by Auge_Ohr
so here is the DLL and LIB and some Demo Code
it is for v1.9.355 ONLY and this Version need OT4XB
XB_PDF05.ZIP
need ot4xb
for v1.9.355 only
(22.46 KiB) Downloaded 680 times
it NEED SumatraPDF.exe (not include) in same Directory
you can get it here https://www.sumatrapdfreader.org/free-pdf-reader.html

Re: Need ActiveX PDF Reader

Posted: Sat Mar 07, 2020 7:22 am
by rdonnay
if Express++ User like SumatraPDF i can send Roger Source Code so he can make a DC_Class of it.
If eXpress++ users request that I support SumatraPDF then I will put some time into this, otherwise I don't know why I should.

Re: Need ActiveX PDF Reader

Posted: Sat Mar 07, 2020 8:06 am
by Victorio
Hi,

I am using Sumatra only as external print utility to direct print PDF to printer, because Sumatra has better management where I can set some parameters from command line as fit page, format, orientation etc.
This parameters not support PDF Acrobat Reader (no all version) or I do not remember how other problems I had with it to implement Sumatra.


Code: Select all

* read or set default print parameters
if empty(aTlaciarne) .or. len(aTlaciarne)=0
	ndialogstyle:=2
	lforcedialog:=.F.
	aTlaciarne:={,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,lforcedialog,,,ndialogstyle,,,,,,,,,,,,,,,,,,,,,,}
endif

* show dialog for set parameters to print
aTlaciarne:=DC_PRINTERDIALOG(aTlaciarne)

* direct print to printer , in aTlaciarne filename to print is sublvpluschrono, 
*************************************************	
cestasumatrapdf:=cestahlprg+"SumatraPDF.exe"
if file(cestasumatrapdf)=.T.
	if !empty(aTlaciarne) .and. len(aTlaciarne)>0 .and. !empty(aTlaciarne[50])
		nDuplexMode:=aTlaciarne[50]
	else
		nDuplexMode:=1
	endif	
	if nDuplexMode=1
		* jednostranná tlač
		RunShell("-print-to-default -print-settings shrink,paper=A4 "+sublvpluschrono,cestasumatrapdf,.f.,.t.)
	elseif nDuplexMode=2 .or. nDuplexMode=3
		* obojstranná tlač
		RunShell("-print-to-default -print-settings shrink,duplex,paper=A4 "+sublvpluschrono,cestasumatrapdf,.f.,.t.)
	endif
	oznam("Print success")
else
	oznam("Error, SumatraPDF.exe not found")
endif

Re: Need ActiveX PDF Reader

Posted: Sat Mar 07, 2020 2:29 pm
by Auge_Ohr
hi Roger,
rdonnay wrote:If eXpress++ users request that I support SumatraPDF then I will put some time into this, otherwise I don't know why I should.
as i know Acrobat Reader will be suspend so i´m working on a Solution after Acrobat.
SumatraPDF is one of these Solution which work fine and are Open Source.

so lets talk again in 2 Years when Acrobat was suspend and User search for new Solution

Re: Need ActiveX PDF Reader

Posted: Mon Mar 09, 2020 3:17 am
by skiman
Auge_Ohr wrote: i´m talking about a Function or CLASS to use SumatraPDF on which i work.
it does NOT use XbpHtmlViewer()
Yes, I know these are two different approaches.

Code: Select all

METHOD Sumatra_FileOpen( oPanel, cPdfFile, nPage, nZoom, nView, lBookmarks, lToolbar, cLang, cExeFile )
METHOD Sumatra_FrameAdjust( oPanel )
METHOD Sumatra_FileClose( oPanel, lRedraw )
so you load it like a Image.
if you want to load next you have to add a "next" Button.
Yes, there should be a new method to load another file.

But the question is: What would that method do? Is it necessary to do a fileclose, followed by a fileopen, OR is there a way to do a fileload. In the documentation I see a reuse-instance, but I don't know if this is to load other files, to refresh te screen.

Re: Need ActiveX PDF Reader

Posted: Mon Mar 09, 2020 4:22 pm
by Auge_Ohr
hi,

how would you do it with Acrobat :?:

i do try to write a Wrapper for SumatraPDF instead of Command line to use with Xbase++
under harbour it use Function but i think a CLASS is a better Way for Xbase++

the Idea of ActiveX is to use it in "own Frame" instead of Stand-alone when call with RUNshell()
same is with SumatraPDF which IS a Stand-alone PDF Reader ... but it can use "plug-in"

i know Edgar have wrote a Wrapper 10 Years ago ... but that was much more complicate than using "plug-in" Trick (not sure it it was available in paste )
now i use only simple USER32 DLL Call and Ot4xb Syntax while i need a CallBack Slot()
as i read Xbase++ v2.x can use DLLCallBack() so Ot4Xb is not need under v2.x.

i will release Source next Day at Pablos Website http://www.xbwin.com -> Newsgroup