PDF Viewer DLL?
Moderator: Rathinagiri
Re: PDF Viewer DLL?
Pablo
I divided the project into two files:
- PdfView.prg - with Harbour functions,
- PdfView_C.c - with C functions.
How it compile using HMG IDE?
I divided the project into two files:
- PdfView.prg - with Harbour functions,
- PdfView_C.c - with C functions.
How it compile using HMG IDE?
- Pablo César
- Posts: 4059
- Joined: Wed Sep 08, 2010 1:18 pm
- Location: Curitiba - Brasil
Re: PDF Viewer DLL?
Hi Krzysztof,
You have prepared into two files, it's a good way to let ready for adopting these C functions at HMG core.
By the way, these C functions are useful and there are not similar one at HMG core.
I hope be incorporated to us as well libSumatraPDF library.
But how to do in good order having in mind our IDE ?
As far I know, IDE works in conjunction with Build.bat file and works with three parameters at build proccess:
In Harbour is correct to include in hbp file but with different name of PRG file taking this in consideration (to avoid conflict).
Probably our IDE should be changed this behaviour during its re-writing hbp files on building process.
What I have been done in this case when C file need to be builded separated from PRG is to put at main PRG file as include file:
It's not a elegant way in my view but it will garantee to be linked.
I very much appreciate your concern to leave the compilation universally with the options we have in HMG.
You have prepared into two files, it's a good way to let ready for adopting these C functions at HMG core.
By the way, these C functions are useful and there are not similar one at HMG core.
I hope be incorporated to us as well libSumatraPDF library.
By habit and practicity we use to put C functions at the same place of prg sources.
But how to do in good order having in mind our IDE ?
As far I know, IDE works in conjunction with Build.bat file and works with three parameters at build proccess:
- /option ( [ /n ] [ /d ] [ /c ] )
- prgfile (main prg) or hbpfile
- hbcfile
In Harbour is correct to include in hbp file but with different name of PRG file taking this in consideration (to avoid conflict).
Probably our IDE should be changed this behaviour during its re-writing hbp files on building process.
What I have been done in this case when C file need to be builded separated from PRG is to put at main PRG file as include file:
It's not a elegant way in my view but it will garantee to be linked.
I very much appreciate your concern to leave the compilation universally with the options we have in HMG.
HMGing a better world
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein
- Pablo César
- Posts: 4059
- Joined: Wed Sep 08, 2010 1:18 pm
- Location: Curitiba - Brasil
Re: PDF Viewer DLL?
In Harbour's ChangeLog there has long been this configuration:
This is not the same case but just for your information.
I've never used it, so I can not give you more details, maybe you can figure it out.
https://www.google.com.br/search?q=bldf ... r+bldflags
To consider that at the time of compilation you can inherit flags from the Harbour.Added -bldflags option which tells hbmk to also
apply user build flags (HB_USER_*FLAGS) used when
building Harbour.
Added new flags to replace -bldflags[-]:
-bldf[-] and -bldf=[p][c][l]. We can pass any combinations
to the latter. '-bldf=' is the same as '-bldf-'.
This is not the same case but just for your information.
I've never used it, so I can not give you more details, maybe you can figure it out.
https://www.google.com.br/search?q=bldf ... r+bldflags
HMGing a better world
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein
Re: PDF Viewer DLL?
Hi Pablo
Thank you very much for your explanation.
For compile via IDE, I found another solution - C functions in PdfView_C.prg.
In new version:
- added ability to translate the interface,
- added Polish translation.
Thank you very much for your explanation.
For compile via IDE, I found another solution - C functions in PdfView_C.prg.
In new version:
- added ability to translate the interface,
- added Polish translation.
Re: PDF Viewer DLL?
A Huge "Thank You"
- Pablo César
- Posts: 4059
- Joined: Wed Sep 08, 2010 1:18 pm
- Location: Curitiba - Brasil
Re: PDF Viewer DLL?
You are welcome Krzysztof and happy you give a way putting at PRG for IDE proposes.
I also liked the language option which is a good step for the user to create their translations for their own language.
By the way, have you seen my project Google Translate and HMG ?
I've used this at PrintFile thinking to make easier for users at translation process .
I loved the way applied by Google Translator and ActiveX and what they can do together...
Thank you for your new release and congratulations. Excellent job.
I also liked the language option which is a good step for the user to create their translations for their own language.
By the way, have you seen my project Google Translate and HMG ?
I've used this at PrintFile thinking to make easier for users at translation process .
I loved the way applied by Google Translator and ActiveX and what they can do together...
Thank you for your new release and congratulations. Excellent job.
HMGing a better world
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein
Re: PDF Viewer DLL?
Compiling in IDE, it works perfectly !!
(Tested on windows 10 and Windows Server 2012)
Τhank you again !
Best Regards,
Nikos.
os: Windows Server 2019 - 64
Nikos.
os: Windows Server 2019 - 64
- vagblad
- Posts: 160
- Joined: Tue Jun 18, 2013 12:18 pm
- DBs Used: MySQL,DBF
- Location: Thessaloniki, Greece
Re: PDF Viewer DLL?
I've checked the option "Open pdf at once" and from the toolbar the zoom option "Fit to page" (ctrl+0)
Everytime you scroll down the grid to another file the pdf opens in "Fit Width" mode. So i have to click the Fit to page button again or press Ctrl+0 everytime.
This could be a problem for someone who just wants to make a quick check on the pfd or use the whole thing as a preview browser.
I went and added inside PdfView.prg the following :
in 2 places. At the end of the FIleopen Function and at the end of Filereopen function. It works ok now for me but it does a small flickering of the screen everytime you change files, because at first it opens the pdf in fit to width mode and then goes to fit to page mode again.
Is there any way to use the "Fit to page" mode by default?
Thanks for your great work.
Everytime you scroll down the grid to another file the pdf opens in "Fit Width" mode. So i have to click the Fit to page button again or press Ctrl+0 everytime.
This could be a problem for someone who just wants to make a quick check on the pfd or use the whole thing as a preview browser.
I went and added inside PdfView.prg the following :
Code: Select all
Sumatra_Zoom(cPanel, 2)
Is there any way to use the "Fit to page" mode by default?
Thanks for your great work.
Vagelis Prodromidis
Email: vagblad@gmail.com, Skype: vagblad
Email: vagblad@gmail.com, Skype: vagblad
- vagblad
- Posts: 160
- Joined: Tue Jun 18, 2013 12:18 pm
- DBs Used: MySQL,DBF
- Location: Thessaloniki, Greece
Re: PDF Viewer DLL?
After a few tries we've decided to do the following:
Added a new line at the end of the pdfview.ini:
Now inside SumatraPDF.prg we changed the line 74 to:
At the PdfView.prg we made the following changes and additions:
Line 33: Added the static czoom variable:
Line 240,241,242 :
At the FUNCTION SettingsRead()
line 1029:
line 1053:
and finally at the Function SettingsWrite() lines 1109 and 1110:
With this way we use the fit page as default viewing method and everytime you change it from the menu it saves the new value inside the ini file. That did the trick for us and i thought i should share it.
I am attaching the files as well. Thanks again.
Added a new line at the end of the pdfview.ini:
Code: Select all
Zoom=fit page
Code: Select all
EXECUTE FILE '"' + cExeFile + '"' PARAMETERS '-zoom ' + '"' + cZoom + '"' + ' -page ' + HB_NtoS(nPage) + ' -lang ' + cLang + ' -plugin ' + HB_NtoS(GetProperty(cPanel, 'HANDLE')) + ' "' + cPdfFile + '"'
Line 33: Added the static czoom variable:
Code: Select all
STATIC cZoom
Code: Select all
MENUITEM LangStr("FitPage") + e"\tCtrl+0" NAME FitPage ACTION {Sumatra_Zoom(cPanel, 2), cZoom := "fit page"}
MENUITEM LangStr("RealSize") + e"\tCtrl+1" NAME SizeReal ACTION {Sumatra_Zoom(cPanel, 3), cZoom := "actual size"}
MENUITEM LangStr("FitWidth") + e"\tCtrl+2" NAME FitWidth ACTION {Sumatra_Zoom(cPanel, 4), cZoom := "fit width"}
line 1029:
Code: Select all
cZoom := "fit page"
Code: Select all
CASE "Zoom" ; cZoom := cValue ; EXIT
Code: Select all
"Lang=" + cLang + CRLF + ;
"Zoom=" + cZoom + CRLF
With this way we use the fit page as default viewing method and everytime you change it from the menu it saves the new value inside the ini file. That did the trick for us and i thought i should share it.
I am attaching the files as well. Thanks again.
Vagelis Prodromidis
Email: vagblad@gmail.com, Skype: vagblad
Email: vagblad@gmail.com, Skype: vagblad