Closed davidalejandroaguilar closed 5 years ago
what exactly do you want to achive?
The Pdf Version is indicated in the first bytes of the file:
%PDF-1.3
sure you may change it to:
%PDF-1.7
As far as I know, this number is just ignored by any PDF viewer. However Origami automatically generates the version number in order to be compliant, based on the objects that compose the document. Have you found a case where this causes breakage?
If your only goal is to modify this number in a document, I think it's much simpler to just modify the single byte in the file header rather than loading a full PDF parser/generator like Origami.
Alternative solution is to modify it like:
pdf.header.minor_version = 5 # will set version 1.5
pdf.save "doc.pdf"
But that's overly expensive as it will recompile the entire document while you could do it just by overwriting a single byte. I am closing this issue now.
Went through the Rubydoc documentation but couldn't find anything related to it, but I've could've missed it. Is it possible?