Do you see a better way of doing this with PDF::API2?

"spinningwebz2002" <spinningwebz2002-/[email protected]>
Newsgroups gmane.comp.lang.perl.modules.pdfapi2
Message-ID <[email protected]>
First off, let me preface this by saying Thank You to all of you who 
have helped me understand how PDF::API2 works (and a BIG thanks to 
the author!), without it I would not even be 10% of the way through 
this project.

Now here is the next question I hope you can help me with. FYI all of 
this is working right now.

1. I am currently creating a multi-page pdf using text that is input 
by the user.

2. I then save this pdf into a file.

3. I then re-open this pdf and extract out the individual pages into 
seperate files (reason for this is they may want to view just that 
page and I need the individual pages for step 5).

4. I then create a new pdf.

5. I then open and insert the individual pages into the new file, 
along with any photo pages that were made (these are done in a 
seperate section and a single page pdf is made with the photo) using 
a page map, as an example, if I have a 7 page pdf (filename-1.pdf 
through filename-7.pdf (created in step 3)) and my page map says to 
insert photopage-1.pdf before page 3 and photopage-2.pdf before page 
6 I will end up with a 9 page pdf containing:
filename-1.pdf
filename-2.pdf
photopage-1.pdf
filename-3.pdf
filename-4.pdf
filename-5.pdf
photopage-2.pdf
filename-6.pdf
filename-7.pdf

6. I then save this new finished pdf

The above steps are important, because if they make a new photo page 
I create the page and then jump to step 4 to make a new finished pdf.

Now the question is, how can I make this faster program wise (it isnt 
THAT slow, on a 10 page pdf it takes 45 seconds or so)? The one thing 
I can think of that would work is if I could combine steps 2 & 3, so 
that while I am making the multipage pdf I can save the current page 
as a new pdf without closing the multipage pdf. Is it possible to 
save a page on the fly with a new name and not close the current pdf? 
Or, can I copy the current page contents into a new pdf structure and 
save that?

Now I will definatly increase the speed when I add more memory to the 
server I am testing on, and the server we will deploy on will be the 
fastest one possible with the most memory possible, but if I can 
speed it up on my 1.5ghz system with 256mb (I know) then it will THAT 
much faster on a 4+ghz with 2gb+ of ram.

Thanks in advance

Bill H
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.