You are not logged in.
I just discovered SynPDF this morning so please forgive my newbie-ness. I have searched the forum but have not seen this topic addressed elsewhere.
I would like to be able to write the following code and have the text all on the same line:
Rept := TGDIPages.Create(Application);
try
Screen.Cursor := crHourGlass;
Rept.BeginDoc;
Rept.DrawText('plain text ');
Rept.Font.Style := [fsUnderline];
Rept.DrawText('Underlined text');
Rept.Font.Style := [fsBold];
Rept.DrawText('bold text'); // <-- DrawText ALWAYS adds a NEWLINE to the end...
Rept.Font.Style := [];
Rept.DrawText(' plain text');
Rept.EndDoc;
finally
Screen.Cursor := crDefault;
Rept.Free;
end;
Ideally the output would look like this:
plain text underlined textbold text plain text
but it looks like this:
plain text
underlined text
bold text
plain text
---
Is this possible?
Thanks!
PS this tool is great!
Offline
This is not possible directly.
You have several workarounds:
- Use the supplied Canvas property to draw the text as usual with Delphi (you have to render it);
- Write your text into a TRichEdit content, then add it to the page via the TGDIPages.AppendRichEdit() method.
For the later, see http://synopse.info/forum/viewtopic.php?id=76
Offline
Ok thank you. I can do it with the Canvas, I was just hoping to take advantage of the Begin/EndGroup feature.
Thanks for the quick reply.
-Jeff
Offline