Copy link to clipboard
Copied
I opened this document a few days ago and wrote in there with my lenovo pen. Now I get a error 'there was a problem reading this document (14)' and 'expect a dict object'. Other documents I used that they do still work. Can someone please help. I made notes in this document during a class in University and really need the things I wrote down.
@Hannah2323 shared the PDF in question in a private message.
The issue:
Usually the trailer of a PDF has a Root entry which points to the Catalog dictionary which in turn points to several central document structures, in particular its Pages entry points to the page tree of the document.
In the file in question, though, the Root entry in its trailer points to an annotation dictionary!
Thus, while trying to open the file Adobe Acrobat cannot find the page tree in the alleged catalog object and rejec
...Copy link to clipboard
Copied
Maybe importent to know. I'm not able to open this document. I saw this problem on the internet but they had a problem with saving not with opening
Copy link to clipboard
Copied
Can you share the PDF?
Considering the error message it seems like an important object in it is not a dictionary object but should have been... This might be fixable.
Copy link to clipboard
Copied
@Hannah2323 shared the PDF in question in a private message.
The issue:
Usually the trailer of a PDF has a Root entry which points to the Catalog dictionary which in turn points to several central document structures, in particular its Pages entry points to the page tree of the document.
In the file in question, though, the Root entry in its trailer points to an annotation dictionary!
Thus, while trying to open the file Adobe Acrobat cannot find the page tree in the alleged catalog object and rejects the file: Without the page tree there is no content in the PDF at all.
A work-around:
To somewhat fix this issue, I searched the page tree base object, added a new indirect dictionary object to the PDF with a Pages entry pointing there, and changed the trailer to point to this new indirect object as Root. Eventually I added an xref table entry for this new object.
This can be done in a text editor (as long as that text editor does not change regions of the file one doesn't work in) but requires some knowledge of PDF internals.
Thereafter the file could be opened and was mostly ok. Saving from Acrobat then finished the work-around.
A possible cause:
Inspecting the file a bit further one finds a linearization dictionary and two cross reference streams that look like they may have been the two cross reference streams of a linearized file. Furthermore, the object number of the original root entry equals the lower of the Size entries of the cross reference streams, i.e. of the stream that originally would have been located at the end of the linearized file.
Thus, it may be that the tool for the Lenovo pen does not support linearized files with cross reference streams and only considered that cross reference stream at the end, thinking that object number was unused yet.
But this may also be a red herring, maybe the file that tool edited was already somehow broken and this is a situation of GIGO, garbage in, garbage out...
Copy link to clipboard
Copied
Excellent analysis!! However, those fixes are outside the range of what any reasonable PDF user would be able to achieve.
But I thinks it's safe to assume that whatever PDF viewer was making modifications to the PDF in question totally screwed up the PDF file. So the real question here is, was the file being viewed in Acrobat Pro/Reader when the Lenovo Pen was used, or was this in some other PDF viewer? If it was in Acrobat, then this is a significant bug that needs to be reported. Otherwise it's not really an issue for this forum.
Report bugs here:https://www.adobe.com/products/wishform.html
Copy link to clipboard
Copied
I can't quite remember what I was using with this pdf with the lenovo pen. I change between adobe and microsoft edge... The weird thing is that I had this never before on any pdf and I use both programs quite often in combination with the pen.
Copy link to clipboard
Copied
Do you still have the file as it was before you added all those marks with the pen?
Also I doubt it was Adobe Acrobat: The file was saved with cross reference tables instead of cross reference streams referenced at the end of the file, and recent Adobe Acrobat versions do not do that unless it's required.
Copy link to clipboard
Copied
I can download the same file again if that is what you mean.
Then it probably was mircosoft edge...
Copy link to clipboard
Copied
I can download the same file again if that is what you mean.
Indeed, that would be great. If only to support or disprove my assumption above.
Copy link to clipboard
Copied
@Hannah2323 also shared the original file before the pen edits.
It indeed is a linearized file with cross reference streams. It has one issue, though: It is marked as a PDF 1.4 file while cross reference streams have not been introduced before PDF 1.5.
I assume that this version marker led the software used for the pen edits astray and prevented it from properly understanding the cross reference streams.
So this looks like a combination of a small versioning error in the original PDF and a very haywire reaction to that by the software used for the pen edits.
Copy link to clipboard
Copied
That must be a very old PDF form. It's likely that the app that was used with the pen never checked the version and simply did what it usually does on the assumption the version would be compatible. This is one of the standard issues with 3rd party PDF viewers, i.e., no respect for the spec.
That's some seriously detailed analysis!! What tool do you use for analyzing the PDF file structure?
Copy link to clipboard
Copied
That's some seriously detailed analysis!! What tool do you use for analyzing the PDF file structure?
Actually nothing magical, a text/hex viewer (Notepad++ with HEX Editor plugin; alternatively the Total Commander built-in viewer) to have a look at the bare PDF file and a PDF structure browser (iText RUPS; alternatively PDFBox PDFDebugger) for a parsed view of the COS objects.
And in case of doubts of course the PDF spec opened in another window...
Copy link to clipboard
Copied
Have you looked at PDFCanOpener?
Copy link to clipboard
Copied
Have you looked at PDFCanOpener?
Not really. If I see that correctly it works as an Acrobat plugin. Unfortunately I often have to deal with PDFs which don't open in Acrobat at all or which Acrobat repairs (and, therefore, changes) on load. Thus, I need a view on the PDF that is not influenced by Acrobat.
Copy link to clipboard
Copied
Try the forum for Adobe Acrobat.
Find more inspiration, events, and resources on the new Adobe Community
Explore Now