hi there, I have a pile of pdf documents which may or may not contain email adresses. Now I do have to mask the [EMAIL PROTECTED] adresses into something like xyAT whereever.dot
I looked at CAM::PDF and PDF::API2 - my CAM::PDF code would look like foreach my $file (@todo){ my $doc=CAM::PDF->new($file); my $pagenumber = $doc->numPages(); for (my $i=1; $i=$pagenumber; $i++){ my $page=$doc->getPageContent($i); $page =~ s/\@/AT/; $doc->setPageContent($page); } $doc->save(); } That however keeps on repeating a loop somewhere in CAM::PDF forever: --snip-- ET Tw ( ) TjTD25 0.75 re fw ( ) [EMAIL PROTECTED]) Tjrite.de/) Tj) Tjanke Kinder, CVK) Tjj Use of uninitialized value in hash element at /usr/lib/perl5/site_perl/5.8.5/CAM/PDF.pm line 2811. Argument "BT\r70.5 49.5 TD\r0 0 0 rg \r/F0 9.75 Tf\r-0.2025 Tc ..." isn't numeric in numeric lt (<) at /usr/lib/perl5/site_perl/5.8.5/CAM/PDF.pm line 2060. ET Tw ( ) TjTD25 0.75 re fw ( ) [EMAIL PROTECTED]) Tjrite.de/) Tj) Tjanke Kinder, CVK) Tjj Use of uninitialized value in length at /usr/lib/perl5/site_perl/5.8.5/CAM/PDF.pm line 3600. Argument "BT\r70.5 49.5 TD\r0 0 0 rg \r/F0 9.75 Tf\r-0.2025 Tc ..." isn't numeric in numeric lt (<) at /usr/lib/perl5/site_perl/5.8.5/CAM/PDF.pm line 2060. --snap-- With PDF::API2 I manage to get a PDF::API2::Content::Text object -> just that I cant find out what to do with it. How the heck do I find out whether there are emails to be masked in that obj? Does anybody - know where to find documentation an a PDF::API2::Content::Text obj? - know why ma CAM::PDF call end in an endless loop - have any other idea how to replace certain strings in a pdf? - know a docu on how pdf works - which I obviously dont know... Thanks a lot in advance, Wolf -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/