Print Page | Close Window

Page Numbering (Delphi)

Printed From: Debenu Quick PDF Library - PDF SDK Community Forum
Category: For Users of the Library
Forum Name: I need help - I can help
Forum Description: Problems and solutions while programming with the Debenu Quick PDF Library and Debenu PDF Viewer SDK
URL: http://www.quickpdf.org/forum/forum_posts.asp?TID=1555
Printed Date: 26 Aug 25 at 11:32PM
Software Version: Web Wiz Forums 11.01 - http://www.webwizforums.com


Topic: Page Numbering (Delphi)
Posted By: MartinS
Subject: Page Numbering (Delphi)
Date Posted: 26 Aug 10 at 4:26PM
I have been asked to write a procedure to merge multiple documents for a summary, so have used the MergeFiles in a loop so that it will work for any number of reports.
One of the issues i have come across first is that each PDF has it's numbering set on creation, i.e. 1 of x is written into the header of the report, so when merging, I get page 1 of 1 and then page 1 of 2 and 2 of 2.
Is there anyway this can be dealt with in the resulting merged PDF, or do I need to go back to the code that creates the indivdual reports and work out the numbering from there?
Any help or advice gratefully received.
Martin



Replies:
Posted By: Ingo
Date Posted: 27 Aug 10 at 12:20PM
Hi Martin!

The numberring is textual stuff and it's fix in the documents.
My idea: Paste the relevant areas with colour white on white background,
take the new pagecount and create your own numberring.

Cheers and welcome here,
Ingo



Posted By: MartinS
Date Posted: 31 Aug 10 at 11:35AM
Hi
Thanks, that's what I guessed. Will have to look to see how i can re-work the numbering of the unmerged documents.
As an aside, I have been trying to figure out how I can find the total page count for my merged document. This is the code I am using to create my merged document, but in this example, where I only have two files to merge, it returns a PageCount of 1. My code was designed to be re-used for any number of documents, but if this is not the way it should be used, please let me know.

// create list to hold generated filenames...
sFileNameList := TStringList.Create;
// add store it in a list...
sFileNameList.Add('FilePathAndName1');
sFileNameList.Add('FilePathAndName2');
// loop through the list...
for I := 1 to sFileNameList.Count - 1 do
begin
// merge files together...
PDFLibrary.MergeFiles(sFileNameList[0], sFileNameList, sOutputFileName);
end;
// release the memory...
PDFLibrary.Free;
sFileNameList.Free;
Thanks
Martin


Posted By: Ingo
Date Posted: 31 Aug 10 at 8:50PM
Hi!

If you're only using MergeFiles you won't get the complete pagecount.
Try AnalyseFile on the new merged file and directly after this GetAnalyseInfo...
then you'll get the new pagecount.

Cheers, Ingo





Print Page | Close Window

Forum Software by Web Wiz Forums® version 11.01 - http://www.webwizforums.com
Copyright ©2001-2014 Web Wiz Ltd. - http://www.webwiz.co.uk