Class LinearizedException

  • All Implemented Interfaces:

    public class LinearizedException
    extends RuntimeException

    This exception is thrown when there is a problem completing the load of a Linearized PDF. It's a RuntimeException, but usually wraps an IOException and if the PDF has been loaded from a Linearized PDFReader (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.

    See Also:
    PDFReader.setSource(, LoadState, Serialized Form
    • Method Detail

      • isFatal

        public boolean isFatal()
        Return true if the exception is fatal, which indicates the entire PDF object structure must be considered invalid.