Created
January 29, 2013 00:45
-
-
Save hidakatsuya/4660699 to your computer and use it in GitHub Desktop.
A patch for fix an error when print the pdf that is generated with encryption by prawn
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'thinreports' | |
# https://github.com/prawnpdf/prawn/commit/34039d13b7886692debca11e85b9a572a20d57ee | |
class Prawn::Core::Reference | |
def <<(data) | |
(@stream ||= "") << data | |
@data[:Length] = @stream.length | |
@stream | |
end | |
def compress_stream | |
@stream = Zlib::Deflate.deflate(@stream) | |
@data[:Filter] = :FlateDecode | |
@data[:Length] = @stream.length | |
@compressed = true | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment