PDFsharp & MigraDoc Forum
https://forum.pdfsharp.net/

Parser mis-handles dictionary values in content stream
https://forum.pdfsharp.net/viewtopic.php?f=3&t=4788
Page 1 of 1

Author:  cshearercooper [ Fri Feb 14, 2025 9:26 pm ]
Post subject:  Parser mis-handles dictionary values in content stream

I have several PDF files where the page contents look like this:

Code:
/Part <</MCID 0 >>BDC
q
0 -4000 3000 0 0 4000 cm
/Im0 Do
Q
EMC


But when I enumerate through the content objects using ContentReader.ReadContent(page), it tells me there are 7 objects in the sequence:

"Dictionary" with 2 operands ("/Part" and "<</MCID 0 >>")
"BDC" with 0 operands
"q" with 0 operands
"cm" with 6 operands
"Do" with 1 operands
"Q" with 0 operands
"EMC" with 0 operands

"Dictionary" is not a valid PDF operator, it appears the code cannot parse the dictionary value "<</MCID 0 >>" as a parameter for the BDC operator.

Author:  Thomas Hoevel [ Mon Feb 17, 2025 9:57 am ]
Post subject:  Re: Parser mis-handles dictionary values in content stream

Hi!
We'd like to investigate this. Please send us one of the PDF files with that structure.
Thanks.

Author:  cshearercooper [ Mon Feb 17, 2025 3:27 pm ]
Post subject:  Re: Parser mis-handles dictionary values in content stream

It won't let me, I found a 21 KB PDF that shows the problem but when I try to upload the attachment it tells me it's an invalid image

Author:  cshearercooper [ Mon Feb 17, 2025 3:33 pm ]
Post subject:  Re: Parser mis-handles dictionary values in content stream

I click on "Choose File" and select the file. When I click on "Add the file" a new window pops up saying "The upload is currently in progress" and a progress bar that scrolls from left to right. The underlying window changes to "Information", "The image file you tried to attach is invalid" and the progress bar scrolls forever

Author:  Thomas Hoevel [ Mon Feb 17, 2025 3:34 pm ]
Post subject:  Re: Parser mis-handles dictionary values in content stream

You can upload ZIP files. You cannot upload PDF files. Please zip the PDF and upload it.

http://forum.pdfsharp.net/viewtopic.php?f=2&t=832

Author:  cshearercooper [ Mon Feb 17, 2025 3:35 pm ]
Post subject:  Re: Parser mis-handles dictionary values in content stream

Try this link, and I'll upload a ZIP

https://firstcongnet-my.sharepoint.com/ ... g?e=yZKYrh

Author:  cshearercooper [ Mon Feb 17, 2025 3:37 pm ]
Post subject:  Re: Parser mis-handles dictionary values in content stream

Here's the zip

It would be cool if the "Upload attachment" section of this page would remind folks "it must be a ZIP file" but I'm guessing this forum software is so old that it can't be modified anymore?

Attachments:
02-01-09.ThirstyForGod.McMane.zip [12.75 KiB]
Downloaded 307 times

Page 1 of 1 All times are UTC
Powered by phpBB® Forum Software © phpBB Group
https://www.phpbb.com/