PDF Vouchers FAQ

“PDF Vouchers FAQ” Documentation by “WPWeb”

Here you will find answers to commonly asked questions about the WooCommerce PDF Vouchers extension.

Frequently Asked Questions

Does this work with WooCommerce Coupons?

Yes, its work with WooCommerce Coupons. You can redeem vouchers an online shop. To activate this feature, you need to check "Auto Enable Coupon Code Generation" settings.


Why is a single voucher generated with multiple voucher codes when a product is ordered with a quantity > 1?
How do I generate multiple quantities of a voucher?

There is a global setting for that under Settings -> Pdf Vouchers -> Voucher Settings -> "Multiple Vouchers". If you check this option it will generate separate PDF for each voucher.


How to allow Shop Manager, Editor etc. role users to allow check voucher code page and other voucher report pages as administrator ?

You can add this code snippet to a custom plugin or your theme's functions.php to allow other role users.

How can I add custom pdf size instead of predefined sizes: A0, A1, A2, A3, A4, A5, A6, A7, A8 ?

You can add this code snippet to a custom plugin or your theme's functions.php to create a custom pdf size.

How can I add any role to work as a voucher vendor role ?

You can add this code snippet to a custom plugin or your theme's functions.php to assign role as vendor.

How Can I delete Purchased / Used / Unused voucher codes ?

When you delete the order, all voucher codes associated with that order will automatically get removed.

If PDF Vouchers plugin is deactivated and you delete WooCommerce orders then you will see Delete option to delete voucher codes manually as shown in below screenshot

Purchased Voucher Code with Delete Option

Why does background image look blurry on pdf voucher?

This is most likely issue with background image size. Please make sure you have selected background image with proper size. Please check size chart to get idea about background image size based on pdf size you have selected.

Also make sure you have selected 'Full Image' option from the WordPress Image Uploader when you choose background image. Please check below image :

Voucher Options

How to Change format ( pattern ) of unique generated voucher codes?

You can add this code snippet to a custom plugin or your theme's functions.php. ( Note: This code will only works for "Unlimited" Usability of voucher code. )

TCPDF ERROR: [Image] Unable to get the size of the image?

There is a global setting for that under Settings -> Pdf Vouchers -> Misc Settings -> Enable Relative Path. Please check this option and it should resolve the error.

If there is still same issue, please confirm with your Hosting provider that getimagesize() function working properly on your server. if it don't work then you will get this error message.


Fatal error: Allowed memory size of XXXXXXX bytes exhausted (tried to allocate XXXXX bytes) in /path/to/function/file on line XXX ?

The solution is to increase the PHP memory limit on your server.
WordPress offers a way to Increase memory allocated to PHP in your wp-config.php file

Please note that this is not a problem with WooCommerce PDF Voucher - the available memory is shared among all plugins, theme, and WordPress core running in your installation. As the different parts of your installation load, they use up your server's capacity.


How can i change time for deleting generated voucher's PDF?

By default, plugin will delete all generated voucher's PDF twice daily. You can change it from WooCommerce -> Settings -> PDF Vouchers -> Misc Settings as shown in below screenshot.

Voucher Delete Options

How can I change date format for recipient gift date?

By default, a plugin will use WordPress date format that can be managed from Settings -> General -> Date Format. For date picker on a product single page a plugin will use MM-DD-YYYY format and If you want to change it, add below code into your child theme's functions.php.

We recommend you to not change the month format to textual representation as this can cause some issues for validation and on multilingual website.


How can I import/export voucher templates to other website?

To export voucher templates go to Tools >> Export and select Voucher Templates as shown in the screenshot.

Export voucher templates

To Import voucher templates go to Tools >> Import and run WordPress importer and you will have an option to upload the file.

Import voucher templates