new SVGOutputOptions()
An object containing options for ToSvg functions
Methods
-
setAnnots(annots)
-
Control generation of form fields and annotations in SVG.
Parameters:
Name Type Description annots
boolean if false, no form fields or annotations are converted. Default is true Returns:
this object, for call chaining -
setCompress(svgz)
-
Compress output SVG files using SVGZ.
Parameters:
Name Type Description svgz
boolean if true, SVG files are written in compressed format. Default is false. Returns:
this object, for call chaining -
setCreateXmlWrapper(xml)
-
Create a XML document that contains metadata of the SVG document created.
Parameters:
Name Type Description xml
boolean if true, XML wrapper is created. Default is true. Returns:
this object, for call chaining -
setDtd(dtd)
-
Set whether the DTD declaration is included in the SVG files.
Parameters:
Name Type Description dtd
boolean if false, no DTD is added to SVG files. Default is true. Returns:
this object, for call chaining -
setEmbedFonts(embed_fonts)
-
Sets whether to embed fonts into each SVG page file, or to have them shared.
Parameters:
Name Type Description embed_fonts
boolean 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. Returns:
this object, for call chaining -
setEmbedImages(embed_images)
-
Sets whether to embed all images
Parameters:
Name Type Description embed_images
boolean if true, images will be embedded. Default is false. Returns:
this object, for call chaining -
setFlattenContent(flatten)
-
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.
Parameters:
Name Type Description flatten
number PDFNet.Convert.FlattenFlag = { e_off : 0 e_simple : 1 e_fast : 2 e_high_quality : 3 }
Returns:
this object, for call chaining -
setFlattenDPI(dpi)
-
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.
Parameters:
Name Type Description dpi
number the resolution in Dots Per Inch Returns:
this object, for call chaining -
setFlattenMaximumImagePixels(max_pixels)
-
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.
Parameters:
Name Type Description max_pixels
number the maximum number of pixels an image can have Returns:
this object, for call chaining -
setFlattenThreshold(threshold)
-
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.
Parameters:
Name Type Description threshold
number PDFNet.PDFNet.Convert.FlattenThresholdFlag = { e_very_strict : 0 e_strict : 1 e_default : 2 e_keep_most : 3 e_keep_all : 4 }
Returns:
this object, for call chaining -
setIndividualCharPlacement(individual_char_placement)
-
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
Parameters:
Name Type Description individual_char_placement
boolean if true, text will be positioned correctly Returns:
this object, for call chaining -
setNoFonts(no_fonts)
-
Sets whether to disable conversion of font data to SVG
Parameters:
Name Type Description no_fonts
boolean if true, font data conversion is disabled. Default is false. Returns:
this object, for call chaining -
setNoUnicode(no_unicode)
-
Sets whether to disable mapping of text to public Unicode region. Instead text will be converted using a custom encoding
Parameters:
Name Type Description no_unicode
boolean if true, mapping of text to public Unicode region is disabled Returns:
this object, for call chaining -
setOutputThumbnails(include_thumbs)
-
Sets whether per page thumbnails should be included in the file. Default is true.
Parameters:
Name Type Description include_thumbs
boolean if true thumbnails will be included Returns:
this object, for call chaining -
setOverprint(op)
-
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.
Parameters:
Name Type Description op
number PDFNet.PDFRasterizer.OverprintPreviewMode = { e_op_off : 0 e_op_on : 1 e_op_pdfx_on : 2 }
e_op_on: always enabled; e_op_off: always disabled; e_op_pdfx_on: enabled for PDF/X files only.Returns:
this object, for call chaining -
setRemoveCharPlacement(remove_char_placement)
-
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
Parameters:
Name Type Description remove_char_placement
boolean if true, the output of character positions is disabled Returns:
this object, for call chaining -
setSvgFonts(svg_fonts)
-
Sets whether to convert all fonts to SVG or not.
Parameters:
Name Type Description svg_fonts
boolean if true, fonts are converted to SVG. Otherwise they are converted to OpenType. Default is false. Returns:
this object, for call chaining -
setThumbnailSize(size)
-
The maximum dimension for thumbnails.
Parameters:
Name Type Description size
number the maximum dimension (width or height) that thumbnails will have. Default is 400. Returns:
this object, for call chaining