#1 2020-02-05 10:26:44

Spartak86
Member
From: Engels
Registered: 2020-02-05
Posts: 3
Website

Add table in PDF file

Hello. First, thank you very much for providing a tool for creating PDF files

Question:

I add a TeeChart page to a pdf document sheet using the following method:

lPdf := TPdfDocumentGDI.Create;
for i := 1 to Chart0.Pages.Count do
    Begin
      lPage := lPdf.AddPage;
      lPdf.VCLCanvas;
      TPdfPageGDI(lPage).PageMetafile := Chart0.TeeCreateMetafile(false, Rect(150, 150, (lPdf.VCLCanvasSize.Width - 150), (lPdf.VCLCanvasSize.Height - 150)));
      Chart0.NextPage;
    End;

That is, I use "TPdfDocumentGDI"

You can create a table using "TGDIPages"

lPdf := TGDIPages.Create(self);
lPdf.BeginDoc;
lPdf.AddColumns([10,20,50]);
lPdf.AddColumnHeaders(['#','Two','Three'],true,true);
lPdf.EndDoc;

How do I combine these two differently created pages into one?

Last edited by Spartak86 (2020-02-05 10:28:15)

Offline

#2 2020-02-05 11:38:43

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,305
Website

Re: Add table in PDF file

Use TGDIPages, then insert the chart into the page.
Don't create a TPdfDocumentGDI stand-alone instance.

Offline

#3 2020-02-05 12:01:18

Spartak86
Member
From: Engels
Registered: 2020-02-05
Posts: 3
Website

Re: Add table in PDF file

How do I do this?
You can use the example code where "TGDIPages" will be displayed and the Chart will be inserted

Offline

#4 2020-02-07 11:53:15

Spartak86
Member
From: Engels
Registered: 2020-02-05
Posts: 3
Website

Re: Add table in PDF file

Has anyone encountered the following problem? Is this a Chart flaw? And can it be solved somehow?

4aea8896c421.png

At the moment I simply forbade moving the axis outside the chart

Offline

Board footer

Powered by FluxBB