Skip to content
PDF Ink Watermark. Encrypt. Password.
Menu
  • Home
  • Docs
  • Blog
  • Contact
Download   Search Account
Download
Account

Tag: Snippets

Pull Order Data from WooCommerce and Stamp Your PDFs – with VAT Info

January 29th, 2026

If you run a WooCommerce shop that sells digital goodies like e‑books, manuals, or templates in PDF format, you already know how satisfying it is to watch a customer click “Download.” Imagine taking that moment a step further: each PDF leaves the checkout with a tiny, personalized imprint—perhaps their name and email, order number, copyright notice, or timestamp—right on (or hidden inside) the file. Not only does this add a professional touch, it helps you prove ownership, deter piracy, and keep tidy records. PDF Ink allows for adding quite a bit of customer data easily using magic tags. There is no magic tag for VAT, but using a little code, we can and add a […]

Read more »

Snippets WooCommerce

Rewrite PDF Links on the Fly

December 3rd, 2025

When you pair SetaPDF‑Stamper with PDF Ink, a whole new world of “smart PDFs” opens up. Imagine every external link inside a downloadable PDF guide instantly morphing into a personalized gateway—complete with affiliate codes, UTM tags, or a secret user token—without ever touching the original source file. With just a few lines of PHP, you can walk the document’s page tree, sniff out each PDF UriAction, and splice a custom query string onto the URL. We'll show you how.

Read more »

SetaPDF-Stamper Snippets WooCommerce

Block AI from Scraping PDF Content

September 20th, 2025

PDF metadata can signal a request not to scrape content, primarily via the W3C's TDMRep protocol. This functions as a polite request or social contract that compliant AI bots might respect. Malicious or non-compliant scrapers will simply ignore the metadata. To truly block access, technical measures are necessary. Read about using PDF Ink to implement both the "polite request" and technical measures -- and keep AI out of your content!

Read more »

SetaPDF-Stamper Snippets

Use PDF Ink to Embed File Streams in Your PDFs

May 5th, 2025

We often handle a deluge of files for a single project—contracts, spreadsheets, presentations, licenses, and source data all floating around in different emails, shared drives, or chat threads. What if all of that could live in one self-contained PDF “package?” This isn’t just a hypothetical scenario. File stream embedding, an advanced PDF feature, allows businesses to create intelligent, all-in-one digital containers. This approach streamlines workflows, enhances branding and brand loyalty, enhances compliance, and ensures data integrity. The Power of the “All-in-One” Document Below we list some practical, real-world uses for the powerful PDF stream embedding & file attachment capability: User Manuals and Product Information: A product manual PDF can embed supplementary content like software installers, […]

Read more »

SetaPDF-Stamper Snippets WooCommerce

Print Customer’s Choir Ensemble Name on Purchased PDF using WooCommerce Custom Checkout Field

March 12th, 2025

A case study showing how to get a customer's WooCommerce order information printed on their PDF during download, to discourage file sharing & theft. In this case, we have a sheet music distributor who wishes to stamp the purchasing choir name on each page.

Read more »

Magic Tags Snippets WooCommerce

Stamping WooCommerce product variation on PDF

November 13th, 2023

Here is some PHP code for WordPress/WooCommerce which will make PDF Ink recognize TWO custom shortcodes in any watermark content: [VARIATION_DESC] and [VARIATION_NAME]. These translate to variation description and variation name, both aspects of a WooCommerce variable product. This code (everything above the dashed line) should get added anywhere in your functions.php file. If unsure where to put it, add it at the end of the file. You could also add the snippet using the WordPress plugin called “CODE SNIPPETS” (front and back end). This snippet development was sponsored by customer Michael. Thanks Michael! For reference (maybe for people migrating from WaterWoo to PDF Ink) here is a snippet which would have worked with WaterWoo:

Read more »

Magic Tags Snippets WooCommerce

Unique Stamp/Password For Each WooCommerce Product PDF

April 17th, 2023

A customer wrote with a neato request last month. If one WooCommerce product had several PDFs, and wasn’t a variable product, how could each PDF in the list be watermarked differently from the others? There is no setting for that inside PDF Ink because WooCommerce hasn’t exactly made that function easily possible, and also because it somehow hadn’t been requested until last month. That’s sort of amazing considering how long the plugin has been around! Anyway, it was a good request and so we added a filter hook called ‘pdfink_woo_filter_settings‘. (This hook replaces the ‘wwpdf_filter_settings_array’ in WaterWoo PDF Premium, with identical arguments.) Filtering Settings Because WooCommerce — unlike Easy Digital Downloads — doesn’t give a […]

Read more »

Snippets WooCommerce

Different Stamp on First Page of PDF

February 20th, 2023

