Class LinearizedException
- java.lang.Object
-
- java.lang.Throwable
-
- java.lang.Exception
-
- java.lang.RuntimeException
-
- org.faceless.pdf2.LinearizedException
-
- All Implemented Interfaces:
java.io.Serializable
public class LinearizedException extends java.lang.RuntimeException
This exception is thrown when there is a problem completing the load of a Linearized PDF. It's a
RuntimeException
, but usually wraps anIOException
and if the PDF has been loaded from a LinearizedPDFReader
(usually from a URL) then potentially it can be thrown at any time throughout the life of the PDF.As an example, say the PDF is Linearized and has a valid structure, but the second page is damaged. The PDF constructor will complete and the first page can be accessed without exception, but requesting the second page will cause a load and at this point the API determines the file is damaged. Because the PDF object structure has already been created (and possibly even modified by the user), it's impossible to repair at this point. So we will throw a
LinearizedException
and the PDF object must be discarded.This is an inevitable consequence of using a Linearized load. If there is any doubt about the documents structure, Linearized loading should not be used.
For documents not loaded using linearization this Exception will never be thrown.
- Since:
- 2.14
- See Also:
PDFReader.setSource(java.net.URL)
,LoadState
, Serialized Form
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
isFatal()
Return true if the exception is fatal, which indicates the entire PDF object structure must be considered invalid.
-