Here’s an example file you can use to print web viewers in FileMaker 16. We use DayBack Calendar as an example, but you can use these scripts in your own file too. The scripts manage the window sizing which can make printing web viewers tricky. They also use the free ScriptMaster plugin to make PDFs for printing since FileMaker 16 no longer supports printing web viewer content on Mac.
In FileMaker 16, we lost the ability to print the web viewer, whether using Preview mode or Save/Send As PDF. This isn’t always an issue: in many cases, it may make more sense to create a dedicated print layout or sub-summary report to print calendar data. Often this is the only way to print all the text of an event. But sometimes it is best to print web viewer itself. For example, DayBack’s Month, Horizon, and other views would be too tough to replicate without the web viewer for printing.
Thanks to different plugins, we actually can print the web viewer in 16 — by taking screenshots. Once a screenshot is taken, you can insert it into a container field and Preview Mode and Save As PDF will have no trouble printing that image in a container. (Thanks to the FileMaker community at this thread for providing the idea to use screenshot functions as a workaround to printing the web viewer in FM16!)
Here’s a video of this in action:
If you’d like to grab that file and get to work, here it is: DayBack_PrintWebviewerExample
Printing FileMaker Web Viewers: Looking Closer
And here’s a closer look at the first script shown in that video:
Note: The screenshot function used in this script comes standard with the (free) ScriptMaster plugin. The demo file includes a script to initialize the screenshot function on startup, but to use the screenshot functionality, you’ll need to have the ScriptMaster plugin installed. Other plugins also offer screenshot functions, so they could be used instead. Once the plugin is installed, set the script below to run at the end of DayBack’s “Upon Opening” script to initialize the screen capture function. (You’ll find both these scripts in our example file.)
The simple print script above is great because it will print DayBack’s web viewer just as it appears for the user in their open window. But we can be more precise than this. By opening a new window, we can size the window to an exact ratio that will fill our container on the print layout. We can also take advantage of larger screens to capture higher resolution screenshots. The “Print Calendar [ Step ]” script in the example file does just that, but puts an upper limit on the window size, so that objects don’t appear too small when the screenshot is generated on a large screen.
Because the script is dynamically sizing the screen capture window, it also accounts for menu bar heights and window chrome, which are different between Mac and Windows. Also, hi-res monitors may have a different “screen scale factor”, which means the width/height point values in FileMaker will not be equal to the pixel values used by the screen capture function. So, on Windows, we need to adjust the capture width and height by Get ( ScreenScaleFactor ).
At the end of the video above, we show a custom print script that loops through all the events in a project and prints as many months as are required. It then uses the ScriptMaster plugin to stitch these into a single PDF. We use ScriptMaster a lot for assembling complex PDFs; if you need this kind of help, we’re happy to make scripts like this for you too as part of custom work. Please get in touch if you’d like to know more.
And if you think it’s weird that FileMaker 16 lost the ability to print web viewers on Mac, you’re not alone. Here’s a feature request where folks are asking FMI to standardize on a way of rendering web content across platforms. Even without a standard for both Mac and Windows, FMI could forestall moving to the latest WebKit if critical features were missing. Up-vote this if you agree: https://community.filemaker.com/ideas/1850 =)