Document.FromHtml

Overloads

FromHtml(Stream, PageDimensions, HtmlAreaPadding)Gets a Document containing HtmlArea created with the given content.
FromHtml(Stream, PageDimensions, HtmlAreaPadding, Uri)Gets a Document containing HtmlArea created with the given content.
FromHtml(Stream, PageDimensions, Uri)Gets a Document containing HtmlArea created with the given content.
FromHtml(String, PageDimensions, HtmlAreaPadding)Gets a Document containing HtmlArea created with the given content.
FromHtml(String, PageDimensions, HtmlAreaPadding, Uri)Gets a Document containing HtmlArea created with the given content.
FromHtml(String, PageDimensions, Uri)Gets a Document containing HtmlArea created with the given content.
FromHtml(Uri, PageDimensions, HtmlAreaPadding)Gets a Document containing HtmlArea created with the given content.
FromHtml(Uri, PageDimensions, HtmlAreaPadding, Uri)Gets a Document containing HtmlArea created with the given content.
FromHtml(Uri, PageDimensions, Uri)Gets a Document containing HtmlArea created with the given content.

FromHtml(Stream, PageDimensions, HtmlAreaPadding)

Gets a Document containing HtmlArea created with the given content.

public static Document FromHtml(Stream stream, PageDimensions dimensions, HtmlAreaPadding padding)
Shared Function FromHtml(stream As Stream, dimensions As PageDimensions, padding As HtmlAreaPadding) As Document

Parameters

stream
Stream

Stream object containing the HTML contents data.

dimensions
PageDimensions

Page dimensions for HTML Area

padding
HtmlAreaPadding

Padding for HTML Area

Returns

Document

Licensing Info

This method is a full DynamicPDF Core Suite feature. One of the following is required for non-evaluation usage:

Examples

This example shows simple HTML being displayed on the page.
Imports System
Imports ceTe.DynamicPDF
Imports ceTe.DynamicPDF.PageElements
Imports ceTe.DynamicPDF.PageElements.Html
     
Module MyModule
     
    Sub Main()
     
        'Create a PageDimensions
        Dim dimensions As PageDimensions = New PageDimensions(PageSize.Letter, PageOrientation.Portrait, 50.0)

        'Create a stream
        Dim stream As System.IO.Stream = File.OpenRead(inputHTMLPath)

        'Create a HtmlAreaPadding
        Dim padding As HtmlAreaPadding = New HtmlAreaPadding(20.0, 0.0, 20.0, 0.0)

        'Create a PDF Document
        Dim document As Document = document.FromHtml(stream, dimensions, padding)

        ' Save the PDF
        document.Draw(outputPath)
      
    End Sub
End Module
using System;
using System.IO;
using ceTe.DynamicPDF;
using ceTe.DynamicPDF.PageElements;
using ceTe.DynamicPDF.PageElements.Html;

public class Example
{
     public static void CreatePDF(string inputHTMLPath, string outputPath)
     {
         // Create a PageDimensions
         PageDimensions dimensions = new PageDimensions(PageSize.Letter, PageOrientation.Portrait, 50.0f);

         // Create a stream
         Stream stream = File.OpenRead(inputHTMLPath);

         // Create a HtmlAreaPadding
         HtmlAreaPadding padding = new HtmlAreaPadding(20.0f, 0.0f, 20.0f, 0.0f);

         // Create a PDF Document
         Document document = Document.FromHtml(stream, dimensions, padding);

         // Save the PDF
         document.Draw(outputPath);       
     }
}

FromHtml(Stream, PageDimensions, HtmlAreaPadding, Uri)

Gets a Document containing HtmlArea created with the given content.

public static Document FromHtml(Stream stream, PageDimensions dimensions, HtmlAreaPadding padding, Uri baseHref)
Shared Function FromHtml(stream As Stream, dimensions As PageDimensions, padding As HtmlAreaPadding, baseHref As Uri) As Document

Parameters

stream
Stream

Stream object containing the HTML contents data.

dimensions
PageDimensions

Page dimensions for HTML Area

padding
HtmlAreaPadding

Padding for HTML Area

baseHref
Uri

Initializes a new instance of the Uri class with the specified base href URI.

Returns

Document

Licensing Info

This method is a full DynamicPDF Core Suite feature. One of the following is required for non-evaluation usage:

Examples

This example shows simple HTML being displayed on the page.
Imports System
Imports ceTe.DynamicPDF
Imports ceTe.DynamicPDF.PageElements
Imports ceTe.DynamicPDF.PageElements.Html
     
