Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Does anyone know of a (free, Windows) way to convert/change the version numbers of a batch of PDF files?

A command line tool would be ideal, since it can automated rather easily, but the only ones I've come across so far require large amounts of money to make it wor

share|improve this question
add comment

2 Answers

up vote 0 down vote accepted

I'm fairly sure ghostscript can do so. There's a thread on doing this for Linux on SuperUser here -- but Ghostscript runs on Windows too.

share|improve this answer
    
Thanks! It does appear to only be able to change the version up to 1.5 though. Is there any way to convert to higher versions? (1.6, 1.7) –  DanielGibbs Sep 28 '10 at 21:27
add comment

@DanielL: why do you want to convert to a *higher version?!?

Higher versions do have more supported 'features'. These features normally need to be supported+present in the authoring application which created the PDF in the first place. There is hardly a decent way to do it a posteriori.

If you open a PDF in an editor, you'll notice the first line (or one of the first lines, after some "garbage") will contain the string %PDF-1.N (where N in 0..7). Just change N (the 8th byte of the PDF) to the value you want.

This then fakes a new version 'good enough' for most PDF consuming software to believe it... and it will probably be good enough to make some viewers issue a warning saying "This PDF may use features I cannot handle."

Is this what you want?

Here is how you do it:

  1. Install perl (for Windows).
  2. Run the following command to turn a PDF-1.3 into a faked PDF-1.7:
    perl.exe -pi_orig.pdf -e 's/%PDF-1.3/%PDF-1.8/' some.pdf

It will backup some.pdf as some.pdf_orig.pdf and your some.pdf will now fake to be version 1.8.

Run the following command to turn all PDFs in the current directory into faked 1.7-versioned PDFs:

for %i in (*.pdf) do (
  perl.exe -pi_orig.pdf -e 's/%PDF-1../%PDF-1.7/' %i
)

Voila! All what you asked for:

  • Perl is free
  • It's for Windows
  • It changes the version number of a batch of PDF files
share|improve this answer
    
Ok thanks, I'm not sure why I need to change the versions, i've just been asked to change a whole bunch of pdf's to the latest version for some sort of compatability I think? Also, is changing the version string the only thing that changes the version? Aren't they structured slighly differently in different versions? –  DanielGibbs Sep 30 '10 at 3:18
    
@DanieL: I thought I had made it unequivocally clear by using the keyword fake (and using it more than once)? -- No, changing the version string is changing 1 Byte, and not changing any structural differences internally. I also expressed that 'there is hardly a decent way to change an old version PDF to the newest one in the aftermath' without having access to the authoring software and the source document (before it was converted to PDF)... –  Kurt Pfeifle Sep 30 '10 at 8:07
    
OK, there are a few programs out there that claim to do just this, but they cost around $200. Surely they do more than just change 1 byte? –  DanielGibbs Sep 30 '10 at 18:09
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.