Hi,

Thanks for reporting these bugs.

Am Freitag, 26. September 2008 schrieb Shunli (Derek) Zheng:
> Hi PoDoFo supporters,
>
> Thanks for all your contribution to the PoDoFo project. It's a very good
> and useful open source project.
>
> Our company has a project that should add custom attributes to PDF
> file's Info dictionary. And we found some critical bugs of PoDoFo when
> doing test on it.
> 1. There is a crash bug in function PdfPredictorDecoder::Decode() of
> file PdfFiltersPrivate.cpp. You can test with pdf files that are
> converted from .bmp or .jpg by Adobe Acrobat.
>       if( m_nCurRowIndex > m_nRows )
>             {
>                 m_nCurRowIndex  = 0;
>                 m_nCurPredictor = m_nPredictor >= 10 ? *pBuffer + 10 :
> *pBuffer;
>             }
>       else
>       {
>               ...
>               case 12: // png up
>                         m_pPrev[m_nCurRowIndex] += *pBuffer;
> // Here m_nCurRowIndex may equal to m_nRows, and beyond the array
> boundary.
>                         pStream->Write( &m_pPrev[m_nCurRowIndex], 1 );
>               ...
>       }
>
Could you send me an example file for this problem? I think this bug could be 
the solution to a bug David Roach is encountering. I will try to fix it as 
soon as I can reproduce it.

> 2. PoDoFo will failed to parse pdf file if there are some syntax error
> in any dictionay.
>     For example, for the following data, there is string in ( ), and the
> string contains two '('. PoDoFo will not parse the string correctly
> until EOF of the file.
>     There are no bad syntax tolerance codes in the library. I think the
> bugs should be fixed.
> "... << ... /Title (....(..(hello world....) >> endobj ... "
>
Well, you are right. PoDoFo currently accepts only valid PDF files. Only 
balanced brackets are allowed to be not escaped in PDF, so your file is 
broken.

I currently have no time to add a fault-tollerant parser to PoDoFo, but I will 
of course accept code contributions. I think so that the fault tollerant 
parser should be optional. So that PoDoFo has to parsers (or a property on 
PdfParser) to specify that either only valid PDFs are accepted or that PoDoFo 
should be more fault tollerant.

> 3. If I open a pdf file (converted from .vsd file type) with PoDoFo, and
> add some custom attributes into Info dictionary, and write the whole
> back to a new pdf file.
>     Then the new generated file will generate many new dictionaries,
> such as below data. And later if I add new custom attributes to the new
> generated pdf file,
>     PoDoFo will parse the below data failed with "Invalid data type"
> error message. (# is not a delimiter)
>     "100 0 obj << /C /#  #  #  #  #  #  #  # ...  /K ... >> endobj"
>
Quoting from the PDF Reference section 3.2.4 Name Objects:
"The name may include any regular characters, but not delimiter or
white-space characters (see Section 3.1, “Lexical Conventions”)." 

So I think "/# # # #" is no legal name because of the whitespaces. So how do 
these get in their? Does PoDoFo write them? Do we have an encoding problem in 
PdfName?


> 4. PoDoFo failed to parse PDF Portfolio file type with error message: No
> trailer was found in the PDF file.
I'll try to look into this.

best regards,
        Dom

>
> We will be appreciate if your team can fix these bugs in the new verson
> of PoDoFo code. Thanks very much!
>
> Regards,
>
> -Derek
>
> - --------------------------------------------------------------------
> STATEMENT OF CONFIDENTIALITY
>
> The information contained in this electronic message and any attachments to
> this message are intended for the exclusive use of the addressee(s) and may
> contain confidential or privileged information. No representation is made
> on its accuracy or completeness of the information contained in this
> electronic message. Certain assumptions may have been made in the
> preparation of this material as at this date, and are subject to change
> without notice. If you are not the intended recipient, you are hereby
> notified that any dissemination, distribution or copying of this e-mail and
> any attachment(s) is strictly prohibited. Please reply to the sender at
> NextLabs Inc and destroy all copies of this message and any attachments
> from your system.
> ======================================================================



-- 
**********************************************************************
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.

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Podofo-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/podofo-users

Reply via email to