Module MyModule
     
    Sub Main()
     
       'Create a PageDimensions
        Dim dimensions As PageDimensions = New PageDimensions(PageSize.Letter, PageOrientation.Portrait, 50.0)

        'Create a stream
        Dim stream As Stream = System.IO.File.OpenRead(inputHTMLPath)

        'Create a baseHref
        Dim baseHref As Uri = New Uri(baseHrefPath)

        'Create a HtmlAreaPadding
        Dim padding As HtmlAreaPadding = New HtmlAreaPadding(20.0, 0.0, 20.0, 0.0)

        'Create a PDF Document
        Dim document As Document = Document.FromHtml(stream, dimensions, padding, baseHref)

        ' Save the PDF
        document.Draw(outputPath)
      
    End Sub
End Module
using System;
using ceTe.DynamicPDF;
using ceTe.DynamicPDF.PageElements;
using ceTe.DynamicPDF.PageElements.Html;

public class Example
{
    public static void CreatePDF(string inputHTMLPath, string baseHrefPath, string outputPath)
    {    
        // Create a PageDimensions
        PageDimensions dimensions = new PageDimensions(PageSize.Letter, PageOrientation.Portrait, 50.0f);
        
        // Create a stream
        Stream stream = System.IO.File.OpenRead(inputHTMLPath);
        
        // Create a baseHref
        Uri baseHref = new Uri(baseHrefPath);
        
        // Create a HtmlAreaPadding
        HtmlAreaPadding padding = new HtmlAreaPadding(20.0f, 0.0f, 20.0f, 0.0f);
        
        // Create a PDF Document
        Document document = Document.FromHtml(stream, dimensions, padding, baseHref);
        
        // Save the PDF
        document.Draw(outputPath);    
    }
}

FromHtml(Stream, PageDimensions, Uri)

Gets a Document containing HtmlArea created with the given content.

public static Document FromHtml(Stream stream, PageDimensions dimensions, Uri baseHref)
Shared Function FromHtml(stream As Stream, dimensions As PageDimensions, baseHref As Uri) As Document

Parameters

stream
Stream

Stream object containing the HTML contents data.

dimensions
PageDimensions

Page dimensions for HTML Area.

baseHref
Uri

Initializes a new instance of the Uri class with the specified base href URI.

Returns

Document

Licensing Info

This method is a full DynamicPDF Core Suite feature. One of the following is required for non-evaluation usage:

Examples

This example shows simple HTML being displayed on the page.
Imports System
Imports ceTe.DynamicPDF
Imports ceTe.DynamicPDF.PageElements
Imports ceTe.DynamicPDF.PageElements.Html
     
Module MyModule
     
    Sub Main()
     
       'Create a PageDimensions
        Dim dimensions As PageDimensions = New PageDimensions(PageSize.Letter, PageOrientation.Portrait, 50.0)

        'Create a stream
        Dim stream As Stream = System.IO.File.OpenRead(inputHTMLPath)

        'Create a baseHref
        Dim baseHref As Uri = New Uri(baseHrefPath)

        'Create a PDF Document
        Dim document As Document = document.FromHtml(stream, dimensions, baseHref)

        ' Save the PDF
        document.Draw(outputPath)
      
    End Sub
End Module
using System;
using ceTe.DynamicPDF;
using ceTe.DynamicPDF.PageElements;
using ceTe.DynamicPDF.PageElements.Html;
 
public class Example
{
     public static void CreatePDF(string inputHTMLPath, string baseHrefPath, string outputPath)
     {

         // Create a PageDimensions
         PageDimensions dimensions = new PageDimensions(PageSize.Letter, PageOrientation.Portrait, 50.0f);

         // Create a stream
         Stream stream = System.IO.File.OpenRead(inputHTMLPath);

         // Create a baseHref
         Uri baseHref = new Uri(baseHrefPath);

         // Create a PDF Document
         Document document = Document.FromHtml(stream, dimensions, baseHref);

         // Save the PDF
         document.Draw(outputPath);
     }   
}

FromHtml(String, PageDimensions, HtmlAreaPadding)

Gets a Document containing HtmlArea created with the given content.

public static Document FromHtml(string filePath, PageDimensions dimensions, HtmlAreaPadding padding)
Shared Function FromHtml(filePath As String, dimensions As PageDimensions, padding As HtmlAreaPadding) As Document

Parameters

filePath
String

Physical location of the HTML file.

dimensions
PageDimensions

Page dimensions for HTML Area

padding
HtmlAreaPadding

Padding for HTML Area

Returns

Document

Licensing Info

This method is a full DynamicPDF Core Suite feature. One of the following is required for non-evaluation usage:

