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
 
(33 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 ==
== 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.


=== Standard BlueSpice templates ===
Select the export settings.
*'''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}}
* '''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).


=== Safe directories for your own templates ===
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.
The PDF templates may not be customized in the standard template directories (see above) since an update will overwrite these directories.
[[File:StandardPDF template.png|alt=PDF page with default header and footer content an a Table of Contents|center|thumb|424x424px|Standard PDF layout]]


You need to store your custom PDF templates in safe directories instead.
== Related content droplets ==


'''Examples of safe directories:'''
=== Content droplets ===
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.
|-
| 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}


*images/<MyPDFTemplates>
</syntaxhighlight>
*extensions/BlueSpiceFoundation/data/PDFTemplates
|}


== Editing the templates ==
== Adding a new template ==
The PDF templates for single pages and books are very similar.
By default, the wiki provides two PDF templates:


=== Creating your own templates ===
* '''StandardPDF:''' Template without a cover page for the single-page export.
The contents of the directories
* '''StandardBookPDF:''' Template with a cover page for the book export.


*extensions/BlueSpiceUEModulePDF/data/PDFTempates
Starting with '''BlueSpice 5.1''', PDF templates can be created from the page ''Special:PDF templates''.
*extensions/BlueSpiceUEModuleBookPDF/data/PDFTempates


Copy to "extensions/BlueSpiceFoundation/data/PDFTemplates" and rename it
=== Copy an existing template ===
'''To create a new PDF template:'''


*"common" => "common" (remains)
# '''Go''' to the page ''Special:PDF_templates''.
*"BlueSpice" => "MyPageTemplate"
# '''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]]
*"BlueSpice Book" => "MyBookTemplate"
# '''Enter''' a name for the new template.
# '''Click''' ''Copy.''
'''Click''' ''Edit template'' to start customizing your template.


The template names must be changed later in the associated template.php.
[[File:Pdf templates - properties.png|alt=PDF templates page with the edit link of the new template |center|thumb|600x600px|Edit template properties]]


=== Directory structure of the templates ===
=== Select general template properties ===
data/PDFTemplates
# '''Select''' the page orientation and the [[Manual:Extension/PDFCreator#Properties|general export properties]].
    |_ common
# '''Click''' Next.
    |    |_ 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 ===
=== Select the template elements ===
Select the checkboxes for each element you want to include in your template:


