Feature #19076
closed
Added by Laurie Hurson about 1 year ago.
Updated about 1 year ago.
Category name:
WordPress Plugins
Description
Hi All,
A new request from the creator of a the PIR journal site....
https://pirjournal.commons.gc.cuny.edu/puppet-research-international-1-no-1/
They would like to allow visitors to download PDF versions of the articles. I suggested they upload PDFs to media library and make them available for download. But they don't have PDFs...and are hoping to do something like this PDF download option:
https://arabstages.org/?p=3473&preview=true
It seems some kind of tool is running the download on the Arab stages site, but I couldn't figure out the mechanism.
Can you look at this example and see if we might be able to make it possible on the PIR site?
Thanks,
Laurie
Files
The link on the arabstages.org site is created by the plugin wp-posts-to-pdf. The plugin is no longer available on the Commons for activation; see #10858.
I've added Scott as a watcher to see if he has updated ideas about plugins that provide this functionality. In the linked ticket, he recommends Anthologize. But I don't think that's a good substitute - Anthologize requires users to create a PDF document manually, but I think the current use case is for automatically-generated PDFs of each single post.
On other projects, I've used dk-pdf and found it to be OK. https://wordpress.org/plugins/dk-pdf/ We don't currently have this plugin on the Commons. If Scott doesn't have other ideas about how it could be accomplished, perhaps we could add dk-pdf or something like it.
No, I don't think we have any PDF generator for single posts.
- Category name set to WordPress Plugins
- Status changed from New to Staged for Production Release
- Target version set to 2.2.1
- Status changed from Staged for Production Release to Resolved
The dk-pdf
plugin is causing a fatal error when attempting to create the PDF:
Fatal error: Uncaught Mpdf\MpdfException: Temporary files directory "/wp-content/plugins/dk-pdf/tmp" is not writable in /wp-content/plugins/dk-pdf/vendor/mpdf/mpdf/src/Cache.php:23
Stack trace:
#0 /wp-content/plugins/dk-pdf/vendor/mpdf/mpdf/src/Mpdf.php(981): Mpdf\Cache->__construct()
#1 /wp-content/plugins/dk-pdf/includes/dkpdf-functions.php(164): Mpdf\Mpdf->__construct()
#2 /wp-includes/class-wp-hook.php(310): dkpdf_output_pdf()
#3 /wp-includes/class-wp-hook.php(334): WP_Hook->apply_filters()
#4 /wp-includes/plugin.php(565): WP_Hook->do_action()
#5 /wp-includes/class-wp.php(796): do_action_ref_array()
#6 /wp-includes/functions.php(1335): WP->main()
#7 /wp-blog-header.php(16): wp()
#8 /index.php(21): require('/...')
#9 {main} thrown in /wp-content/plugins/dk-pdf/vendor/mpdf/mpdf/src/Cache.php on line 23
By default, the dk-pdf
plugin attempts to write files to the /wp-content/plugins/dk-pdf/tmp/
directory. However, our filesystem set up is restricted so this was causing the fatal error. Fortunately, the dk-pdf
plugin has a filter on their temp directory so I just wrote a quick filter that allows for writing to the /wp-content/uploads/dkpdf/
directory: https://github.com/cuny-academic-commons/cac/commit/a619cbf486a76d5c1d60e1e8a29c92f677d92745. This fix is live and it looks like this allows for the dk-pdf
plugin to render the PDF now.
Thanks Ray! I can see that this is working now!
Thanks for tracking this down so quickly, Ray!
Also available in: Atom
PDF