Category : WordPress Plugins

Full PDF barcode support for TCPDF Bridge

It’s pretty easy to create a QR code that opens a PDF. Google that and you’ll find a million results. But it’s a little trickier to add a QR code to an existing PDF. The TCPDF Bridge WordPress plugin can do that now! We’ve added settings to the TCPDF Bridge plugin settings panel to make adding different barcode types (including QR codes) to your PDFs, whether for retail, pharmacy, or industrial purposes. Since the plugin allows you to accept some user input before your PDF file is downloaded, you can even include that data in your barcode! Completely customized barcodes added on-the-fly to your PDFs, as they are downloaded… that’s pretty cool šŸ˜Ž Here are the types of barcodes supported by TCPDF Bridge: CODE 39. Also called Alpha39, Code 3 of 9, Code 3/9, Type 39, USS Code 39, or continue reading…

Accessible PDF Stamping

Many people and organizations put the extra care into their PDF documents to ensure they are usable by ALL humans, not just people with good vision and keyboard/mouse dexterity. What does this mean? It is often imperative documents be accessible due to accessibility codes and laws. So it must be very frustrating to have accessibility features removed by a PDF manipulation plugin! Unfortunately, the open-source PDF manipulation libraries I use for many of my plugins does not allow for robust or reliable PDF manipulation. Namely, TCPDI/TCPDF depends on being fed a syntactically correct PDF, and then because of the way objects are read flat into PHP memory during the process, certain PDF features in the stream are necessarily lost. Marking/passwording with TCPDI/TCPDF or FPDI/FPDF is lossy, no way around it. However, the SetaPDF library from SetaSign works differently by parsing continue reading…

PDF “Security”

Lately folks have been raising the alarm that passwords and content can be removed from PDFs. Unfortunately, this just isn’t news. When was the Internet a safe place to store or share documents? What does a PDF have in common with NASA, the Pentagon, Nasdaq, and most credit card companies? They are all demonstrably hackable. And if a multi-billion dollar organization can be hacked, you bet your bottom dollar your PDF can be, too. You can also bet that a

Creating your Own Watermarking Shortcodes for WooCommerce

You can add your own shortcodes to WaterWoo PDF Premium for on-the-fly customized watermarks. 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 shortcode: [TOTAL_PRICE] function fetch_woo_order_data_as_shortcode( $input, $order_id, $product_id ) { // first we need to get the order object from the order id // you can get a lot of info from the order object ( $order in this case) $order = wc_get_order( $order_id ); // now let’s get the order data from the order object $order_data = $order->get_data(); $order_total = $order_data[‘total’]; // BINGO! // there is a ton of other data you can get from the WC order object data, check out // https://stackoverflow.com/questions/39401393/how-to-get-woocommerce-order-details // and substitute in what you need into the code that follows below // if there isn’t a continue reading…

Printing a barcode or QR Code on a PDF

Update May 2025: This blog post is no longer valid. PDF Ink has replaced WaterWoo and EDDiMark, and has an easier settings panel interface for adding barcodes more easily to PDF files. If you are or even if you are not using WooCommerce or Easy Digital Downloads but are still programming in PHP, it can be done using PDF Ink.   The WaterWoo PDF Premium and EDDiMark PDF plugins can add barcodes and QR codes to PDFs dynamically upon download request via WooCommerce or Easy Digital Downloads. This is because both WordPress plugins use TCPDF to write PDF content, and TCPDF allows for barcode creation. Though this blog post might also be helpful for someone just trying to figure out how to write a barcode with TCPDF and PHP, these instructions are more geared toward a WordPress developer wishing to continue reading…

Custom Fonts with WooStamper (SetaStamper)

The SetaPDF library which PDF Stamper is built on allows quite a bit of font customization to be done. More on SetaPDF and font manipulations. For the meantime, a quick tutorial on how to get other fonts beyond the three packaged with the plugin (Times, Courier, and Helvetica). Start by finding a TrueType font (.ttf) file which suits your needs. Try to keep the file size small, subsetting if necessary so that your server isn’t bogged down managing a large font file while trying to manipulate your PDF. Upload the file to your wp-content/uploads directory, somewhere it won’t get overwritten. It makes sense to use the woostamper folder, so we’ve gone ahead and done that below. Arimo is a TrueType font which works for our purposes, so we have uploaded it to a folder “arimo.” Look at the function below continue reading…

Adding Custom Fonts to EDDiStamper

All three new Stamper plugins (EDDiStamper, PDF Stamper, and Download Monitor Stamper) come with the three standard PDF fonts: Helvetica, Times New Roman, and Courier. Not much to get excited about, I know. Whereas EDDiMark and WaterWoo (plugins based on TCPDF, not SetaPDF-Stamper) have built-in font uploaders with more instant gratification, the integration with Seta is a bit more complicated, and so you’ll need to use a little code. Whether you add the code into a custom plugin, your child theme functions.php file, or by using the more plug-n-play Code Snippets plugin doesn’t matter. Before using the following example code, we have started by creating a “fonts” folder inside the wp-content/uploads/eddistamper/ folder. We put our Comic Sans (yes!) TTF file inside the fonts folder. You can see that path reflected in line 6 of the code below. So, put the continue reading…

PDF Watermarking Limitations, explained

Update March 2020: PDF Stamper (a separate plugin from Waterwoo PDF Premium) now allows PDF owners to keep their PDFs exactly as they are, but add a stamp. PDF Stamp is a drop-in plugin and requires users also purchase SetaPDF-Stamper software to install alongside it. Learn more here. WaterWoo is magic, but it does have its limitations. And one particular limitation has been disappointing customers, and frustrating us, for years. We'd like to explain. First of all, let's explain how WaterWoo works. In a nutshell, WaterWoo works by first reading a PDF into memory, then spitting it back out onto the page with watermarks rolled in. If the parser (FPDI or TCPDI) which reads the PDF does not read all the PDF, or cannot read certain PDF versions, then WaterWoo fails to deliver the expected. Ultimately, WaterWoo is built on continue reading…

TCPDF Performances

Make sure to test your watermarking thoroughly before going live! TCPDF is a fallible third-party library which does its best to parse/understand and re-write your PDF with your desired changes (watermarks/encryption/etc), but it cannot possibly work on all PDFs and on all servers 100% of the time. Stay realistic, think carefully through the process, plan, and do your testing. PHP Version You should be running at least PHP version 5.6 for the plugin to work, but higher that for it to work WELL. WordPress recommends you run PHP version 7.2 or higher. Our plugins are PHP version 8.3 compatible, so don’t hesitate to upgrade after making backups. PHP 7.0 is twice as fast for WordPress as PHP 5.6, and processes demands much more efficiently! Updating the PHP version on your server is the first thing you should try if you’re continue reading…