开发者 | chrishardie |
---|---|
更新时间 | 2024年8月18日 07:41 |
捐献地址: | 去捐款 |
PHP版本: | 5.6 及以上 |
WordPress版本: | 6.6 |
You can customize the PDF newspaper layout and styles using limited CSS definitions, in two different ways:
ppn_pdf_template_css_file_path
to specify the full filesystem path to a file containing CSS styles.<style>
tag or any other HTML. Invalid CSS may break the PDF generation process.
Here are the CSS classes you may wish to adjust:
assets/admin/css/pdf-template-styles.css
or in Trac.
Note that TCPDF only supports a limited subset of the full CSS specification. Also note that any fonts referenced must be available in the TCPDF library used to generate the PDF. You can view the TCPDF core font list.
There's also an experimental filter, ppn_font_file_paths
, that allows you to add to or change the array of TTF font file paths being loaded.
Currently the header image size/position and subheading styles are not easily customizable, but will be in the future.
These filters are available to further customize the plugin functionality:
ppn_post_query_args
: override the array of arguments to WP_Query to control which posts are includedppn_pdf_configuration
: override the array of PDF configuration values specified by the admin userppn_pdf_template_css_file_path
: override the full filesystem path to a CSS file for PDF content stylingppn_font_file_paths
: override the array of filesystem paths to TTF font files to include in the PDFadd_filter( 'ppn_pdf_configuration', function( $config ) { $config['number'] = 2; return $config; }, 10, 1 );
Some people still encounter things and ideas through engagement with objects in the physical world. If you are looking to attract readers to your WordPress-powered writing, distributing a printed "teaser" version might just help.