Class ProfileComplianceException

  • All Implemented Interfaces:

    public class ProfileComplianceException
    extends IllegalStateException

    This exception is thrown when an action is not allowed based on the OutputProfile that is applied to the PDF - for example, if the PDF only allows CMYK colors and an attempt is made to add RGB to the page.

    Prior to 2.24.3 this situation resulted in an IllegalStateException - for compatibility this class extends that exception type, but with additional information.

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

      • ProfileComplianceException

        public ProfileComplianceException​(String msg,
                                          OutputProfile.Feature feature,
                                          boolean denied)
        Create a nwe ProfileComplianceException
        msg - the message
        feature - the feature that is disallowed or required
        denied - if true, the feature was denied in the source profile
    • Method Detail

      • setDetail

        public void setDetail​(String detail)
        Set additional detail on the fault.
      • getDetail

        public String getDetail()
        Return any additional detail on the fault.
      • setLocator

        public void setLocator​(Locator locator)
        Set the source of this exception as a Locator. This Locator doesn't have to represent an XML file, it's just a convenient method of storing a filename (the system id), line number and column number.