Sha256: 06f35ccca926a0a887757a19fdbd743aad8d4bbb3a90752c7d631446d6027fb6
Contents?: true
Size: 655 Bytes
Versions: 20
Compression:
Stored size: 655 Bytes
Contents
# ## Optimizing a PDF File # # This example shows how to read a PDF file, optimize it and write it # out again. # # The heavy work is done by the `:optimize` task which allows control # over which aspects should be optimized. See [HexaPDF::Task::Optimize] # for detailed information. # # The hexapdf binary provides an optimization command which does some # additional operations like optimizing the page tree. # # Usage: # : `ruby optimizing.rb INPUT.PDF` # require 'hexapdf' HexaPDF::Document.open(ARGV.shift) do |doc| doc.task(:optimize, compact: true, object_streams: :generate, compress_pages: false) doc.write('optimizing.pdf') end
Version data entries
20 entries across 20 versions & 1 rubygems