how to use CAM::PDF to find + replace from command line

752 views Asked by At

Sorry for the noob question. I just downloaded CAM::PDF along with Strawberry for Windows, and trying to do find/replace from the command line. Ran buidinstalldeps to get all needed prereqs.

I'm trying to run changepagestring.pl from command line. But idk how to reference the file location and have it put the output file for me in a specified location:

changepagestring.pl master-exch-manual.pdf "as shown in Figure" figure output.pdf

My goal is to replace "see above figure" with "figure" in this file. But it's in a different directory than the one I'm in, C:\Users\Me\Doc\CAM-PDF-1.60\ So how do I run and do all this from the command line. I've seen the help file with example, but I get this: CAM::PDF from command shell with PL file not recognized

1

There are 1 answers

1
Chris Dolan On

There are a few possible solutions. The easiest one from the directory you mentioned is:

perl -Ilib bin/changepagestring.pl ...

Alternatively, if you run the usual Perl install commands from that folder, then changepagestring.pl should be included in your usual path

perl Makefile.PL
make install

Alternatively^2, you can use the "cpan" tool to automate the download, build, test and install steps in one go:

cpan install CAM::PDF