#1 Re: PDF Engine » VCLCanvas.TextRect or VCLCanvas.TextOut » 2017-12-04 21:50:39

please tell me how the syntax of this command is, since I tried anyway to find something that solved my problem, but I did not find it.
I searched everywhere and found nothing.
I reviewed each VCL canvas procedure, but I did not get anything.

#2 PDF Engine » VCLCanvas.TextRect or VCLCanvas.TextOut » 2017-12-02 11:55:15

katcharowski
Replies: 3

I need to print a text aligned from right to left using TPdfDocumentGDI and VCLcanvas. What is missing in this code for it to work?

procedure TForm2.Button3Click(Sender: TObject);
var  lPdf         : TPdfDocumentGDI;
      lPage       : TPdfPage;
      DrawRect : TRect;
begin
      lPdf := TPdfDocumentGDI.Create;

      lPdf.DefaultPaperSize   := psA4;
      lPdf.ScreenLogPixels    := 50;

      lPdf.Info.Author           := 'SINTEG Sistemas de Informação';
      lPdf.Info.CreationDate  := Now;
      lPdf.Info.Creator          := 'Sinteg Web-mobile';
      lpdf.Info.Title               := 'Relatório de Contas a Receber';
      lpdf.Info.Subject          := 'Ordenado por Cliente';

      lPDF.VCLCanvas.Font.Size  := 7;
      lPDF.VCLCanvas.Font.Name  := 'Arial';
      lPDF.VCLCanvas.Font.color := clred;
      lPDF.VCLCanvas.Font.Style := [fsbold,fsitalic];

      lpdf.VCLCanvas.TextRect(DrawRect, 130, 21, 'printed from left to right');
      lpdf.VCLCanvas.TextRect(DrawRect, 130, 31, 'printed from right to left');
end;

the result should be this:

------------------------------------------------------ col 130 --------------------------

                                                                       printed from left to right
                                     printed from right to left

Board footer

Powered by FluxBB