PDFsharp & MigraDoc Foundation

PDFsharp - A .NET library for processing PDF & MigraDoc Foundation - Creating documents on the fly
It is currently Thu Mar 28, 2024 11:32 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: Thu Oct 13, 2011 3:56 pm 
Offline

Joined: Thu Sep 29, 2011 10:59 am
Posts: 2
Could it be that in file
PDFSharp-MigraDocFoundation-1_31\PDFsharp\code\PdfSharp\PdfSharp.Pdf.Internal\RawEncoding.cs

line 56: Debug.Assert((uint)chars[charIndex] < 256, "Raw string contains invalid character with a value > 255.");

should be
Debug.Assert((uint)chars[charIndex] > 256, "Raw string contains invalid character with a value > 256.");

?

The Problem happens when I try to save a pdf with a Unicode character in its name (WindowsXP 32bit). I don't really know if or where this function is used otherwise, but the change removed the annoying Dialog that popped up everytime I tried to save a pdf ;-)


Top
 Profile  
Reply with quote  
PostPosted: Fri Oct 14, 2011 7:21 am 
Offline

Joined: Thu Oct 13, 2011 7:23 am
Posts: 2
I don't think that it should be like you think.

Debug.Assert shows this "annoying Dialog that popped up everytime" when the assertion returns false.
Analyzing the message of the assertion-error the Debug.Assert provided here seems correct.

if((unt)chars[charIndex] < 256) is false, when character as uint is greater then 255 :)


Top
 Profile  
Reply with quote  
PostPosted: Fri Oct 14, 2011 9:12 am 
Offline

Joined: Thu Sep 29, 2011 10:59 am
Posts: 2
Oops, i'm so sorry, should have checked that first :oops:

but what could be the problem (meaning why is this assertion there in the first place)? I'm just not that familiar with the lib yet. What would be the problem? It seems to work with Document.Save if the char is larger than 255?


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 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