Yes... maybe. If you read Adobe's documentation on the PDF format you'll
discover that sections may or may not be encoded. If you do not have
compressed PDF documents you could just do a search/replace right on the
PDF. If it's compressed then you may need to use one of the PDF modules. I
haven't yet figured out how to extract text so I can't help with that.

Of course, if you just replace longer strings with shorter strings you
will end up with empty space where the full URL used to be. This is
because a PDF is more like a graphic picture than it is like a text
document. Everything in a PDF is described by it's XY coordinate values. A
simple search/replace will not do any of the paragraph re-alignment you
may be expecting. You may need to write some additional code to crunch the
text after you've fixed the URL. Depending on your goals it may be easier
to just correct the source documents.

On the other hand, perhaps someone else has already written a tool to do
this?

Joshua Jore




Roland Corbet <[EMAIL PROTECTED]>
Sent by: [EMAIL PROTECTED]
10/02/01 06:21 AM


        To:     "Perl-General (E-mail)"
<[EMAIL PROTECTED]>
        cc:
        Subject:        Changing Links in PDFs with Perl


I have been given the task of converting links in around 2000 PDF
documents.

If I open up the PDFs in notepad, I can see the links:

http://www.my.link/folder/dir/my.filename

They need converting to relative links:

folder/dir/my.filename

I was wondering if there would be any way with Perl to change these links?
 If I could read through the file, and process any text, I could do a
regex substitution to change the links.

TIA for any help.

Kind Regards,

Roland



_______________________________________________
ActivePerl mailing list
[EMAIL PROTECTED]
http://listserv.ActiveState.com/mailman/listinfo/activeperl

Reply via email to