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

"Tim Turner" <[email protected]>
Newsgroups gmane.comp.lang.perl.modules.pdfapi2
Message-ID <20070815022120.OJRM18264.ibm66aec.bellsouth.net@SONYXP2003>
Hello,
I can tell you from experience the server is a big deal.  We had a PDF that
took 40 to 50 sec to generate that now takes only 5 seconds to APPEAR inside
acrobat on a newer better server. Loading even static PDFs often takes a few
seconds to APPEAR in acrobat.  So anyway, you should still pursue code
improvements but don't underestimate the effect of a better server if you
can afford whatever cost is associated with that improvement.

Regards,
-Tim 
-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of spinningwebz2002
Sent: Tuesday, August 14, 2007 8:10 PM
To: [email protected]
Subject: [perl-text-pdf-modules] Do you see a better way of doing this with
PDF::API2?

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.