Integrations

PDF Ink fluidly integrates with WooCommerce, Easy Digital Downloads, and Download Monitor. If you are using one of these e-commerce solutions and wish to manipulate your PDF files (or PDFs inside ZIP archives), you are in luck!

Integrations Settings Panel

The PDF Ink settings panel has an “Integrations” tab which will take you to a panel where you can turn on your integration. For example, to integrate with WooCommerce, first make sure you have activated the WooCommerce, plugin, then navigate to WP Menu -> PDF Ink -> Integrations.

At the top of the page is a list of sections. They are:

WP Media Uploads

Use these settings if you want PDF files to be stamped and/or passworded upon UPLOAD to your WordPress Media Library. As the settings panel says, use prudently!

We say “use prudently,” because if you leave this box checked and forget it, all your PDFs will continue to be stamped upon upload (possibly confusing future site administrators). This feature certainly has its uses, but for many users, the PDF Ink Sandbox is an equally handy place to manipulate files on-the-fly.

WooCommerce Setup

In the “WooCommerce + PDF Ink” square, check the box to “Integrate with WooCommerce.” If you plan on manipulating most or all of your PDF files, go ahead and check the next checkbox which says “Check to manipulate all PDFs.” If there are files you wish to exclude, those can be excluded in your WooCommerce per-product (or per-variation) PDF Ink settings.

Conversely, if you only wish to manipulate a couple or a few of very many files, you might leave the “Check to manipulate all PDFs” checkbox UN-checked, and then head over to your Woo per-product or per-variation settings to turn PDF Ink on only for those files. There are also ways to include/exclude files using filter hooks, but we’ll leave that for your development team.

To quickly turn on WooCommerce + PDF Ink, go to “Integrations” in the PDF Ink side menu (in black) scroll to WooCommerce + PDF Ink, and check both boxes. If you don’t want to stamp every PDF, you can go to the PDF WooCommerce product page, and turn on stamping in the PDF Ink metabox there.

Integration settings are very similar for Easy Digital Downloads and Download Monitor. Once you have turned on WooCommerce in the Integration settings, go to Frontend settings to arrange how your files will be handled. Continue reading to learn about more granular control of file handling.

WooCommerce Per-Product Settings

Each WooCommerce product and product variation has its own PDF Ink settings. This is useful for if you have some products needing to be marked or passworded differently, or excluded. Navigate to the product edit page, then down to the menu where price and attributes are set. If you are using Gutenberg (WordPress block editor) you will want to temporarily disable that in order to see the PDF Ink per-product settings.

Make sure your product is “Downloadable” so that the PDF Ink tab shows, then click the PDF Ink tab.
Clicking the PDF Ink tab (1) will open a panel where Frontend settings can be overwritten (2). Choose to either stamp this product’s file(s) differently, or not at all (3).

The graphic above shows the settings panel for a Simple WooCommerce product. When the “Check to override global PDF Ink settings” checkbox is checked, you will be given a choice to either override frontend settings, or forego manipulating this product’s files.

WooCommerce Product Variation Settings

PDF settings can be further narrowed down using product variation settings, if your product has variations. Open the “Variations” tab in the product editor and at the foot of each variation row, you will find PDF Ink settings. Check the override checkbox then choose between manipulate or skip:

If you have very many files and wish to manipulate/skip in bulk without dealing with settings panels, this can be done using filter hooks based on filters like product name, SKU, product category etc. Get in touch with us for advice.

WooCommerce Plugin Compatibility

PDF Ink is compatible with the third-party “Free Downloads WooCommerce” plugin – shoot out watermarked PDFs straight from the product page! It is also compatible with the third-party “WooCommerce Bulk Downloads” plugin, which allows you to stamp PDFs before ZIP archiving them.

Watermark files stored on remote servers (compatible with WooCommerce Amazon S3 and WooCommerce Dropbox)

PDF Ink is also capable of opening ZIP files and seeking PDFs inside to stamp, stamping, and then re-zipping before delivery. Read more on ZIP file watermarking below.

Easy Digital Downloads

PDF Ink is compatible with the EDD Free Downloads and EDD All Access extensions.