Examples

This example shows simple HTML being displayed on the page.
Imports System
Imports ceTe.DynamicPDF
Imports ceTe.DynamicPDF.PageElements
Imports ceTe.DynamicPDF.PageElements.Html
     
Module MyModule
     
    Sub Main()
     
        'Create a PageDimensions
        Dim dimensions As PageDimensions = New PageDimensions(PageSize.Letter, PageOrientation.Portrait, 50.0)

        'Create a HtmlAreaPadding
        Dim padding As HtmlAreaPadding = New HtmlAreaPadding(20.0, 0.0, 20.0, 0.0)

        'Create a PDF Document
        Dim document As Document = Document.FromHtml(inputHTMLPath, dimensions, padding)

        ' Save the PDF
        document.Draw(outputPath)
      
    End Sub
End Module
using System;
using ceTe.DynamicPDF;
using ceTe.DynamicPDF.PageElements;
using ceTe.DynamicPDF.PageElements.Html;

public class Example
{
     public static void CreatePDF(string inputHTMLPath, string outputPath)
     {
         // Create a PageDimensions
         PageDimensions dimensions = new PageDimensions(PageSize.Letter, PageOrientation.Portrait, 50.0f);

         // Create a HtmlAreaPadding
         HtmlAreaPadding padding = new HtmlAreaPadding(20.0f, 0.0f, 20.0f, 0.0f);

         // Create a PDF Document
         Document document = Document.FromHtml(inputHTMLPath, dimensions, padding);

         // Save the PDF
         document.Draw(outputPath);
     }
}

FromHtml(String, PageDimensions, HtmlAreaPadding, Uri)

Gets a Document containing HtmlArea created with the given content.

public static Document FromHtml(string filePath, PageDimensions dimensions, HtmlAreaPadding padding, Uri baseHref)
Shared Function FromHtml(filePath As String, dimensions As PageDimensions, padding As HtmlAreaPadding, baseHref As Uri) As Document

Parameters

filePath
String

Physical location of the HTML file.

dimensions
PageDimensions

Page dimensions for HTML Area

padding
HtmlAreaPadding

Padding for HTML area

baseHref
Uri

Initializes a new instance of the Uri class with the specified base href URI.

Returns

Document

Licensing Info

This method is a full DynamicPDF Core Suite feature. One of the following is required for non-evaluation usage:

Examples

This example shows simple HTML being displayed on the page.
Imports System
Imports ceTe.DynamicPDF
Imports ceTe.DynamicPDF.PageElements
Imports ceTe.DynamicPDF.PageElements.Html
     
Module MyModule
     
    Sub Main()
     
	  'Create a PageDimensions
        Dim dimensions As PageDimensions = New PageDimensions(PageSize.Letter, PageOrientation.Portrait, 50.0)

        'Create a baseHref
        Dim baseHref As Uri = New Uri(baseHrefPath)

        'Create a HtmlAreaPadding
        Dim padding As HtmlAreaPadding = New HtmlAreaPadding(20.0, 0.0, 20.0, 0.0)

        'Create a PDF Document
        Dim document As Document = Document.FromHtml(inputHTMLPath, dimensions, padding, baseHref)

        ' Save the PDF
        document.Draw(outputPath)
        
    End Sub
End Module
using System;
using ceTe.DynamicPDF;
using ceTe.DynamicPDF.PageElements;
using ceTe.DynamicPDF.PageElements.Html;

public class Example
{
    public static void CreatePDF(string inputHTMLPath, string baseHrefPath, string outputPath)
    {    
        // Create a PageDimensions
        PageDimensions dimensions = new PageDimensions(PageSize.Letter, PageOrientation.Portrait, 50.0f);
        
        // Create a baseHref
        Uri baseHref = new Uri(baseHrefPath);
        
        // Create a HtmlAreaPadding
        HtmlAreaPadding padding = new HtmlAreaPadding(20.0f, 0.0f, 20.0f, 0.0f);       
        
        // Create a PDF Document
        Document document = Document.FromHtml(inputHTMLPath, dimensions, padding, baseHref);
        
        // Save the PDF
        document.Draw(outputPath);    
    }
}

FromHtml(String, PageDimensions, Uri)

Gets a Document containing HtmlArea created with the given content.

public static Document FromHtml(string filePath, PageDimensions dimensions, Uri baseHref)
Shared Function FromHtml(filePath As String, dimensions As PageDimensions, baseHref As Uri) As Document

Parameters

filePath
String

Physical location of the HTML file.

dimensions
PageDimensions

Page dimensions for HTML Area.

