Manual:Extension/PDFCreator: Difference between revisions

Redaktion (talk | contribs)
Created page with "If you have server access, you can customize the PDF templates for your wiki. If your wiki is hosted in the ''BlueSpice cloud'', basic customizations can be made directly in the wiki. These instructions refer to the PDF single page export and the book export. Please note that the book export is only available in''BlueSpice pro''. == Directory paths for templates == === Standard BlueSpice templates === *'''Com..."
 
Redaktion (talk | contribs)
No edit summary
 
(48 intermediate revisions by the same user not shown)
Line 1: Line 1:
If you  have server access, you can customize the PDF templates for your wiki. If your wiki is hosted in the ''BlueSpice cloud'', basic customizations can be made [[Manual:Extension/BlueSpiceUniversalExport/Customization|directly in the wiki]]. These instructions refer to the PDF single page export and the book export. Please note that the book export is only available in''BlueSpice pro''.
{{DISPLAYTITLE:PDF export (with template customization)}}


== Directory paths for templates ==
{{Textbox|boxtype=important|header=Migration of existing custom PDF templates:|text=Custom PDF templates from earlier BlueSpice versions require manual updates to the new PDFCreator functionality.
Depending on the requirements, the templates can be newly created in the wiki. For complex customizations, the support of a developer is required.


=== Standard BlueSpice templates ===
*'''Common:''' extensions/BlueSpiceUEModulePDF/data/PDFTemplates/common
*'''Single page:''' extensions/BlueSpiceUEModulePDF/data/PDFTemplates/BlueSpice
*'''Book:''' extensions/BlueSpiceUEModuleBookPDF/data/PDFTemplates/BlueSpice Book


{{Textbox|boxtype=important|header=|text=The '''Common''' directory contains common files such as  ''page.css'' that defines the page margins.|icon=no}}
For existing BlueSpice cloud templates, there are some [[Manual:Extension/PDFCreator/Migrating_existing_cloud_templates|instructions for the necessary changes]].|icon=yes}}


=== Safe directories for your own templates ===
== Exporting a page or a book ==
The PDF templates may not be customized in the standard template directories (see above) since an update will overwrite these directories.
To print a page to PDF, click on the page-icon in the page tools. This opens the export dialog field.
[[File:PDF export dialog.png|alt=dialog with dropdown menus for selecting export mode and template|center|thumb|450x450px|PDF export dialog]]
Select the export settings.


You need to store your custom PDF templates in safe directories instead.  
* '''Mode:'''
** ''Page:'' Prints the page.
** ''Page with subpages:'' Prints the page and all its subpages. This option is only shown if the page has subpages.
** ''Page with linked pages:'' Prints the page and the pages that are linked directly from this page
* '''Template:'''
** ''StandardPDF:'' This prints the page or pages without a cover sheet  (unless the template has been edited).
** ''StandardBookPDF:'' This adds a cover sheet to the PDF (unless the template has been edited).
{{Textbox|boxtype=note|header=|text=Whether linked pages should be considered in the PDF export is defined in the chosen export template.|icon=yes}}


'''Examples of safe directories:'''
By default, the template ''StandardPDF'' shows the wiki's logo (from the [[Manual:Extension/FlexiSkin|skin settings page]]). If there are no custom settings, the default BlueSpice logo is used.
=== Exporting media links ===
By default, media links (=links that point directly to the file on the server) will add an attachment to the exported PDF File. This is independent of the chosen export mode (Page, Page with linked pages).


*images/<MyPDFTemplates>
This is also true for PDF files that are embedded via Content Droplet PDF preview.
*extensions/BlueSpiceFoundation/data/PDFTemplates


