/**
* An HTML Header or Footer which will be printed onto every page of the PDF. This can be used to override
*
* When using HtmlHeaderFooter it is important to set {@link htmlFragment}
*
* Merge meta-data into your HTML using any of these placeholder strings: {page} {total-pages} {url} {date} {time} {html-title} {pdf-title}
*/
export interface HtmlAffix {
/**
* The HTML which will be used to render the Header or Footer should be an HTML snippet rather than a complete
* document. It may contain styles & images.
*
* Merge meta-data into the HtmlFragment by putting any of these placeholder strings into the text:
* {page} {total-pages} {url} {date} {time} {html-title} {pdf-title}.
* An alternative mail-merge style using the pattern is also supported.
*
* HtmlFragment is a stand-alone HTML document which does not inherit styles or settings from your
* main HTML content unless LoadStylesAndCSSFromMainHtmlDocument is set to true.
*/
htmlFragment: string;
// /**
// * The Base URL all URLs in the {@link htmlFragment} will be relative to. This includes
// * 'src' attributes on images, scripts, style-sheets, and also hrefs on hyperlinks.
// *
// * Note: A base URL that points to a directory should end with a slash.
// * Base URL accepts file paths as well as URLs. If no BaseUrl is given,
// * the HtmlHeaderFooter BaseUrl will be inherited from the main HTML document where possible.
// */
// baseUrl ?: string | undefined; //not supported
/**
* Maximum Height of the HTML Header / Footer in millimeters. This value must be set sufficiently high to display the
* full HTML header / footer content.
*/
maxHeight ?: number | undefined;
/**
* Adds a horizontal line divider between the header / footer and the page content on every page of the PDF document.
*
* @default false
*/
dividerLine ?: boolean | undefined;
/**
* A html color code for divider line color see {@link dividerLine}
*
* @default #b1b1b1
*/
dividerLineColor ?: string | undefined;
/**
* Loads style code blocks and links to CSS style sheets from the main HTML document (which provides the PDF content) into the {@link HtmlAffix}.
*
* By default, Html Headers and Footers are stand-alone HTML documents with their own default styles. Setting {@link loadStylesAndCSSFromMainHtmlDocument} to true will attempt to load all STYLE and LINK tags from the main HTML document (which renders the PDF) into the {@link HtmlHeaderFooter}.
*
* If your main HTML document contains complex CSS frameworks, styles the HEAD or BODY element heavily, or loads CSS from JavaScript, then this method may not work as intended.
*
* This feature is not available for RenderUrlAsPdf methods. It works for HTMLToPdf and HtmlFileToPdf conversions only.
*
* It is often preferable to load style sheets explicitly into your HTML Headers and Footers as STYLE and LINK tags within the {@link htmlFragment} for granular control.
*
* @default false
*/
loadStylesAndCSSFromMainHtmlDocument ?: boolean | undefined;
}
/**
* Defines PDF Header and Footer display options.
*
* {@link TextAffix} uses a logical approach to rendering Headers and Footers for the most common use cases.
*
* @see {@link HtmlAffix}
*/
export interface TextAffix {
/**
* Sets the left-hand side header text for the PDF document.
*
* Merge meta-data into your header using any of these placeholder strings:
* {page} {total-pages} {url} {date} {time} {html-title} {pdf-title}
*/
leftText ?: string | undefined;
/**
* Sets the centered header text for the PDF document.
*
* Merge meta-data into your header using any of these placeholder strings:
* {page} {total-pages} {url} {date} {time} {html-title} {pdf-title}
*/
centerText ?: string | undefined;
/**
* Sets the right-hand side header text for the PDF document.
*
* Merge meta-data into your header using any of these placeholder strings:
* {page} {total-pages} {url} {date} {time} {html-title} {pdf-title}
*/
rightText ?: string | undefined;
/**
* Adds a horizontal line divider between the header / footer and the page content on every page of the PDF document.
*
* @default false
*/
dividerLine ?: boolean | undefined;
/**
* A html color code for divider line color see {@link dividerLine}
*
* @default #b1b1b1
*/
dividerLineColor ?: string | undefined;
/**
* Font family. Default is {@link AffixFonts.Arial}.
*/
font?: AffixFonts | undefined;
/**
* Font size in px.
* @default 10
*/
fontSize ?: number | undefined;
}
/**
* Supported Affix Fonts
*/
export enum AffixFonts {
Arial,
Arial_Bold,
Arial_BoldItalic,
Arial_Italic,
Courier,
Courier_BoldOblique,
Courier_Oblique,
Courier_Bold,
CourierNew,
CourierNew_Bold,
CourierNew_BoldItalic,
CourierNew_Italic,
Helvetica,
Helvetica_Bold,
Helvetica_BoldOblique,
Helvetica_Oblique,
Symbol,
TimesNewRoman,
TimesNewRoman_Bold,
TimesNewRoman_BoldItalic,
TimesNewRoman_Italic,
ZapfDingbats,
}