#1 Re: PDF Engine » Best way to make pdf of a multi page textfile » 2011-07-19 07:41:40

To print cyrillic characters (russian) I tried setting font.Charset to "RUSSIAN CHARSET" (204)
Output is is however unchanged.

Using
      Pdf.BeginDoc;
      Pdf.DrawText(S);
      Pdf.EndDoc;
Fails

but substituting Pdf.Drawtext(S) with Pdf.Canvas.TextOut(300,100, S) works
appart from page layout, but the russian characters print OK

What is the correct method to print russian characters?

#2 Re: PDF Engine » Best way to make pdf of a multi page textfile » 2011-07-17 08:06:48

How do I specify the paper size the pdf is intended to be printed on?
I need A4?

#3 Re: PDF Engine » Best way to make pdf of a multi page textfile » 2011-07-15 17:10:50

I get a runtime error when I use lPDF.Addpage.
Can you provide an example that uses lPDF.AddPage?

Where is TGDIPages defined?

AJ

#4 PDF Engine » Best way to make pdf of a multi page textfile » 2011-07-14 19:56:58

AndersJ
Replies: 7

I down loaded the pdf engine and found an example that works fine.

uses SynPdf;
procedure TForm1.DoIt;
var
lPdf   : TPdfDocument;
lPage  : TPdfPage;
begin
  lPdf := TPdfDocument.Create;
  try
    lPdf.Info.Author        := 'Tester';
    lPdf.Info.CreationDate  := Now;
    lPdf.Info.Creator       := 'Tester';
    lPdf.DefaultPaperSize   := psA4;
    lPage := lPDF.AddPage;
    lPDF.Canvas.SetFont('Helvetica',10.0,[]);
    lPDF.Canvas.SetLeading(lPDF.Canvas.Page.FontSize);
    lPDF.Canvas.SetLineWidth(0.1);

    lPdf.Canvas.BeginText;
    lPdf.Canvas.TextOut( 300, 700,  'This is some text_700.');
    lPdf.Canvas.TextOut( 300, 600,  'This is some text_600.');
    lPdf.Canvas.TextOut( 300, 500,  'This is some text_500.');
    lPdf.Canvas.TextOut( 300, 400,  'This is some text_400.');
    lPdf.Canvas.TextOut( 100, 300,  'This is some text_100,300.');
    lPdf.Canvas.EndText;

    lPdf.SaveToFile('c:\temp\test.pdf');
  finally
    lPdf.Free;
  end;
end;

BUT,

How do I add a new page?
Is TextOut the best way to do this?
I basically want a bunch of WriteLn's, a new page, and more WriteLn's.

Thanks for any hint,
Anders J

Board footer

Powered by FluxBB