Support » Plugin: WaterWoo PDF Plugin » TCPDF_PARSER ERROR: Invalid PDF data: missing %PDF header.

  • Resolved MDC2957

    (@mdc2957)


    Just got strange email from a customer. He bought a downloadable file, which is a zip file, not a PDF. So I’m not sure why this would happen, he reported the following error:

    Unable to watermark this file for download. Please notify site administrator.
    TCPDF_PARSER ERROR: Invalid PDF data: missing %PDF header.
Viewing 8 replies - 1 through 8 (of 8 total)
  • Plugin Author Little Package

    (@littlepackage)

    Hi @mdc2957,

    Sorry to hear that happened with a customer. However, this plugin watermarks PDFs. It does not unpack ZIP files. So of course you’re going to get an error.

    ??? I think you read my post too quickly. He purchased a ZIP file for download, not a PDF file. As such, he shouldn’t be getting any error messages about watermarking from your plugin. What it appears is happening is your plugin is attempting to watermark a zip file. Does it make more sense now?

    Plugin Author Little Package

    (@littlepackage)

    Hi again @mdc2957

    That’s really strange because WaterWoo does checks to see if it should proceed on a download file. I’m wondering why your download would fail… assuming this file in question is named like “something.zip”…

    // PDF - watermarking - start by checking if it's even a PDF
    $file_extension = preg_replace( '/\?.*/', '', substr( strrchr( $file_path, '.' ), 1 ) );
    // Abort if not a PDF
    if ( ! strtolower( $file_extension ) == 'pdf' ) return $file_path;

    What is the file named?

    I can’t remember the exact name, but it does indeed end in .zip extension.
    It was working fine as recently as Jan 31st I think. If the problem existed then, then the customer didn’t complain about it anyways.

    Plugin Author Little Package

    (@littlepackage)

    @mdc2957 I’d be really curious to know what the file name was in this case (and frankly can’t do much anyway without knowing) because honestly this is the first time since 2013 I’ve heard of this happening! Let me know if you remember.

    Sure, I sent it to you privately via the pre-sales contact form on your website

    Plugin Author Little Package

    (@littlepackage)

    @mdc2957 Got it! Wrote you back via email.

    Plugin Author Little Package

    (@littlepackage)

    @mdc2957 Thanks to your kind cooperation, version 2.5.1 is ready, and this issue should be fixed. 🙂

Viewing 8 replies - 1 through 8 (of 8 total)
  • You must be logged in to reply to this topic.