#1 Re: PDF Engine » Rotated text / logfont » 2014-06-07 19:50:07

Thanks all, I have resolved the issue using vcl canvas.

Les

#2 Re: PDF Engine » Rotated text / logfont » 2014-06-07 17:23:56

I am still failing at assigning the font. I am trying:

   
var
lPdf   : TPdfDocumentGDI;
lPage  : TPdfPage;
LogFont         :TLogFont;
tf      :tFont;

begin
     lPdf := TPdfDocumentGDI.Create;
     lPage := lPDF.AddPage;
{

otherworking code here

}
     tf := tFont.Create;
     tf.Assign(Form1.Canvas.Font) ;
     GetObject(tf.Handle, sizeof(LogFont), @LogFont) ;
     LogFont.lfEscapement   := 315 * 10;
     LogFont.lfOrientation  := 315 * 10;
     tf.Handle :=  CreateFontIndirect(LogFont) ;

     lPDF.Canvas.Page.Font.Assign(tf);

Up to the point where I try to create the rotated font all is well.
I can write text using:
   lPDF.Canvas.TextOut(xe, ye, 'MINUTES');
And draw lines using:
  lPDF.Canvas.MoveTo(GraphLeft,ye);
  lPDF.Canvas.LineTo(GraphRight,ye);
  lPDF.Canvas.Stroke;

The code compiles, but when it tries to assign the font, I get:
'Cannot assign a tFont to a tPDFFontTrueType' error message.

Any additional help would be greatly appreciated.

Les

#3 PDF Engine » Rotated text / logfont » 2014-06-07 14:48:45

Lesh11
Replies: 3

All,
I am totally lost.  Could I please get some sample code for rotating text.  If I could figure out how to use a logfont I could go from there.

Thanks,
Les

Board footer

Powered by FluxBB