WXR2PDF
Convert an WordPress Export File to PDF
★ 7stars
1forks
Install
No release zip yet. The repository archive installs, but the folder name will carry the branch suffix and updates will not flow:
wp plugin install https://github.com/soderlind/wxr2pdf/archive/refs/heads/master.zipDeclares an update source (https://github.com/soderlind/wxr2pdf), so updates arrive through the plugin's own updater.
From the readme
wxr2pdf, convert an WordPress Export File to PDF
wxr2pdf is an WP-CLI extension that converts the content of an WordPress Export File to PDF.
Syntax
wp wxr2pdf [parameters]
Parameters
Required, either
- file path to the WordPress Export File.
or
- --stdin
Optional
- --posttype= select post type. If not set, post is used. Separate post types using colon.
- --language= loads languages/countryCODE.mo
- --paper-format= default is A4, alternative is Letter
- --paper-orientation= default is P (portarit), alternative is L (landscape)
- --watermark= add watermark to the PDF, enclose in quotes if more than one word.
- --noimg don't include images.
- --nocomments don't include comments
Add defaults options to your wp-cli.yml file, eksample:
Examples
Export from WordPress using wp export
Convert to PDF, assuming the export is wxr-file.xml or reading from STDIN
The example PDF is created using wp wxr2pdf --posttype=post --watermark=WXR2PDF wxr2pdf.WordPress.2019-02-26.xml
- Site content from wptest.io
Installation and activation
1. In wp-content/plugins do git clone https://github.com/soderlind/wxr2pdf
1. In wp-content/plugins/wxr2pdf run composer install
1. Activate the plugin: