plugin:html2pdf
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
plugin:html2pdf [2009-12-26 18:38] – 125.131.236.242 | plugin:html2pdf [2019-08-16 15:05] (current) – Aleksandr | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== html2pdf | + | ====== html2pdf |
---- plugin ---- | ---- plugin ---- | ||
- | description: | + | description: |
author | author | ||
email : d.stonier@gmail.com | email : d.stonier@gmail.com | ||
Line 10: | Line 10: | ||
depends | depends | ||
conflicts | conflicts | ||
- | similar | + | similar |
- | tags : export, pdf | + | tags : export, pdf, !broken |
+ | |||
+ | sourcerepo : https:// | ||
+ | bugtracker : https:// | ||
+ | downloadurl: | ||
---- | ---- | ||
- | ===== Download and Installation ===== | ||
- | |||
- | Download and install the plugin using the [[plugin: | ||
- | |||
- | * http:// | ||
- | |||
- | Warning! This is a large file (52MB) and the plugin manager would not handle it for me (not sure where that's a DokuWiki setting or an Apache setting at this point in time). To install it manually, just download and install into the doku/ | ||
===== Overview ==== | ===== Overview ==== | ||
Line 31: | Line 28: | ||
* Outputs graphics of reasonable quality. | * Outputs graphics of reasonable quality. | ||
- | ===== Demo ==== | + | ===== Demo (not working) ===== |
- | Not available yet. | + | * [[http:// |
- | ===== Creating an Export Link ===== | + | ===== Installation ====== |
- | To use the script, you simply need to call the page passing it a " | + | Download and install |
- | == Dokubook == | + | * https:// |
- | I use an extended dokubook for this, and have the following code inserted | + | Warning! This is a large file (~36MB) and the plugin manager would not handle it for me (not sure where that's a DokuWiki setting or an Apache setting at this point in time). Alternatively, you can install it manually, just download |
- | <code php> | + | ===== Links ===== |
- | $pdf_plugin | + | |
- | if ( $pdf_plugin ) { | + | |
- | if ( !plugin_isdisabled($pdf_plugin-> | + | |
- | print '< | + | |
- | print ' | + | |
- | echo exportlink($ID, | + | |
- | print '" | + | |
- | print '</ | + | |
- | } | + | |
- | } | + | |
- | </ | + | |
- | The appropriate bit of CSS is added for //tab_pdf// in '' | + | == Insufficient Memory == |
- | == Monobook == | + | The html2ps script is pretty greedy and you might not have enough memory reserved for the PHP script. When this happens, it will return with an error stating so. To increase the memory: |
+ | Edit your php.ini file, set the memory_limit variable to 128K or more. Restart the web server. | ||
- | When using the template " | + | == Bad CSS == |
- | <code php> | + | The html2pdf script doesn't know how to handle the !important CSS property so internal links do not get styled. If you want them to show up as they appear on the web page, go into your template and edit /lib/tpl/_template/ |
- | $monobook['defaulttoolbox' | + | |
- | $monobook[' | + | |
- | </code> | + | |
- | That's all -- at least for me ;-) --- //[[w.flamme@web.de|Werner Flamme]] 2009-02-16 10:00 CET// | + | |
- | ===== TroubleShooting ===== | + | == Blank PDF Output |
- | * [[http://snorriheim.dnsdojo.com/doku/doku.php/en: | + | Check that the html is being made in doku/lib/plugins/html2pdf/tmp/export_pdf.html. |
+ | Check that the html2pdf is working with the systemcheck link in the troubleshooting section above. | ||
+ | Especially check curl and ghostscript - you need php with curl use flag and ghostscript | ||
+ | Make sure your entire directory is read/ | ||
- | Another thing to do is to do a few self checks on the html2ps engine yourself. Try the links below (replacing localhost/ | + | == Large PDF File Size == |
- | * http:// | + | Aye, thats normal. The holy grail of easily convertable documents isn't really here yet (though I've seen a project aiming to get there), but this is the best I've seen for faithfully rendering what you see in a dokuwiki page to pdf, even if it is pretty heavy getting there. I wouldn' |
- | * http:// | + | |
- | Faithfully rendering HTML+CSS job is a massive job (even browsers have trouble with it) and so you're bound to find a few things the html2ps library can't do well. When I first started with it, it had a few problems with regular DokuWiki pages, but by reducing the problem to a simple example and positing it to the forum (link below), I found the author very responsive and he addressed the issues very quickly. You may wish to consider a similar approach - and if you get an update let me know and I'll update the html2ps in this plugin. | + | ===== Export Link/Button ===== |
- | * [[http:// | + | To use the plugin, you simply need to call the page passing it a “do=export_pdf” php argument. The easiest way to implement this is to add a button or similar somewhere in your template design. |
+ | == Dokubook == | ||
- | ===== Known Issues ===== | + | I use an extended dokubook for this, and have the following code inserted into the top__nav unordered list in main.php: |
- | == PHP == | + | <code php> |
+ | $pdf_plugin | ||
+ | if ( $pdf_plugin ) { | ||
+ | if ( !plugin_isdisabled($pdf_plugin-> | ||
+ | print '< | ||
+ | print ' | ||
+ | echo exportlink($ID, | ||
+ | print '" | ||
+ | print '</ | ||
+ | } | ||
+ | } | ||
+ | </ | ||
- | The html2ps script | + | The appropriate bit of CSS is added for tab_pdf in dokubook_design.css. |
- | * Edit your '' | + | == Monobook == |
- | * Restart Apache. | + | |
- | == CSS == | + | When using the template “monobook for DokuWiki”, |
- | The html2pdf script doesn't know how to handle the !important CSS property so internal links do not get styled. If you want them to show up as they appear on the web page, go into your template and edit '' | + | <code php> |
+ | $monobook['defaulttoolbox' | ||
+ | $monobook['defaulttoolbox'][' | ||
+ | </ | ||
+ | |||
+ | ===== Issues and Requests ===== | ||
+ | |||
+ | You can either use the forum above, or add below for any discussion about problems/requests you might have. Some of the old issues have been moved to the FAQ. | ||
+ | |||
+ | === Use with the FCKG plugin === | ||
- | ===== Requests ===== | ||
> I'm using the [[plugin: | > I'm using the [[plugin: | ||
> So, would it be possible to somehow convert such a document (which includes, for example tables with colored cells, etc.) to PDF with html2pdf? | > So, would it be possible to somehow convert such a document (which includes, for example tables with colored cells, etc.) to PDF with html2pdf? | ||
Line 104: | Line 108: | ||
This package uses a library maintained by someone else which is just focusing on converting html to pdf. | This package uses a library maintained by someone else which is just focusing on converting html to pdf. | ||
- | ===== Problems ====== | + | === Some Rendering Errors === |
- | + | ||
- | ==== Some Rendering Errors | + | |
> I just installed the html2pdf Plugin. It's great an I like its performance. But I stumbled upon two Problems: First I wanted to export a gcalender produced by the gcalender Plugin, but it did not render the Pictures the PDF just showed the Text Second I was using an .htaccess to secure the Wiki. I got a lot of 401 errors as long I had this activated. Wen I deactivated it the Plugin just worked fine. My question is whether there are any workarounds to get rid of the two mentioned problems. | > I just installed the html2pdf Plugin. It's great an I like its performance. But I stumbled upon two Problems: First I wanted to export a gcalender produced by the gcalender Plugin, but it did not render the Pictures the PDF just showed the Text Second I was using an .htaccess to secure the Wiki. I got a lot of 401 errors as long I had this activated. Wen I deactivated it the Plugin just worked fine. My question is whether there are any workarounds to get rid of the two mentioned problems. | ||
Line 114: | Line 116: | ||
The second problem, I'm a bit curious as to your setup. I'm using 2008 DokuWiki with Apache which has an AllowOverRide all setting for the DokuWiki directory. Other than that, I leave DokuWiki to handle the access (I think it uses one .htaccess file in the root folder - but I might be wrong about that, haven' | The second problem, I'm a bit curious as to your setup. I'm using 2008 DokuWiki with Apache which has an AllowOverRide all setting for the DokuWiki directory. Other than that, I leave DokuWiki to handle the access (I think it uses one .htaccess file in the root folder - but I might be wrong about that, haven' | ||
- | ==== Page not Showing up ==== | + | === Poor Graphics |
- | > I recently installed this addon, but my PDF is showing a blank page. I have done everything this site and the other linked from this page has suggested but to no > prevail. | + | > I have installed the plugin html2pdf and when I tried it, the PDF-file that has been generated was good but not as far as those which are generated on the [[http:// |
- | + | ||
- | *Plugin DOES show up in the admin section of DokuWiki | + | |
- | *Tried with ALL access and restricted | + | |
- | *http.conf makes _export/ | + | |
- | + | ||
- | > Thanks | + | |
- | > Jason - 2009.06.24 | + | |
- | + | ||
- | * Check that the html is being made in _doku_dir_/ | + | |
- | * Check that the html2pdf is working with the systemcheck link in the troubleshooting section above. | + | |
- | * Especially check curl and ghostscript - you need php with curl use flag and ghostscript package installed. | + | |
- | * Make sure your entire directory is read/ | + | |
- | + | ||
- | + | ||
- | + | ||
- | ==== Large File Size ==== | + | |
- | + | ||
- | > After installing html2pdf, i tried and generated pdf file 15.2Mb size from 2 pages of simple text. Is this a normal behavior or i did something wrong? | + | |
- | + | ||
- | + | ||
- | Aye, thats normal. The holy grail of easily convertable documents isn't really here yet (though I've seen a project aiming to get there), but this is the best I've seen for faithfully rendering what you see in a dokuwiki page to pdf, even if it is pretty heavy getting there. I wouldn' | + | |
- | + | ||
- | ==== Poor Graphics ==== | + | |
- | + | ||
- | > I have installed the plugin html2pdf and when I tried it, the PDF-file that has been generated was good but not as far as those which are generated on the [[http://> snorriheim.dnsdojo.com/ | + | |
> I have maybe a file to modify, to configure the PDF export, but were is it? What can I put into it to have a good result as on the demo website?\\ | > I have maybe a file to modify, to configure the PDF export, but were is it? What can I put into it to have a good result as on the demo website?\\ | ||
> Thanks!\\ | > Thanks!\\ | ||
Line 147: | Line 124: | ||
Run the systemcheck link (see the troubleshooting section above) and check everything is in working order. Is it primarily a fonts or graphics problem? | Run the systemcheck link (see the troubleshooting section above) and check everything is in working order. Is it primarily a fonts or graphics problem? | ||
+ | |||
+ | |||
+ | === Too heavy === | ||
+ | I see the interest to include the font, but the result is really too heavy; such files cannot even be sent by mail! \\ | ||
+ | Pat -- 2010-11-09 |
plugin/html2pdf.1261849104.txt.gz · Last modified: 2009-12-26 18:38 by 125.131.236.242