PDF Viewer DLL?

Moderator: Rathinagiri

edk
Posts: 909
Joined: Thu Oct 16, 2014 11:35 am
Location: Poland

Re: PDF Viewer DLL?

Post by edk »

mol wrote: Thu Apr 20, 2017 8:43 pmDzięki!
+1
User avatar
Pablo César
Posts: 4059
Joined: Wed Sep 08, 2010 1:18 pm
Location: Curitiba - Brasil

Re: PDF Viewer DLL?

Post by Pablo César »

KDJ wrote: Thu Apr 20, 2017 8:39 pm New version of PdfView for HMG 3.4.4.
It doesn't work with earlier HMG versions.
Very good to make mention in the posted message. :)
SumatraPDF as library 32-bit:
SumatraPDF_lib_32bit.zip
Nice ! :P

Excellent work, Krzysztof !

I liked that you left in "Settings" the option "Open PDF at once" (GRID event ON CHANGE) and other options as well. Availability in a correct and objective manner in my POV.

I would like to add how directives could be done for those who use the IDE and/or want to still use the batch file for compilation and still maintain the settings that you include in the HBP (project file).

I have noted that you use directives in the hbp file very often. But this when is being used the IDE for compiling, is completely lost. You can check the Build.log file and see in it (not recognize these directives.
I clarify this because there are some colleagues who use the compilation (as well as me) and could find some difficulty.

Harbour and more precisely the IDE allows you to do the compiler directives through the HBC file.

I read about each one of them and I even tested and removed each one of them but I think maybe they are not necessary because (I believe) Harbour defaults these directives:

Code: Select all

#harbour options:
-a
-m
-n
-v
-w3

#hbmk2 options:
#-compr
I know this last line, you let it as comment, just for who want to compress compiling

All this is still new to me (hbc use), if you believe so needed, could you please explain why these "harbour options" are used for in your project ?

I have done (please revise it if it's correct) the following changes:
  1. I have created a sub-folder named lib at current project's folder and placed your libSumatraPDF.a file lib.
     
  2. For PdfView.hbc:

    Code: Select all

    libpaths=lib
    libs=SumatraPDF
    prgflags=-w3
    #compr=min
    Please note this is the right way to be used when wish to compress it or using max flag option.
    prgflags can be added (with space character between each "harbour options").
     
  3. For PdfView.hbp:

    Code: Select all

    pdfview.prg
  4. For PdfViewBuild.cmd:

    Code: Select all

    call C:\hmg.3.4.4\build.bat PdfView.hbp PdfView.hbc
    Please note that PdfView.hbc was added. So it's going to work by IDE and by batch file in building process.
     
  5. And renamed a typo in name of SumatraPDFLibBuild32.cmd.
    It also good to say that HMGPATH is needing for change folder name according with our HMG installation.
I only wished to add my comments, in order to let this project and example workable for both: batch file and IDE.
I am in doubt if these directives are so necessary but be that any case, these changes that I indicate may be useful for the future.

However I want to clarify that your batch files files work very well.
Given the other way of compilation in Harbour and consequently in HMG.

Thank you very much Krzysztof for this brillant work.

Dzięki!
HMGing a better world
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein
User avatar
bpd2000
Posts: 1207
Joined: Sat Sep 10, 2011 4:07 am
Location: India

Re: PDF Viewer DLL?

Post by bpd2000 »

mol wrote: Thu Apr 20, 2017 8:43 pmDzięki!
+1
BPD
Convert Dream into Reality through HMG
User avatar
serge_girard
Posts: 3158
Joined: Sun Nov 25, 2012 2:44 pm
DBs Used: 1 MySQL - MariaDB
2 DBF
Location: Belgium
Contact:

Re: PDF Viewer DLL?

Post by serge_girard »

Thanks Krzysztof !
There's nothing you can do that can't be done...
KDJ
Posts: 243
Joined: Mon Sep 05, 2016 3:04 am
Location: Poland

Re: PDF Viewer DLL?

Post by KDJ »

Hi Pablo

I do not use HMG IDE.
For compiling I use .cmd (.bat) and .hbp files.
In .hbp you can place all options for compiler and linker, so .hbc file is unnecessary.
And you can place libSumatraPDF.a library in HMGdirectory\lib.
User avatar
Pablo César
Posts: 4059
Joined: Wed Sep 08, 2010 1:18 pm
Location: Curitiba - Brasil

Re: PDF Viewer DLL?

Post by Pablo César »

Hi Krzysztof,
KDJ wrote: Fri Apr 21, 2017 7:55 pm In .hbp you can place all options for compiler and linker, so .hbc file is unnecessary.
Yes but to work properly with the IDE must be present hbc. It's what I already said.
Otherwise all directives that you put in hbp file will be lost and in hbc file is not the say way as you do in hbp.

What I tried to say is this project have been done ready to be compiled by batch file and not for IDE. But even losing those directives in IDE, will compile anyway because those directives are not so necessary be setted (I guess).

You do not use IDE to compile, but there are many who use it a lot. And to meet those users I've clarified how to make it workable without losing the settings options for IDE building. So I asked to you for an explanation of these directives. ;)
HMGing a better world
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein
User avatar
Pablo César
Posts: 4059
Joined: Wed Sep 08, 2010 1:18 pm
Location: Curitiba - Brasil

Re: PDF Viewer DLL?

Post by Pablo César »

If you make a test opening this project at IDE and after you builded, will run ok but check again the hbp file you will see all those setting will be lost.
This is the main reason of .hbc files. At least important for whom use IDE on compiling process.
HMGing a better world
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein
KDJ
Posts: 243
Joined: Mon Sep 05, 2016 3:04 am
Location: Poland

Re: PDF Viewer DLL?

Post by KDJ »

OK, Pablo. Check whether this will be good:

PdfView_source.zip
(12.9 KiB) Downloaded 230 times

However I do not understand why IDE changes .hbp file content.
It also changes .rc content.
And how to create library (eg. libSumatraPDF.a) via IDE?
User avatar
Pablo César
Posts: 4059
Joined: Wed Sep 08, 2010 1:18 pm
Location: Curitiba - Brasil

Re: PDF Viewer DLL?

Post by Pablo César »

I think it's great ! :)
However I do not understand why IDE changes .hbp file content.
It also changes .rc content.
Unfortunately, IDE always changes these files.
I think the IDE should only write when they are changed through the IDE.

But what I think is still very bad is when the DBF files are not lberados even leaving the table manager, HMG Report Builder and also occurs with the project folder, which even closing the project does not release. This was pointed out in: viewtopic.php?p=47543#p47543
And how to create library (eg. libSumatraPDF.a) via IDE?
In POV I do not think so necessary. Because it's make it at once.

I have no difficulty in compiling other projects unless at least some of the files are missing.

Sorry to bother you, I just wanted you to know why I've noticed that in your previous projects you used to do that (not that this could be wrong in Harbour) but and some colleagues could find the same problem at missing directives.

Thank Krzysztof.
HMGing a better world
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein
Post Reply