Brought to you by a longtime user, Jake, is the following snippet, which allows for a different stamp on the first page than all other pages. This is a function for users of TCPDF. PDF Ink loops through each PDF page with TCPDF to apply watermarks. What this PHP code says is that if inside this loop, and we are on the first page (the page indicated as “start_page” in PDF Ink settings), apply the special stamp. For all other pages, business as usual (maybe a different stamp. The code needs to be cut and pasted into your WordPress child theme functions.php file, or maybe using the Code Snippets plugin if you are uncomfortable working […]

Read more »

Snippets

Creating your Own Dynamic PDF Watermarks for WooCommerce

February 15th, 2021

There are quite a few built in shortcodes, but sometimes we just need something… special. You can add your own shortcodes to PDF Ink for on-the-fly customized watermarks on PDF pages. In this simple example we are going to create a shortcode to reflect a customer’s order total (price) in the watermark, when using a custom shortcode: [TOTAL_PRICE] Now when you use [TOTAL_PRICE] in your watermark, the PDF will show the total price of the WooCommerce order the PDF was purchased in. Perhaps this way you could print out the price on a gift certificate. More on how to create gift certificates using PDF Ink can be found here. Another Example In the following example […]

Read more »

Magic Tags Snippets WooCommerce

Watermark Width on a PDF

October 20th, 2020

A customer just brought up an interesting point: since the watermark width (“cell width” in TCPDF terms) is determined by the PDF page width, won’t a line of text be a “little short” (limited) if the watermark is rotated diagonally? Since it would take a lot of math with a few variables (page size, mainly) to determine the max cell width based on degree of rotation, we just included a new filter in PDF Ink instead. It’s called ‘pdfink_filter_cell_width’. (Hey, I like math but it’s still really smokey in California and getting hard to think.) The following code is a simple example of an attempt to override the cell width with 300mm, which should work […]

Read more »

Snippets

Communicating File Passwords to Customers: Best Practices for WooCommerce

July 7th, 2020

Clear communication about password-protected PDFs is crucial to avoid customer confusion. For WooCommerce shops, customize the Thank You page and order confirmation emails to inform customers of their PDF passwords. Use hooks to add messages indicating that passwords are their email addresses or phone numbers. Highlight this information with bold text or colors to ensure it stands out. Effective communication enhances the customer experience, reduces support inquiries, and builds trust, ultimately leading to repeat business and positive word-of-mouth for your shop.

Read more »

Snippets WooCommerce

Watermark WooCommerce PDFs with Custom Data

June 1st, 2020

If you would like to create a custom magic tag to display dynamic output, that can usually be done using filter hooks included in PDF Ink. The filter hook to use is ‘pdfink_filter_placement_content’ and the parameters it passes are $content, $key, $order_id and $product_id. $key refers to the placement: 0 is the first placement, 1 is the second, and if you have more, they’d be numbered 2, 3, 4 etc. PSST! The ‘pdfink_filter_placement_content‘ hook also works for Easy Digital Downloads and Download Monitor, with nearly identical parameters. Keep reading! Unless you are adding static content (such as the hour), or global data (such as the $_SERVER[‘REMOTE_ADDR’]), it’s necessary that you have collected and have reliable […]

Read more »

Magic Tags Snippets WooCommerce

Brazil Shops can print CPF on a PDF

October 6th, 2018

Here is an example of adding new magic tags to PDF Ink for on-the-fly and totally-customized watermarks. A Brazilian customer using WooCommerce requested a magic tag to display the Cadastro de Pessoas Físicas (CPF) on PDFs. CPF is a taxpayer identification number all citizens of Brazil must use to shop online within Brasil. In order to collect CPF data from customers, our customer uses the Woocommerce Extra Checkout Fields for Brazil plugin.* We wrote the following code to programmatically create the magic tag [BILLING_CPF]. This magic tag will import any customer’s CPF number into their personalized PDF during stamping (when the customer clicks download). The “WooCommerce Extra Checkout” plugin mentioned above must be in use, […]

Read more »

Magic Tags Snippets WooCommerce
Sidebar

About Us

Based in the US desert Southwest, we've been building practical, functional PDF-wrangling plugins for WordPress since 2014. We know a thing or two about WordPress and PDFs and want to help you succeed! Learn more

Get PDF Ink

The most robust PDF watermark & password solution for WordPress & PHP, since 2014!

Download PDF Ink

∙ Easy to set up and use
∙ 30-day money back guarantee

Recent Posts

  • Pull Order Data from WooCommerce and Stamp Your PDFs – with VAT Info
  • Rewrite PDF Links on the Fly
  • Small‑Biz Perseverance v. Big‑Corp Muscle – A WordPress Plugin Battle
  • Stamp Sequential Order Number on PDF
  • Block AI from Scraping PDF Content
  • Add a Fun Barcode Shape to Your PDFs
  • PDF Reader & Writer – A Friendly Guide to Keeping Your PDFs Healthy
  • New: EPUB Watermarking!
  • Using Sample PDFs for Marketing & Search Engine Optimization
  • How to Keep Links in PDF Table of Contents

PDF Ink

Open-source PHP-based PDF manipulation for WordPress & beyond.
Adds watermarks, passwords and content to existing PDF files.
Proudly made with love since 2014.

Resources

FAQ

Demo

Documentation

Blog

Search

L'ink In

Get PDF Ink

Account

Contact

Terms & ConditionsPrivacy

® 2026 Canyon Webworks, LLC. All Rights Reserved.