I tested it with

    PoDoFo::PdfReference ref00(0, 0);
    PoDoFo::PdfReference ref10(1, 0);
    PoDoFo::PdfReference ref11(1, 1);
    PoDoFo::PdfReference ref01(0, 1);

    cout << ref00.IsIndirect() << " -- " << ref00.ToString() << endl;
    cout << ref10.IsIndirect() << " -- " << ref10.ToString() << endl;
    cout << ref11.IsIndirect() << " -- " << ref11.ToString() << endl;
    cout << ref01.IsIndirect() << " -- " << ref01.ToString() << endl;

Output:

0 -- 0 0 R
1 -- 1 0 R
1 -- 1 1 R
1 -- 0 1 R

Looks like a bug. 

Also IsIndirect() function name sounds like 'direct references are
exists'. But reference can point only to indirect object. So function
should be renamed to IsValid(). And returns true when (objNumber > 0 &&
genNumber >= 0). ToString() should return string representation of
PdfReference only for valid objects. For invalid it should returns
empty strings.

On Tue, 11 Aug 2020 12:29:05 +0500
Ivan Romanov via Podofo-users <podofo-users@lists.sourceforge.net>
wrote:

> Hi guys.
> 
> I found a strange thing. PoDoFo defines indirect as 'A reference is
> indirect if object number and generation number are both not equal 0'.
> 
> But PDF 1.7 specification defines the same in another way 'indirect
> object an object that is labeled with a positive integer object number
> followed by a non-negative integer generation number followed by obj
> and having endobj after it'.
> 
> It different with generation number. In PoDoFo it can'b zero but in
> PDF specification it's OK.


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

Reply via email to