plugin:dw2pdf
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
plugin:dw2pdf [2017-11-17 14:50] – 130.112.1.3 | plugin:dw2pdf [2023-11-25 23:50] (current) – version upped andi | ||
---|---|---|---|
Line 6: | Line 6: | ||
email : andi@splitbrain.org, | email : andi@splitbrain.org, | ||
type : action, renderer | type : action, renderer | ||
- | lastupdate : 2017-11-15 | + | lastupdate : 2023-11-25 |
- | compatible : 2016-06-26, Weatherwax, Binky, Ponder Stibbons, Hrun,Detritus, Frusterick Manners | + | compatible : !Greebo, Hogfather, Igor, Jack Jackrum |
depends | depends | ||
conflicts | conflicts | ||
Line 22: | Line 22: | ||
===== Download and Installation ===== | ===== Download and Installation ===== | ||
- | Download | + | Search |
- | :!: The plugin | + | Only **PHP 7.4 up to PHP 8.1** are supported by dw2pdf |
- | Only **PHP 5.6 and newer** are supported by dw2pdf plugin. | + | To export (png) images with an alpha channel (used for transparency), |
- | To export images with an alpha channel (used for transparency), | + | |
- | + | ||
- | | + | |
Also see the [[: | Also see the [[: | ||
Line 44: | Line 42: | ||
===== Features ===== | ===== Features ===== | ||
- | * Uses the [[http://www.mpdf1.com/|mPDF]] PHP library. | + | * Uses the [[https://mpdf.github.io|mPDF]] PHP library. |
* Handles different languages (it bundles the large, but relatively complete Unicode font). | * Handles different languages (it bundles the large, but relatively complete Unicode font). | ||
* Easy customizing through headers, footers and CSS | * Easy customizing through headers, footers and CSS | ||
Line 56: | Line 54: | ||
* Release based at previous mPDF 5.7.4 version -- [[https:// | * Release based at previous mPDF 5.7.4 version -- [[https:// | ||
- | ===== Installation | + | ===== Usage ===== |
+ | There are three ways to export: | ||
+ | * **Export one page**\\ You simply need to call the page with an additional '' | ||
+ | * **Export an entire namespace**\\ There is the URL parameter '' | ||
+ | * **Export selection of pages**\\ If you need to select just some pages to export to one PDF, you can use [[plugin: | ||
- | To use the plugin, you simply need to call the page passing it a //" | + | ===== HowTo' |
+ | Please refer to the following pages to learn how to use or support | ||
+ | * Set [[plugin: | ||
+ | * [[plugin: | ||
+ | * [[plugin: | ||
+ | * Plugin developers: [[plugin: | ||
- | See the [[# | ||
- | ==== Export button in pagetools/ | ||
- | |||
- | {{: | ||
- | |||
- | For more details about how to implement it in your template, see [[plugin: | ||
===== Syntax ===== | ===== Syntax ===== | ||
Line 78: | Line 79: | ||
Handling of [[config: | Handling of [[config: | ||
- | ===== Configuration ===== | ||
- | The plugin provides a few configuration settings that can be configured in the [[plugin: | ||
- | |||
- | * ** Only via url-parameters: | ||
- | |||
- | ==== Document Title ==== | ||
- | |||
- | '' | ||
- | * '' | ||
- | '' | ||
- | * '' | ||
- | * '' | ||
- | * '' | ||
- | * '' | ||
- | Parameter '' | ||
- | * '' | ||
- | |||
- | * ** Override-able via url-parameters: | ||
- | |||
- | If a url-parameter is provided, that value is used, otherwise the plugin config setting from the Configuration Manager is used. | ||
- | |||
- | ==== Pagesize ==== | ||
- | |||
- | '' | ||
- | A page format as supported by mPDF. Usually '' | ||
- | |||
- | ==== Orientation ==== | ||
- | |||
- | '' | ||
- | Page orientation of the whole document, you can select '' | ||
- | |||
- | Also you can change the orientation of only some pages. Adding the syntax will change the orientation, | ||
- | |||
- | ~~PDF: | ||
- | ~~PDF: | ||
- | |||
- | ==== Double-sided document ==== | ||
- | |||
- | '' | ||
- | By default a double-sided PDF document is outputted. The first page is an odd page (left hand-side page) and further even-odd page pairs are added. Disabling this will output a single-sided document with only odd pages. The single-sided document doesn' | ||
- | |||
- | ==== Table of Contents ==== | ||
- | |||
- | '' | ||
- | '' | ||
- | An auto-generated Table of Contents can be included by enabling the setting ' | ||
- | |||
- | ==== Bookmarks ==== | ||
- | |||
- | '' | ||
- | By default the plugin generates PDF bookmarks for each headline in the source page. You can lower the number here to include only higher level headlines in the bookmarks. Set it '' | ||
- | |||
- | ==== Template ==== | ||
- | |||
- | '' | ||
- | Choose which PDF template (see below) should be used by default. The template can be overridden with the '' | ||
- | |||
- | |||
- | * ** Only via configuration manager: ** | ||
- | |||
- | ==== Output Control ==== | ||
- | |||
- | The '' | ||
- | |||
- | ==== Caching ==== | ||
- | |||
- | By default, generated PDFs are cached. This includes embedded images. This means the ACLs for embedded images will not be rechecked when a user requests a cached PDF. If this is a problem, you should disable caching. | ||
- | |||
- | ==== Plugin Styles ==== | ||
- | |||
- | The plugin automatically uses '' | ||
- | |||
- | ==== QR code==== | ||
- | |||
- | Via a placeholder a QR code can be added in the pdf-templates, | ||
- | |||
- | ==== Show export button ==== | ||
- | |||
- | Lets you show or hide the toolbar button in the pagetools. | ||
- | |||
- | ==== Plugin Compatibility ==== | ||
- | |||
- | To work with other plugins you have to add '' | ||
- | var $supportedModes = array(' | ||
- | Otherwise you may have problems with caching. | ||
- | |||
- | ===== PDF Templates ===== | ||
- | |||
- | Templates define the design of the created PDF files and are a good way to easily customize them to your Corporate Identity. | ||
- | |||
- | To create a new template, just create a new folder within the plugin' | ||
- | |||
- | ==== Headers and Footers ==== | ||
- | |||
- | The following files can be created and will be used to set headers and footers on odd or even pages. Special headers/ | ||
- | |||
- | * '' | ||
- | * '' | ||
- | * '' | ||
- | * '' | ||
- | |||
- | * '' | ||
- | * '' | ||
- | * '' | ||
- | * '' | ||
- | |||
- | * '' | ||
- | * '' | ||
- | * '' | ||
- | |||
- | You can use all HTML that is understood by mpdf (See http:// | ||
- | |||
- | If you reference image files from your pdf-template file, be sure to prefix them with the @TPLBASE@ parameter (See [[# | ||
- | |||
- | ==== Replacements ==== | ||
- | |||
- | The following replacement patterns can be used within the header and | ||
- | footer files. | ||
- | |||
- | * '' | ||
- | * '' | ||
- | * '' | ||
- | * '' | ||
- | * '' | ||
- | * '' | ||
- | * '' | ||
- | * '' | ||
- | * '' | ||
- | |||
- | //Remark about Bookcreator//: | ||
- | The page dependent replacements are only for '' | ||
- | In the headers and footers the ID of the bookmanager page of the Bookcreator is applied. | ||
- | * '' | ||
- | * '' | ||
- | * '' | ||
- | * '' | ||
- | |||
- | ==== Styles ==== | ||
- | |||
- | Custom stylings can be provided in the following file of your pdf-template folder: | ||
- | |||
- | * '' | ||
- | |||
- | You can use all the CSS that is understood by mpdf \\ (See https:// | ||
- | |||
- | ===== For developers ===== | ||
- | |||
- | If you're a plugin developer and want to make your syntax plugin compatible with the PDF export, here are a few tips: | ||
- | |||
- | * provide a useful '' | ||
- | * if you want to use special stylings for PDF export provide a '' | ||
- | * your HTML and CSS should be simple enough to be understood by mpdf (see [[https:// | ||
- | |||
- | If you want to provide custom HTML for the PDF export you should check if the renderer is a '' | ||
- | |||
- | <code php> | ||
- | function render($mode, | ||
- | if($mode == ' | ||
- | | ||
- | // this is the PDF export, render simple HTML here | ||
- | | ||
- | // this is normal XHTML for Browsers, be fancy here | ||
- | } | ||
- | | ||
- | } | ||
- | return false; | ||
- | } | ||
- | </ | ||
- | |||
- | By default, '' | ||
- | |||
- | <code php> | ||
- | $R->doc .= '< | ||
- | </ | ||
===== Issues and Requests ===== | ===== Issues and Requests ===== | ||
- | Please report issues and requests in the issue tracker: https:// | + | Please report issues and requests in the issue tracker:\\ https:// |
==== How to collect more debug info? ==== | ==== How to collect more debug info? ==== | ||
Line 277: | Line 104: | ||
Feel free to add yours here: | Feel free to add yours here: | ||
- | * [[http:// | ||
- | * [[http:// | ||
- | * [[http:// | ||
* [[http:// | * [[http:// | ||
- | * [[http:// | + | * [[http:// |
- | * [[http:// | + | * [[http:// |
- | * [[http:// | + | |
- | * [[http:// | + | |
- | * [[http:// | + | |
- | * [[http:// | + | |
- | * [[http:// | + | |
- | * [[http:// | + | |
- | * [[http:// | + | |
* [[http:// | * [[http:// | ||
- | * [[http:// | + | * [[http:// |
+ | * [[http:// | ||
+ | * [[http:// | ||
+ | * [[http:// | ||
* [[http:// | * [[http:// | ||
- | * [[http://www.estechnical.co.uk/docs|ESTechnical Documentation (English)]] | + | * [[https://webge.fr/dokuwiki|WEBGE wikis (french)]] |
- | * [[http:// | + | |
- | * [[http:// | + | |
- | * [[http:// | + | |
- | * [[http:// | + | |
- | ===== Linked Images | + | ===== Other info ===== |
+ | ==== Linked Images ==== | ||
Not all image format variations are successfully embedded in the PDF, even if they are properly displayed in DokuWiki. If you get missing images in your output, try stripping the Alpha channel of your (e.g. PNG) images. | Not all image format variations are successfully embedded in the PDF, even if they are properly displayed in DokuWiki. If you get missing images in your output, try stripping the Alpha channel of your (e.g. PNG) images. | ||
Line 307: | Line 124: | ||
If using full http links, make sure the permissions are set up for retrieving the image directly (test in a browser). DokuWiki may prevent outside access to images in the data/media directory. | If using full http links, make sure the permissions are set up for retrieving the image directly (test in a browser). DokuWiki may prevent outside access to images in the data/media directory. | ||
- | ===== Password protection of generated documents | + | ==== Password protection of generated documents ==== |
To set fixed password for generated documents, edit: | To set fixed password for generated documents, edit: | ||
- | '' | + | '' |
and add following lines: | and add following lines: | ||
Line 322: | Line 139: | ||
(filips) | (filips) | ||
- | ===== iPhone/iPad ===== | ||
- | When using with an iPhone/iPad disable the setting: Seiten mit gzip komprimiert ausliefern | + | ==== Hyphenation ==== |
- | otherwise this plugin will not generate PDF-Files on iPhone/ | + | |
- | ==== Discussion ==== | + | With the following setting in ''style.css'' |
- | === Linked Images === | + | < |
- | Is it possible to somehow add a tutorial for how to get external embedded images into the pdf? i'd really appreciate that. | + | body { |
- | === Date format example === | + | hyphens: auto; |
- | An example for the footer HTML placeholder / variable to show just the Year so that you can add a dated copyright notice : '' | + | } |
- | === Disable Hyperlinks in export === | + | |
- | >Is there a way to disable all hyperlinks in the pdf export? | + | |
- | + | ||
- | The only way I have found is to modify the file **mpdf.php**: | + | |
- | < | + | |
- | /** | + | |
- | * add this after line 8816 | + | |
- | */ | + | |
- | $annot=''; | + | |
</ | </ | ||
- | === Additional config pages === | + | The hyphenation is of course language dependent. Normally, the wiki login language is used. If the [[translation|translation plugin]] is installed, the language selected here is used for hyphenation when creating |
- | Feature request : Can we have a footer_last.html and header_last.html for the back cover page or front cover page? | + | |
- | === Styling and sizing the box that appears when hovering over the TOC in the pdf === | + | ==== Rendering Limitations ==== |
- | I see a huge yellow box with a number in it when hovering over the TOC in the PDF. | + | |
+ | Because |
plugin/dw2pdf.1510926652.txt.gz · Last modified: 2017-11-17 14:50 by 130.112.1.3