Page cloning
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=702
Printed Date: 16 May 24 at 12:14AM Software Version: Web Wiz Forums 11.01 - http://www.webwizforums.com
Topic: Page cloning
Posted By: Boris
Subject: Page cloning
Date Posted: 05 Apr 07 at 5:50PM
Hi,
The problem I am trying to solve all day today...
I have a database with some number of employees. let's say 2 employees.
I also have a "template" PDF which is used to enter some data about each employee, and these data I read from the database.
What I do is first I load the "template". Then I count how many
employees I have (in this example I have 2 employees only). Next, I
CLONE the first page of the "template" PDF by number of employees, this
way I practicaly finish with the document having 2 pages. All of them
the same.
Now I jump to the FIRST document page, and traverse through the
database and write each employee data on the separate page. And this
part is the problem.
The first page contains the data only for the FIRST employee.
But, the second page contains data fr FIRST employee and ALSO the data fro SECOND employe!!??
Seams to me that when we clone the pages for example we clone the FIRST
page, whatever we later write ont the FIRST page is automaticaly
written on this page CLONE ALSO!?
I suppose this is why I got on the second page the data for the FIRST
employee, and on top of this data the SECOND employee data are written
also....
Basicaly what I need is:
1. Load the template
2. Clone the first page as many times as the number of employees in the database
3. Start writing data from the database, first employee data goes on the page 1, second employee data on page 2 etc...
4. Saving the document under the different name.
Please, give me a hand about this issue, it prevents me from finishing
the project and I feel it is something trivial which I am mislooking
all the time...
regards
------------- Better to write programs than not to write programs...
|
Replies:
Posted By: ixm7
Date Posted: 06 Apr 07 at 5:46PM
Please provide more detail about what you intend to do with the final document.
|
Posted By: Boris
Date Posted: 06 Apr 07 at 9:07PM
I solved this today, by using another aproach.
First I calculate the number of employees (which may vary of course).
Then I merge the same "template.pdf" twice into a new document.
I repeat merging until I finish with the desired number of pages.
Then I traverse through the database and write each employee data on separate page.
Works perfect.
Regards
------------- Better to write programs than not to write programs...
|
|