Hi,
I have a question. I'm trying to create a PDF that has a text layout rectangle to insert text into. This layout rectangle should be COMPLETELY transparent. Including the border. It should be invisible. I just need to use it to layout and align text inside of to force the text to wrap to a new line if it runs outside the dimensions of the rectangle. I've run into an issue with the DrawString() method ...
... when using a container rectangle inside the graphics.DrawString() method, it automatically creates a tiny little border around my layout rectangle despite drawing the rectangle with XPens.Transparent. It makes the INSIDE of the rectangle transparent, but it does NOT remove the tiny white border around it.
If I could figure out how to wrap text using DrawString WITHOUT laying it out inside a container rectangle that would work! I need my text to wrap that's why I have to use a container rectangle, which is the issue...I can't get the container rectangle's border to be transparent.
In another section of the page, I'm using a container rectangle to layout an image. It works fine, but thats using DrawImage() method, not DrawString(). I have to use DrawString() method here because I'm just outputting text inside the rectangle so DrawImage() won't work...please advise.
Here's my code snippet that does this..
Code:
XRect practiceNameContainer = new XRect(420, 595, 120, 120);
gfx.DrawRectangle(XPens.Transparent, practiceNameContainer);
XTextFormatter textFormatter = new XTextFormatter(gfx);
textFormatter.DrawString(this.PracticeName, font, XBrushes.Black, practiceNameContainer, XStringFormats.TopLeft);