Class: Typst::Pdf

Inherits:
Base
  • Object
show all
Defined in:
lib/typst.rb

Instance Attribute Summary collapse

Attributes inherited from Base

#font_paths, #input, #root

Instance Method Summary collapse

Methods inherited from Base

from_s, from_zip, #write

Constructor Details

#initialize(input, root: ".", font_paths: []) ⇒ Pdf

Returns a new instance of Pdf.



79
80
81
82
# File 'lib/typst.rb', line 79

def initialize(input, root: ".", font_paths: [])
  super(input, root: root, font_paths: font_paths)
  @bytes = Typst::_to_pdf(self.input, self.root, self.font_paths, File.dirname(__FILE__))
end

Instance Attribute Details

#bytesObject

Returns the value of attribute bytes.



77
78
79
# File 'lib/typst.rb', line 77

def bytes
  @bytes
end

Instance Method Details

#documentObject



84
85
86
# File 'lib/typst.rb', line 84

def document
  bytes.pack("C*").to_s
end