PDFsharp & MigraDoc Foundation

PDFsharp - A .NET library for processing PDF & MigraDoc Foundation - Creating documents on the fly
It is currently Sun Apr 18, 2021 1:55 pm

All times are UTC


Forum rules


Please read this before posting on this forum: Forum Rules



Post new topic Reply to topic  [ 4 posts ] 
Author Message
PostPosted: Wed Nov 01, 2006 9:40 pm 
Offline

Joined: Wed Nov 01, 2006 9:35 pm
Posts: 2
I have found that the XGraphicsRdfRenderer.DrawString() truncates strings when the string includes an & symbol( at the &). It also will remove + character from a string (I am sure there are others characters that give strange behavior as well). Is there a way to get these symbols to display on the PDF? What is the list of special characters that will not display?

Rob.


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Thu Nov 02, 2006 9:06 pm 
Offline
empira Employee
User avatar

Joined: Thu Oct 12, 2006 10:07 pm
Posts: 49
Location: Cologne, Germany
Hello,

the class XGraphicsPdfRenderer is not intended for beeing used directly in your code (it was public, but this was a mistake). Use only class XGraphics for drawing.

However, I cannot duplicate your observation. Please tell me more details.

>>What is the list of special characters that will not display?
By design there are no such characters.

Regards
Stefan Lange


Top
 Profile  
Reply with quote  
PostPosted: Thu Nov 02, 2006 9:18 pm 
Offline

Joined: Wed Nov 01, 2006 9:35 pm
Posts: 2
Actually, we are not calling the renderer directly. We traced the call back from XGraphics.DrawString. Given the snippet of code below if we try to draw the a string that contains "Hello & World" the pdf will contain "Hello". If we try "Hello + World" we get "Hello World". If we try "Hello World" we get "Hello World".

XGraphics gfx=XGraphics.FromPdfPage(doc.AddPage(new PdfPage()))

XStringFormat format = new XStringFormat();

format.Alignment=XStringAlignment.Center;
format.LineAlignment=XLineAlignment.Near;

gfx.DrawString(title1,
new XFont("Verdana",12,XFontStyle.Italic),
XBrushes.Black,
new XRect(TITLE_BOX_X,TITLE_BOX_Y,TITLE_BOX_WIDTH,TITLE_BOX_HEIGHT)
,format);


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Thu Nov 02, 2006 10:09 pm 
Offline
empira Employee
User avatar

Joined: Thu Oct 12, 2006 10:07 pm
Posts: 49
Location: Cologne, Germany
I believe you, but I have no idea. I tried the "Hello, World" sample and it works. There is no code that eats up special characters.

Please mail me the PDF file that your sample produces.


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

All times are UTC


Who is online

Users browsing this forum: No registered users and 27 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:  
cron
Privacy Policy, Data Protection Declaration, Impressum
Powered by phpBB® Forum Software © phpBB Group