View previous topic :: View next topic |
Author |
Message |
robtester
Joined: 01 Nov 2006 Posts: 2
|
Posted: Wed Nov 01, 2006 9:40 pm Post subject: Truncating ampersands & and others |
|
|
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. |
|
Back to top |
|
 |
Stefan Lange

Joined: 12 Oct 2006 Posts: 47 Location: Cologne, Germany
|
Posted: Thu Nov 02, 2006 9:06 pm Post subject: |
|
|
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 |
|
Back to top |
|
 |
robtester
Joined: 01 Nov 2006 Posts: 2
|
Posted: Thu Nov 02, 2006 9:18 pm Post subject: Truncating ampersands & and others |
|
|
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); |
|
Back to top |
|
 |
Stefan Lange

Joined: 12 Oct 2006 Posts: 47 Location: Cologne, Germany
|
Posted: Thu Nov 02, 2006 10:09 pm Post subject: |
|
|
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. |
|
Back to top |
|
 |
|