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…

Invisible Watermarks and Other Ways to Protect Your PDFs

PDFs are a fantastic way to share documents – they preserve formatting, are widely compatible, and can even be compressed for easy transmission. But what if that PDF contains sensitive or monetized information? The Portable Document Format (PDF) offers some security, which when stacked can be quite effective. These include: Watermarks. Adding content to a PDF, especially content customized to the end-user (such as their name and other personally-identifying information like phone/email, can not only personalize a PDF, but also thwart unauthorized sharing. Keep reading to find out how to make your watermarks most effective against PDF theft. Encryption. Arcfour RC4, and the superior 128-bit key or 256-bit AES encryption Passwording. User and owner passwords can be set. An owner password gives the holder full control over the PDF, including the ability to remove passwording entirely — share with caution! 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

Where are the WordPress.org free plugins?

I’m getting too many emails about this to answer them all, sorry. Hopefully I can answer you here. I write and maintain WordPress plugins for a living. For ~8 years I have also provided and supported free plugins on the side. I provide two plugins in the free (open-source) WordPress.org plugin repository, both of which are well-loved and rated. As you may have noticed, they were abruptly removed by WordPress on January 24th. It was a surprise to me, too! Frankly I have been feeling burned out on supporting free software, so maybe this is a chance for me to at least say my piece. One has to think abstractly for it to feel rewarding, as in “I know people aren’t saying anything, but I imagine these plugins make the world better and peoples’ days easier.” I also feel like continue reading…

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

If you are or even if you are not using WooCommerce or Easy Digital Downloads but are still programming in PHP, I am available to consult on your TCPDF barcoding project to get it running. Get in touch!   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 add 1D or 2D barcodes to existing PDF files. For WaterWoo, use the ‘wwpdf_add_barcode’ filter hook in the plugin (located in classes/wwpdf-watermark.php). 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…

Beyond Stamping PDFs with Custom Fonts

If you have tried to use the included font uploader in WaterWoo or EDDiMark, most the time you will be satisfied. It makes it very easy to add and watermark PDFs in nearly any font.

Unfortunately for some users whose languages require special characters, those characters might not be mapped in the font definition files and the dreaded ??????? or ▯▯▯▯▯▯▯ will show. That’s stressful!

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…