baseHref
Uri

Initializes a new instance of the Uri class with the specified base href URI.

Returns

Document

Licensing Info

This method is a full DynamicPDF Core Suite feature. One of the following is required for non-evaluation usage:

Examples

This example shows simple HTML being displayed on the page.
Imports System
Imports ceTe.DynamicPDF
Imports ceTe.DynamicPDF.PageElements
Imports ceTe.DynamicPDF.PageElements.Html
     
Module MyModule
     
    Sub Main()
     
        'Create a PageDimensions
        Dim dimensions As PageDimensions = New PageDimensions(PageSize.Letter, PageOrientation.Portrait, 50.0)

        'Create a baseHref
        Dim baseHref As Uri = New Uri(baseHrefPath)

        'Create a PDF Document
        Dim document As Document = document.FromHtml(inputHTMLPath, dimensions, baseHref)

        ' Save the PDF
        document.Draw(outputPath)
      
    End Sub
End Module
using System;
using ceTe.DynamicPDF;
using ceTe.DynamicPDF.PageElements;
using ceTe.DynamicPDF.PageElements.Html;

public class Example
{
    public static void CreatePDF(string inputHTMLPath, string baseHrefPath, string outputPath)
    {    
        // Create a PageDimensions
        PageDimensions dimensions = new PageDimensions(PageSize.Letter, PageOrientation.Portrait, 50.0f);
        
        // Create a baseHref
        Uri baseHref = new Uri(baseHrefPath);        
        
        // Create a PDF Document
        Document document = Document.FromHtml(inputHTMLPath, dimensions, baseHref);
        
        // Save the PDF
        document.Draw(outputPath);       
    }
}

FromHtml(Uri, PageDimensions, HtmlAreaPadding)

Gets a Document containing HtmlArea created with the given content.

public static Document FromHtml(Uri uri, PageDimensions dimensions, HtmlAreaPadding padding)
Shared Function FromHtml(uri As Uri, dimensions As PageDimensions, padding As HtmlAreaPadding) As Document

Parameters

uri
Uri

Initializes a new instance of the Uri class with the specified URI.

dimensions
PageDimensions

Page dimensions for HTML Area

padding
HtmlAreaPadding

Padding for HTML Area

Returns

Document

Licensing Info

This method is a full DynamicPDF Core Suite feature. One of the following is required for non-evaluation usage:

Examples

This example shows simple HTML being displayed on the page.
Imports System
Imports ceTe.DynamicPDF
Imports ceTe.DynamicPDF.PageElements
Imports ceTe.DynamicPDF.PageElements.Html
     
Module MyModule
     
    Sub Main()
     
	    'Create a PageDimensions
        Dim dimensions As PageDimensions = New PageDimensions(PageSize.Letter, PageOrientation.Portrait, 50.0)

        'Create a uri
        Dim uri As Uri = New Uri(inputHTMLPath)

        'Create a HtmlAreaPadding
        Dim padding As HtmlAreaPadding = New HtmlAreaPadding(20.0, 0.0, 20.0, 0.0)

        'Create a PDF Document
        Dim document As Document = Document.FromHtml(uri, dimensions, padding)

        ' Save the PDF
        document.Draw(outputPath)
	          
    End Sub
End Module
using System;
using ceTe.DynamicPDF;
using ceTe.DynamicPDF.PageElements;
using ceTe.DynamicPDF.PageElements.Html;

public class Example
{
    public static void CreatePDF(string inputHTMLPath, string outputPath)
    {    
        // Create a PageDimensions
        PageDimensions dimensions = new PageDimensions(PageSize.Letter, PageOrientation.Portrait, 50.0f);
        
        // Create a uri
        Uri uri = new Uri(inputHTMLPath);
        
        // Create a HtmlAreaPadding
        HtmlAreaPadding padding = new HtmlAreaPadding(20.0f, 0.0f, 20.0f, 0.0f);
        
        // Create a PDF Document
        Document document = Document.FromHtml(uri, dimensions, padding);
        
        // Save the PDF
        document.Draw(outputPath);    
    }
}

FromHtml(Uri, PageDimensions, HtmlAreaPadding, Uri)

Gets a Document containing HtmlArea created with the given content.

public static Document FromHtml(Uri uri, PageDimensions dimensions, HtmlAreaPadding padding, Uri baseHref)
Shared Function FromHtml(uri As Uri, dimensions As PageDimensions, padding As HtmlAreaPadding, baseHref As Uri) As Document

Parameters

uri
Uri

Initializes a new instance of the Uri class with the specified URI.

dimensions
PageDimensions

