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:

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

BaseRefGets or sets the base ref of the Html Layout.
BottomMarginGets or sets the bottom margin of the Html Layout.
FooterGets a FooterHtmlLayout object that represents the footer properties.
HeaderGets a HeaderHtmlLayout object that represents the the header properties.
LeftMarginGets or sets the left margin of the Html Layout.
RightMarginGets or sets the right margin of the Html Layout.
TopMarginGets 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)

See Also

ceTe.DynamicPDF

In this topic