PTImageSettings

@interface PTImageSettings : NSObject

A class that stores downsampling/recompression settings for color and grayscale images.

  • create an ImageSettings object with default options

    Declaration

    Objective-C

    - (instancetype)init;

    Swift

    init!()
  • Sets the maximum and resampling dpi for images. By default these are set to 144 and 96 respectively.

    Declaration

    Objective-C

    - (void)SetImageDPI:(double)maximum resampling:(double)resampling;

    Swift

    func setImageDPI(_ maximum: Double, resampling: Double)

    Parameters

    maximum

    the highest dpi of an image before it will be resampled

    resampling

    the image dpi to resample to if an image is encountered over the maximum dpi

  • Sets the output compression mode for this type of image The default value is e_retain

    Declaration

    Objective-C

    - (void)SetCompressionMode:(PTCompressionMode)mode;

    Swift

    func setCompressionMode(_ mode: PTCompressionMode)

    Parameters

    mode

    the compression mode to set

  • Sets the downsample mode for this type of image The default value is e_default which will allow downsampling of images

    Declaration

    Objective-C

    - (void)SetDownsampleMode:(PTDownsampleMode)mode;

    Swift

    func setDownsampleMode(_ mode: PTDownsampleMode)

    Parameters

    mode

    the downsample mode to set

  • Sets the quality for lossy compression modes from 1 to 10 where 10 is lossless (if possible) the default value is 5

    Declaration

    Objective-C

    - (void)SetQuality:(unsigned int)quality;

    Swift

    func setQuality(_ quality: UInt32)
  • Sets whether recompression to the specified compression method should be forced when the image is not downsampled. By default the compression method for these images will not be changed.

    Declaration

    Objective-C

    - (void)ForceRecompression:(BOOL)force;

    Swift

    func forceRecompression(_ force: Bool)

    Parameters

    force

    if true the compression method for all images will be changed to the specified compression mode

  • Sets whether image changes that grow the PDF file should be kept. This is off by default.

    Declaration

    Objective-C

    - (void)ForceChanges:(BOOL)force;

    Swift

    func forceChanges(_ force: Bool)

    Parameters

    force

    if true all image changes will be kept.