WordPress.org

Ready to get started?Download WordPress

Forums

VoucherPress
[resolved] Corrupted pdf (39 posts)

  1. Black Angus
    Member
    Posted 3 years ago #

    When I download the voucher I get an error message "Corrupted pdf." I see a couple other people have had this problem but I don't see where it was resolved.

    http://wordpress.org/extend/plugins/voucherpress/

  2. Black Angus
    Member
    Posted 3 years ago #

    This is the error message: "Adobe Reader could not open 'myvoucher.pdf' because it is either not a supported file type or because the file has been damaged (for example, it was sent as an email attachment and wasn't correctly decoded)."

  3. rrohde
    Member
    Posted 3 years ago #

    I have the same issue as BlackAngus; all PDFs obtained from this plugin are corrupt. I've tried opening them with Adobe Reader, Evince, The Gimp and Mod PDF - to no avail!

    Any help please?

    Cheers,
    Rainer

  4. Chris Taylor
    Member
    Plugin Author

    Posted 3 years ago #

    A few people have had this problem, but I haven't found a pattern yet. Can you supply full details of your WP installation, the voucher settings you're using, and details of your server please.

  5. pwhitelaw
    Member
    Posted 3 years ago #

    The program is running fine on my server. But I have had several users complain that they cannot open the PDF file. I have tested the PDF in my reader and it appears fine.
    WP 3.0.1

  6. halalan
    Member
    Posted 3 years ago #

    I too am getting this very same error when trying to view the PDF file.

    This is the error message: "Adobe Reader could not open 'myvoucher.pdf' because it is either not a supported file type or because the file has been damaged (for example, it was sent as an email attachment and wasn't correctly decoded).

    I hope this can be corrected, so I can try this out. It sounds like just what I was looking for too!!

  7. Black Angus
    Member
    Posted 3 years ago #

    Hi, halalan. I figured out my problem was probably because the server I was on had 4.3 something php. I've switched to a host with 5.2 something php and VoucherPress works like a charm! So see what version of php you are running.

  8. halalan
    Member
    Posted 3 years ago #

    I am using bluehost as my hosting account. All plugins have worked fine to date. I too am running PHP 5.2.14 However I also have it set for PHP5 (FastCGI) in the configuration. I have been using this again with no other issues. It says: All files with the extension .php will be handled by PHP5 FastCGI processes. FastCGI for PHP makes all your PHP applications run through mod_fastcgi instead of mod_suphp. This eliminates the overhead of loading the PHP interpretor on every hit. Since it is always in memory ready for the next hit, the responses will be generated faster.

    Maybe that will help figure out the issue somehow and maybe a fix too.

  9. rrohde
    Member
    Posted 3 years ago #

    I am on Godaddy w/ PHP Version: PHP 5.x - and I still don't have this working.

    Anything that I should be looking for in my php.ini?

  10. websitism
    Member
    Posted 3 years ago #

    I have the same problem on my local server with php 5.x.
    The voucher outputs readable pdf while using the serif 1 font.

    I tried opening the corrupted pdf in notepad and it shows "TCPDF ERROR: Could not include font definition file: courierb".

    May be a font embedding problem is the cause of the pdf error.

  11. halalan
    Member
    Posted 3 years ago #

    I just updated wordpress to newest release, had hoped just maybe that might help..NOPE. Oh well.. ANYBODY FIGURE OUT A FIX TO VIEW THE PDF FILE??

    ERROR I STILL GET WITH ALL FONT CHOICES WHEN PDF TRIES TO OPEN:

    This is the error message: "Adobe Reader could not open 'myvoucher.pdf' because it is either not a supported file type or because the file has been damaged (for example, it was sent as an email attachment and wasn't correctly decoded).

    Incentive..GET IT WORKDING I WILL MAKE A $25 DONATION !!! Others join in and lets motivate the developer..

  12. rrohde
    Member
    Posted 3 years ago #

    Here's some more info on my GoDaddy host running WP:

    WordPress version: 3.0.2 You have the latest stable version of WordPress.

    Operating System : Linux
    Server : Apache
    Memory usage : 26.53 MByte
    MYSQL Version : 5.0.91-log
    SQL Mode : Not set
    PHP Version : 5.2.14
    PHP Safe Mode : Off
    PHP Allow URL fopen : Off
    PHP Memory Limit : 256M
    PHP Max Upload Size : 128M
    PHP Max Post Size : 256M
    PHP Max Script Execute Time : 1600s
    PHP Exif support : Yes ( V1.4 )
    PHP IPTC support : Yes
    PHP XML support : Yes

  13. Chris Taylor
    Member
    Plugin Author

    Posted 3 years ago #

    Thanks for reporting these problems. The closest thing I can see to a cause for this problem is from websitism:

    > I tried opening the corrupted pdf in notepad and it shows "TCPDF ERROR: Could not include font definition file: courierb".

    So can everyone who has this problem please email me an affected voucher - plus details of the fonts chosen - to mrwiblog (at) gmail dot com. Thanks.

  14. halalan
    Member
    Posted 3 years ago #

    I just emailed you a sample pdf file from my site that won't open. I also have tried every font choice just to see..NO LUCK. I am sure it is something simple. One of those..that make you kick yourself once it is figured out. Good luck..great plugin..looking forward to test out a working version.

  15. Chris Taylor
    Member
    Plugin Author

    Posted 3 years ago #

    It look like this is down to PHP running out of memory. Your PDF file contained this:

    <b>Fatal error</b>: Allowed memory size of 67108864 bytes exhausted (tried to allocate 7864320 bytes) in <b>[path removed]/wp-content/plugins/voucherpress/tcpdf/unicode_data.php</b> on line <b>16485</b>

    As the plugin uses TCPDF (http://www.tcpdf.org) to produce the PDF files I've built a new version using the latest TCPDF library. Please download it from here and let me know if it handles memory better (it works for me): http://www.stillbreathing.co.uk/misc/voucherpress.zip

    It's a very large plugin (nearly 20mb) but that is almost entirely TCPDF. If there is a better way to create PDFs on the fly please tell me about it.

  16. rrohde
    Member
    Posted 3 years ago #

    Hi Chris,

    this works for me now for the first time! Thank you! :) The PDFs open just fine.

    Now, this is what I get when I downloading a voucher:

    Warning: Unknown: open(D:\TEMP\PHP/sess_la8i93ts68sbpjq4q5nbjknv51, O_RDWR) failed: No such file or directory (2) in Unknown on line 0
    
    Warning: Unknown: Failed to write session data (files). Please verify that the current setting of session.save_path is correct (D:\TEMP\PHP) in Unknown on line 0

    ^^^ Needless to say, my site's hosted on Linux, so there's no "D:\" drive; maybe something in the code that needs to be cleaned up?

  17. rrohde
    Member
    Posted 3 years ago #

    Err - I take that back. Any subsequent attempt to create a voucher has produced a similar outcome as stated initially - I cannot open the PDF because it is corrupt. :(

    The file-size on those corrupted ones is 1 or 0KB respectively, while the one that worked (the first one I've done after I updated the plugin) is 126KB.

    Any ideas?

  18. Black Angus
    Member
    Posted 3 years ago #

    >>It look like this is down to PHP running out of memory.

    A great (and easy to use) plugin for cleaning up the database is GD Press Tools. Plus you can easily change the memory allotment for php.

    From WordPress:

    "GD Press Tools is a collection of various administration, seo, maintenance, backup and security related tools. This tools can be integrated into the various WordPress admin panels, can perform maintenance operations, change some aspects of WordPress..."

  19. Chris Taylor
    Member
    Plugin Author

    Posted 3 years ago #

    rrohde: OK, I think it was too much to expect it to work flawlessly first time. I'll work on this some more soon. Thanks for your patience.

  20. rrohde
    Member
    Posted 3 years ago #

    Chris - no, THANK YOU for all the effort! This is truly a remarkable WP plugin. Keep up the fantastic work! :)

  21. rrohde
    Member
    Posted 3 years ago #

    Chris - I've got a question: is there any way to implement this voucher plugin with WP e-commerce so that I can actually sell those vouchers as gift certificate if I wanted to?

  22. Chris Taylor
    Member
    Plugin Author

    Posted 3 years ago #

    rrohde: At the moment no, but the next version of the plugin contains several custom actions which may make it possible to integrate the two plugins. I'm afraid I don't have time to do that myself, though.

    To anyone getting the "corrupted PDF" problem: Can you open one of the broken PDFs in a text editor and if it looks like a PHP error paste the details here. Thanks.

  23. halalan
    Member
    Posted 3 years ago #

    I am still not having any luck, I tried the new update large file, but it would not properly activate in the backend, I reloaded the older version and get that now memory error. Only plugin to do that to me.

    Fatal error: Allowed memory size of 67108864 bytes exhausted (tried to allocate 7864320 bytes) in /home1/ctoanet/public_html/mainstreethardy/wp-content/plugins/voucherpress/tcpdf/unicode_data.php on line 16485

  24. Chris Taylor
    Member
    Plugin Author

    Posted 3 years ago #

    I've just released version 1.2 of VoucherPress which should fix the out of memory error, and the activation problem. There are also several other features in this release - although be warned: I haven't had chance to test this as thoroughly as I would like. The bugfixes/new features are:

    - Changed templates to work at 150dpi (1181 x 532 pixels) to overcome memory limit problem
    - Added code which attempts to temporarily increase PHP memory limit to 64mb while a voucher is being rendered
    - Fixed activation bug caused by WordPress breaking the Plugin Register plugin
    - Upgraded to recent version of TCPDF
    - Allowed CSV download for all vouchers, not just ones requiring an email address
    - Added nonce fields for security

    The next version of VoucherPress will be a complete rewrite as the code is currently very messy. I also hope to include a feature to create vouchers of different sizes, and have the option to format the vouchers in more ways.

    Please report any problems using the forum system on WordPress.org as this allows me to manage all the bugs: http://wordpress.org/extend/plugins/voucherpress/

  25. halalan
    Member
    Posted 3 years ago #

    Just upgraded and still same problem when trying to view the PDF file. I get the:

    This is the error message: "Adobe Reader could not open 'myvoucher.pdf' because it is either not a supported file type or because the file has been damaged (for example, it was sent as an email attachment and wasn't correctly decoded).

    Maybe I need to delete the plugin completely and try to reinstall? I will try it just for the heck of it.

  26. kuznetsof
    Member
    Posted 3 years ago #

    Hi Chris
    Thank you so much for hard working.

    Here`s an error i see when i open pdf in text editor
    -------------------------------------------------------------
    <b>Parse error</b>: syntax error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in <b>/home/content/j/o/e/joeswolfrd/html/wp-content/plugins/voucherpress/voucherpress_pdf.php</b> on line <b>14</b>
    -------------------------------------------------------------
    Does anyone know what i can do in order to download and open pdf ???

  27. zylootino
    Member
    Posted 3 years ago #

    Hi, I'm using plugin version 1.2 on WP 3.0.4 and I have the file corrupted error. I have set a memory limit up to 2048M in my php.ini file so it can't be the memory.

    The PDF generated for previewing coupons in the admin works fine. It's only the production coupons with codes that makes corrupted pdf files.

    This is the output of a pdf file opened in a text editor:
    %PDF-1.7
    5 0 obj
    << /Type /Page /Parent 1 0 R /LastModified (D:20110108185610+00'00') /Resources 2 0 R /MediaBox [0.00 0.00 566.93 255.12] /CropBox [0.00 0.00 566.93 255.12] /BleedBox [0.00 0.00 566.93 255.12] /TrimBox [0.00 0.00 566.93 255.12] /ArtBox [0.00 0.00 566.93 255.12] /Contents 6 0 R /Rotate 0 /Group << /Type /Group /S /Transparency /CS /DeviceRGB >> /Annots [ 4 0 R ] /PZ 1 >>
    endobj
    6 0 obj
    <</Filter /FlateDecode /Length 354>> stream
    xœ¥“ËnÂ0E÷ùŠYÂÇãGštY^*j+¨²…JÕÆà‚Rþ¾“„B¤€DŠ”±£±îœë±Í™¾ƒ8 (>`<¥)¢èS,�‡Ü
    Æ9„ 膯+Ø“¼”íy,�$â ´f( _·ù¸�#gTŸxHÉRŠ\`ÎBh Åx sR†rŠŸòøÚwˆ[ÒPu!ý“ä á‚Ë3µsÛ›3Kv T˜
    Ú¢
    )ÕÍ2J0-

    Thanks for your help!

    PS: I didn't see this post at first and I created another post. Sorry for this, I can't delete it.

  28. halalan
    Member
    Posted 3 years ago #

    I finally got mine to work for the FIRST time once I went and set my memory in the MAIN php.ini file to 128M. In some versions of wordpress it has its own memory setting. Is it possible even though you set it in the Main php it is getting reset within the wordpress directory? Just a thought.

    In wordpress it isn;t in the PHP file its in another file name where memory is set.. I JUST CANT REMEMBER IT RIGHT NOW :-( Just a thought to check into.

  29. Chris Taylor
    Member
    Plugin Author

    Posted 3 years ago #

    If you're having problems it's likely the plugin didn't install properly (the size is something I'm working on). Try deactivating, deleting the files - don't worry, your vouchers will be safe - then reinstalling.

    Let me know here if you still have problems.

  30. zylootino
    Member
    Posted 3 years ago #

    Thank you for your reply, Chris.
    Unfortunately it did not help.
    I still have the very same problem. Nothing in the logs.
    But since the generation of the preview pdf works, I thought the problem could come from the coupon code generation. Do you know how could I catch an error there?
    By the way, did you test it with WP 3.0.4?

    Thanks a lot

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic