#1 2016-07-27 00:26:35

cosworth
Member
Registered: 2016-02-05
Posts: 10

Help with PDFDocumentGDI

I'm using PDFDocumentGDI and VCLCanvas calls to create the pdf. The last part I need is page numbers. Is there an easy way to add these, I saw on another post about GDIPages owning and calling PDFDocumentGDI, do you have an example of this?
I have been reading through the documentation and comments in your units and looked at the examples and reading through the Forum, but there's a lot to process and I'm on a tight timescale (aren't we always). any additional help/examples would be appreciated.

Offline

#2 2016-07-27 09:55:04

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

Re: Help with PDFDocumentGDI

You have to handle this by hand, if you are using TPdfDocumentGDI directly.
Just like with any canvas-oriented process.

For high-level page rendering, consider using mORMotReport.pas and its simple reporting class, which features page number creation.

Offline

#3 2016-07-27 10:59:44

cosworth
Member
Registered: 2016-02-05
Posts: 10

Re: Help with PDFDocumentGDI

I will be taking a look at the rest of mORMot later. I currently produce a pdf with a varied number of pages. All the coordinates are stored in 2 tables, one for the default layout i.e Titles, rects, lines and fixed text, the other table holds the coordinates for the data. I use 3 Stored Procedures to extract the data to be printed joined with the coordinates it's to be printed at. 1 stored procedure provides the Header Data, i.e. Address's that repeat on each page but are different for each report, another Stored Proc for the footer information and summary data, again, mostly the same for each page and different for each report (it does subtotaling if it page throws) and the 3 Stored Proc supplies the detail which could be any number of lines and has a free text field (Varchar 5000). So I have to keep track of the Y position. I currently control all this from code and TextOut, I did some work with the GDIPages and liked it, done a few other reports with it, but I couldn't control how far down the page DrawAcrossColumns went before it went to the next page, I'm sure it can be done but I only have a finite amount of time to solve a Threading problem with another component. I believe my lack of understanding is probably a general programming issue rather anything with your product, but it's something I haven't had to research since I have been using a component that allowed page numbering and handled for me.

Offline

Board footer

Powered by FluxBB