<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body>
<div dir="ltr">
<div>Yeah, was considering a similar approach, but hoping there might be a less hacky way of handling it.
<br>
</div>
<div><br>
</div>
<div>Initial experiments indicate that the poppler pdfunite utility invoked with a single input argument just round trips the specified document, cleaning up the issue I'm seeing on the way.</div>
<div>
<div class="gmail_extra"><br>
<div class="gmail_quote">On 21 August 2018 at 18:11, Andreas Oxenstierna <span dir="ltr">
<<a href="mailto:ao@t-kartor.se" target="_blank">ao@t-kartor.se</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div text="#000000" bgcolor="#FFFFFF">
<div class="m_6817995160948192030moz-cite-prefix">Hi<br>
<br>
I have also encountered similar issues with PDFs from other Windows softwares.<br>
The workaround I use is to recreate the PDF in any available software which ignores missing EOFs, endstreams etc.<br>
Programmatically, this can be done as described in <a class="m_6817995160948192030moz-txt-link-freetext" href="https://codedprojects.wordpress.com/2017/06/09/how-to-fix-pypdf-error-eof-marker-not-found/" target="_blank">
https://codedprojects.<wbr>wordpress.com/2017/06/09/how-<wbr>to-fix-pypdf-error-eof-marker-<wbr>not-found/</a><br>
<br>
</div>
<blockquote type="cite">
<div>
<div class="h5">
<div dir="ltr">
<div>Hi all,</div>
<div><br>
</div>
<div>I'm currently working on a map viewer application that uses GDAL for processing geo-referenced map images. Up till now I've been successfully using the poppler library for PDF support, but am currently trying to shift to the podofo/poppler hybrid approach
(podofo library with poppler pdftoppm utility) to work around poppler's GPL licence restrictions.
<br>
</div>
<div><br>
</div>
<div>I have a collection of sample map PDF documents generated by ESRI ArcMap 10 (different documents from different releases in the 10.x release family), which I could successfully process with GDAL/poppler, but most of which fail to load with GDAL/podofo.
The document loading also fails with the stand-alone podofo pdftoppm utility, both with a version that I've built from podofo 0.9.6 source and with the 0.9.3 version installed onto my ubuntu xenial machine from the APT package repository.</div>
<div><br>
</div>
<div>The typical error message is as follows:</div>
<div><br>
</div>
<div>
<div><br>
</div>
Error: An error 5 ocurred during uncompressing the pdf file.<br>
<br>
<br>
PoDoFo encounter an error. Error: 5 ePdfError_UnexpectedEOF<br>
Error Description: End of file was reached unxexpectedly.<br>
Callstack:<br>
#0 Error Source: /build/libpodofo-NltoF1/<wbr>libpodofo-0.9.3/src/base/<wbr>PdfParser.cpp:226<br>
Information: Unable to load objects from file.<br>
#1 Error Source: /build/libpodofo-NltoF1/<wbr>libpodofo-0.9.3/src/base/<wbr>PdfParser.cpp:334<br>
Information: Unable to load xref entries.<br>
#2 Error Source: /build/libpodofo-NltoF1/<wbr>libpodofo-0.9.3/src/base/<wbr>PdfParser.cpp:738<br>
#3 Error Source: /build/libpodofo-NltoF1/<wbr>libpodofo-0.9.3/src/base/<wbr>PdfTokenizer.cpp:339<br>
<div><br>
</div>
<div>which seems to indicate an invalid xref table.<br>
</div>
</div>
<div><br>
</div>
<div><br>
</div>
<div><br>
</div>
<div><br>
</div>
<div>I don't think this is a podofo bug as such, as various online pdf validators I've tried also flag the documents as problematic, but several other bits of pdf software I've tried (notably the poppler library utilities) seem to treat it as a non-fatal recoverable
error. <br>
</div>
<div><br>
</div>
<div>Has anyone else come across this and come up with a work-around or fix? <br>
</div>
<div><br>
</div>
<div>Example problem file to be found at <a href="https://www.dropbox.com/s/khlzgz8o2gxq89y/6090_harvest.pdf?dl=0" target="_blank">
https://www.dropbox.com/s/<wbr>khlzgz8o2gxq89y/6090_harvest.<wbr>pdf?dl=0</a></div>
<div><br>
</div>
<div>
<div><br>
</div>
<div>thanks</div>
<div><br>
</div>
<div>Richard.</div>
<br>
</div>
<div><br>
</div>
</div>
<br>
<fieldset class="m_6817995160948192030mimeAttachmentHeader"></fieldset> <br>
</div>
</div>
<pre>______________________________<wbr>_________________
gdal-dev mailing list
<a class="m_6817995160948192030moz-txt-link-abbreviated" href="mailto:gdal-dev@lists.osgeo.org" target="_blank">gdal-dev@lists.osgeo.org</a>
<a class="m_6817995160948192030moz-txt-link-freetext" href="https://lists.osgeo.org/mailman/listinfo/gdal-dev" target="_blank">https://lists.osgeo.org/<wbr>mailman/listinfo/gdal-dev</a></pre>
<span class="HOEnZb"><font color="#888888"></font></span></blockquote>
<span class="HOEnZb"><font color="#888888">
<p><br>
</p>
<pre class="m_6817995160948192030moz-signature" cols="72">--
Best regards
Andreas Oxenstierna
T-Kartor Geospatial AB
mobile: +46 733 206831
mailto: <a class="m_6817995160948192030moz-txt-link-abbreviated" href="mailto:ao@t-kartor.se" target="_blank">ao@t-kartor.se</a>
<a class="m_6817995160948192030moz-txt-link-freetext" href="http://www.t-kartor.com" target="_blank">http://www.t-kartor.com</a></pre>
</font></span></div>
</blockquote>
</div>
<br>
</div>
</div>
</div>
</body>
</html>