== Editing the templates ==
If no attachments should be added, this has to be defined in the [[Manual:Extension/PDFCreator#Properties|Properties]] of the PDF template.
The PDF templates for single pages and books are very similar.


=== Creating your own templates ===
=== Exporting pages with linked pages ===
The contents of the directories
When pages are exported with their linked pages,  link types are processed as follows:


*extensions/BlueSpiceUEModulePDF/data/PDFTempates
* '''Media links''' will add an attachment to the exported PDF File
*extensions/BlueSpiceUEModuleBookPDF/data/PDFTempates
* '''File links''' are clickable and forward to the corresponding file page
* '''Mentions''' are clickable and forward to the user page
If no attachments should be added, this has to be defined in the [[Manual:Extension/PDFCreator#Properties|Properties]] of the PDF template.


Copy to "extensions/BlueSpiceFoundation/data/PDFTemplates" and rename it
If no links to pages that are not included in the PDF should be added,  this has to be defined in the [[Manual:Extension/PDFCreator#Properties|Properties]] of the PDF template.


*"common" => "common" (remains)
== Adding a new template ==
*"BlueSpice" => "MyPageTemplate"
By default, the wiki provides two PDF templates:
*"BlueSpice Book" => "MyBookTemplate"


The template names must be changed later in the associated template.php.
* '''StandardPDF:''' Template without a cover page for the single-page export.
* '''StandardBookPDF:''' Template with a cover page for the book export.  


=== Directory structure of the templates ===
Starting with '''BlueSpice 5.1''', PDF templates can be created from the page ''Special:PDF templates''.  
data/PDFTemplates
    |_ common
    |    |_ stylesheets ('''page.css -> Settings for page margins''')
    |
    |_ MyPageTemplate
    |    |_ template.php
    |    |_ template.html
    |    |_ images
    |    |_ stylesheets ('''styles.css -> Logo in Page Header''')
    |
    |_ MyBookTemplate
          |_ template.php
          |_ template.html
          |_ images
          |_ stylesheets ('''styles.css -> Logo in Page Header''')


=== Customization of the templates ===
=== Copy an existing template ===
'''To create a new PDF template:'''


==== template.php ====
# '''Go''' to the page ''Special:PDF_templates''.
The file <code>template.php</code> contains the description or definition of the template. All css files and, if applicable, fonts that are to be used in the template must be specified here.
# '''Copy''' an existing template.[[File:PDF templates - copy.png|alt=special page "PDF templates" with selected standard book pdf to be copied|center|thumb|600x600px|Copy a template]]
# '''Enter''' a name for the new template.
# '''Click''' ''Copy.''
'''Click''' ''Edit template'' to start customizing your template.


The images must also be specified, for example the images that should be used in the header.
[[File:Pdf templates - properties.png|alt=PDF templates page with the edit link of the new template |center|thumb|600x600px|Edit template properties]]


=== Select general template properties ===
# '''Select''' the page orientation and the [[Manual:Extension/PDFCreator#Properties|general export properties]] (for example, whether to show the Table of Contents for each page or whether to include links to pages that are not exported in the PDF itself).
# '''Click''' Next.


=== Select the template elements ===
Select the checkboxes for each element you want to include in your template:


Special requirements for the book:
* Header: Page header for the template pages
* Footer: Page footer for the template pages
* Document preface: Cover page
* Document appendix: Additional page that is added at the end of the pdf. It is formatted like the content pages (with header and footer) and adds to the PDF page count.


The PDF template for the book accesses the common directory of the single page template.
'''Click''' ''Configure'' for each template element to design the layout.
For this reason, the '''template.php''' contains a variable '''$sCommonDir''' that points to the directory. If the templates are copied into their own directory, this path must be adjusted.


=== Configure the header ===
The header elements can consist of a header image (usually your logo) and some text (which can be a combination of predefined parameters and your own text).
[[File:Pdf templates - header editor.png|alt=Edit idalog for the header section|center|thumb|450x450px|Defining the header]]
If you want to show an image that is different from your wiki logo, you can select "Use custom logo" and enter an existing image name or upload a new image.


=== Configure the footer ===
By default, the wiki provides [[mediawikiwiki:Help:Magic_words#Localization_functions|localization system messages]] for each footer section.  Use system messages if you want to support the language settings of your users. For example, in an English wiki, the English system message for <code><nowiki>{{int:pdfcreator-pdf-disclaimer}}</nowiki></code>  can be changed on the page <code>MediaWiki:pdfcreator-pdf-disclaimer</code>. the German language version on page <code>MediaWiki:pdfcreator-pdf-disclaimer/de</code>.


'''Important changes in the sections:'''
Alternatively, you can simply type your own text if the PDF export does not have to consider user languages. Or leave the section blank if you don't want to print text.


<u>Section '''info''':</u>
=== Configure the document preface (PDF cover) ===
You can define the following elements on your cover page:


*name => name of the template (e.g. MyPageTemplate). '''MUST''' match the directory name
Background image:


<u>Section '''resources''':</u>
* If a bookshelf image exists, the bookshelf image is used as cover image for the Book PDF export.
* If no bookshelf image exists, the default image defined in the Configuration Manager is used as cover image for the Book PDF export.
* If a custom image is defined in the PDF template, the custom image will be used for the Book PDF export.
If you do not want to use any background image on your PDF cover page, all three locations for defining a book image must be empty.


*STYLESHEETS => if necessary, specify additional style sheets here. These must also be specified in the template.html. If you use other fonts, they must also be specified here.
=== Properties ===
*IMAGES => enter the images you want to use here. Example 'images/bs-header.jpg'
The following properties can be configured:<syntaxhighlight lang="json">
{
"embed-page-toc": true,
"nsPrefix": true,
"attachments": true,
"suppress-links": false,
"no-redirect": true,
"coverBackground": ""
}


<u>Section '''messages''':</u>
</syntaxhighlight>
{| class="wikitable" style="width: 100%;"
! style="" |Label
! style="" |Name
! style="" |Default value
! style="" |Description
|-
| style="" |Show namespace prefix
| style="" |nsPrefix
| style="" |true
| style="" |The namespace prefix of pages is not printed in the page titles.
|-
| style="" |Show table of contents
| style="" |embed-page-toc
| style="" |true
| style="" |Include the table of contents of each exported page.
|-
| style="" |Ignore redirect
| style="" |no-redirect
| style="" |false
| style="" |If links are redirecting to a different page, the target page is not included in the pdf.
|-
| style="" |Allow attachments
| style="" |attachments
| style="" |true
| style="" |If files are directly linked with syntax <code>Media:</code> , the files are also attached in the pdf.
|-
| style="" |Disable links in PDF
| style="" |suppress-links
| style="" |false
| style="" |Replaces all links in the pdf with a span-element if they do not link to a target within the pdf.
|-
| style="" | -
| style="" |coverBackground
| style="" |<File:filename.png>
| style="" |This property is set programmatically when a custom cover background image is provided.
|}


*Here, texts can be assigned to so-called msg keys. These msg keys can be used in the template.html, e.g. the disclaimer.
==PDF template slots==
*en, de, de-formal are the languages. Unlike texts written in template.html, these msg keys are used depending on the language.
All templates are saved as subpages of <code>MediaWiki:PDFCreator</code>.


==== template.html ====
There, you can see the syntax for the different template elements.
Basic structure of the page. Here, the page number, for example, can be removed from the footer.
If you want to include your own css files, they must be specified here in the '''<head>'''.


Example:
=== Template elements ===
  <link href="stylesheets/styles.css" type="text/css" rel="stylesheet" />
Each template consists of  the same elements (slots):
{| class="wikitable" style="width: 100%;"
! style="" |Template slot
! style="" |Description
|-
! style="" |Header
| style="" |The page header of each PDF page. The basic structure is:<syntaxhighlight lang="html">
<div class="pdfcreator-runningheaderfix">
<table>
<tr>
<td>
<div class="pdfcreator-runningheader-logo">
{{{logo}}}
</div>
</td>
<td>
<h1 class="title">{{{title}}}</h1>
</td>
</tr>
</table>
</div>
</syntaxhighlight>{{Textbox|boxtype=important|header=Important!|text=The class ''.pdfcreator-runningheaderfix'' is necessary to top-align the header on the page. It works in conjunction with the class-declaration in the "Styles" tab of the template.  Both need to be modified together.|icon=yes}}
|-
! style="" |Content
| style="" |The content layout. The basic structure is:<syntaxhighlight lang="html">
{{{content}}}
</syntaxhighlight>
|-
! style="" |Footer
| style="" |The page footer of each PDF page. The basic structure is:<syntaxhighlight lang="html">
<div class="pdfcreator-runningfooterfix">
<table>
<tr>
<td>
<span>{{int:pdfcreator-pdf-disclaimer}}</span>
</td>
<td>
<span>{{int:pdfcreator-pdf-export-time}}:{{#time:d.m.Y|now}}</span>
</td>
<td>
<span>{{int:pdfcreator-pdf-param-currentpagenumber-label}} </span>{{{currentpagenumber}}}
<span> {{int:pdfcreator-pdf-param-totalpagescount-label}} </span>{{{totalpagescount}}}
</td>
</tr>
</table>
</div>
</syntaxhighlight>{{Textbox|boxtype=important|header=Important!|text=The class ''.pdfcreator-runningfooterfix'' is necessary to top-align the header on the page. It works in conjunction with the class-declaration in the "Styles" tab of the template. Both need to be modified together.|icon=yes}}
|-
! style="" |Document preface
| style="" |The cover page. It is meant for the book export, but can also be used for a page export. The basic structure for a book cover page is:<syntaxhighlight lang="html">
<div class="pdfcreator-intro">
<div class="pdfcreator-intro-title">{{{title}}}</div>
</div>
</syntaxhighlight>{{Textbox|boxtype=important|header=Important!|text=The class ''.pdfcreator-intro'' is necessary to display the image for the {{{logo}}}-parameter. Without this class present in the template, the {{{logo}}}-parameter has no effect.|icon=yes}}
|-
! style="" |Document appendix
| style="" |The last page of the PDF export. It has no predefined basic structure.
|-
! style="" |Styles
| style="" |Style declarations for the CSS classes that are used in any of the template elements. You can [[Manual:Extension/PDFCreator/Standard styles|view the standard styles]] here.
|-
! style="" |Properties
| style="" |Allows to control some aspects of the PDF output. The following properties are available (shown in default settings):<syntaxhighlight lang="json">
{
"embed-page-toc": true,
"nsPrefix": true,
"attachments": true,
"suppress-links": false,
"no-redirect": false,
"coverBackground": "File:filename.jpg"
}
</syntaxhighlight>
|-
! style="" |Description
| style="" |Internal notes for the usage of this template. The description has no effect on the template itself.
|}


=== Customization of the style sheets ===
== Configuration ==
The display can be changed in the style sheets. This concerns e.g.
{{#dpl:title=Manual:Extension/BlueSpiceConfigManager|include=#PDFCreator}}


*Margins
== Customizations ==
*Header with logo
*Headings
*Text colors
*...


=== Semantic property ===
It is possible to print a semantic property value in any template slot. The following example prints the value of the property "Revision_ID" of a page  in the PDF footer.<syntaxhighlight lang="text">
<div class="pdfcreator-runningfooterfix">
{{#show:{{FULLPAGENAME}}|?Revision_ID}}
</div>
</syntaxhighlight>


=== Background color for header and footer ===


<u>'''The most important examples:'''</u>
In the ''Styles'' tab, add:<syntaxhighlight lang="css">
/* add a background color to the header and footer */
.pdfcreator-runningheaderfix, .pdfcreator-runningfooterfix {
background-color: #eee;
}
</syntaxhighlight>This adds a grey background color.


<u>Page margins:</u>
=== Remove the underline from the header and footer ===
In the ''Styles'' tab, add:<syntaxhighlight lang="css">
/* remove the border from the header */
.pdfcreator-runningheaderfix > table {
border-bottom: none !important;
}


'''File:''' common/stylesheets/page.css
/* remove the border from the header */
.pdfcreator-runningfooterfix > table {
border-top: none !important;
}
</syntaxhighlight>


The '''@page''' area is the normal page in portrait format. The page margins are set in the "margin" line (order: top right bottom left).
=== Remove page Table of Contents ===
The table of contents at the beginning of a PDF should be displayed, but not the table of contents for the sections of the pages.




In the ''Styles'' tab, add:<syntaxhighlight lang="css">
/* remove the border from the header */
.pdfcreator-type-page .toc {
    display:none;
}


<u>Background image:</u>
</syntaxhighlight>
To also remove the toc at the beginning of the PDF:<syntaxhighlight lang="css">
/* remove the border from the header */
.toc {
    display:none;
}


'''File:''' common/stylesheets/page.css
</syntaxhighlight>


The '''@page''' area is the normal page in portrait format. The background image is set in the “background” line.
== Related content droplets ==


The background image must be specified in the '''template.php'''. (Only used for the single page at BlueSpice.)
The following content droplets are available:
{| class="wikitable"
|+
! style="" |Droplet name
! style="" |Comments
|-
| style="" |Book PDF link
| style="" |Inserts a link on the page to a book. Clicking the link immediately downloads the PDF.
|-
| style="" |PDF link
| style="" |Inserts a link on the page to the same or any other page. Clicking the link immediately downloads the page.
|-
| style="" |PDF preview
| style="" |Opens the PDF directly on a page in a PDF viewer.
|-
| style="" |Exclude content in PDF
| style="" |Wraps content in the tags <code><nowiki><pdfexcludestart />...<pdfexcludeend /></nowiki></code>You can expand the excluded content by moving the tags in source edit mode to a different content location.
Note: The  tag <code><uenoexport /></code>  is deprecated, but still supported. It should no longer be used.
|-
| style="" |PDF page break
| style="" |The inserted page break marker is visible both in editing and in view mode. To hide this visual marker in view mode, you can add the following declaration to MediaWiki:Common.css:<syntaxhighlight lang="css">
/*Hide PDF page break marker in view mode */
.bs-tag-pdfpagebreak {display:none}
.bs-tag-pdfpagebreak.ve-ce-leafNode {display:block}


</syntaxhighlight>
|}


== Semantic Mediawiki ==
The books in which a page exists can be queried via the semantic property  ''Books'' (''Property:Books'').
[[File:property books.png|alt=Display of values for property "book" of a wikipage|center|thumb|450x450px|Semantic property "Books"]]


<u>Header (logo):</u>
== Migrating existing cloud templates ==
[[Manual:Extension/PDFCreator/Migrating existing cloud templates|For information about migrating your existing cloud template, click here.]]


'''File:''' MyPageTemplate/stylesheets/page.css
{{translation}}
 
or
 
'''File:''' MyBookTemplate/stylesheets/page.css
 
With '''#bs-runningheaderfix''', the logo for the header is set in the "background" line.
 
The logo must be specified in the '''template.php'''.
 
The size of the header and logo can be influenced with the parameters “margin”, “background-size” and “height”. The “width” line should remain at 21cm (entire page width).
 
== Configuring the templates ==
PDF templates cannot be configured via the Wiki.
 
The following lines must be added to LocalSettings.php:
 
*Example for single page:
 
  $GLOBALS['bsgUEModulePDFTemplatePath'] = 'extensions/BlueSpiceFoundation/data/PDFTemplates';
  $GLOBALS['bsgUEModulePDFDefaultTemplate'] = 'MyPageTemplate';
 
*Example for book:
 
  $GLOBALS['bsgUEModuleBookPDFTemplatePath'] = 'extensions/BlueSpiceFoundation/data
 
[[de:Handbuch:Erweiterung/BlueSpiceUniversalExport/PDF_Vorlagen_erstellen]]

Latest revision as of 14:40, 28 May 2025


Migration of existing custom PDF templates:

Custom PDF templates from earlier BlueSpice versions require manual updates to the new PDFCreator functionality. Depending on the requirements, the templates can be newly created in the wiki. For complex customizations, the support of a developer is required.


For existing BlueSpice cloud templates, there are some instructions for the necessary changes.


Exporting a page or a book

To print a page to PDF, click on the page-icon in the page tools. This opens the export dialog field.

dialog with dropdown menus for selecting export mode and template
PDF export dialog

Select the export settings.

  • Mode:
    • Page: Prints the page.
    • Page with subpages: Prints the page and all its subpages. This option is only shown if the page has subpages.
    • Page with linked pages: Prints the page and the pages that are linked directly from this page
  • Template:
    • StandardPDF: This prints the page or pages without a cover sheet (unless the template has been edited).
    • StandardBookPDF: This adds a cover sheet to the PDF (unless the template has been edited).
Whether linked pages should be considered in the PDF export is defined in the chosen export template.


By default, the template StandardPDF shows the wiki's logo (from the skin settings page). If there are no custom settings, the default BlueSpice logo is used.

Exporting media links

By default, media links (=links that point directly to the file on the server) will add an attachment to the exported PDF File. This is independent of the chosen export mode (Page, Page with linked pages).

This is also true for PDF files that are embedded via Content Droplet PDF preview.

If no attachments should be added, this has to be defined in the Properties of the PDF template.

Exporting pages with linked pages

When pages are exported with their linked pages, link types are processed as follows:

  • Media links will add an attachment to the exported PDF File
  • File links are clickable and forward to the corresponding file page
  • Mentions are clickable and forward to the user page

If no attachments should be added, this has to be defined in the Properties of the PDF template.

If no links to pages that are not included in the PDF should be added, this has to be defined in the Properties of the PDF template.

Adding a new template

By default, the wiki provides two PDF templates:

  • StandardPDF: Template without a cover page for the single-page export.
  • StandardBookPDF: Template with a cover page for the book export.

Starting with BlueSpice 5.1, PDF templates can be created from the page Special:PDF templates.

Copy an existing template

To create a new PDF template:

  1. Go to the page Special:PDF_templates.
  2. Copy an existing template.
    special page "PDF templates" with selected standard book pdf to be copied
    Copy a template
  3. Enter a name for the new template.
  4. Click Copy.

Click Edit template to start customizing your template.

PDF templates page with the edit link of the new template
Edit template properties

Select general template properties

  1. Select the page orientation and the general export properties (for example, whether to show the Table of Contents for each page or whether to include links to pages that are not exported in the PDF itself).
  2. Click Next.

Select the template elements

Select the checkboxes for each element you want to include in your template:

  • Header: Page header for the template pages
  • Footer: Page footer for the template pages
  • Document preface: Cover page
  • Document appendix: Additional page that is added at the end of the pdf. It is formatted like the content pages (with header and footer) and adds to the PDF page count.

Click Configure for each template element to design the layout.

Configure the header

The header elements can consist of a header image (usually your logo) and some text (which can be a combination of predefined parameters and your own text).

Edit idalog for the header section
Defining the header

If you want to show an image that is different from your wiki logo, you can select "Use custom logo" and enter an existing image name or upload a new image.

Configure the footer

By default, the wiki provides localization system messages for each footer section. Use system messages if you want to support the language settings of your users. For example, in an English wiki, the English system message for {{int:pdfcreator-pdf-disclaimer}} can be changed on the page MediaWiki:pdfcreator-pdf-disclaimer. the German language version on page MediaWiki:pdfcreator-pdf-disclaimer/de.

Alternatively, you can simply type your own text if the PDF export does not have to consider user languages. Or leave the section blank if you don't want to print text.

Configure the document preface (PDF cover)

You can define the following elements on your cover page:

Background image:

  • If a bookshelf image exists, the bookshelf image is used as cover image for the Book PDF export.
  • If no bookshelf image exists, the default image defined in the Configuration Manager is used as cover image for the Book PDF export.
  • If a custom image is defined in the PDF template, the custom image will be used for the Book PDF export.

If you do not want to use any background image on your PDF cover page, all three locations for defining a book image must be empty.

Properties

The following properties can be configured:

{
	"embed-page-toc": true,
	"nsPrefix": true,
	"attachments": true,
	"suppress-links": false,
	"no-redirect": true,
	"coverBackground": ""
}
Label Name Default value Description
Show namespace prefix nsPrefix true The namespace prefix of pages is not printed in the page titles.
Show table of contents embed-page-toc true Include the table of contents of each exported page.
Ignore redirect no-redirect false If links are redirecting to a different page, the target page is not included in the pdf.
Allow attachments attachments true If files are directly linked with syntax Media: , the files are also attached in the pdf.
Disable links in PDF suppress-links false Replaces all links in the pdf with a span-element if they do not link to a target within the pdf.
- coverBackground <File:filename.png> This property is set programmatically when a custom cover background image is provided.

PDF template slots

All templates are saved as subpages of MediaWiki:PDFCreator.

There, you can see the syntax for the different template elements.

Template elements

Each template consists of the same elements (slots):

Template slot Description
Header The page header of each PDF page. The basic structure is:
<div class="pdfcreator-runningheaderfix">
	<table>
		<tr>
			<td>
				<div class="pdfcreator-runningheader-logo">
					{{{logo}}}
				</div>
			</td>
			<td>
				<h1 class="title">{{{title}}}</h1>
			</td>
		</tr>
	</table>
</div>
Important! The class .pdfcreator-runningheaderfix is necessary to top-align the header on the page. It works in conjunction with the class-declaration in the "Styles" tab of the template. Both need to be modified together.
Content The content layout. The basic structure is:
{{{content}}}
Footer The page footer of each PDF page. The basic structure is:
<div class="pdfcreator-runningfooterfix">
	<table>
		<tr>
			<td>
				<span>{{int:pdfcreator-pdf-disclaimer}}</span>
			</td>
			<td>
				<span>{{int:pdfcreator-pdf-export-time}}:{{#time:d.m.Y|now}}</span>
			</td>
			<td>
				<span>{{int:pdfcreator-pdf-param-currentpagenumber-label}} </span>{{{currentpagenumber}}} 
				<span> {{int:pdfcreator-pdf-param-totalpagescount-label}} </span>{{{totalpagescount}}}
			</td>
		</tr>
	</table>
</div>
Important! The class .pdfcreator-runningfooterfix is necessary to top-align the header on the page. It works in conjunction with the class-declaration in the "Styles" tab of the template. Both need to be modified together.
Document preface The cover page. It is meant for the book export, but can also be used for a page export. The basic structure for a book cover page is:
<div class="pdfcreator-intro">
	<div class="pdfcreator-intro-title">{{{title}}}</div>
</div>
Important! The class .pdfcreator-intro is necessary to display the image for the {{{logo}}}-parameter. Without this class present in the template, the {{{logo}}}-parameter has no effect.
Document appendix The last page of the PDF export. It has no predefined basic structure.
Styles Style declarations for the CSS classes that are used in any of the template elements. You can view the standard styles here.
Properties Allows to control some aspects of the PDF output. The following properties are available (shown in default settings):
{
	"embed-page-toc": true,
	"nsPrefix": true,
	"attachments": true,
	"suppress-links": false,
	"no-redirect": false,
	"coverBackground": "File:filename.jpg"
}
Description Internal notes for the usage of this template. The description has no effect on the template itself.

Configuration

Konfiguration for the default page export template and default cover image
PDFCreator Konfiguration

Hide namespace prefix in PDF: Removes the namespace prefix from titles and from template parameter "title" in the PDF output.

  • Default export template for pages: The default template is shown when users select an export template in "Page" mode. It is also used when clicking on the PDF link for the Content Droplet PDF Link .
  • Default cover background image


Admins can also set a default cover background image. It is applied whenever the document preface of the template contains the standard "intro"-wrapper:

<div class="pdfcreator-intro">
....
</div>

Default image:

/app/bluespice/w/extensions/BlueSpiceBookshelf/data/common/images/bs-cover.png

Output:

Image of an enlarged keyboard key with book symbol
Default PDF cover image


​The image path can be deleted. In this case, no image will be output by default.

Alternatively, an uploaded image file can be specified (without a namespace prefix), for example: industry.jpg

Example default image on an exported cover sheet.
Default image for the cover sheet

If a book has its own bookshelf-image, this will be generated in the PDF when exporting directly from the special page "Books".


Customizations

Semantic property

It is possible to print a semantic property value in any template slot. The following example prints the value of the property "Revision_ID" of a page in the PDF footer.

<div class="pdfcreator-runningfooterfix">
	{{#show:{{FULLPAGENAME}}|?Revision_ID}}
</div>

Background color for header and footer

In the Styles tab, add:

/* add a background color to the header and footer */
.pdfcreator-runningheaderfix, .pdfcreator-runningfooterfix {
background-color: #eee;
}

This adds a grey background color.

Remove the underline from the header and footer

In the Styles tab, add:

/* remove the border from the header */
.pdfcreator-runningheaderfix > table {
border-bottom: none !important;
}

/* remove the border from the header */
.pdfcreator-runningfooterfix > table {
border-top: none !important;
}

Remove page Table of Contents

The table of contents at the beginning of a PDF should be displayed, but not the table of contents for the sections of the pages.


In the Styles tab, add:

/* remove the border from the header */
.pdfcreator-type-page .toc {
    display:none;
}

To also remove the toc at the beginning of the PDF:

/* remove the border from the header */
.toc {
    display:none;
}

Related content droplets

The following content droplets are available:

Droplet name Comments
Book PDF link Inserts a link on the page to a book. Clicking the link immediately downloads the PDF.
PDF link Inserts a link on the page to the same or any other page. Clicking the link immediately downloads the page.
PDF preview Opens the PDF directly on a page in a PDF viewer.
Exclude content in PDF Wraps content in the tags <pdfexcludestart />...<pdfexcludeend />You can expand the excluded content by moving the tags in source edit mode to a different content location.

Note: The tag <uenoexport /> is deprecated, but still supported. It should no longer be used.

PDF page break The inserted page break marker is visible both in editing and in view mode. To hide this visual marker in view mode, you can add the following declaration to MediaWiki:Common.css:
/*Hide PDF page break marker in view mode */
.bs-tag-pdfpagebreak {display:none}
.bs-tag-pdfpagebreak.ve-ce-leafNode {display:block}

Semantic Mediawiki

The books in which a page exists can be queried via the semantic property Books (Property:Books).

Display of values for property "book" of a wikipage
Semantic property "Books"

Migrating existing cloud templates

For information about migrating your existing cloud template, click here.



PDF exclude - start

To submit feedback about this documentation, visit our community forum.

PDF exclude - end