#1 Re: PDF Engine » TGDIPages - can DrawText not append a NewLine? » 2012-04-08 19:13:26

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

#2 PDF Engine » TGDIPages - can DrawText not append a NewLine? » 2012-04-05 19:51:27

Jeff
Replies: 2

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!

Board footer

Powered by FluxBB