PDFsharp & MigraDoc Foundation

PDFsharp - A .NET library for processing PDF & MigraDoc Foundation - Creating documents on the fly
It is currently Thu Mar 28, 2024 6:31 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 
Offline

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

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

e.g.

//TEST//
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.
ScanSingleLineComment();
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.


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

Joined: Sat Mar 14, 2015 10:15 am
Posts: 909
Location: CCAA
Hi!

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
Thomas
(Freelance Software Developer with several years of MigraDoc/PDFsharp experience)


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

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.

Thanks

Steve


Top
 Profile  
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 50 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