Method: Origami::PDF#save
- Defined in:
- lib/origami/pdf.rb
#save(path, params = {}) ⇒ Object Also known as: write
Saves the current document.
- filename
-
The path where to save this PDF.
221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 |
# File 'lib/origami/pdf.rb', line 221 def save(path, params = {}) = { delinearize: true, recompile: true, decrypt: false } .update(params) if self.frozen? # incompatible flags with frozen doc (signed) [:recompile] = [:rebuild_xrefs] = [:noindent] = [:obfuscate] = false end if path.respond_to?(:write) fd = path else path = File.(path) fd = File.open(path, 'w').binmode close = true end load_all_objects unless @loaded intents_as_pdfa1 if [:intent] =~ /pdf[\/-]?A1?/i self.delinearize! if [:delinearize] and self.linearized? compile() if [:recompile] fd.write output() fd.close if close self end |