Uncaught exception ‘InvalidArgumentException’ with message ‘Cannot open’…
If you get this error while trying to stamping a file, it means the PDF reader could not open the PDF. Make sure the PDF is where the computer thinks it is. Double check your file paths, and that the PDF is where you think you put it. Are the file permissions set too restrictively? In WordPress files should be chmoded to 644 and directories to 755.
Also it could be a problem if your filename has unsafe characters like spaces or unusual characters (like emojis! or unicode symbols) in the PDF file name. Use plain keyboard characters and replace spaces with dashes or underscores or remove them.
Warning: fopen(): remote host file access not supported
If you get this message it’s because you’re trying to store your PDF on another host (another domain). An attempt was made to fetch the file from that remote server, but failed, possibly due to the location not being a valid url or missing authentication. It might also be that a higher timeout needs to be set (you could use the `http_request_timeout` or `pdfink_remote_get_timeout` filter hook to set the timeout higher), but then again… ask yourself if you really want to be bringing files in from a remote server, processing them on your server, then sending them out again.
If you are using WooCommerce or another WP e-commerce plugin, you generally need to be paying for a plugin that brings in the file from S3 or Dropbox or whatever. If you have that in place and it’s still not working, get in touch and we will try to help.
Fatal error: Allowed memory size of n bytes exhausted
If you get this error, please refer to “Performance tuning.” Some of these TCPDF performance tuning aspects will also refer to FPDF and SetaPDF-Stamper.
TL;DR: This plugin can use a lot of system memory. Start by upgrading your PHP installation to at least PHP 8.0 and increase your PHP memory limits (256-1024MB is usually PLENTY). If you keep encountering this error, our server will likely need more RAM. Speak to your host about that upgrade.
If you cannot afford more RAM, try to simplify your stamp by removing HTML, images, fonts, and/or encryption. FPDF/TCPDF makes a huge demand on the server after FPDI/TCPDI parses the entire PDF into memory, in order to spit the PDF back out with the watermark added. If you have a large PDF and a complex watermark to add to it, and are expecting affordable, un-managed shared hosting to reliably process the file on potentially heavy customer demand, you’re rolling the dice.
SetaPDF-Stamper is an upgrade to consider as it will make less demand on the server performing the same task.
TCPDF_PARSER ERROR: decodeFilterFlateDecode: invalid code
If you get this error, it is possibly because you are trying to manipulate a PDF which has already been passworded or protected. PDFs must be unlocked with full user permissions in order to be parsed by TCPDI and watermarked. SetaPDF-Stamper can unlock PDFs prior to manipulation – if you provide an password in the PDF Ink settings for that PDF.
Otherwise, if it is definitely not locked, please send us a copy of the PDF for study, so we can possibly fix the parsing issue (licensed customers only).
Error: Could not include font definition file
When PDF Ink is installed inside WordPress, font files are automagically moved from library (TCPDF,FPDF) folders to safe-keeping in the wp-content/pdf-ink/fonts/tcpdf and wp-content/pdf-ink/fonts/fpdf directories. This way the library font files are not over-written when the plugin is updated. The directory is also where any custom font files end up being safely stored. If this migration failed during plugin launch, or the files went missing, you will get this message. Try deactivating, and then re-activating PDF Ink.
This error shouldn’t apply to SetaPDF-Stamper or FPDI PDF-Parser setups because you will install/upgrade them separately from WordPress, where PDF Ink will not overwrite them when updated.
If you’re getting a different error message on the screen, please let us know! Everyone’s WordPress setup is different, so help us understand yours and how it might be interacting with PDF Ink.