lib/hexapdf/task/optimize.rb in hexapdf-0.10.0 vs lib/hexapdf/task/optimize.rb in hexapdf-0.11.0
- old
+ new
@@ -113,11 +113,11 @@
doc.revisions.delete(0)
if object_streams == :generate
process_object_streams(doc, :generate, xref_streams)
elsif xref_streams == :generate
- doc.add(Type: :XRef)
+ doc.add({Type: :XRef})
end
end
# Processes the object streams in each revision according to method: For :preserve, nothing
# is done, for :delete all object streams are deleted and for :generate objects are packed
@@ -140,11 +140,11 @@
end
when :generate
doc.revisions.each_with_index do |rev, rev_index|
xref_stream = false
count = 0
- objstms = [doc.wrap(Type: :ObjStm)]
+ objstms = [doc.wrap({Type: :ObjStm})]
rev.each do |obj|
if obj.type == :XRef
xref_stream = true
elsif obj.type == :ObjStm
rev.delete(obj)
@@ -154,10 +154,10 @@
next if obj.respond_to?(:stream)
objstms[-1].add_object(obj)
count += 1
if count == 200
- objstms << doc.wrap(Type: :ObjStm)
+ objstms << doc.wrap({Type: :ObjStm})
count = 0
end
end
objstms.each {|objstm| doc.add(objstm, revision: rev_index) }
doc.add({Type: :XRef}, revision: rev_index) unless xref_stream