Page dimensions for HTML Area

padding
HtmlAreaPadding

Padding for HTML Area

baseHref
Uri

Initializes a new instance of the Uri class with the specified base href URI.

Returns

Document

Licensing Info

This method is a full DynamicPDF Core Suite feature. One of the following is required for non-evaluation usage:

Examples

This example shows simple HTML being displayed on the page.
Imports System
Imports ceTe.DynamicPDF
Imports ceTe.DynamicPDF.PageElements
Imports ceTe.DynamicPDF.PageElements.Html
     
Module MyModule
     
    Sub Main()
      
	   'Create a PageDimensions
        Dim dimensions As PageDimensions = New PageDimensions(PageSize.Letter, PageOrientation.Portrait, 50.0)

        'Create a uri
        Dim uri As Uri = New Uri(inputHTMLPath)

        'Create a HtmlAreaPadding
        Dim padding As HtmlAreaPadding = New HtmlAreaPadding(20.0, 0.0, 20.0, 0.0)

        'Create a baseHref
        Dim baseHref As Uri = New Uri(baseUriPath)

        'Create a PDF Document
        Dim document As Document = Document.FromHtml(uri, dimensions, padding, baseHref)

        ' Save the PDF
        document.Draw(outputPath)
	          
    End Sub
End Module
using System;
using ceTe.DynamicPDF;
using ceTe.DynamicPDF.PageElements;
using ceTe.DynamicPDF.PageElements.Html;

public class Example
{
    public static void CreatePDF(string inputHTMLPath, string baseUriPath, string outputPath)
    {    
        // Create a PageDimensions
        PageDimensions dimensions = new PageDimensions(PageSize.Letter, PageOrientation.Portrait, 50.0f);
         
        // Create a Uri
        Uri uri = new Uri(inputHTMLPath);
        
        // Create a HtmlAreaPadding
        HtmlAreaPadding padding = new HtmlAreaPadding(20.0f, 0.0f, 20.0f, 0.0f);
        
        // Create a baseHref
        Uri baseHref = new Uri(baseUriPath);
        
        // Create a PDF Document
        Document document = Document.FromHtml(uri, dimensions, padding, baseHref);
        
        // Save the PDF
        document.Draw(outputPath);    
    }
}

FromHtml(Uri, PageDimensions, Uri)

Gets a Document containing HtmlArea created with the given content.

public static Document FromHtml(Uri uri, PageDimensions dimensions, Uri baseHref)
Shared Function FromHtml(uri As Uri, dimensions As PageDimensions, baseHref As Uri) As Document

Parameters

uri
Uri

Initializes a new instance of the Uri class with the specified URI.

dimensions
PageDimensions

Page dimensions for HTML Area.

baseHref
Uri

Initializes a new instance of the Uri class with the specified base href URI.

Returns

Document

Licensing Info

This method is a full DynamicPDF Core Suite feature. One of the following is required for non-evaluation usage:

Examples

This example shows simple HTML being displayed on the page.
Imports System
Imports ceTe.DynamicPDF
Imports ceTe.DynamicPDF.PageElements
Imports ceTe.DynamicPDF.PageElements.Html
     
Module MyModule
     
    Sub Main()
      
	   'Create a PageDimensions
        Dim dimensions As PageDimensions = New PageDimensions(PageSize.Letter, PageOrientation.Portrait, 50.0)

        'Create a uri
        Dim uri As Uri = New Uri(inputHTMLPath)

        'Create a baseHref
        Dim baseHref As Uri = New Uri(baseUriPath)

        'Create a PDF Document
        Dim document As Document = Document.FromHtml(uri, dimensions, baseHref)
        'Create a PDF Document
        ' Save the PDF
        document.Draw(outputPath)
	          
    End Sub
End Module
using System;
using ceTe.DynamicPDF;
using ceTe.DynamicPDF.PageElements;
using ceTe.DynamicPDF.PageElements.Html;

public class Example
{
    public static void CreatePDF(string inputHTMLPath, string baseUriPath, string outputPath)
    {    
        // Create a PageDimensions
        PageDimensions dimensions = new PageDimensions(PageSize.Letter, PageOrientation.Portrait, 50.0f);
         
        //Create a Uri
        Uri uri = new Uri(inputHTMLPath);
        
        // Create a baseHref
        Uri baseHref = new Uri(baseUriPath);
        
        // Create a PDF Document
        Document document = Document.FromHtml(uri, dimensions, baseHref);
        
        // Save the PDF
        document.Draw(outputPath);    
    }
}

See Also

Document
ceTe.DynamicPDF

In this topic