PerlSufi has asked for the
wisdom of the Perl Monks concerning the following question:

Hello monks,
I have used the super search to try to find an example of how to extract text from a pdf file and attach it to another pdf file, but haven't found any good examples. Any help would be greatly appreciated! here is my code so far:

I added the CAM::PDF modules and PDF::Extract modules because that is what I found. I just haven't figured out to use them yet.. I want to open a file in the working folder called pdfone.pdf and write it to file I created in the code I posted

You are getting the error "Can't call method "getRootDict" on an undefined value" because 'new.pdf' doesn't exist.

Manipulating PDF files is quite complex and I found that I had to use both modules to achieve what you are trying to do as PDF::API2 doesn't seem to have any way of extracting text and CAM::PDF doesn't seem to have any way of adding an empty page.

Thank you tangent!! You're a life saver! I was banging my head against the wall all day yesterday on how to do this. I saw that CAM::PDF couldn't create a new page so I knew I had to combine them, I just didn't see how yet. Is there a GIVE MONEY$$ option on here for monks?! :P

If your script is called awesomedoodles.pl, you will be making a pdf called awesomedoodles.pl.pdf . $0 contains the script's name. While not wrong, it reduces the usefulness of your script, as you would have to rename the script each time you want to use it.