Hi Pierre,

Thanks for reporting this issue. I had some time today to debug this problem 
and I came to the conclusion, that your fix is correct. 

Decrementing if we have the first page is simply wrong in this case. I totally 
missed the case of the tree structure found in the T1_SPEC.pdf.


                          Node
                      /       |       \
                 Page   Node   Node
                             /   \          ....
                         Page Node 
                                    /    \
                               Page  Node 
                                           .....

I hope the graph is readable. At lease the code without your fix fails for 
such trees on evey first page object in a node. 

best regards,
        Dom

Am Mittwoch, 24. Juni 2009 schrieb Pierre Marchand:
> Hi Dom,
>
> I had a problem to get the first page of  [1]. I’ve worked around without
> really understanding the problem with this change (which is not a fix, it
> returned page 0 for page 1 as well as far as I understood):
>
> Index: src/PdfPagesTree.cpp
> ===================================================================
> --- src/PdfPagesTree.cpp        (révision 1056)
> +++ src/PdfPagesTree.cpp        (copie de travail)
> @@ -300,7 +300,8 @@
>                  else // Type == Page
>                  {
>                      // Skip a normal page
> -                    nPageNum--;
> +                    if(nPageNum > 0 )
> +                                               nPageNum--;
>                      if( 0 == nPageNum )
>                      {
>                          rLstParents.push_back( pParent );
>
> Prevent requested page number to go below 0 at this point is certainly a
> bit too late in the process but I’ve been unable to spot where it was wrong
> before. Hope you’ll be smarter than me :)
>
> [1]  <http://partners.adobe.com/public/developer/en/font/T1_SPEC.PDF>



-- 
**********************************************************************
Dominik Seichter - [email protected]
KRename  - http://www.krename.net  - Powerful batch renamer for KDE
KBarcode - http://www.kbarcode.net - Barcode and label printing
PoDoFo - http://podofo.sf.net - PDF generation and parsing library
SchafKopf - http://schafkopf.berlios.de - Schafkopf, a card game,  for KDE
Alan - http://alan.sf.net - A Turing Machine in Java
**********************************************************************

Attachment: signature.asc
Description: This is a digitally signed message part.

------------------------------------------------------------------------------
_______________________________________________
Podofo-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/podofo-users

Reply via email to