Changes

Jump to: navigation, search

PDF Writer Custom Tags

113 bytes removed, 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.
* '''<pd4mlstyle="PAGE-BREAK-inside:page.break>avoid"''': inserts Prevents an HTML element from being broken by a page break at this location. We recommend using the '''SmartFields PDF formatting''' setting for inserting page breaks between custom fields. Note::Options:::* ifSpaceBelowLessThan= pixels: allows to suppress the page break if If the available space on the current page element is more than the specified value. ::* htmlWidth=pixels: forces PD4ML to change current htmlWidth (screenWidth) value a page in length this setting cannot be applied and to affect HTML-to-PDF scaling factorwill be ignored. “reset” returns htmlWidth to the initial stateMust be wrapped in angle brackets.::* htmlWidth="reset"::* pageFormat="rotate"::* pageFormat="WxH"::* pageFormat="reset"::* next="even - odd"::* pageCounter=pagenum
'''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::* '''<pd4mlifSpaceBelowLessThan= pixels:allows to suppress the page.header> </pd4ml:break if the available space on the current page.header>''': Content between tags will be used as is more than the page headerspecified value.:* htmlWidth=pixels:Options:forces PD4ML to change current htmlWidth (screenWidth) value and to affect HTML-to-PDF scaling factor. “reset” returns htmlWidth to the initial state.::* scopehtmlWidth="scopereset": explicitly defines pages where the header should appear. Example: scope* pageFormat="odd,5,15-25,45+,skiplastrotate"::* heightpageFormat="heightWxH"::* widthpageFormat="widthreset"::* stylenext="associated style infoeven - odd"::* $[page], $[total] and $[title]: inserts current page number, total number of pages, and document title (respectively)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::* '''&lt;pd4mlscope="scope":pageexplicitly defines pages where the header should appear.footer>''' first page footer. page Example: scope="odd,5,15-25,45+,skiplast":* height="height":* width="width":* style="associated style info":* $[page] of , $[total]</pd4mland $[title]:inserts current page.footer>: Content between tags will be used as the page footer (see Example below). Affects all subsequent number, total number of pages , and document title (unless Scope option is definedrespectively)::Options: same as pd4ml:page.header tag.
'''pd4ml:page.footer''' and '''/pd4ml:page.footer''' Use to define the footer. Typically enter '''page $[page] of $[total]''' Must be wrapped in angle brackets.
* : Options: same as pd4ml:page.header tag.'''&lt;pd4ml:toc>''': table of contents.::Options:::* pncorr="number": a correction value to add to page numbersMust be wrapped these in angle brackets.
: Options:
:* pncorr="number": a correction value to add to page numbers
* '''&lt;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
==Fonts and Special Characters==
Roboto The web page view sample template includes a declaration for TTF (True Type Font). This TTF declaration is the required for some Unicode characters to display. ===Changing Fonts===The default font for all text is Roboto and we recommend you use this font. It is possible to customize a PDF creationto use one of three other fonts: Times New Roman, Arial, and Verdana. Four other  '''Note''': These fonts are not officially supportedbut can be used in some scenarios like a customized Web Page View. Not all characters are supported in all fonts, example, Arialdoes not support U+0294, Courier New, VerdanaU+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 Times New Romanas such should be used cautiously.
Most western Latin Unicode characters If you want to use one of these alternate fonts, you will be displayed normallyneed to add a CSS class within the head of the web page view template. If your PDF contains special charactersThen, then reference the PDF writer must be told CSS class within your custom content wherever you wish to use TTF (True Type Font)override the system font. TTF is already declared in the standard For example, this web page view template.makes use of all available and supported fonts:
[[File:WPV-Font-Sample.png|thumb|none|500px]] To classes in the screenshot are: ====CSS Styles==Specify PDF File Name==If the syntax ''<nowikipre><!.font_times {font--filename='WPF - filename'--></nowiki>'' is included in the HTML Templatefamily: Times New Roman, when saved as a PDF, the PDF filename will default to 'WPF - filename.pdf'.<br />Serif;color: lightcoral;Variables such as @name@ can be used (ex. ''<nowiki><!--filename='WPF - @name@'--></nowiki>'') to dynamically set the resultant PDF filename.}
==Sample HTML Template==.font_arial {font-family: Arial, Sans-Serif;color: goldenrod;}
<pre>.font_verdana {<html><head><style type="text/css"><!--body {font-family: ArialVerdana, Times New Roman;}.overflow {width: 700px; word-wrap: breakSans-wordSerif;}.white {color: #ffffffteal;}.spacer {font-family: Arial, Helvetica, sans-serif; font-size: 10px; color: #FFF;}--></style></head><body bgcolor="#FFFFFF" topmargin="25" bottommargin="25" leftmargin="30" rightmargin="30"><!--Use Letter--><!--Use TTF--><!--filename='WPF - filename'--><!--START: Header and Footer when converted to PDF--><pd4ml:page.header><table width="700px" border="0" cellspacing="0" cellpadding="0" align="center"><tr><td><div class="overflow"><strong>@type@ - @year(fullstartdate)@</strong></div></td></tr></table></pd4ml:page.header><pd4ml:page.footer><div style="pd4ml-display:block;display:none;margin-top: 30px;margin-left:30px;margin-right:30px;margin-bottom:30px"><table width="700px" align="center"><tr><td style="text-align:right">page $[page] of $[total]</td></tr></table></div></pd4ml:page.footer><!--END Header and Footer for PDF--><pd4ml><table width="700" border="0" cellspacing="0" cellpadding="0" align="center" style="PAGE-BREAK-inside: avoid;"><tr><td valign="top"><div class="overflow">Page 1 text goes here</div></td></tr></table><div class="spacer">.</div><pd4ml:page.break/><table width="700" border="0" cellspacing="0" cellpadding="0" align="center" style="PAGE-BREAK-inside: avoid;"><tr><td valign="top"><div class="overflow">Page 2 text goes here</div></td></tr></table></pd4ml></body></html>
.font_default {
color: purple;
}
</pre>
 
====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==
Use the '''Exported File Name''' input to change the name on the generated PDF file. This will change the HTML comment tag called '''filename='Application Preview'''' in the '''HTML Template'''.
Variables such as @name@ can be used (ex. filename='WPF - @name@').
==See Also==
Smartstaff
2,107
edits

Navigation menu