DokuWiki

It's better when it's simple

User Tools

Site Tools


plugin:dw2pdf:pdftemplate

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Last revisionBoth sides next revision
plugin:dw2pdf:pdftemplate [2017-11-19 23:36] Klap-inplugin:dw2pdf:pdftemplate [2023-03-21 21:37] – [Replacements] USERNAME added 2.211.18.113
Line 7: Line 7:
  
 {{ :plugin:dw2pdf:pdfexport_with_default_tpl.png?direct&200|The default shipped PDF template}} {{ :plugin:dw2pdf:pdfexport_with_default_tpl.png?direct&200|The default shipped PDF template}}
-To create a new template, just create a new folder within the plugin's ''lib/plugins/dw2pdf/tpl/'' folder and put your header, footers, cover page, and style definitions in it. See ''lib/plugins/dw2pdf/tpl/default'' for an example. Do //not modify// the template ''default'', this template will be overwritten on updates, so you will lose your changes. +To create a new template, just create a new folder within the plugin's ''lib/plugins/dw2pdf/tpl/'' folder and put your header, footers, cover page, and style definitions in it. See ''lib/plugins/dw2pdf/tpl/default'' for an example. Do //**not modify**// the template ''default'', this template will be overwritten on updates, so you will lose your changes.  
 + 
 +After creation, you set in the [[plugin:config|Configuration Manager]] that your template should be used for exports. Eventually, if you like to change template incidentally, you can use the URL parameter ''&tpl=<foldername>''
 + 
 +Default the css is included for the print view (which replaces parts of the screen view to make it leaner - see also Print preview of your browser) of the wiki-[[:template]] and the active [[:plugins]]. The PDF-templates can override these styles.
  
 ===== Headers and Footers ===== ===== 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/footers can be used on the first page of a document. If a file does not exist the next more generic one will be tried. Eg. if you don't differ between even and odd pages, just the ''header.html'' is used.+The following files can be created and will be used to set headers and footers on odd or even pages. Special headers/footers can be used on the first page of a document. If a file does not exist the next more generic one will be tried. E.g. if you don't differ between even and odd pages, just the ''header.html'' is used.
  
   * ''header.html'' -- Header for all pages   * ''header.html'' -- Header for all pages
Line 24: Line 28:
  
   * ''citation.html'' -- Citationbox to be printed after each article   * ''citation.html'' -- Citationbox to be printed after each article
 +
   * ''cover.html'' -- If exists, added once before first page   * ''cover.html'' -- If exists, added once before first page
   * ''back.html'' -- If exists, added once after last page   * ''back.html'' -- If exists, added once after last page
Line 47: Line 52:
   * ''@INC@'' -- the absolute wiki install directory on the filesystem   * ''@INC@'' -- the absolute wiki install directory on the filesystem
   * ''@DATE(<date>[, <format>])@'' -- formats the given date with [[config:dformat]] or with the given format such as ''%Y-%m-%e'', e.g. this would give just the current year ''@DATE(@DATE@,%Y)@''   * ''@DATE(<date>[, <format>])@'' -- formats the given date with [[config:dformat]] or with the given format such as ''%Y-%m-%e'', e.g. this would give just the current year ''@DATE(@DATE@,%Y)@''
 +  * ''@USERNAME@'' -- name of the user who creates the PDF
  
 //Remark about Bookcreator//: //Remark about Bookcreator//:
Line 54: Line 60:
   * ''@PAGEURL@'' -- URL to the article   * ''@PAGEURL@'' -- URL to the article
   * ''@UPDATE@'' -- Time of the last update of the article   * ''@UPDATE@'' -- Time of the last update of the article
-  * ''@QRCODE@'' -- QR code image pointing to the original page url (requires an online generator, see config setting)+  * ''@QRCODE@'' -- QR code image pointing to the original page url (uses an online generator on https://quickchart.io, see [[plugin:dw2pdf:configuration#qr_code]] config setting). On a closed LAN-network, this could result in timeouts, Error 504)
  
 ===== Styles ===== ===== Styles =====
Line 63: Line 69:
  
 You can use all the CSS that is understood by mPDF \\ (See https://mpdf.github.io/css-stylesheets/supported-css.html) You can use all the CSS that is understood by mPDF \\ (See https://mpdf.github.io/css-stylesheets/supported-css.html)
 +
 +
 +==== Style sheets loaded by dw2pdf ====
 +
 +Some background about css file loading. The dw2pdf loads the print style sheets of the wiki including these of plugins to get a leaner appearance of the article. A first impression can be gotten by looking in the print preview of your browser. Note that due to limitations of the mPDF-library, the final pdf can look different. 
 +
 +During the generation of the pdf the following files are tried to load in the given order:
 +  * ''lib/styles/screen.css''
 +  * ''lib/styles/print.css''
 +  * per plugin:
 +    * only if requested in config setting ''plugin»dw2pdf»usestyles'':
 +      * ''lib/plugins/<plugin>/screen.css'' and ''screen.less''
 +      * ''lib/plugins/<plugin>/style.css'' and ''style.less''
 +    * ''lib/plugins/<plugin>/all.css'' and ''all.less''
 +    * if exists:\\ ''lib/plugins/<plugin>/pdf.css'' and ''pdf.less''
 +    * if pdf.css/pdf.less not exists:\\ ''lib/plugins/<plugin>/print.css'' and ''print.less''
 +  * for the active [[:template]]:
 +    * ''lib/tpl/<template>/pdf.css'' and ''pdf.less''
 +    * ''lib/tpl/<template>/css/pdf.css'' and ''pdf.less''
 +    * ''lib/tpl/<template>/styles/pdf.css'' and ''pdf.less''
 +  * ''lib/plugins/dw2pdf/conf/style.css'' (overwritten on each plugin update)
 +  * ''lib/plugins/dw2pdf/tpl/<pdf-template>/style.css'' (note that the supplied example pdf-template "default" is overwritten on each plugin update, so rename/copy that pdf-template folder before making changes)
 +  * ''lib/plugins/dw2pdf/conf/style.local.css'' (not overwritten on plugin updates)
 +
  
plugin/dw2pdf/pdftemplate.txt · Last modified: 2023-08-15 08:33 by Klap-in

Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Share Alike 4.0 International
CC Attribution-Share Alike 4.0 International Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki