TTMSFNCCustomPDFLib Class
Base class for PDF document generation; provides page layout, header/footer, font embedding, and graphics access.
API unit family: TMSFNCPDFLib
Inherits from: TTMSFNCCustomComponent
Syntax
TTMSFNCCustomPDFLib = class(TTMSFNCCustomComponent)
Remarks
Use TTMSFNCPDFLib as the drop-on component. Call BeginDocument, add pages with NewPage, draw via Graphics, then call EndDocument.
Properties
| Name | Description |
|---|---|
| ArtBox | Art box defining the content area intended for display in points. |
| Author | Author metadata written into the PDF document information dictionary. |
| BitmapContainer | Bitmap container used as the source for named bitmaps drawn on PDF pages. |
| BleedBox | Bleed box defining the clip region for production bleed in points. |
| Creator | Creator metadata written into the PDF document information dictionary. |
| CropBox | Crop box defining the visible page region in a viewer, in points. |
| EmbedFontType | Controls which font data is embedded: full font program or subset. |
| EmbedFonts | When True, fonts used in the document are embedded in the PDF output. |
| FontFallBackList | Ordered list of fallback font names tried when a glyph is not available in the primary font. |
| Footer | Text drawn in the footer area of every page. |
| FooterAlignment | Horizontal alignment of the footer text. Default is gtaCenter. |
| FooterFont | Font used to render the footer text. |
| FooterMargins | Margins around the footer area in points. |
| FooterSize | Height of the footer strip in points. |
| FormFields | Provides access to interactive form fields (text boxes, combo boxes, list boxes, check boxes, radio buttons) on the current page. |
| Header | Text drawn in the header area of every page. |
| HeaderAlignment | Horizontal alignment of the header text. Default is gtaCenter. |
| HeaderFont | Font used to render the header text. |
| HeaderMargins | Margins around the header area in points. |
| HeaderSize | Height of the header strip in points. |
| Keywords | Keywords metadata written into the PDF document information dictionary. |
| MediaBox | Media box defining the full page extent in points. |
| PageHeight | Page height in points; effective only when PageSize is psCustom. |
| PageNumber | Controls automatic page numbering placement. Default is pnNone. |
| PageNumberAlignment | Horizontal alignment of the automatic page number text. Default is gtaCenter. |
| PageNumberFont | Font used to render the automatic page number text. |
| PageNumberFormat | Format string for the automatic page number. Use placeholders supported by the underlying PDF engine (e.g. %d for the page index). |
| PageNumberMargins | Margins around the page-number area in points. |
| PageNumberSize | Height of the page-number strip in points. |
| PageOrientation | Page orientation. Default is poPortrait. |
| PageSize | Standard page size preset. Default is psLetter. Set to psCustom and assign PageWidth/PageHeight for a non-standard size. |
| PageWidth | Page width in points; effective only when PageSize is psCustom. |
| Subject | Subject metadata written into the PDF document information dictionary. |
| Title | Title metadata written into the PDF document information dictionary. |
| TrimBox | Trim box indicating the intended finished page size in points. |
| Version | Returns the component version string. |
Methods
| Name | Description |
|---|---|
| BeginDocument | Starts a new PDF document, optionally writing output directly to a file. |
| EndDocument | Finalises the document and returns its content as a memory stream. |
| GetFooterRect | Returns the bounding rectangle of the footer area on the current page, in points. |
| GetHeaderRect | Returns the bounding rectangle of the header area on the current page, in points. |
| GetPageCount | Returns the total number of pages added to the document so far. |
| GetPageIndex | Returns the zero-based index of the currently active page. |
| GetPageNumberRect | Returns the bounding rectangle of the automatic page-number area on the current page, in points. |
| Graphics | Returns the graphics interface for drawing on the current page. |
| NewPage | Appends a new blank page to the document and makes it the current drawing target. |
Events
| Name | Description |
|---|---|
| OnAfterDrawFooter | Fires after the footer has been drawn on a page; allows overlay drawing. |
| OnAfterDrawHeader | Fires after the header has been drawn on a page; allows overlay drawing. |
| OnAfterDrawPageNumber | Fires after the automatic page number has been drawn; allows overlay drawing. |
| OnBeforeDrawFooter | Fires before the footer is drawn on a page; allows custom rendering or suppression. |
| OnBeforeDrawHeader | Fires before the header is drawn on a page; allows custom rendering or suppression. |
| OnBeforeDrawPageNumber | Fires before the automatic page number is drawn; allows custom rendering or suppression. |
| OnNewPageStarted | Fires when a new page is started via NewPage. |