lib/podoff.rb in podoff-1.3.0 vs lib/podoff.rb in podoff-1.4.0

- old
+ new

@@ -4,11 +4,11 @@ require 'stringio' module Podoff - VERSION = '1.3.0' + VERSION = '1.4.0' def self.load(path, encoding) Podoff::Document.load(path, encoding) end @@ -492,17 +492,19 @@ end class Stream attr_accessor :obj + attr_accessor :deflate - def initialize(obj=nil) + def initialize(obj=nil, opts={}) @obj = obj @font = nil @color = nil @content = StringIO.new + @deflate = opts.has_key?(:deflate) ? opts[:deflate] : true end def tf(font_name, font_size) n = font_name[0] == '/' ? font_name[1..-1] : font_name @@ -586,10 +588,10 @@ def to_s s = @content.string f = '' - if s.length > 98 + if @deflate && s.length > 98 f = ' /Filter /FlateDecode' s = Zlib::Deflate.deflate(s) end "#{obj.ref} obj\n" +