HtmlLayout
Represents a html layout of the document.
public class HtmlLayout
Public Class HtmlLayout
Inheritance: ObjectHtmlLayout
Licensing Info
This class is a full DynamicPDF Core Suite feature. One of the following is required for non-evaluation usage:
- An active DynamicPDF Ultimate Subscription
- An active DynamicPDF Professional or Professional Plus Subscription with DynamicPDF Core Suite selected.
- A DynamicPDF Core Suite for .NET v12.X Developer License.
Examples
This example shows simple Header Footer Text being displayed on the document.Imports System
Imports ceTe.DynamicPDF
Imports ceTe.DynamicPDF.PageElements
Imports ceTe.DynamicPDF.PageElements.Html
Module MyModule
Sub Main()
'Create Html layout page info
Dim layoutPage As PageInfo = New PageInfo(PageSize.A4, PageOrientation.Portrait)
'Create Uri
Dim uri As Uri = New Uri(inputHTMLPath)
'Create a Html Layout
Dim html As HtmlLayout = New HtmlLayout(uri, layoutPage)
' Create a header
html.Header.Center.Text = "%%PR%%%%SP%% of %%ST%%"
html.Header.Center.HasPageNumbers = True
html.Header.Center.Width = 200
' Create a footer
html.Footer.Center.Text = "%%PR%%%%SP(A)%% of %%ST(B)%%"
html.Footer.Center.HasPageNumbers = True
html.Footer.Center.Width = 200
'Create a PDF Document
Dim document As Document = html.Layout
' Save the PDF
document.Draw(outputPath)
End Sub
End Module
using System;
using ceTe.DynamicPDF;
public class Example
{
public static void CreatePDF(string inputHTMLPath, string outputPath)
{
//Create Html layout page info
PageInfo layoutPage = new PageInfo(PageSize.A4, PageOrientation.Portrait);
//Create Uri
Uri uri = new Uri(inputHTMLPath);
//Create Html Layout
HtmlLayout html = new HtmlLayout(uri, layoutPage);
// Create a header
html.Header.Center.Text = "%%PR%%%%SP%% of %%ST%%";
html.Header.Center.HasPageNumbers = true;
html.Header.Center.Width = 200;
// Create a footer
html.Footer.Center.Text = "%%PR%%%%SP(A)%% of %%ST(B)%%";
html.Footer.Center.HasPageNumbers = true;
html.Footer.Center.Width = 200;
// Create a PDF Document
Document document = html.Layout();
// Save the PDF
document.Draw(outputPath);
}
}
Remarks
This class can be used to place html layout on a document.
Constructors
HtmlLayout(Stream, PageInfo) | Initializes a new instance of the HtmlLayout class. |
HtmlLayout(Stream, Uri, PageInfo) | Initializes a new instance of the HtmlLayout class. |
HtmlLayout(String, PageInfo) | Initializes a new instance of the HtmlLayout class. |
HtmlLayout(String, Uri, PageInfo) | Initializes a new instance of the HtmlLayout class. |
HtmlLayout(Uri, PageInfo) | Initializes a new instance of the HtmlLayout class. |
HtmlLayout(Uri, Uri, PageInfo) | Initializes a new instance of the HtmlLayout class. |
Properties
BaseRef | Gets or sets the base ref of the Html Layout. |
BottomMargin | Gets or sets the bottom margin of the Html Layout. |
Footer | Gets a FooterHtmlLayout object that represents the footer properties. |
Header | Gets a HeaderHtmlLayout object that represents the the header properties. |
LeftMargin | Gets or sets the left margin of the Html Layout. |
RightMargin | Gets or sets the right margin of the Html Layout. |
TopMargin | Gets or sets the top margin of the Html Layout. |
Methods
Equals(Object) | Determines whether the specified Object is equal to the current Object . (Inherited from Object) |
GetHashCode() | Serves as a hash function for a particular type. (Inherited from Object) |
GetType() | Gets the Type of the current instance. (Inherited from Object) |
Layout() | Gets a Document containing the paginated pages. |
Layout(Document) | Adds the paginated pages to the supplied Document . |
ToString() | Returns a String that represents the current Object . (Inherited from Object) |