Sorry,

I think this somehow got lost on the list.

====

As list administrator, your authorization is requested for the
following mailing list posting:

    List:    [email protected]
    From:    [EMAIL PROTECTED]
    Subject: Re: [Podofo-users] PDF version
    Reason:  Message body is too big: 50703 bytes with a limit of 40 KB

At your convenience, visit:

    https://lists.sourceforge.net/lists/admindb/podofo-users
        
to approve or deny the request.
 <<input.pdf>> 

Hello there,

I wrote a small code based on the image extractor, it doesn't make much
sense but it reproduces the bug.
(my code is too long and specific).
I attached a small (16K file) - low resolution Image for example (1x1
inch, 72 DPI).


#ifdef USE_PODOFO
#include <podofo/podofo.h>
using namespace PoDoFo;

void DrawToPdf ()
{
        const char* inname = "input.pdf"; //change to full path

    PdfDocument indoc( inname ); // <-----   crash

    TCIVecObjects it = indoc.GetObjects().begin();
    PdfObject*  pObj  = NULL;

    while( it != indoc.GetObjects().end() )
    {
        if( (*it)->IsDictionary() )
        {            
            pObj = (*it)->GetDictionary().GetKey( PdfName::KeyType );
            if( pObj && pObj->IsName() && ( pObj->GetName().GetName() ==
"XObject" ) )
            {
                pObj = (*it)->GetDictionary().GetKey(
PdfName::KeySubtype );
                if( pObj && pObj->IsName() && (
pObj->GetName().GetName() == "Image" ) )
                {
                     PdfMemStream* stream =
dynamic_cast<PdfMemStream*>((*it)->GetStream());
                                        stream->Uncompress();
                                                
                                        //.......write the file

                                        const char* fname  =
"output.pdf"; //change to full path

                
                                        PdfStreamedDocument document(
fname );
                                        
                                        //image Is 1x1 Inch and of 72
dpi                                             
                                        PdfRect rSize(0, 0, 72, 72);
                                        PdfPage* pPage =
document.CreatePage(rSize);
                                        if( !pPage ) 
                                        {
                                                PODOFO_RAISE_ERROR(
ePdfError_InvalidHandle );
                                        }
                                        
                                        PdfPainter painter;
                                        painter.SetPage( pPage );

                                        PdfMemoryInputStream pStream
(stream->Get(), stream->GetLength());
                                        PdfImage pImage(&document);

                                        pImage.SetImageData (72, 72, 8,
&pStream);
                                                
                                        painter.DrawImage (0, 0,
&pImage, 1.0, 1.0);
                                                
                                        painter.FinishPage();
                                        document.Close();
                                        //.......
                                        break;

                }
            }
        }
                ++it;
    }
}
#endif






Jonathan Sibony wrote:
> Hello All,
> 
> In "encountering problems with Pdf 1.6" i meant that each time I am 
> trying to instantiate a PDFDocument using the constructor that gets a 
> file name (to be loaded into document) I crash.
> This only happens with files of pdf version 1.6.
> 
> Apparently an error is thrown from HasLinearizationDict when trying to

> find out if dictionary contains a key named "Linearized" (second line 
> within try):

Some sample code to trigger the issue and a backtrace would be useful.

--
Craig Ringer
If you reply to this message, keeping the Subject: header intact,
Mailman will discard the held message.  Do this if the message is
spam.  If you reply to this message and include an Approved: header
with the list password in it, the message will be approved for posting
to the list.  The Approved: header can also appear in the first line
of the body of the reply.

-- 
**********************************************************************
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: input.pdf
Description: input.pdf

Attachment: pgp0ilEq72V5f.pgp
Description: PGP signature

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/
_______________________________________________
Podofo-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/podofo-users

Reply via email to