PDFsharp & MigraDoc Foundation

PDFsharp - A .NET library for processing PDF & MigraDoc Foundation - Creating documents on the fly
It is currently Thu Mar 28, 2024 1:12 pm

All times are UTC


Forum rules


Please read this before posting on this forum: Forum Rules



Post new topic Reply to topic  [ 6 posts ] 
Author Message
PostPosted: Mon Feb 19, 2007 3:18 pm 
Offline

Joined: Mon Feb 19, 2007 2:41 pm
Posts: 3
Hi,

Your software is impressive and easy to use. It has been working well.

Unfortunately I am now getting a 'Not implemented; unknown escape character.' exception.

at Lexer.ScanLiteralString()
at Lexer.ScanNextToken()
at Parser.ScanNextToken()
at Parser.ParseObject(Symbol Stop)
at Parser.ReadArray(PdfArray array, Boolean includeReference)
at Parser.ReadObject(PdfObject pdfObject, OdfObjectID objectID, Boolean includeReference)
at PdfReader.Open(Stream stream, String password, PdfDocumentOpenMode openmode, PdfPasswordProvider passwordProvider)
...........

The PDF file can be a single page or multiple pages. All the PDF files that cause this problem are created on different XP PRO SP2 (32bit edition) machines by printing from Microsoft Publisher 2000 using CutePDF Writer 2.7.

I can send you a single page PDF file that causes the problem if it helps.

Interestingly, the PDF file can be processed by PDFSharp if it is created on XP (64bit edition) by printing the same Publisher file using Microsoft Publisher 2003 with the same version of CutePDF Writer - 2.7.

All the PDF files that cause an exception in PDFSharp can be opened successfully in Adobe Reader 8.

Don't know if this is a bug in PDFSharp or CutePDF and I do not know enough about the PDF format to investigate further.

Is there any chance this can be fixed in PDFSharp, if not can you provide further information so that I can talk to Cute PDF.

Many thanks for any help you can provide.

Brian

_________________
Brian


Top
 Profile  
Reply with quote  
PostPosted: Mon Feb 19, 2007 5:11 pm 
Offline

Joined: Mon Feb 19, 2007 2:41 pm
Posts: 3
Hi,

More info - problem seems to be when the Publisher document includes GIF's.

_________________
Brian


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Tue Feb 20, 2007 5:42 pm 
Offline
PDFsharp Guru
User avatar

Joined: Mon Oct 16, 2006 8:16 am
Posts: 3095
Location: Cologne, Germany
Do you get an exception or an assertion?
Assertions only occur with debug builds.

I'm not sure if we fixed this with current internal builds of PDFsharp.

If you send me a file via PM or publish the download location here, I will test it with a current build.

_________________
Regards
Thomas Hoevel
PDFsharp Team


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Wed Feb 28, 2007 4:27 pm 
Offline
PDFsharp Guru
User avatar

Joined: Mon Oct 16, 2006 8:16 am
Posts: 3095
Location: Cologne, Germany
I can replicate the assertion (it's not an exception).
Our experts will have to take a look at that.
Should be fixed with the next release.

_________________
Regards
Thomas Hoevel
PDFsharp Team


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Fri Mar 02, 2007 9:08 am 
Offline
PDFsharp Guru
User avatar

Joined: Mon Oct 16, 2006 8:16 am
Posts: 3095
Location: Cologne, Germany
Hi!
We have fixed this bug.

Here's the solution for lexer.cs (line 543):
Code:
                  default:
                    if (char.IsDigit(ch))
                    {
#if true
                      // Octal character code
                      int n = ch - '0';
                      if (Char.IsDigit(this.nextChar))
                      {
                        n = n * 8 + ScanNextChar() - '0';
                        if (Char.IsDigit(this.nextChar))
                          n = n * 8 + ScanNextChar() - '0';
                      }
                      ch = (char)n;
#else
                      //TODO
                      Debug.Assert(false, "Not implemented; unknown escape character.");
#endif
                    }
                    break;


Will be fixed in the next release (which is not scheduled yet).
Thank you, Brian, for your PDF file.

_________________
Regards
Thomas Hoevel
PDFsharp Team


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Fri Mar 02, 2007 10:45 am 
Offline

Joined: Mon Feb 19, 2007 2:41 pm
Posts: 3
Have added your patch and we can now process the PDF file which had the error.

That's great support. Thank you very much. It is much appreciated.

_________________
Brian


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

All times are UTC


Who is online

Users browsing this forum: No registered users and 47 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