Class: String
Direct Known Subclasses
Asciidoctor::PDF::ThemeLoader::HexColorValue, Asciidoctor::PDF::ThemeLoader::TransparentColorValue, FormattedString
Instance Method Summary collapse
-
#as_pdf ⇒ Object
If the string is ASCII only, convert it to a PDF LiteralString object.
- #pred ⇒ Object
-
#to_pdf_object ⇒ Object
Convert the string to a serialized PDF object.
Instance Method Details
#as_pdf ⇒ Object
If the string is ASCII only, convert it to a PDF LiteralString object. Otherwise, return self.
13 14 15 |
# File 'lib/asciidoctor/pdf/ext/core/string.rb', line 13 def as_pdf ascii_only? ? (::PDF::Core::LiteralString.new encode ::Encoding::ASCII_8BIT) : self end |
#pred ⇒ Object
4 5 6 7 8 9 10 |
# File 'lib/asciidoctor/pdf/ext/core/string.rb', line 4 def pred # integers (Integer self).pred.to_s rescue ::ArgumentError # chars (upper alpha, lower alpha, lower greek) ([65, 97, 945].include? ord) ? '0' : ([ord - 1].pack 'U1') end |
#to_pdf_object ⇒ Object
Convert the string to a serialized PDF object. If the string can be encoded as ASCII-8BIT, first convert it to a PDF LiteralString object.
19 20 21 |
# File 'lib/asciidoctor/pdf/ext/core/string.rb', line 19 def to_pdf_object ::PDF::Core.pdf_object as_pdf end |