==== template.php ====
* Header: Page header for the template pages
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.
* 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 images must also be specified, for example the images that should be used in the header.
'''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).
[[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>.


Special requirements for the book:
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.


The PDF template for the book accesses the common directory of the single page template.
=== Configure the document preface (PDF cover) ===
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.
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.


'''Important changes in the sections:'''
=== Properties ===
{| class="wikitable" style="width: 100%;"
! style="" |Label
! style="" |Name
! style="" |Default value
! style="" |Description
|-
| style="" |Show table of contents
| style="" |embed-page-toc
| style="" |true
| style="" |Include the table of contents of each page.
|-
| style="" |Show namespace prefix
| style="" |no-redirect
| style="" |false
| style="" |If links are redirecting to a different page, the target page is not included in the pdf.
|-
| style="" |Export attachmentws
| style="" |attachments
| style="" |true
| style="" |If files are directly linked with syntax <code>Media:</code> , the files are exported as well to 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.
|}


<u>Section '''info''':</u>
==Editing existing PDF templates==
You can edit the existing standard PDF or Book PDF template directly in the wiki. In addition to the existing Manual:Templates|templates, you can add your own custom templates. When printing a page or book, users can choose between these templates.


*name => name of the template (e.g. MyPageTemplate). '''MUST''' match the directory name
In addition, each book can be associated with a particular template when it is printed from the Books page.


<u>Section '''resources''':</u>
'''To edit an existing template:'''
# '''Open''' the page ''MediaWiki:PDFCreator.''
# '''Select''' the template you want to edit. As an example, we select the ''StandardPDF'' template.
# '''Open''' the page in edit mode. This shows you the current layout of each PDF element. You can click on any tab to switch between the template elements you want to customize.
# Click the ''Help-''button to see the available template slots you can add to each PDF layout section.  The parameters with prefix "book"  are metadata that are defined in books and will not have any effect on pages that are not associated with a book.


*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.
=== Template elements ===
*IMAGES => enter the images you want to use here. Example 'images/bs-header.jpg'
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,
"no-redirect":false,
"attachments": true,
"suppress-links": false
}
</syntaxhighlight>
|-
! style="" |Description
| style="" |Internal notes for the usage of this template. The description has no effect on the template itself.
|}


<u>Section '''messages''':</u>
== Configuration ==
{{#dpl:title=Manual:Extension/BlueSpiceConfigManager|include=#PDFCreator}}


*Here, texts can be assigned to so-called msg keys. These msg keys can be used in the template.html, e.g. the disclaimer.
== Customization examples for the header and footer ==
*en, de, de-formal are the languages. Unlike texts written in template.html, these msg keys are used depending on the language.


==== template.html ====
=== Custom logo ===
Basic structure of the page. Here, the page number, for example, can be removed from the footer.
By default, the parameter <code><nowiki>{{{logo}}}</nowiki></code> displays the wiki logo in the PDF. You can also directly reference an uploaded image as your logo for your different PDF templates. Here, we add a custom logo to the header of a template:
If you want to include your own css files, they must be specified here in the '''<head>'''.


Example:
# <syntaxhighlight lang="text">
  <link href="stylesheets/styles.css" type="text/css" rel="stylesheet" />
<div class="pdfcreator-runningheaderfix">
<table>
<tr>
<td>
<div class="pdfcreator-runningheader-logo">
[[File:my-logo.png|alt=my logo name]]
</div>
</td>
<td>
<h1 class="title">{{{title}}}</h1>
</td>
</tr>
</table>
</div>
</syntaxhighlight>


=== Customization of the style sheets ===
=== Semantic property ===
The display can be changed in the style sheets. This concerns e.g.
It is also possible to print a semantic property in the footer. 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>


*Margins
=== Background color for header and footer ===
*Header with logo
*Headings
*Text colors
*...


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.


=== 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;
}


<u>'''The most important examples:'''</u>
/* remove the border from the header */
.pdfcreator-runningfooterfix > table {
border-top: none !important;
}
</syntaxhighlight>


<u>Page margins:</u>
== Customization examples for the cover page ==
The cover page can be changed from the ''Document preface''-tab.  It is mainly used forbook templates. The default elements are:


'''File:''' common/stylesheets/page.css
* Title
* Logo
* Bookshelf image: If a cover image is explicitely set by the user, the cover image is printed automatically. It does not have a parameter.  The automatically generated preview images on the bookshelf are '''not''' printed on the PDF cover.


The '''@page''' area is the normal page in portrait format. The page margins are set in the "margin" line (order: top right bottom left).
=== Adding a white background to the logo ===


====Using background colors====
Instead of using cover images, you can define some designs based on colors.
{{Textbox|boxtype=important|header=Important:|text=If a book has a cover, it will be printed over the layout that is defined in the customized cover layout. Layouts therefore have to be tested in combination with cover images!|icon=yes}}
Here is an example and the needed HTML/CSS for the PDF layout.  <gallery widths="220" heights="300" perrow="34">
File:Manual:Cover-bgcolor-stripe-EN.png|BookStyle1
</gallery>


=== BookStyle1 ===
'''Document preface:'''<syntaxhighlight lang="html">
<!-- Logo -->
<div class="pdfcreator-bookStyle1-logo">
  {{{logo}}}
</div>
<!-- Color block -->
<div class="pdfcreator-bookStyle1-colorblock">
</div>
<div class="pdfcreator-bookStyle1-colorblock-accent">
</div>
<!-- Title -->
<div class="pdfcreator-bookStyle1-title">
    {{{title}}}
</div>
<!-- Subtitle -->
<div class="pdfcreator-bookStyle1-subtitle">
    {{{book-subtitle}}}
</div>
</syntaxhighlight>
'''Document preface:'''<syntaxhighlight lang="css">
/* Logo */
.pdfcreator-bookStyle1-logo {margin:1cm; text-align:right}


<u>Background image:</u>
/* Color block */
.pdfcreator-bookStyle1-colorblock  {position:absolute; height:2cm; width:1.8cm; background-color:#3a3b3c;
margin:4cm 0 0 0;  z-index:-500}


'''File:''' common/stylesheets/page.css
.pdfcreator-bookStyle1-colorblock-accent {position:absolute; height:2cm; width:24cm; background-color:#3366cc;
margin:4cm 0 0 1.8cm;  z-index:-500}


The '''@page''' area is the normal page in portrait format. The background image is set in the “background” line.
/* Title */
.pdfcreator-bookStyle1-title {font-size:28pt;font-weight:bold;margin:8.5cm 1cm 1cm 1.8cm;color:#333333;}


The background image must be specified in the '''template.php'''. (Only used for the single page at BlueSpice.)
/* Subtitle */
.pdfcreator-bookStyle1-subtitle {font-size:16pt; margin:1cm 1cm 1cm 1.8cm; color:#555555}
</syntaxhighlight>


==Migrating existing cloud templates==


[[Manual:Extension/PDFCreator/Migrating existing cloud templates|For information about migrating your existing cloud template, click here.]]


<u>Header (logo):</u>
{{translation}}
 
'''File:''' MyPageTemplate/stylesheets/page.css
 
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 15:20, 14 April 2025


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.

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).

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.

PDF page with default header and footer content an a Table of Contents
Standard PDF layout

Related content droplets

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.
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}

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.
  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.

Properties

Label Name Default value Description
Show table of contents embed-page-toc true Include the table of contents of each page.
Show namespace prefix no-redirect false If links are redirecting to a different page, the target page is not included in the pdf.
Export attachmentws attachments true If files are directly linked with syntax Media: , the files are exported as well to 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.

Editing existing PDF templates

You can edit the existing standard PDF or Book PDF template directly in the wiki. In addition to the existing Manual:Templates|templates, you can add your own custom templates. When printing a page or book, users can choose between these templates.

In addition, each book can be associated with a particular template when it is printed from the Books page.

To edit an existing template:

  1. Open the page MediaWiki:PDFCreator.
  2. Select the template you want to edit. As an example, we select the StandardPDF template.
  3. Open the page in edit mode. This shows you the current layout of each PDF element. You can click on any tab to switch between the template elements you want to customize.
  4. Click the Help-button to see the available template slots you can add to each PDF layout section. The parameters with prefix "book" are metadata that are defined in books and will not have any effect on pages that are not associated with a book.

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,
	"no-redirect":false,
	"attachments": true,
	"suppress-links": false
}
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
  • 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 .

Templates of type "Page" usually do not have a cover page defined.

PDF export dialog with default page template selected
Default page template

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".

Customization examples for the header and footer

By default, the parameter {{{logo}}} displays the wiki logo in the PDF. You can also directly reference an uploaded image as your logo for your different PDF templates. Here, we add a custom logo to the header of a template:

  1. <div class="pdfcreator-runningheaderfix">
    	<table>
    		<tr>
    			<td>
    				<div class="pdfcreator-runningheader-logo">
    					[[File:my-logo.png|alt=my logo name]]
    				</div>
    			</td>
    			<td>
    				<h1 class="title">{{{title}}}</h1>
    			</td>
    		</tr>
    	</table>
    </div>
    

Semantic property

It is also possible to print a semantic property in the footer. 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;
}

Customization examples for the cover page

The cover page can be changed from the Document preface-tab. It is mainly used forbook templates. The default elements are:

  • Title
  • Logo
  • Bookshelf image: If a cover image is explicitely set by the user, the cover image is printed automatically. It does not have a parameter. The automatically generated preview images on the bookshelf are not printed on the PDF cover.

Using background colors

Instead of using cover images, you can define some designs based on colors.

Important:If a book has a cover, it will be printed over the layout that is defined in the customized cover layout. Layouts therefore have to be tested in combination with cover images!

Here is an example and the needed HTML/CSS for the PDF layout.

BookStyle1

Document preface:

<!-- Logo -->
<div class="pdfcreator-bookStyle1-logo">
   {{{logo}}}
</div>
<!-- Color block -->
<div class="pdfcreator-bookStyle1-colorblock">
</div>
<div class="pdfcreator-bookStyle1-colorblock-accent">
</div>
<!-- Title -->
<div class="pdfcreator-bookStyle1-title">
    {{{title}}} 
</div>
<!-- Subtitle -->
<div class="pdfcreator-bookStyle1-subtitle">
    {{{book-subtitle}}}
</div>

Document preface:

/* Logo */
.pdfcreator-bookStyle1-logo {margin:1cm; text-align:right}

/* Color block */
.pdfcreator-bookStyle1-colorblock  {position:absolute; height:2cm; width:1.8cm; background-color:#3a3b3c; 
margin:4cm 0 0 0;  z-index:-500}

.pdfcreator-bookStyle1-colorblock-accent {position:absolute; height:2cm; width:24cm; background-color:#3366cc; 
margin:4cm 0 0 1.8cm;  z-index:-500}

/* Title */
.pdfcreator-bookStyle1-title {font-size:28pt;font-weight:bold;margin:8.5cm 1cm 1cm 1.8cm;color:#333333;}

/* Subtitle */
.pdfcreator-bookStyle1-subtitle {font-size:16pt; margin:1cm 1cm 1cm 1.8cm; color:#555555}

Migrating existing cloud templates

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




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