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.
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.
Allowed memory size of n bytes exhausted or Maximum execution time of n seconds exceeded
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.
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).
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.
Caught Exception: Unable to fetch remote file. More info: cURL error 28: Operation timed out after 15000 milliseconds
This error should only happen if you are bringing files down from a remote server (such as Amazon S3) for PDF Ink manipulation on your server just before delivery to your website user. It means that the file took longer than 15 seconds (15000 milliseconds) to download. WordPress sets the time limit at 5 seconds (filterable with the http_request_timeout
hook), meaning a download must take under 5 seconds. PDF Ink increases that to 15 seconds (filterable with the pdfink_remote_get_timeout
hook, in case you are not using WP) to try to avoid more errors. You could bring the limit up higher in case you are wanting to serve large files, experience heavy traffic on occasion, etc. etc., but this isn’t a guaranteed solution.
Here’s a PHP snippet that increases the time limit (timeout) to 25 seconds:
function up_pdfink_remote_get_timeout( $timeout ) {
return 25;
}
add_filter( 'pdfink_remote_get_timeout', 'up_pdfink_remote_get_timeout', 10, 1 );
That said, our general recommendation is to store your files on the same server they are manipulated on, since they don’t have to be sent around the world twice.
As of fall 2025, we are working on manipulating download streams, which will help alleviate this annoying issue (for SetaPDF-Stamper users only).
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.