Hello again.
I just realized the exception and failure were not a consequence of the
warning message at all.
The exception was raised because I had enquoted the destination directory,
and the quotes were not trimmed, which gave an invalid path and the file
creation failed, that or the fact I had not created the destination dir yet.
Once I created the directory and removed the quotes the image extraction
works just fine.
But the warning remains, and it seems to me the size key of the trailer
directory is never initialized (random huge number).
As for your fix suggestion it works without. Sorry to have wasted your time.
I had focused on the warning, wrongly assuming the failure was a consequence
of it.
Thanks a bunch. I can start working on my stuff now.
Philippe.
2010/11/6 Dominik Seichter <[email protected]>
> Hi Phillipe,
>
> Thanks for your help.
> I just gave it a quick try and I could extract all images from the PDF
> using
> podofoimgextract SVN trunk on Linux.
>
> So, I guess the error is plattform specific. If you open the file
> ImageExtractor.cpp and replace the following line:
> snprintf( m_szBuffer, MAX_PATH, "%s/pdfimage_%04i.%s",
> m_pszOutputDirectory, m_nCount++, pszExtension );
>
> with
> snprintf( m_szBuffer, MAX_PATH, "%s\\pdfimage_%04i.%s",
> m_pszOutputDirectory, m_nCount++, pszExtension );
>
> (i.e. backslash instead of slash) - Does it work then?
>
> Cheers,
> Dominik
>
>
> Am Saturday 06 November 2010 schrieb Philippe van Zuylen:
> > Hi Dominik. Thank you for your help.
> >
> > The files i have been using for testing come from various sources. I
> don't
> > know how they were generated though. They all share a specificity :
> there
> > is no text in them, only images. I'm attaching one of them so you can try
> > it out anyway. It happens to be copywrighted work so I can't post it to
> > the list.
> >
> > Philippe van Zuylen
> >
> > 2010/11/6 Dominik Seichter <[email protected]>
> >
> > > Hi,
> > >
> > > Seems like a problem with the particular PDF files you are using for
> your
> > > tests. Are they all created by the same tool? This error message is a
> > > very uncommon one ...
> > > Could you post one PDF to this list, our bug tracker or send it via
> > > private mail to me?
> > >
> > > Cheers,
> > >
> > > Dominik
> > >
> > > Am Saturday 06 November 2010 schrieb Philippe van Zuylen:
> > > > Hello,
> > > > First I'd like to thank you all for your work.
> > > >
> > > > I'm looking for a way to extract the images in a pdf to an IStream
> > >
> > > object,
> > >
> > > > for processing with the Windows Imaging Component library. (C++ WTL
> > >
> > > project
> > >
> > > > with VS10)
> > > > I have been starting with this today and I must say that I don't know
> > > > anything about the pdf format, and if I could achieve my goal without
> > > > learning anything about it, well... it would'nt make me sad :).
> > > >
> > > > So It seems Podofo is the best way to get there. The tool
> > >
> > > podofoimgextract
> > >
> > > > looks like it could be used as a starting point, I successfully built
> > > > podofo 0.8.4 as a shared library with freetype 2.4.3 (seems to be
> > > > required. Is there a way to not include it?), libjpeg 8b and zlib
> 1.2.5
> > > >
> > > > But when I try podofoimgextract it fails systematically with the
> > >
> > > following
> > >
> > > > output. Of course I tried with different files from different
> sources,
> > >
> > > all
> > >
> > > > displaying allright with adobe reader.
> > > >
> > > > cmd > podofoimgextract.exe "test.pdf" "test"
> > > >
> > > > outputs <
> > > > WARNING: There are more objects (923) in this XRef table than
> specified
> > >
> > > in
> > >
> > > > the size key of the trailer directory (51492809588343700)!
> > >
> > >
> <</ID[<6B4A3F34C7E2F845822B08B27D40759F><965F4DA125DF534997374AC2D4E08E20
> > > >]
> > >
> > > > /Info 915
> > > > 0 R/Root 917 0 R/Size 916>>
> > > > Error: An error 2 ocurred during processing the pdf file.
> > > >
> > > > PoDoFo encounter an error. Error: 2 ePdfError_InvalidHandle
> > > >
> > > > Error Description: A NULL handle was passed, but initialized
> > > > data
> > > >
> > > > was expected.
> > > >
> > > > Callstack:
> > > >
> > > > #0 Error Source:
> > > > ..\..\..\tools\podofoimgextract\ImageExtractor.cpp:105
> > > >
> > > > Any Idea what is wrong?
> > >
> > > --
> > > Dominik Seichter - [email protected] -
> http://domseichter.blogspot.com
> > > 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
>
>
> --
> Dominik Seichter - [email protected] - http://domseichter.blogspot.com
> 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
>
------------------------------------------------------------------------------
The Next 800 Companies to Lead America's Growth: New Video Whitepaper
David G. Thomson, author of the best-selling book "Blueprint to a
Billion" shares his insights and actions to help propel your
business during the next growth cycle. Listen Now!
http://p.sf.net/sfu/SAP-dev2dev
_______________________________________________
Podofo-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/podofo-users