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

hello, I need to delete text from a PDF file. does anyone know how can I do? thank you very much

Replies are listed 'Best First'.
Re: PDF remove a text
by marto (Cardinal) on May 04, 2012 at 09:09 UTC

    The example below uses the CAM::PDF module, which you use here and I suspect this post relates to.

    #!/usr/bin/perl use strict; use warnings; use CAM::PDF; my $pdf = CAM::PDF->new('test.pdf'); my $pagecontent = $pdf->getPageContent(1); # $pagecontent now holds the text within the first page. # say I want to replace the word Release with Distribution. $pagecontent =~ s/Release/Distribution/; $pdf->setPageContent(1, $pagecontent); $pdf->cleanoutput('test_replace.pdf');

    If you have any interest in learning Perl I suggest you take the time to read: