Skip to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Add SVG to PDF pages as vector graphics in FileMaker

Featured Replies

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.

DynaPDF-SVG-FileMaker.jpg

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 document
Set Variable [ $pdf ; Value: MBS("DynaPDF.New") ]
Set Variable [ $r ; Value: MBS("DynaPDF.AppendPage"; $pdf) ]
#
# Load SVG
Set Variable [ $r ; Value: MBS("DynaPDF.LoadSVG"; $pdf; SVG::SVG) ]
#
# Place the image
Set 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 save
Set 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.

  • 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

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.