Exception: HexaPDF::MalformedPDFError
- Defined in:
- lib/hexapdf/error.rb
Overview
Raised when the PDF is invalid and can’t be read correctly.
Instance Attribute Summary collapse
-
#pos ⇒ Object
readonly
The byte position in the PDF file where the error occured.
Instance Method Summary collapse
-
#initialize(message, pos:) ⇒ MalformedPDFError
constructor
Creates a new malformed PDF error object for the given exception message.
-
#message ⇒ Object
:nodoc:.
Constructor Details
#initialize(message, pos:) ⇒ MalformedPDFError
Creates a new malformed PDF error object for the given exception message.
The byte position where the error occured has to be given via the pos
argument.
48 49 50 51 |
# File 'lib/hexapdf/error.rb', line 48 def initialize(, pos:) super() @pos = pos end |
Instance Attribute Details
#pos ⇒ Object (readonly)
The byte position in the PDF file where the error occured.
43 44 45 |
# File 'lib/hexapdf/error.rb', line 43 def pos @pos end |
Instance Method Details
#message ⇒ Object
:nodoc:
53 54 55 |
# File 'lib/hexapdf/error.rb', line 53 def # :nodoc: "PDF malformed around position #{pos}: #{super}" end |