Please, consider other users which just try to create a new PDF.  It's nothing
CRITICAL here. You can not retrieve a page 0 when it does not exists, yet.

Part of patch is wrong. It should be:

     if( static_cast<int>(numKids) < nPageNum )

http://sourceforge.net/p/podofo/code/1683    

    // use <= since nPageNum is 0-based
    if( static_cast<int>(numKids) <= nPageNum )
    {
        PdfError::LogMessage( eLogSeverity_Critical,
        "Cannot retrieve page %i from a document with only %i pages.",
                              nPageNum, static_cast<int>(numKids) );
        return NULL;
    }


E:\devel\podofo-trunk\build\examples\helloworld-base14>helloworld-base14.exe
sample.pdf
CRITICAL: Cannot retrieve page 0 from a document with only 0 pages.Courier Width
= 309.6 Height = 9.432
Courier-Bold Width = 345.6 Height = 9.432
Courier-Oblique Width = 367.2 Height = 9.432
Courier-BoldOblique Width = 396 Height = 9.432
Helvetica Width = 275.304 Height = 11.1
Helvetica-Bold Width = 315.444 Height = 11.1
Helvetica-Oblique Width = 320.652 Height = 11.1
Helvetica-BoldOblique Width = 360.12 Height = 11.1
Times-Roman Width = 279.12 Height = 10.8
Times-Bold Width = 277.992 Height = 10.8
Times-Italic Width = 269.112 Height = 10.8
Times-BoldItalic Width = 296.16 Height = 10.8
Symbol Width = 256.548 Height = 10.8
ZapfDingbats Width = 405.996 Height = 10.8
Arial Width = 249.973 Height = 13.7988
Times New Roman Width = 303.768 Height = 13.7988
Verdana Width = 304.57 Height = 14.584

Created a PDF file containing the line "Hello World!": sample.pdf


----- Original Message ----- From: zyx <z...@litepdf.cz> To:
podofo-users@lists.sourceforge.net CC: Sent: 19:54 Friday, 2 October 2015
Subject: Re: [Podofo-users] unreachable-code and robustness fixes in
PdfPagesTree::GetPageNode() On Sat, 2015-09-19 at 00:05 +0000, Matthew Brincke
wrote:
>> So I hope that the patch now makes the method so robust that you'll
>> accept it, please review it, and if accepted, please apply
>> (separately)
>> to the public repository.
>     Hi,
> I gave a little testing to your patch and it seems to work, I didn't
> notice any regression with the PDF files I tried. Interestingly, the
> produced PDF seems not to be too nice, at least evince (3.16.1) is
> quite unhappy about it, not being able to show other than the first
> page. It can be an issue in the evince, I do not know.
>
> I committed your change as revision 1683:
> http://sourceforge.net/p/podofo/code/1683
>
>     Bye,
>     zyx
>

------------------------------------------------------------------------------
_______________________________________________
Podofo-users mailing list
Podofo-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/podofo-users

Reply via email to