lib/hexapdf/cli/command.rb in hexapdf-0.8.0 vs lib/hexapdf/cli/command.rb in hexapdf-0.9.0
- old
+ new
@@ -228,11 +228,11 @@
doc.task(:optimize, compact: @out_options.compact,
object_streams: @out_options.object_streams,
xref_streams: @out_options.xref_streams,
compress_pages: @out_options.compress_pages)
if @out_options.streams != :preserve || @out_options.optimize_fonts
- doc.each(current: false) do |obj|
+ doc.each(only_current: false) do |obj|
optimize_stream(obj)
optimize_font(obj)
end
end
end
@@ -322,10 +322,10 @@
# Removes unused pages and page tree nodes from the document.
def remove_unused_pages(doc)
retained = doc.pages.each_with_object({}) {|page, h| h[page.data] = true }
retained[doc.pages.root.data] = true
- doc.each(current: false) do |obj|
+ doc.each(only_current: false) do |obj|
next unless obj.kind_of?(HexaPDF::Dictionary)
if (obj.type == :Pages || obj.type == :Page) && !retained.key?(obj.data)
doc.delete(obj)
end
end