PDFsharp & MigraDoc Foundation

PDFsharp - A .NET library for processing PDF & MigraDoc Foundation - Creating documents on the fly
It is currently Fri Mar 29, 2024 5:47 am

All times are UTC


Forum rules


Please read this before posting on this forum: Forum Rules



Post new topic Reply to topic  [ 9 posts ] 
Author Message
PostPosted: Tue Mar 08, 2011 1:00 am 
Offline

Joined: Fri Mar 05, 2010 8:04 pm
Posts: 3
Location: Quakertown, PA
We have an application that, among other things, merges several PDFs together with PDFSharp. It works correctly except for a few files created by AutoCAD. When we try to open one in debug mode, we get a "Not implemented: unknown escape character" in Lexer.ScanLiteralString().

Here is our current code to open the files. A sample PDF that produces the error is attached.

Code:
' Open the document to import pages from it.
Dim InputDocument As PdfDocument = PdfReader.Open("Sample.pdf", PdfDocumentOpenMode.Import)

' Iterate pages
Dim PageCount As Integer = InputDocument.PageCount
For PageIndex As Integer = 0 To PageCount - 1
   ' Get the page from the external document...
   Dim page As PdfPage = InputDocument.Pages(PageIndex)
   ' ...and add it to the output document.
   AddedPage = OutputDocument.AddPage(page)
Next

If we run in release mode, we don't get any errors on the Open but instead get a null reference error on the Pages collection.

This has become an escalated issue with one of our clients and we would like an estimate of the time and cost to have you fix this issue. Please reply to this account's email.

Thank you,
Sean Swope
Chief Software Architect
Synergis Software


Attachments:
Sample.zip [1.37 KiB]
Downloaded 565 times
Top
 Profile  
Reply with quote  
PostPosted: Tue Mar 08, 2011 10:28 pm 
Offline
empira Employee
User avatar

Joined: Thu Oct 12, 2006 10:07 pm
Posts: 49
Location: Cologne, Germany
The PDF file contains two elements that are not valid referring to the PDF Reference of Adobe. One element is (\ ). A backslash followed by a blank is not a valid escape sequence. The other element is the number 264584027963392 which is neither a 32 bit integer (too large) nor a PDF real value (missing the decimal point).

I fixed the issues by treating “backslash blank” simply as blank and too large numbers as real values.

With this fixes PDFsharp handles this PDF file. I will send you a copy of Lexer.cs by email.

Regards
Stefan Lange


Top
 Profile  
Reply with quote  
PostPosted: Wed Mar 09, 2011 3:54 pm 
Offline

Joined: Fri Mar 05, 2010 8:04 pm
Posts: 3
Location: Quakertown, PA
I received the file and it works perfectly. Thank you for the quick response and fix. That is amazing customer support. Please keep up the great work on an exceptional product.

Thank you,
Sean Swope
Chief Software Architect
Synergis Software


Top
 Profile  
Reply with quote  
PostPosted: Mon Oct 07, 2013 11:33 pm 
Offline

Joined: Mon Oct 07, 2013 11:27 pm
Posts: 1
Hi Stefan,

We are also receiving the same error when working with pdfs generated by the AutoCAD product.
It would be greatly appreciated if you're able to provide the updated Lexer.cs file?

Thanks,
Alec.


Top
 Profile  
Reply with quote  
PostPosted: Mon Jun 06, 2016 2:59 pm 
Offline

Joined: Mon Jun 06, 2016 2:54 pm
Posts: 4
I'm using version 1.32 and am running into the same issue with pdf documents created from AutoCAD. Is this fix available anywhere?

Thanks,


Top
 Profile  
Reply with quote  
PostPosted: Mon Jun 06, 2016 3:13 pm 
Offline
PDFsharp Guru
User avatar

Joined: Mon Oct 16, 2006 8:16 am
Posts: 3095
Location: Cologne, Germany
Hi!

Have you tried version 1.50 beta 3?

As far as I can tell from the source, both fixes mentioned here have been included with PDFsharp 1.50.
You can use Lexer.cs to patch your PDFsharp 1.32 if migration to 1.50 is not an option.

_________________
Regards
Thomas Hoevel
PDFsharp Team


Top
 Profile  
Reply with quote  
PostPosted: Mon Jun 06, 2016 3:14 pm 
Offline

Joined: Mon Jun 06, 2016 2:54 pm
Posts: 4
I have not.


Top
 Profile  
Reply with quote  
PostPosted: Mon Jun 06, 2016 3:19 pm 
Offline

Joined: Mon Jun 06, 2016 2:54 pm
Posts: 4
I'll give 1.50 a try and report back.


Top
 Profile  
Reply with quote  
PostPosted: Mon Jun 06, 2016 3:28 pm 
Offline

Joined: Mon Jun 06, 2016 2:54 pm
Posts: 4
That did the trick. Thanks.


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 9 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 155 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Privacy Policy, Data Protection Declaration, Impressum
Powered by phpBB® Forum Software © phpBB Group