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

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

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

 



johnsonj1978
newbie

Oct 25, 2001, 12:05 PM

Post #1 of 1 (191 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 ./test_pdf.pl line 10, near "->open "testfile.pdf""
(Missing operator before "testfile.pdf"?)
syntax error at ./test_pdf.pl 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 http://search.cpan.org/doc/AREIBENS/PDF-API2-0.1.16_beta/lib/PDF/API2.pm

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

#!/usr/bin/perl
use PDF::API2;
use PDF::API2::Util;
use Text::PDF::Utils;

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

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

$page=$pdf->page;
$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