HPDF SET PAGENUMBERING

Moderator: Rathinagiri

Post Reply
User avatar
ljubacirovic
Posts: 12
Joined: Thu Mar 27, 2014 6:38 am
DBs Used: DBF, MySQL, MS Access, MS SQL

HPDF SET PAGENUMBERING

Post by ljubacirovic »

Hi guys,

My deepest respect and thanks to all of developers for such a nice tool like HMG.

Now, maybe I am doing something wrong, but when I implement HPDF command SET PAGENUMBERING the last page of a multi page document remains unnumbered.(?!?)
This is my command structure
START HPDFDOC
SET HPDFDOC ENCODING TO cEncoding
SET HPDFDOC PAGENUMBERING FROM nPage STYLE DECIMAL PREFIX "Page: "
START HPDFPAGE
....<commands>
END HPDFPAGE
END HPDFDOC
Now, the results are always the same, regardless of the nPage value (I tried 0, 1, 2), that is all pages are numbered except the last one.
Am I doing something wrong or is this a bug?
Of course, I circumvented this by implementing this command before END HPDFPAGE:
@ nRow,nCol HPDFPRINT "Page: "+transform(HMG_HPDF_PageNo(),'99.') FONT cNormal SIZE nFtSz

Also, I have noticed that in the on-line manual for HMG HPDF -> Miscellaneous the syntax for source code examples is wrong, it says:
SET HPDFDOC PAGENUMBERING FROM PAGE 2
instead of
SET HPDFDOC PAGENUMBERING FROM 2.
Not a big deal but it would be nice to correct it.

Best regards,
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: HPDF SET PAGENUMBERING

Post by serge_girard »

Hello ljubacirovic,

Please take a look at the demo I send in this topic:

viewtopic.php?f=5&t=5107

Serge
There's nothing you can do that can't be done...
User avatar
ljubacirovic
Posts: 12
Joined: Thu Mar 27, 2014 6:38 am
DBs Used: DBF, MySQL, MS Access, MS SQL

Re: HPDF SET PAGENUMBERING

Post by ljubacirovic »

Hello Serge (serge_girard),

Thank you for your interest and the code example. Your solution, as I understood it, is aimed to print one employee record per page and the way of page numbering is OK - through FUNCTION Prt_HDR_Personel_PDF(), by increasing value of the variable nCurrentPage.

My primary dilemma is if the command SET HPDFDOC PAGENUMBERING is buggy and should be avoided or not?
As I said in my previous post, results with changing page number from 0 to 2 are not as expected.

Here is what the manual says:
SET HPDFDOC PAGENUMBERING:
This command is used to set the page numbering style of the PDF Document and the starting page number to be used for that purpose. Lower/Upper case can be used for Roman/Letters number styles.
A prefix can be used to attach before the page numbers in thumbnails.
and what I get on a generated PDF document of 4 pages.

Code: Select all

=====================================================================================================================
Option FROM   Printed in PDF                       FoxIT PDF Viewer thumbnail        Acrobat PDF Viewer thumbnail
---------------------------------------------------------------------------------------------------------------------
    0         prefix on pages 1, 2, 3,             displays prefix and page number   displays prefix and page number
              4th page no prefix, no page number   on all four pages                 on all four pages
---------------------------------------------------------------------------------------------------------------------
    1         same as previous                     no prefix on page 1, on pages 2,  no prefix, no page number on any
                                                   3 and 4 prefix is displayed with  of the four pages
                                                   page number where page number 
                                                   is n-1 (i.e. 2 is 1) 
---------------------------------------------------------------------------------------------------------------------
    2         same as previous                     same as previous                  same as previous
---------------------------------------------------------------------------------------------------------------------
no arguments  no prefix, no page number            pages 3 and 4 are designated as   page counter is (1..4)/4
                                                   page 3
=====================================================================================================================
Because of these results I am rather convinced that this command is either poorly documented and I did not understand it's real purpose or is buggy and should not be used at all.

I hope that this issue can be resolved.

Ljuba
User avatar
Rathinagiri
Posts: 5471
Joined: Tue Jul 29, 2008 6:30 pm
DBs Used: MariaDB, SQLite, SQLCipher and MySQL
Location: Sivakasi, India
Contact:

Re: HPDF SET PAGENUMBERING

Post by Rathinagiri »

Thanks for reporting Ljuba.

I will check that.
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.
User avatar
ljubacirovic
Posts: 12
Joined: Thu Mar 27, 2014 6:38 am
DBs Used: DBF, MySQL, MS Access, MS SQL

Re: HPDF SET PAGENUMBERING

Post by ljubacirovic »

Hello Rathinagiri,

I am glad that you will check this issue and thank you for that.
After retesting the command SET HPDFDOC PAGENUMBERING I have concluded that it is not meant to print page numbers in PDF document at all, as I expected. It only adjusts some PDF page properties, but the generated PDF document does not produce the same results in two different PDF viewers.
Also, if the option FROM is set to 2, fist two pages are skipped but the third page is numbered as 2 instead of 1.
Therefore, I am enclosing results of the last testing of a 4 page document.

Code: Select all

==================================================================================
Option FROM   FoxIT PDF Viewer thumbnail        Acrobat PDF Viewer thumbnail
----------------------------------------------------------------------------------
    0         displays prefix and page number   displays prefix and page number
              on all four pages                 on all four pages
----------------------------------------------------------------------------------
    1         no prefix on page 1, on pages 2,  no prefix, no page number on any
              3 and 4 prefix is displayed with  of the four pages
              page number where page number 
              is n-1 (i.e. 2 is 1) 
----------------------------------------------------------------------------------
    2         no prefix on pages 1 and 2,       same as previous
              on pages 3 and 4 prefix is 
              displayed with page number 
              where page numbering starts
              from 2 (i.e. 3 is 2)
----------------------------------------------------------------------------------
no arguments  pages 1 and 2 are designated as   page counter is (1..4)/4
              page 1 in page counter
              i.e. 1 (1/4), 1 (2/4), 2 (3/4)
              3 (4/4)
==================================================================================
I believe that the code and the documentation for this command have to be reviewed and corrected.

Ljuba
Post Reply