Changes

Jump to: navigation, search

PDF Writer Custom Tags

492 bytes added, 15:15, 29 March 2023
m
List of Custom Tags (pd4ml)
==List of Custom Tags (pd4ml)==
'''style="pd4ml-display:none"''' or '''style="pd4ml-display:block"''': Controls whether a HTML element will be included or not included in the PDF.'''style="PAGE-BREAK-inside: avoid"''': Prevents an HTML element from being broken by a page break. Note: If the element is more than a page Must be wrapped in length this setting cannot be applied and will be ignoredangle brackets.
'''<style="PAGE-BREAK-inside: avoid"''': Prevents an HTML element from being broken by a page break. Note: If the element is more than a page in length this setting cannot be applied and will be ignored. Must be wrapped in angle brackets. '''pd4ml:page.break>''': inserts a page break at this location. We recommend using the '''SmartFields PDF formatting''' setting for inserting page breaks between custom fields.Must be wrapped in angle brackets. :Options:
:* ifSpaceBelowLessThan= pixels: allows to suppress the page break if the available space on the current page is more than the specified value.
:* htmlWidth=pixels: forces PD4ML to change current htmlWidth (screenWidth) value and to affect HTML-to-PDF scaling factor. “reset” returns htmlWidth to the initial state.
:* next="even - odd"
:* pageCounter=pagenum
'''<pd4ml:page.header> <''' and '''/pd4ml:page.header>''': Content between tags will be used as the page header.Must be wrapped in angle brackets. 
: Options:
:* scope="scope": explicitly defines pages where the header should appear. Example: scope="odd,5,15-25,45+,skiplast"
:* $[page], $[total] and $[title]: inserts current page number, total number of pages, and document title (respectively)
'''pd4ml:page.footer''' and '''/pd4ml:page.footer''' Use to define the footer. Typically enter '''page $[page] of $[total]''' Must be wrapped in angle brackets.
 
'''<pd4ml:page.footer>''' first page footer. page $[page] of $[total]: Content between tags will be used as the page footer (see Example below). Affects all subsequent pages (unless Scope option is defined)
: Options: same as pd4ml:page.header tag.
'''pd4ml:toc''' table of contents. Must be wrapped these in angle brackets.
'''<pd4ml:toc>''': table of contents.
: Options:
:* pncorr="number": a correction value to add to page numbers
'''<pd4ml:page.break/>''': insert this for a PDF page break. Must be wrapped in angle brackets.
==Page Format==
To generate PDFs in a specific format within the body of the [[Web Page View]], add the appropriate tag below. We recommend adding the sample template to your Web Page View custom field. This will use SmartFields and will automatically create a formatted PDF for you.
 * <span style="font -size="3: medium;">&lt;!--Use Landscape--></fontspan> - will set the HTML width based on the paper type.* <span style="font -size="3: medium;">&lt;!--Use Letter--></fontspan> - will set the page width to 971.* <span style="font -size="3: medium;">&lt;!--Use Legal--></fontspan> - will set the page width to 1235.
==Table Size==
Recommended table sizes are as follows:
 
* Letter 700 pixels wide
* Letter (landscape) 950 pixels wide
===Changing Fonts===
The default font for all text is Roboto and we recommend you use this font. It is possible to customize a PDF to use one of three other fonts: Times New Roman, Arial, and Verdana, and Times New Roman.  '''Note''': These fonts are not officially supported but can be used in some scenarioslike a customized Web Page View. Not all characters are supported in all fonts, example, Arial does not support U+0294, U+0313, U+2C61. Also Arial does not pass the I-L-1 test as the capital I and lower case L look very similar and as such should be used cautiously. If you want to use one of these alternate fonts, you will need to create add a special CSS class within the head of the web page view template. Then, reference the CSS style class within your custom contentwherever you wish to override the system font. For For example, this web page view makes use of all available and supported fonts:
[[File:WPV-Font-Sample.png|thumb|none|500px]]
To replicate this style, you can make use of classes in the sample CSS and HTML code belowscreenshot are:
====CSS Styles====
====HTML Portion====
The above styled identifiers can now be placed within wrapped div tags for text you want to style. For example, this sample code displays how to call your CSS classes in your HTML template.
 * '''[https://wiki.smartsimple.com/images/8/80/WPV-Font-Classes.zip Download:]''' [[File:WPV-Font-Classes.zip]]
==Specify PDF File Name==
If Use the syntax ''<nowiki><!--'Exported File Name''' input to change the name on the generated PDF file. This will change the HTML comment tag called '''filename='WPF - filenameApplication Preview''--></nowiki>'' is included in the '''HTML Template, when saved as a PDF, the PDF filename will default to 'WPF - filename.pdf''.<br />Variables such as @name@ can be used (ex. ''<nowiki><!--filename='WPF - @name@'--></nowiki>'') to dynamically set the resultant PDF filename.
==See Also==
Smartstaff
2,107
edits

Navigation menu