Sha256: 0085d79d4e56394f656a3b7395481d83c622bcda2b08c079ba004f721292f758

Contents?: true

Size: 769 Bytes

Versions: 4

Compression:

Stored size: 769 Bytes

Contents

module PDF
module Core
class Page
  # Restore the new_content_stream method from PDF::Core::Page
  #
  # The prawn-templates gem relies on the new_content_stream method on
  # PDF::Core::Page, which was removed in pdf-core 0.3.1. prawn-templates is
  # used for importing a single-page PDF into the current document.
  #
  # see https://github.com/prawnpdf/pdf-core/commit/67f9a08a03bcfcc5a24cf76b135c218d3d3ab05d
  def new_content_stream
    return if in_stamp_stream?
    unless ::Array === dictionary.data[:Contents]
      dictionary.data[:Contents] = [content]
    end
    @content = document.ref({})
    dictionary.data[:Contents] << document.state.store[@content]
    document.renderer.open_graphics_state
  end unless respond_to? :new_content_stream
end
end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
asciidoctor-pdf-1.5.0.alpha.12 lib/asciidoctor-pdf/pdf_core_ext/page.rb
asciidoctor-pdf-1.5.0.alpha.11 lib/asciidoctor-pdf/pdf_core_ext/page.rb
asciidoctor-pdf-1.5.0.alpha.10 lib/asciidoctor-pdf/pdf_core_ext/page.rb
asciidoctor-pdf-1.5.0.alpha.9 lib/asciidoctor-pdf/pdf_core_ext/page.rb