Sha256: 639095de90fd83ae4f916ab5a3bae1df1755b18fc8340502f62dc6b4a38d69c2

Contents?: true

Size: 989 Bytes

Versions: 5

Compression:

Stored size: 989 Bytes

Contents

class PDF::Core::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 Hash.new
    dictionary.data[:Contents] << document.state.store[@content]
    document.open_graphics_state
  end unless method_defined? :new_content_stream

  # Restore the imported_page? method from PDF::Core::Page
  #
  # see https://github.com/prawnpdf/pdf-core/commit/0e326a838e142061be8e062168190fae6b3b1dcf
  def imported_page?
    @imported_page
  end unless method_defined? :imported_page?
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
asciidoctor-pdf-1.5.0.beta.1 lib/asciidoctor-pdf/pdf-core_ext/page.rb
asciidoctor-pdf-1.5.0.alpha.18 lib/asciidoctor-pdf/pdf-core_ext/page.rb
asciidoctor-pdf-1.5.0.alpha.17 lib/asciidoctor-pdf/pdf-core_ext/page.rb
asciidoctor-pdf-1.5.0.alpha.16 lib/asciidoctor-pdf/pdf-core_ext/page.rb
asciidoctor-pdf-1.5.0.alpha.15 lib/asciidoctor-pdf/pdf-core_ext/page.rb