Class IccBasedColorSpace


  • public class IccBasedColorSpace
    extends ColorSpace
    • Method Detail

      • create

        public static IccBasedColorSpace create​(Document targetDocument,
                                                Stream profile)
                                         throws java.io.IOException,
                                                UnknownFormatException,
                                                CorruptException

        Create an new ICC-based color space from an ICC color profile.

        The returned color space object is not yet used on any page, but it is associated with the given target document.
        Parameters:
        targetDocument - the output document with which the returned object is associated
        profile - the color profile data stream
        Returns:
        newly created color profile object
        Throws:
        java.io.IOException - Error reading from the profile or writing to the document
        UnknownFormatException - The profile data has an unknown format
        CorruptException - The profile data is corrupt
        java.lang.IllegalArgumentException - if the targetDocument argument has already been closed
        java.lang.IllegalArgumentException - if the targetDocument argument is read-only
        java.lang.IllegalArgumentException - if the profile argument is null
        java.lang.IllegalArgumentException - if targetDocument is null
        java.lang.IllegalArgumentException - if profile is null
      • copy

        public static IccBasedColorSpace copy​(Document targetDocument,
                                              IccBasedColorSpace colorSpace)
                                       throws java.io.IOException,
                                              CorruptException,
                                              ConformanceException

        Copy an ICC-based color space

        Copy an ICC-based color space object from an input document to the given targetDocument. The returned object is associated with the given target document but not yet part of it.
        Parameters:
        targetDocument - the output document with which the returned object is associated
        colorSpace - an ICC-based color space of a different document
        Returns:
        the copied color space, associated with the current document.
        Throws:
        java.io.IOException - Error reading from the source document or writing to the target document
        CorruptException - The source document is corrupt
        ConformanceException - The conformance level of the source document is not compatible with the conformance level of the target document.
        java.lang.IllegalArgumentException - if the targetDocument argument has already been closed
        java.lang.IllegalArgumentException - if the targetDocument argument is read-only
        java.lang.IllegalArgumentException - if the colorSpace object is not associated with an input document
        java.lang.IllegalArgumentException - if the document associated with colorSpace has already been closed
        java.lang.IllegalArgumentException - if targetDocument is null
        java.lang.IllegalArgumentException - if colorSpace is null