Setup:Installation Guide/Advanced/Maintenance scripts/CreatePDF: Difference between revisions

Redaktion (talk | contribs)
No edit summary
Redaktion (talk | contribs)
No edit summary
Line 23: Line 23:
     ]
     ]
  }
  }
Start export form CLI:<syntaxhighlight lang="php">
Start export form CLI:<syntaxhighlight lang="php">php extensions/PDFCreator/maintenance/CreatePDF.php cache/specification.json</syntaxhighlight>
php extensions/PDFCreator/maintenance/CreatePDF.php cache/specification.json
</syntaxhighlight>
{| class="wikitable"
{| class="wikitable"
|+Key/value pairs for the specification file
|+Key/value pairs for the specification file
Line 59: Line 57:
| style="" |Name of the page to be exported
| style="" |Name of the page to be exported
|}
|}
   
 
== Setting up a CronJob ==
To automate the export, the following CronJob is available:
  php {MW_ROOT}/extensions/PDFCreator/maintenance/CreatePDF.php --specification-file={MW_ROOT}/extensions/BlueSpiceFoundation/data/spec.json
__FORCETOC__
__FORCETOC__

Revision as of 08:33, 25 April 2025

Review PDF export compatibility!The PDF export script for BlueSpice 4 is different.


Export PDF from cli

After creating a specificaton json file, the pdf export can be triggered from CLI.

Example json content:

{
    "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"
        }
    ]
}

Start export form CLI:

php extensions/PDFCreator/maintenance/CreatePDF.php cache/specification.json
Key/value pairs for the specification file
key possible values module=pdf

(exports a set of wiki pages)

target filesystem The file is exported to a local file system
file-name Name of the exported PDF file
filesystem-path Target file location
attachments true

false

true = attachments (links to "media" files) are included

false = no attachments are included

type type of resource to be exported
target Name of the page to be exported

Setting up a CronJob

To automate the export, the following CronJob is available:

php {MW_ROOT}/extensions/PDFCreator/maintenance/CreatePDF.php --specification-file={MW_ROOT}/extensions/BlueSpiceFoundation/data/spec.json



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