PDF Ink allows for stamping PDF files hosted on AWS in conjunction with the Easy Digital Downloads – Amazon S3 extension. It allows for stamping PDF files hosted at Dropbox in conjunction with the Easy Digital Downloads Dropbox extension.

Easy Digital Downloads retains a legacy setting for file control which you will notice in the Integrations panel. That textarea can be used to exempt files, or the per-download settings metaboxes can be used for granular control of file manipulation. This nuance is explained in the Easy Digital Downloads + PDF Ink settings box in the Integration + EDD settings area.

Adobe SDK for PDF Embeds

It is also possible to integrate PDF Ink with the Adobe SDK API to embed customized PDF files on your web pages. Learn more about Adobe SDK Integration.

ZIP File Handling

If you have PDF files inside ZIP archives and would like those to be passworded/watermarked, you can set that up in the “Zip File Handling” section of the Integrations settings panel. Your zip files will be unzipped, PDF files will be sought out and manipulated, and then the whole thing will be zipped back up.

EPUB File Stamping

EPUB file stamping for WooCommerce, Easy Digital Downloads, and Download Monitor arrived with version 1.1.0 of PDF Ink.

This was a long time coming, but we wanted to make sure we had the bandwidth to properly support EPUB. It’s great how now you can use PDF Ink to cover two ebook formats: EPUB and PDF. We plan to add MOBI by the end of the year.

EPUB coverage is simple, but then again, EPUB is simple. Generally, for ebooks, each chapter — not each page — is an XHTML file. PDF Ink can add content to the XHTML files, meaning each chapter or section can have a stamp. Since some EPUBs reflow and others do not, results may vary. You should play around with the settings until you have happy results.

EPUB Setup Settings

In order to set up EPUB in PDF Ink, go to the PDF Ink -> Integrations settings panel and scroll down to the EPUB File Stamping section.

Screenshot of PDF Ink EPUB setup settings, with on/off switch and textarea to list files to include (or inversely omit)

In order to allow PDF Ink to watermark your EPUB files, you will need to check the “EPUB Integration” checkbox. The following text area, named “Exclusions” can be used to exclude specific EPUB files if the checkbox is checked. Alternatively if you only want to mark a couple of your many, many EPUB files, it might be wiser to leave the checkbox unchecked, and name your files in the “Exclusions” box.

If you want to exclude ranges of files based on naming patterns, you can use GREP. Otherwise, if you want to roll up your sleeves and include/exclude files based on more complex decisions having to do with product, order or customer data, you can use PDF Ink filter hooks, namely pdfink_filter_skip_epub.

EPUB Stamp Content

In the screenshot below, we have an XHTML watermark that will have the buyers first and last name on one line, their email on the next, and the order date on the final line. Because we have chosen to use XHTML for our mark, there is an issue, though. Can you spot the problem?

screenshot of PDF Ink EPUB content setting field with XHTML, but there is a slight error because one -br- tag is not closed.

The problem is: the second <br> tag is not closed. It should be <br/> in order to be inserted inline into the EPUB XHTML without causing errors. EPUB files must be 100% valid XHTML. So, that’s to say, if you check the “Are you using XHTML in your EPUB” checkbox, make SURE any XHTML you use in your content is valid XHTML. Your XHTML will be inlined in the EPUB <body>, and if it is invalid, your EPUB will break.

If you prefer to just add a string of text without using XHTML, it will be added to the PDF using the CSS content property instead.

EPUB Font, Size, Color, Style and Position

Below the XHTML shows as corrected, and we can see the remaining settings.

Screenshot showing the PDF Ink EPUB stamping settings as well as the font, color, size, opacity, and placement settings.

We can see the stamp will be placed on the bottom of each EPUB section on the center, in Futura font size 16, very dark green color, and italic. We chose Futura in this case because that font is embedded with the EPUB. (We know that because we composed the EPUB.)

If we desired an invisible mark, we could set the Font Opacity to zero (0). This is desirable in cases where you don’t want your end user to know that their EPUB has been stamped. A quick forensic glance into the stamped EPUB’s XHTML files (or CSS) would find the stamp content, if need be.