DocumentGetSvgOptions Enumeration (original) (raw)

(1) Indicates that all text is replaced by path elements.

ForceTextPath and ForceRealText can be used to control how the toolkit treats any text elements found in the source document when GetSvg or GetSvgUrl is called.

Text found in the source document are usually converted to text elements with the appropriate font family name, size and style. If the resulting SVG file is then viewed in the system that does not have this font installed, it might get substituted by an equivalent font by the viewer (such as, a web browser). This may result in the resulting SVG file not matching the original document 100%.

Also, some PDF files are encoded in a way where the text element have completely different characters than what appears on the screen due to the PDF font embedding feature. This is used by many PDF files as a form of protection against copying/pasting the content from a viewer. The PDF file may contain some text that can be viewed correctly using real text elements and then some text that cannot.

Rasterizing these PDF documents is not a problem since the engine will draw the font from the internal data found in the PDF into the destinations surface at load time.

For text that cannot be viewed correctly as SVG using text elements, a workaround is to replace the text with path elements that 100% match the data found in the file. This results in an SVG file that 100% matches the original document but may increase the size of the SVG data and of course the text itself is lost and cannot be obtained from the SVG.

When the values of ForceTextPath and ForceRealText are both false (the default values), the engine works in Auto mode. Here, the toolkit will replace only the text that is not guaranteed to be viewable by path elements. This is the recommended loading a PDF file as SVG for viewing purposes.

When ForceTextPath is used in the options, then all text is replaced by path elements. This guarantees that the resulting SVG will match the source document 100%. Naturally, this result in an SVG file that does not have any text elements to parse. This may result in larger SVG data and should be used when exact match of the source document and what is being viewed is absolutely needed.

When ForceRealText is used in the options, then all text is converted into text elements by the engine. This mode is suitable when the SVG is obtained for text searching.

Both ForceTextPath and ForceRealText are only used when loading PDF files.