Sha256: 93dacc3e789c44c19387910a3343ca885baad113bfa52771264edd1cf0db59c1

Contents?: true

Size: 716 Bytes

Versions: 6

Compression:

Stored size: 716 Bytes

Contents

module Asciidoctor
module Pdf
class Pdfmarks
  def initialize doc
    @doc = doc
  end

  def generate
    current_datetime = ::DateTime.now.strftime '%Y%m%d%H%M%S'
    doc = @doc
    content = <<-EOS
[ /Title (#{doc.doctitle sanitize: true, use_fallback: true})
  /Author (#{doc.attr 'authors'})
  /Subject (#{doc.attr 'subject'})
  /Keywords (#{doc.attr 'keywords'})
  /ModDate (D:#{current_datetime})
  /CreationDate (D:#{current_datetime})
  /Creator (Asciidoctor PDF #{::Asciidoctor::Pdf::VERSION}, based on Prawn #{::Prawn::VERSION})
  /Producer (#{doc.attr 'publisher'})
  /DOCINFO pdfmark
    EOS
    content
  end

  def generate_file pdf_file
    ::IO.write %(#{pdf_file}marks), generate
  end
end
end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
asciidoctor-pdf-1.5.0.alpha.6 lib/asciidoctor-pdf/pdfmarks.rb
asciidoctor-pdf-1.5.0.alpha.5 lib/asciidoctor-pdf/pdfmarks.rb
asciidoctor-pdf-1.5.0.alpha.4 lib/asciidoctor-pdf/pdfmarks.rb
asciidoctor-pdf-1.5.0.alpha.3 lib/asciidoctor-pdf/pdfmarks.rb
asciidoctor-pdf-1.5.0.alpha.2 lib/asciidoctor-pdf/pdfmarks.rb
asciidoctor-pdf-1.5.0.alpha.1 lib/asciidoctor-pdf/pdfmarks.rb