PDFsharp & MigraDoc Foundation

PDFsharp - A .NET library for processing PDF & MigraDoc Foundation - Creating documents on the fly
It is currently Tue Dec 07, 2021 7:14 pm

All times are UTC

Forum rules

Please read this before posting on this forum: Forum Rules

Post new topic Reply to topic  [ 3 posts ] 
Author Message
PostPosted: Sun Nov 17, 2019 4:03 pm 

Joined: Sun Nov 17, 2019 3:52 pm
Posts: 2

I have been using Migradoc 1.32 and recently have been trying the stable version 1.5
I found that we got an error in 1.5 but not in 1.32. It seems to relate to table rendering when the table cell text contains a double forward slash


It appears that in the DDL this sequence is seen as a "comment" in the function ReadCode() in DdlScanner.cs

else if (_currChar == '/' && _nextChar == '/')
// Token is comment. In code comments are ignored.
goto Again;

In 1.5 it generates an " End of file expected." Exception while 1.32 treats it as a comment

In 1.5 when the same text is not in a table it appears to be treated as comment and does not raise an exception so this seems to be related to tables which were modified significantly between1.32 and 1.50

I have captured the DDL in a file (about 33 Kb). Which I have attached as a zip.

Is there any way to "escape" the // in the text?

I have had a look on the forums but have also failed to identify anything to help me.

Is anyone able to offer advice? As I have to admit I have not been able to identify the issue so far.

I am using GDI build.
Using Both PDFSharp and Migradoc
full PDFsharp/MigraDoc source code from github being built under VS2017 and used within a VB.NET project
I originally have a C background from the mid 80's so can "read" the Migradoc code, but I am not a C++ or C# coder.

Thank you.

error.zip [2.06 KiB]
Downloaded 343 times
Reply with quote  
PostPosted: Mon Nov 18, 2019 12:02 am 
PDFsharp Expert
User avatar

Joined: Sat Mar 14, 2015 10:15 am
Posts: 683
Location: CCAA

As a workaround you can add a soft hyphen between the two slashes. Or maybe a zero-width joiner, a zero-width non-joiner or other "invisible" Unicode characters.

Any escaping should be done by the DLL writer, not in user code.

Best regards
(Freelance Software Developer with several years of MigraDoc/PDFsharp experience)

Reply with quote  
PostPosted: Tue Nov 19, 2019 3:25 pm 

Joined: Sun Nov 17, 2019 3:52 pm
Posts: 2
Hi Thomas,

Thank you for this, I will implement a workaround in the data we supply to MigraDoc which will resolve it for now, hopefully a full resolution will appear at a later date.



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

All times are UTC

Who is online

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