If you offer PDF files to your WP Users then this feature may be helpful for you.
The PDF Stamper plugin lets you create a download now button for your WP Users. A logged in WP User can use that button to download the PDF file. The plugin will stamp the file with the WP User’s details (name and email address) at the time of download.
It will also keep the source PDF file’s URL hidden.
Use the following shortcode to place a PDF download now button for WP Users.
[stamper_download_button_for_wp_user file_url="example.com/url-to-your-file.pdf" button_text="Download Now"]
Using a Custom Button Image with the Download Now Button
You can use a custom button image for the download now button instead of the text. Use the “button_image” parameter in the shortcode to use your custom button image for the button. Below is an example:
[stamper_download_button_for_wp_user file_url="example.com/url-to-your-file.pdf" button_image="example.com/custom-image-url"]
Opening the PDF Download in a New Window
Use the “new_window” parameter in the shortcode to open the download in a new window. Example shortcode usage below:
[stamper_download_button_for_wp_user file_url="example.com/url-to-your-file.pdf" button_text="Download Now" new_window="1"]
What Variables Can be Stamped?
This shortcode can only stamp the following variables.
- {customer_name} – This will be replaced with the name of the customer making the purchase
- {first_name} – This will be replaced with the first name of the customer
- {last_name} – This will be replaced with the last name of the customer
- {customer_email} – This will be replaced with the email address of the customer making the purchase
- {date} – Stamping date
User’s address and phone number are not standard fields of WP User record. This shortcode can only stamp values that will be available on all standard WordPress installs.
Here’s more information from the forums, for those who would be looking for it, as I did. 🙂
1. When you do the above, you will get the button, on which when you click, the PDF file will open in the same window, in the browser view, instead of opening in a new window and downloading as a file.
To change that, add new_window attribute to the shortcode above, for example:
Now the file will open in a new window, but not download. For it to download, go to your .htaccess file and add the following code there:
Don’t forget to set the .htaccess permission to 750.
2. If you need to disallow copying of the text and images in the pdf, you need not only to uncheck the “Allow copy”, but also to check “Enable PDF File Encryption”, simply leaving the password field empty. This way the file will not be protected with a password, but the copying of the content will be disallowed.
3. If you need to use {date} in the format you’ll like, set it in the WordPress Settings, the PDF Stamper will take the format from there.
Good luck, and heartfelt appreciation to the developers! 🙂