As you may know we have a great Optimize command for DynaPDF. You can use it on PDF documents in both FileMaker and Xojo plugins. Over time the command got more and more powerful and we like to write here about some of the features.
In general the function rebuilds the content stream of all pages, templates, patterns, annotations, and form fields. This may remove errors in the content stream and produce a consistent document.
When you specify the flags, the default flag value (0) just rebuilds the content stream and fixes errors. You may specify "InMemory" to have changes made in a way, that the PDF is in memory and not flushed to the current output. Normally you may not notice the difference, but if you like to continue writing to the PDF, the memory flag is needed.
The Optimize function can reduce the file size of PDF files. You can pass the ScaleImages flag and then all images are checked. You can define a minimum and target resolution for images. All pictures with at least the minimum resolution are checked. This avoids that we look on icons for example and only process pictures with a significant resolution. DynaPDF scales the images down to the target resolution and compresses them with the compression algorithm you specify, usually JPEG. If the final picture is smaller in size, we store it, otherwise we keep the original image. The reason is that often one bit tiff images can be smaller than a reduced resolution JPEG file.
You can pass flag SkipMaskedImages to skip masked images as JPEG compression may not work well with pictures, where a specific color is used to mark transparency. The check whether new picture is smaller than original image can be disabled via NoImageSizeCheck flag.
If you like to get images compressed with JBIG2, you can use CompressWithJBIG2 flag. This can drastically reduce the file size since JBIG2 compression achieves much higher compression rates than any other 1 bit image filter that PDF supports. The JBIG2 compression filter in DynaPDF is lossless, that means the original image quality will be preserved. Great to combine with ConvertGrayTo1Bit flag discussed below.
The names for links in the PDF may often have names from the original content. For example our documentation uses the function names there as link names. But this can be optimized with the NewLinkNames flag and rename the internal link names with a running counter. This saves a few bytes for each link, which can sum up with thousands of link names.
Some drawing paths have an no-op operator on the end. Instead of defining a path and not using it, we can remove the definition. This usually happens in a lot of tools to create PDFs, as paths are defined automatically. e.g. you may have a rectangle to group items on the layout and the rectangle is not visible as it has no stroke and no fill. The resulting path is there, but has no output.
If you pass FlattenLayers flag, all the layers may get flattened and non visible layers may get removed. As some layers may have content behind other layers, the invisible paths check above may kick in and remove content.
See also FlattenAnnots and FlattenForm functions.
The PDF may contain additional things, which can safely be removed. This includes private data from applications like Indesign or Adobe Illustrator. Those store details for editing of the PDF with the PDF as a BLOB. We can skip this data and get a smaller PDF size. Usually a PDF viewer will ignore any item it doesn't understand.
We can remove thumbnails embedded in the pictures as those will be generated in the viewer if needed. Same for alternative representations of images. For example an application may include a CMYK and a RGB representation and we can remove one (the one marked as alternative).
Convert to colorspace
Beside optimization, we can do some extra operations like converting colors to other color spaces. This includes converting to grayscale, RGB or CMYK. If you like to convert a PDF to grayscale, converting colors here may be useful. Otherwise if you have to send a PDF to a printer, you can convert to CMYK. Usually you don't need this as the printer will raster the PDF in CMYK color space. Converting CMYK content to RGB may reduce size as images have only 3 instead of 4 color spaces.
The flag ConvertAllColors allows to convert separation, DeviceN and NChannel color spaces to RGB/CMYK colors. This usually means you loose color information as the alternative colors will be used and those are specified in RGB, CMYK or LAB color spaces. For example a printer may have cyan, magenta, yellow, black and a special colors like gold and silver colors. An area marked with a Device color like gold will be printed with the gold ink to produce the shiny effect on the paper. Replacing those colors with their alternative CMYK color will remove that and the color is then printer with a mixture of yellow.
Finally the flag ConvertGrayTo1Bit can be used to convert colors to black and white. For this you can pass UseOtsuFilter flag to request to use Otsu filter.
Convert Text to Outlines
Recently added in the last weeks, DynaPDF can now convert text to outlines. This removes fonts and text information from the PDF and leaves the content as vector graphics. You can still read it as human, but a computer needs OCR to get back text.
Optionally you can pass ConvNonEmbFontsOnly flag to limit the conversion of text to outlines only for non embedded files. This way a PDF referencing fonts on your computer can convert those to outlines. Great to email your PDF to printer shop, where they don't have the required font and you can still get your PDF printed well.
Annotations and form fields are not affected by the conversion. In order to consider these objects too it is possible to flatten all annotations and form fields before calling Optimize. See FlattenAnnots and FlattenForm functions.
The flags above can be combined in various ways. In general Optimize should be called at the end of your PDF processing just before outputting the PDF document. Our plugin may render preview and close the PDF file.
To use the Optimize function, you need a DynaPDF license with Pro or Enterprise level. Starter or Lite versions are not enough.
Without a license key you can test this feature and see how it works.
For more details, please check the DynaPDF manual on the Optimize function. For FileMaker specific notes, please check DynaPDF.Optimize function in our documentation. For Xojo specific things, please check Optimize function in DynaPDFMBS class.
Check also DuplicateCheck flag for SetImportFlags2 function to enable duplication check. This helps to reduce the file size as duplicate font, image, templates and extended graphics state are replaced with references to first one.
Please do not hesitate to contact us with your questions.
Updated internet plug-in is compatible with FileMaker 19 and macOS 11.0
Lienden, the Netherlands, December 18, 2020–Troi today announced the immediate availability of Troi URL Plug-in 7.0 for FileMaker Pro 19. This is a maintenance update which is tested and made compatible with Claris FileMaker Pro 19 and macOS 11.0.
Improvements in Troi URL Plug-in version 7.0
Troi URL Plug-in 7.0 has the following changes and improvements:
Tested and made compatible with Claris FileMaker Pro 19, including FileMaker Pro 19.1.3 and 19.2. Tested and made compatible with macOS 10.15 (Catalina) and macOS 11.0 (Big Sur). Tested and made compatible with Windows 10 version 20H2 (October 2020 Update), version 1909 (November 2019 Update) and version 2004 (May 2020 Update). Added new switch “-ImageFileName” to the TURL_GetLastProperties function, which will return the filename of the last image downloaded. (macOS) Improved compatibility when running FileMaker Pro 19 in dark mode, the flash dialog is now more visible. (macOS) Improved loading the plug-in with runtime apps created with FileMaker Pro 18. (macOS) Modernized the plug-in. It now uses a more modern framework. (macOS) Improved error reporting when there is a problem loading the plug-in. (macOS) If the plug-in can’t load a bundle at start-up, the plug-in will now write a detailed error to the system.log. See the Console.app in this case (search for FileMaker in the system.log). IMPORTANT (macOS only) The minimum supported FileMaker version is now FileMaker Pro 15. Also the minimum supported Mac OS version is now macOS 10.13 (High Sierra). Several other bug fixes and further (security) improvements. Fixed a bug in the TURL_Get function, when getting images a slash could be added at the start of the name of the image, when storing the image in a container. Improved the FillForm.fmp12 example. Modernized the OAuthWebService.fmp12 example. Small cosmetic improvement of the Regifunc.fmp12 example. More detailed information on all changes and improvements can be found on the URL Plug-in page.
You can download the new version there.
Version 7 needs a new registration string. Upgrading to version 7 is free for all customers who bought a license for version 6 on or after March 20, 2019. Eligible users will be sent a new registration code.
Upgrades from older versions are available from US $ 49. You can order upgrades from our shop.
How to transfer document from FileMaker to DocuSign via Claris connect?
I updated my SwiftFM repo for the FileMaker 19 Data API.
Notable improvements include support for the new `validateSession()`, and moving the server `message` into the completion block. So now you can access the message in the closure, where it's more helpful. Better examples as well. Give it a ⭐️ on GitHub if you find it useful. Thanks! 😘
Everyone talks about IoT. We don't talk, we do. Just like our colleague Milan who wanted to get his greenhouse under control...
As a little boy he grew tomatoes and some herbs in pots on balcony (because we didn’t have a garden at that time). Over time his hobby evolved into growing vegetables in a greenhouse. Since he also likes technology and automation, now many of the repeating processes are controlled by Claris FileMaker, Raspberry Pi, Hardwario, LoRa, Node-RED, etc.
As Milan grew up and got his own garden, he could build a greenhouse there. Thanks to the greenhouse, he can extend the growing season to begin in early spring and last until late fall. But growing vegetables in a greenhouse has its own specifics…
Read more about how he's added modern technology to his greenhouse in Milan's recent artcile.