Need ActiveX PDF Reader

Xbase++ 2.0 Build 554 or later
Message
Author
skiman
Posts: 1195
Joined: Thu Jan 28, 2010 1:22 am
Location: Sijsele, Belgium
Contact:

Re: Need ActiveX PDF Reader

#31 Post 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.
Best regards,

Chris.
www.aboservice.be

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

Re: Need ActiveX PDF Reader

#32 Post 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.
greetings by OHR
Jimmy

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

Re: Need ActiveX PDF Reader

#33 Post 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.
Best regards,

Chris.
www.aboservice.be

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

Re: Need ActiveX PDF Reader

#34 Post 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.
greetings by OHR
Jimmy

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

Re: Need ActiveX PDF Reader

#35 Post 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 905 times
it NEED SumatraPDF.exe (not include) in same Directory
you can get it here https://www.sumatrapdfreader.org/free-pdf-reader.html
greetings by OHR
Jimmy

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

Re: Need ActiveX PDF Reader

#36 Post 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.
The eXpress train is coming - and it has more cars.

Victorio
Posts: 633
Joined: Sun Jan 18, 2015 11:43 am
Location: Slovakia

Re: Need ActiveX PDF Reader

#37 Post 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

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

Re: Need ActiveX PDF Reader

#38 Post 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
greetings by OHR
Jimmy

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

Re: Need ActiveX PDF Reader

#39 Post 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.
Best regards,

Chris.
www.aboservice.be

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

Re: Need ActiveX PDF Reader

#40 Post 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
greetings by OHR
Jimmy

Post Reply