archi-scripting-plugin
archi-scripting-plugin copied to clipboard
Feature Request: Text clipping workaround for .renderViewToPDF()
Hello! Is it possible to add Text clipping workaround as a parameter of .renderViewToPDF() function? I'm using jArchi script for batch PDF export and need this parameter to fix issues with missing part of last character of some texts.
Thanks! David
This can happen with certain fonts. In the meantime you could try a different font. I'll add this one to the list.
Thank you!
For the next version of jArchi we will support a map of options for the SVG and PDF image export.
The current API for SVG and PDF is:
$.model.renderViewAsSVGString(view, setViewBox)
$.model.renderViewToSVG(view, filePath, setViewBox)
$.model.renderViewToPDF(view, filePath)
We can add extra functions that take a map of options in the arguments:
$.model.renderViewAsSVGString(view, options)
$.model.renderViewToSVG(view, filePath, options)
$.model.renderViewToPDF(view, filePath, options)
Examples:
var svgOptions = {setViewBox: true, viewBoxBounds: "0 0 1000 200", textAsShapes: false, embedFonts: true, textOffsetWorkaround: true};
var svgString = $.model.renderViewAsSVGString(view, svgOptions);
$.model.renderViewToSVG(view, "pathTo/test.svg", svgOptions);
var pdfOptions = {textAsShapes: false, embedFonts: true, textOffsetWorkaround: true};
$.model.renderViewToPDF(view, "pathTo/test.pdf", pdfOptions);
Each option can be omitted if required so you can set just one or two options. The defaults are:
setViewBox: true (this option applies only to SVG export)
viewBoxBounds: null (this option applies only to SVG export)
textAsShapes: true
embedFonts: false
textOffsetWorkaround: false