CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
Search Posts SEARCH
Who's Online WHO'S
Log in LOG

Home: Perl Programming Help: Intermediate:
Editing a PDF file



Oct 25, 2001, 12:05 PM

Post #1 of 1 (360 views)
Editing a PDF file Can't Post

Hi - I'm trying to open an existing PDF file to add snippets of text to certain areas of it - the problem is that I have yet to get an existing PDF file to simply OPEN (I'm using the API2 module). When I try to run the script, I get two error messages - the first one is when the "PDF::API2->open" command is invoked, and the second is when the "$pdf->openpage" command is invoked. Both error messages are the same:

<variable type> found where operator expected at ./ line 10, near "->open "testfile.pdf""
(Missing operator before "testfile.pdf"?)
syntax error at ./ line 10, near "->open "testfile.pdf""

where <variable type> is a string or scalar. I modeled the commands I'm using from the command examples for this module at

Can someone tell me how to fix this? I pasted the snippet of code from this script relevant to this procedure below. Thanks!

use PDF::API2;
use PDF::API2::Util;
use Text::PDF::Utils;

# $pdf=PDF::API2->new;

$pdf=PDF::API2->open "testfile.pdf";

$page=$pdf->openpage $index;


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives