PTSVGOutputOptions

@interface PTSVGOutputOptions : NSObject

A class containing options for ToSvg functions

  • Creates an SVGOutputOptions object with default settings

    Declaration

    Objective-C

    - (instancetype)init;

    Swift

    init!()
  • Sets whether to embed all images

    Declaration

    Objective-C

    - (void)SetEmbedImages:(BOOL)embed_images;

    Swift

    func setEmbedImages(_ embed_images: Bool)

    Parameters

    embed_images

    if true, images will be embedded. Default is false.

  • Sets whether to disable conversion of font data to SVG

    Declaration

    Objective-C

    - (void)SetNoFonts:(BOOL)no_fonts;

    Swift

    func setNoFonts(_ no_fonts: Bool)

    Parameters

    no_fonts

    if true, font data conversion is disabled. Default is false.

  • Sets whether to convert all fonts to SVG or not.

    Declaration

    Objective-C

    - (void)SetSvgFonts:(BOOL)svg_fonts;

    Swift

    func setSvgFonts(_ svg_fonts: Bool)

    Parameters

    svg_fonts

    if true, fonts are converted to SVG. Otherwise they are converted to OpenType. Default is false.

  • Sets whether to embed fonts into each SVG page file, or to have them shared.

    Declaration

    Objective-C

    - (void)SetEmbedFonts:(BOOL)embed_fonts;

    Swift

    func setEmbedFonts(_ embed_fonts: Bool)

    Parameters

    embed_fonts

    if true, fonts are injected into each SVG page. Otherwise they are created as separate files that are shared between SVG pages. Default is false.

  • Sets whether to disable mapping of text to public Unicode region. Instead text will be converted using a custom encoding

    Declaration

    Objective-C

    - (void)SetNoUnicode:(BOOL)no_unicode;

    Swift

    func setNoUnicode(_ no_unicode: Bool)

    Parameters

    no_unicode

    if true, mapping of text to public Unicode region is disabled

  • Some viewers do not support the default text positioning correctly. This option works around this issue to place text correctly, but produces verbose output. This option will override SetRemoveCharPlacement

    Declaration

    Objective-C

    - (void)SetIndividualCharPlacement:(BOOL)individual_char_placement;

    Swift

    func setIndividualCharPlacement(_ individual_char_placement: Bool)

    Parameters

    individual_char_placement

    if true, text will be positioned correctly

  • Sets whether to disable the output of character positions. This will produce slightly smaller output files than the default setting, but many viewers do not support the output correctly

    Declaration

    Objective-C

    - (void)SetRemoveCharPlacement:(BOOL)remove_char_placement;

    Swift

    func setRemoveCharPlacement(_ remove_char_placement: Bool)

    Parameters

    remove_char_placement

    if true, the output of character positions is disabled

  • Flatten images and paths into a single background image overlaid with vector text. This option can be used to improve speed on devices with little processing power such as iPads. Default is e_fast.

    Declaration

    Objective-C

    - (void)SetFlattenContent:(PTFlattenFlag)flatten;

    Swift

    func setFlattenContent(_ flatten: PTFlattenFlag)

    Parameters

    flatten

    select which flattening mode to use.

  • Used to control how precise or relaxed text flattening is. When some text is preserved (not flattened to image) the visual appearance of the document may be altered.

    Declaration

    Objective-C

    - (void)SetFlattenThreshold:(PTFlattenThresholdFlag)threshold;

    Swift

    func setFlattenThreshold(_ threshold: PTFlattenThresholdFlag)

    Parameters

    threshold

    the threshold setting to use.

  • The output resolution, from 1 to 1000, in Dots Per Inch (DPI) at which to render elements which cannot be directly converted. Default is 140.

    Declaration

    Objective-C

    - (void)SetFlattenDPI:(unsigned int)dpi;

    Swift

    func setFlattenDPI(_ dpi: UInt32)

    Parameters

    dpi

    the resolution in Dots Per Inch

  • Specifies the maximum image slice size in pixels. Default is 2000000.

    Note

    This setting now will no longer reduce the total number of image pixels. Instead a lower value will just produce more slices and vice versa.

    Note

    Since image compression works better with more pixels a larger max pixels should generally create smaller files.

    Declaration

    Objective-C

    - (void)SetFlattenMaximumImagePixels:(unsigned int)max_pixels;

    Swift

    func setFlattenMaximumImagePixels(_ max_pixels: UInt32)

    Parameters

    max_pixels

    the maximum number of pixels an image can have

  • Compress output SVG files using SVGZ.

    Declaration

    Objective-C

    - (void)SetCompress:(BOOL)svgz;

    Swift

    func setCompress(_ svgz: Bool)

    Parameters

    svgz

    if true, SVG files are written in compressed format. Default is false.

  • Sets whether per page thumbnails should be included in the file. Default is true.

    Declaration

    Objective-C

    - (void)SetOutputThumbnails:(BOOL)include_thumbs;

    Swift

    func setOutputThumbnails(_ include_thumbs: Bool)

    Parameters

    include_thumbs

    if true thumbnails will be included

  • The maximum dimension for thumbnails.

    Declaration

    Objective-C

    - (void)SetThumbnailSize:(unsigned int)size;

    Swift

    func setThumbnailSize(_ size: UInt32)

    Parameters

    size

    the maximum dimension (width or height) that thumbnails will have. Default is 400.

  • Create a XML document that contains metadata of the SVG document created.

    Declaration

    Objective-C

    - (void)SetCreateXmlWrapper:(BOOL)xml;

    Swift

    func setCreateXmlWrapper(_ xml: Bool)

    Parameters

    xml

    if true, XML wrapper is created. Default is true.

  • Set whether the DTD declaration is included in the SVG files.

    Declaration

    Objective-C

    - (void)SetDtd:(BOOL)dtd;

    Swift

    func setDtd(_ dtd: Bool)

    Parameters

    dtd

    if false, no DTD is added to SVG files. Default is true.

  • Control generation of form fields and annotations in SVG.

    Declaration

    Objective-C

    - (void)SetAnnots:(BOOL)annots;

    Swift

    func setAnnots(_ annots: Bool)

    Parameters

    annots

    if false, no form fields or annotations are converted. Default is true

  • Enable or disable support for overprint and overprint simulation. Overprint is a device dependent feature and the results will vary depending on the output color space and supported colorants (i.e. CMYK, CMYK+spot, RGB, etc). Default is e_op_pdfx_on.

    Declaration

    Objective-C

    - (void)SetOverprint:(PTOverprintPreviewMode)mode;

    Swift

    func setOverprint(_ mode: PTOverprintPreviewMode)

    Parameters

    op

    e_op_on: always enabled; e_op_off: always disabled; e_op_pdfx_on: enabled for PDF/X files only.