No edit summary Tag: 2017 source edit |
No edit summary |
||
(One intermediate revision by the same user not shown) | |||
Line 1: | Line 1: | ||
{{Textbox|boxtype=warning|header=Review PDF export compatibility!|text=The [[en4:Setup:Installation_Guide/Advanced/Maintenance_scripts/export|PDF export script for BlueSpice 4]] is different | {{Textbox|boxtype=warning|header=Review PDF export compatibility!|text=The [[en4:Setup:Installation_Guide/Advanced/Maintenance_scripts/export|PDF export script for BlueSpice 4]] is different.|icon=yes}} | ||
Line 5: | Line 5: | ||
You can export PDF files from your MediaWiki installation via the command line by using a specification file in JSON format. | You can export PDF files from your MediaWiki installation via the command line by using a specification file in JSON format. | ||
==== Create a JSON | ==== Create a JSON Specification File ==== | ||
This file defines all the parameters for the export process. Below is a minimal example: | This file defines all the parameters for the export process. Below is a minimal example: | ||
<syntaxhighlight lang="json">{ | <syntaxhighlight lang="json">{ | ||
Line 35: | Line 35: | ||
"title": "My Export Title", | "title": "My Export Title", | ||
"template": "AdvancedTemplate", | "template": "AdvancedTemplate", | ||
}, | }, | ||
"options": { | "options": { | ||
Line 64: | Line 61: | ||
}</syntaxhighlight> | }</syntaxhighlight> | ||
==== Start | ==== Start Export from CLI ==== | ||
Once your JSON file is ready, run the following command to start the export: | Once your JSON file is ready, run the following command to start the export: | ||
<code>php extensions/PDFCreator/maintenance/CreatePDF.php cache/specification.json</code> | <code>php extensions/PDFCreator/maintenance/CreatePDF.php cache/specification.json</code> | ||
=== Available | === Available Parameters === | ||
==== General | ==== General Parameters (<code>params</code>): ==== | ||
* <code>filename</code>: Name of the exported PDF. | * <code>filename</code>: Name of the exported PDF. | ||
Line 78: | Line 75: | ||
* <code>title</code>: Optional title for the PDF. | * <code>title</code>: Optional title for the PDF. | ||
* <code>template</code>: Optional PDF template. | * <code>template</code>: Optional PDF template. | ||
==== Options (<code>options</code>): ==== | ==== Options (<code>options</code>): ==== | ||
Line 88: | Line 83: | ||
* <code>no-redirect</code>: <code>true</code> to avoid following redirects. | * <code>no-redirect</code>: <code>true</code> to avoid following redirects. | ||
==== Page | ==== Page Definitions (<code>pages</code>): ==== | ||
* <code>type</code>: One of <code>page</code>, <code>pageWithSubpages</code>, <code>pageWithLinkedPages</code>. | * <code>type</code>: One of <code>page</code>, <code>pageWithSubpages</code>, <code>pageWithLinkedPages</code>. | ||
Line 100: | Line 95: | ||
Replace <code>{MW_ROOT}</code> with your MediaWiki installation path. | Replace <code>{MW_ROOT}</code> with your MediaWiki installation path. | ||
=== Migration from | === Migration from Older Format === | ||
If you're using the legacy <code>pdf</code> or <code>bookpdf</code> module format, migrate to the new <code>batch</code> format using the following mapping: | If you're using the legacy <code>pdf</code> or <code>bookpdf</code> module format, migrate to the new <code>batch</code> format using the following mapping: | ||
==== Old | ==== Old Format ==== | ||
< | <code>{ | ||
"module": "pdf", | "module": "pdf", | ||
"attachments": 1, | "attachments": 1, | ||
Line 112: | Line 107: | ||
"target-file-name": "All.pdf", | "target-file-name": "All.pdf", | ||
"target-file-path": "/path/to/target-file" | "target-file-path": "/path/to/target-file" | ||
}</ | }</code> | ||
==== New | ==== New Format ==== | ||
< | <code>{ | ||
"module": "batch", | "module": "batch", | ||
"params": { | "params": { | ||
Line 132: | Line 127: | ||
} | } | ||
] | ] | ||
}</ | }</code> | ||
==== Key | ==== Key Changes ==== | ||
{| class="wikitable" | {| class="wikitable" | ||
!Old Parameter | ! style="" |Old Parameter | ||
!New Parameter | ! style="" |New Parameter | ||
!Notes | ! style="" |Notes | ||
|- | |- | ||
|<code>module=pdf</code> | | style="" |<code>module=pdf</code> | ||
|<code>module=batch</code> | | style="" |<code>module=batch</code> | ||
|Unified module name | | style="" |Unified module name | ||
|- | |- | ||
|<code>attachments</code> | | style="" |<code>attachments</code> | ||
|<code>options.attachments</code> | | style="" |<code>options.attachments</code> | ||
|Moved into <code>options</code>, uses <code>true/false</code> | | style="" |Moved into <code>options</code>, uses <code>true/false</code> | ||
|- | |- | ||
|<code>recursive</code> | | style="" |<code>recursive</code> | ||
|Removed | | style="" |Removed | ||
|Use <code>pageWithLinkedPages</code> instead | | style="" |Use <code>pageWithLinkedPages</code> instead | ||
|- | |- | ||
|<code>title</code> | | style="" |<code>title</code> | ||
|<code>params.title</code> | | style="" |<code>params.title</code> | ||
|Moved into <code>params</code> | | style="" |Moved into <code>params</code> | ||
|- | |- | ||
|<code>target=localfilesystem</code> | | style="" |<code>target=localfilesystem</code> | ||
|<code>params.target=filesystem</code> | | style="" |<code>params.target=filesystem</code> | ||
|Updated value | | style="" |Updated value | ||
|- | |- | ||
|<code>target-file-name</code> | | style="" |<code>target-file-name</code> | ||
|<code>params.filename</code> | | style="" |<code>params.filename</code> | ||
|Renamed and moved into <code>params</code> | | style="" |Renamed and moved into <code>params</code> | ||
|- | |- | ||
|<code>target-file-path</code> | | style="" |<code>target-file-path</code> | ||
|<code>params.filesystem-path</code> | | style="" |<code>params.filesystem-path</code> | ||
|Renamed and moved into <code>params</code> | | style="" |Renamed and moved into <code>params</code> | ||
|} | |} | ||
=== Feedback === | |||
To submit feedback about this documentation, visit our [https://community.example.org community forum]. |
Latest revision as of 07:59, 1 July 2025
Review PDF export compatibility!
The PDF export script for BlueSpice 4 is different.
PDF Export from CLI
You can export PDF files from your MediaWiki installation via the command line by using a specification file in JSON format.
Create a JSON Specification File
This file defines all the parameters for the export process. Below is a minimal example:
{
"module": "batch",
"params": {
"filename": "MyExport.pdf",
"filesystem-path": "/app/d/pdfcreator/cache",
"target": "filesystem",
"user": "WikiSysop"
},
"options": {
"attachments": true
},
"pages": [
{
"type": "page",
"target": "Main_Page"
}
]
}
You can expand this file to include more pages, templates, or custom options. Here’s a more advanced example:
{
"module": "batch",
"params": {
"filename": "FullExport.pdf",
"filesystem-path": "/var/pdf_exports",
"target": "filesystem",
"user": "ExportAdmin",
"title": "My Export Title",
"template": "AdvancedTemplate",
},
"options": {
"attachments": true,
"suppress-links": false,
"embed-page-toc": true,
"no-redirect": true
},
"pages": [
{
"type": "page",
"target": "Main_Page",
"label": "Hauptseite"
},
{
"type": "pageWithSubpages",
"target": "Category:Documentation",
"label": "Dokumentation"
},
{
"type": "pageWithLinkedPages",
"target": "Help:Editing",
"label": "Bearbeitungshilfe"
}
]
}
Start Export from CLI
Once your JSON file is ready, run the following command to start the export:
php extensions/PDFCreator/maintenance/CreatePDF.php cache/specification.json
Available Parameters
General Parameters (params
):
filename
: Name of the exported PDF.filesystem-path
: Path to store the exported file.target
: Can befilesystem
ordownload
.user
: Username used for export context.title
: Optional title for the PDF.template
: Optional PDF template.
Options (options
):
attachments
:true
to include media files.suppress-links
:true
to disable links in the PDF.embed-page-toc
:true
to include a table of contents.no-redirect
:true
to avoid following redirects.
Page Definitions (pages
):
type
: One ofpage
,pageWithSubpages
,pageWithLinkedPages
.target
: Page name.label
: Custom label (optional).params
: Page-specific options (e.g.,rev-id
,status
).
Automating with CronJob
To automate regular exports, set up a CronJob:
php {MW_ROOT}/extensions/PDFCreator/maintenance/CreatePDF.php --specification-file={MW_ROOT}/extensions/BlueSpiceFoundation/data/spec.json
Replace {MW_ROOT}
with your MediaWiki installation path.
Migration from Older Format
If you're using the legacy pdf
or bookpdf
module format, migrate to the new batch
format using the following mapping:
Old Format
{
"module": "pdf",
"attachments": 1,
"recursive": 1,
"title": "MyPDF",
"target": "localfilesystem",
"target-file-name": "All.pdf",
"target-file-path": "/path/to/target-file"
}
New Format
{
"module": "batch",
"params": {
"filename": "All.pdf",
"filesystem-path": "/path/to/target-file",
"target": "filesystem",
"title": "MyPDF"
},
"options": {
"attachments": true
},
"pages": [
{
"type": "page",
"target": "Main_Page"
}
]
}
Key Changes
Old Parameter | New Parameter | Notes |
---|---|---|
module=pdf
|
module=batch
|
Unified module name |
attachments
|
options.attachments
|
Moved into options , uses true/false
|
recursive
|
Removed | Use pageWithLinkedPages instead
|
title
|
params.title
|
Moved into params
|
target=localfilesystem
|
params.target=filesystem
|
Updated value |
target-file-name
|
params.filename
|
Renamed and moved into params
|
target-file-path
|
params.filesystem-path
|
Renamed and moved into params
|
Feedback
To submit feedback about this documentation, visit our community forum.