Yesterday at 11:57 AM1 day With the recent DynaPDF update 5.0.4, you can place SVG drawings on a page in a PDF document. By converting all SVG drawing commands into PDF drawing commands, the graphics is preserved as a vector graphics. This avoids any pixelation that a bitmap graphics would have.You can load a SVG from file with DynaPDF.LoadSVGFile or with container (DynaPDF.LoadSVG. Then query the sizes and insert the graphics to the current open page in a PDF document with DynaPDF.InsertSVG. There you pass a rectangle and optional the name of the symbol.When you insert a SVG into a PDF page, you can change the size of the drawing by passing a different width and height. You can pick the position where to place and apply transformations if needed. This allows you to rotate the drawing, mirror it or stretch it in one or both axes. You can use SVG drawings for templates and stamp annotations.Some SVG files have multiple drawings, so you can use DynaPDF.GetSVGSymbolCount function to query the count. Then check the internal name of the drawing with DynaPDF.GetSVGSymbolName function. Or use DynaPDF.GetSVGSymbolNames to list all names. Once you have a name, you can pass it to DynaPDF.InsertSVG for the symbol id parameter.Here is a sample script:# Start new PDF documentSet Variable [ $pdf ; Value: MBS("DynaPDF.New") ]Set Variable [ $r ; Value: MBS("DynaPDF.AppendPage"; $pdf) ]# # Load SVGSet Variable [ $r ; Value: MBS("DynaPDF.LoadSVG"; $pdf; SVG::SVG) ]# # Place the imageSet Variable [ $width ; Value: 500 ]Set Variable [ $Height ; Value: 0 // automatic ]Set Variable [ $r ; Value: MBS("DynaPDF.InsertSVG"; $pdf; 0; 0; $width; $height) ]# # close page and saveSet Variable [ $r ; Value: MBS("DynaPDF.EndPage"; $pdf) ]Set Field [ MyTable::ContainerField; MBS( "DynaPDF.Save"; $pdf; "report.pdf" ) ]Set Variable [ $r ; Value: MBS("DynaPDF.Release"; $pdf) ]If something goes wrong while drawing a SVG, the error is logged. You can use DynaPDF.ErrLogMessage to get the list of issues. That may be a font missing or an unsupported operation.We did have GraphicsMagick functions to render a SVG to a bitmap picture and save it as PNG or JPEG. Using PNG allowed to preserve transparency.Please try the example file included with MBS FileMaker Plugin 16.4.
Yesterday at 12:44 PM1 day Newbies You can add SVG files to PDF pages as true vector graphics in Claris FileMaker by using the Monkeybread Software (MBS) FileMaker Plugin (version 16.4 or newer) paired with DynaPDF update 5.0.4.
Create an account or sign in to comment