You are on page 1of 1110

SelectPdf Pdf Library for .

NET

Welcome to Select.Pdf Library for .NET


Select.Pdf for .NET is a professional PDF library that can be used for creating,
writing, editing, handling and reading PDF files without any external dependencies
within .NET applications. Using this .NET PDF library, you can implement rich
capabilities to create PDF files from scratch or process existing PDF documents
entirely through C#/VB.NET without installing Adobe Acrobat.
Many rich features can be supported by the .NET PDF API, such as security setting
(including digital signatures), PDF merge/split, text, html and image drawing into
pdf and many more. Besides, Select.Pdf for .NET can be used to easily convert HTML
to PDF with C#/VB.NET in high quality.

Sample Code
Coding with Select.Pdf is very easy. Take a look at the section below:
C#
// create a new pdf document
PdfDocument doc = new PdfDocument();
// add a new page to the document
PdfPage page = doc.AddPage();
// create a new pdf font
PdfFont font = doc.AddFont(PdfStandardFont.Helvetica);
font.Size = 20;
// create a new text element and add it to the page
PdfTextElement text = new PdfTextElement(50, 50, "Hello world!",
font);
page.Add(text);
// save pdf document
doc.Save(file);
// close pdf document
doc.Close();
VB
' create a new pdf document
Dim doc As New PdfDocument()
' add a new page to the document
Dim page As PdfPage = doc.AddPage()
' create a new pdf font
Dim font As PdfFont = doc.AddFont(PdfStandardFont.Helvetica)
font.Size = 20

SelectPdf Pdf Library for .NET

' create a new text element and add it to the page


Dim text As New PdfTextElement(50, 50, "Hello world!", font)
page.Add(text)
' save pdf document
doc.Save(file)
' close pdf document
doc.Close()

See Also
Reference
SelectPdf
Other Resources
Select.Pdf Website
Select.Pdf Online Demo with C# Sample Code
Select.Pdf Online Demo with Vb.Net Sample Code

SelectPdf Pdf Library for .NET

Installation
Select.Pdf can be downloaded from the product site: http://selectpdf.com.
Select.Pdf is shipped as a product archive with the following structure:
Assemblies
Contains the assemblies and related files needed by SelectPdf Library for .NET.
Select.Pdf Library is shipped with different versions for CLR 2.0 (.NET 2.0, 3.5)
and for CLR 4.0 (.NET 4.0 and above).
Documentation
Contains the product documentation in CHM format.
Samples
Contains C# and VB.NET samples that show how to use most of the features the
library provides.

Project Setup
To use Select.Pdf in a .NET project, a reference needs to be added to Select.Pdf.dll.
If the application will use the html to pdf converter, an additional file
(Select.Html.dep) will be needed. This needs to be manually copied into the bin
folder of the application, next to Select.Pdf.dll. Alternatively, the path to
Select.Html.dep can be specified using the HtmlEngineFullPath property of the
GlobalProperties class.

GAC Installation
If you plan to install Select.Pdf into GAC, the only dll that needs to be added to GAC
is Select.Pdf.dll.
Important
In the case of GAC installation, if the html to pdf converter is used, the full path to
Select.Html.dep must always be specified in code using the HtmlEngineFullPath
property of the GlobalProperties class.

See Also
Other Resources
Licensing
License Agreement
Deployment
Select.Pdf Website

SelectPdf Pdf Library for .NET

Licensing Select.Pdf Library


Acquiring a license
Select.Pdf Library for .NET is provided as a free trial product that can be tested
without any limitations for 30 days.
The free trial is fully functional, but without a license key, an watermark will be
displayed in each page of the pdf documents generated with the library. A license
key is need to unlock the product and remove the demo watermark.
A license key can be purchased from the product website: http://selectpdf.com.
Take a look at the End User License Agreement for licensing details.

Applying the license key


Once the license is purchased, a license key is delivered by email.
There is no need to download another version of the product, as the free trial is a
full version. To unlock the product, the license key needs to be set in code, using the
LicenseKey property of the GlobalProperties class:
C#
// sample license key setting
GlobalProperties.LicenseKey = "your-license-key";
VB
' sample license key setting
GlobalProperties.LicenseKey = "your-license-key"
Do not forget to replace your-license-key with the actual license key received by
email when the order is processed.

See Also
Other Resources
License Agreement
Deployment
Select.Pdf Website

SelectPdf Pdf Library for .NET

End User License Agreement


This End-User Software License Agreement ("EULA") is a legal agreement between
you and SelectPdf for software together with all related documentation ("SOFTWARE
PRODUCT" or SOFTWARE") provided by SelectPdf. By using the SOFTWARE
PRODUCT, you agree to be bound by the terms of this End User License Agreement
("EULA").

GRANT OF LICENSE
THE SOFTWARE is licensed, not sold to you, to use only under the terms of this
license agreement. SelectPdf retains the ownership of the product source code and
reserves all the rights not expressly granted to you. SelectPdf grants you the
following rights:
Free Trial License: The product can be used for evaluation purposes for 30 days.
Single Developer License: A single developer can develop a single application
with the product and can deploy it to a single deployment machine.
Single Developer OEM License: A single developer can develop applications with
the product and can deploy it to an unlimited number of deployment machines.
5-Developers License: Up to 5 developers can develop applications with the
product and can deploy it up to 10 deployment machines.
5-Developers OEM License: Up to 5 developers can develop applications with the
product and can deploy it to an unlimited number of deployment machines.
Enterprise License: An unlimited number of developers can develop applications
with the product and can deploy it up to 100 deployment machines.
Enterprise OEM License: An unlimited number of developers can develop
applications with the product and can deploy it to an unlimited number of
deployment machines.
Important
Only the OEM licenses are royalty-free. The rest of the licenses are restricted
related to the number of deployment machines.
Each license includes 1 year maintenance plan (upgrades and support). After 1
year, the maintenance plan can be renewed if needed.

COPYRIGHT
THE SOFTWARE is owned by SelectPdf, and it is protected by international copyright
laws and international treaty provisions. You shall not develop/market/sell any
similar product that is based on the SOFTWARE PRODUCT, either in its original form
or thin wrapped form.

SelectPdf Pdf Library for .NET

DECOMPILING, DISASSEMBLING OR REVERSE ENGINEERING


You acknowledge that THE SOFTWARE contains trade secrets and other proprietary
information of SelectPdf and its licensors. Except to the extent expressly permitted
by this Agreement or by the laws of the jurisdiction where you are located, you may
not decompile, disassemble or otherwise reverse engineer THE SOFTWARE or
engage in any other activities to obtain underlying information that is not visible to
the user in connection with normal use of THE SOFTWARE.

TERM AND TERMINATION


The license granted under this EULA will continue in force until terminated, as set
forth herein. If you fail to pay any fees related to THE SOFTWARE or any related
service, or violate any term or condition of this EULA, SelectPdf or its agent may
terminate this license immediately by giving notice of termination to you. You are
responsible for providing valid contact information to SelectPdf. If no valid contact
information is available for you in SelectPdf's records, SelectPdf is not required to
give notice of termination to you.

NO WARRANTY
ANY USE BY YOU OF THE SOFTWARE IS AT YOUR OWN RISK. THE SOFTWARE IS
PROVIDED FOR USE "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR
IMPLIED, INCLUDING, WITHOUT LIMITATION, IMPLIED WARRANTIES OR CONDITIONS
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND
NONINFRINGEMENT.

LIMITATION OF LIABILITY
IN NO EVENT SHALL SELECTPDF OR ITS LICENSORS BE LIABLE FOR ANY DAMAGES
WHATSOEVER (INCLUDING, WITHOUT LIMITATION, INCIDENTAL, DIRECT, INDIRECT,
SPECIAL OR CONSEQUENTIAL DAMAGES, DAMAGES FOR LOSS OF BUSINESS
PROFITS, BUSINESS INTERRUPTION, LOSS OF BUSINESS INFORMATION, OR OTHER
PECUNIARY LOSS) ARISING OUT OF THE USE OR INABILITY TO USE THIS SOFTWARE,
EVEN IF SELECTPDF HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
BECAUSE SOME STATES/COUNTRIES DO NOT ALLOW THE EXCLUSION OR LIMITATION
OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES, THE ABOVE
LIMITATION MAY NOT APPLY TO YOU.

MORE INFORMATION
For more information visit Select.Pdf Website.

SelectPdf Pdf Library for .NET

Deployment
To deploy a project using Select.Pdf, simply include Select.Pdf.dll along with your
project. There are no additional setups or configurations needed either on your
server or your client's machine.
If the html to pdf feature is used in your project, an additional file is need
(Select.Html.dep). This file needs to be deployed in the same folder with
Select.Pdf.dll. Alternatively, the path to Select.Html.dep can be specified using
the HtmlEngineFullPath property of the GlobalProperties class.
Important
Full trust is required on the deployment machine. SelectPdf.Pdf makes numerous
native API calls, thus it requires full trust to run.

GAC Installation
If you plan to install Select.Pdf into GAC, the only dll that needs to be added to GAC
is Select.Pdf.dll.
Important
In the case of GAC installation, if the html to pdf converter is used, the full path to
Select.Html.dep must always be specified in code using the HtmlEngineFullPath
property of the GlobalProperties class.

Deployment to a Shared Hosting Environment


If you plan to deploy Select.Pdf to a shared hosting environment, please check with
your hosting company whether they support full trust. SelectPdf.Pdf makes
numerous native API calls, thus it requires full trust to run. If your hosting company
cannot grant full trust to your site, you may need to consider moving your site to a
dedicated or virtual server.

Deployment to Windows Azure


If you plan to deploy Select.Pdf to Windows Azure, make sure you deploy to a Cloud
Service or a Virtual Machine. Due to some security restrictions, Select.Pdf does not
support Windows Azure WebSite execution mode. To resolve the issue, you can
either deploy your site to a Cloud Service or a Virtual Machine, or isolate the PDF
related feature into a separate Web Service that runs on a different server (either on
a Windows Azure Cloud Service/Virtual Machine, or a dedicated server hosted
elsewhere), then call the web service from your Windows Azure WebSite.

See Also
Other Resources
Installation
Licensing
License Agreement

SelectPdf Pdf Library for .NET

Getting Started
To start using Select.Pdf Library, follow the instructions from the Installation section
to setup a project and add a reference to Select.Pdf.dll.
This section will show how to create a simple 'Hello World!' application with
Select.Pdf.

Import the namespace


To use Select.Pdf classes, a namespace needs to be imported.
C#
using SelectPdf;
VB
Imports SelectPdf

Create the document


The first thing to do when using Select.Pdf library is to create the pdf document that
is an instance of PdfDocument class.
C#
// create a new pdf document
PdfDocument doc = new PdfDocument();
VB
' create a new pdf document
Dim doc As New PdfDocument()

Create the first page of the document


Once the document is created, a first page is need in the pdf document. To do that,
the method AddPage() of the PdfDocument class can be used. A page in a pdf
document is an instance of the PdfPage class.
C#
// add a new page to the document
PdfPage page = doc.AddPage();
VB
' add a new page to the document
Dim page As PdfPage = doc.AddPage()

Create a font
To add a text to a pdf document, a font is needed. A font in a pdf document is an
instance of the PdfFont class.
C#
// create a new pdf font

SelectPdf Pdf Library for .NET


PdfFont font = doc.AddFont(PdfStandardFont.Helvetica);
font.Size = 20;
VB
' create a new pdf font
Dim font As PdfFont = doc.AddFont(PdfStandardFont.Helvetica)
font.Size = 20

Create a text element


To add a text to a pdf document, the PdfTextElement class can be used. After the
PdfTextElement object is created, it must be added to the appropriate PdfPage
object.
C#
// create a new text element and add it to the page
PdfTextElement text = new PdfTextElement(50, 50, "Hello world!",
font);
page.Add(text);
VB
' create a new text element and add it to the page
Dim text As New PdfTextElement(50, 50, "Hello world!", font)
page.Add(text)

Save the document


Once the content is created, you can save the document. The document can be
saved to a stream or file on disk.
C#
// save pdf document
doc.Save(file);
// close pdf document
doc.Close();
VB
' save pdf document
doc.Save(file)
' close pdf document
doc.Close()

Full Code
The full code of the 'Hello World!' application looks like this:
C#
// create a new pdf document
PdfDocument doc = new PdfDocument();

SelectPdf Pdf Library for .NET

// add a new page to the document


PdfPage page = doc.AddPage();
// create a new pdf font
PdfFont font = doc.AddFont(PdfStandardFont.Helvetica);
font.Size = 20;
// create a new text element and add it to the page
PdfTextElement text = new PdfTextElement(50, 50, "Hello world!",
font);
page.Add(text);
// save pdf document
doc.Save(file);
// close pdf document
doc.Close();
VB
' create a new pdf document
Dim doc As New PdfDocument()
' add a new page to the document
Dim page As PdfPage = doc.AddPage()
' create a new pdf font
Dim font As PdfFont = doc.AddFont(PdfStandardFont.Helvetica)
font.Size = 20
' create a new text element and add it to the page
Dim text As New PdfTextElement(50, 50, "Hello world!", font)
page.Add(text)
' save pdf document
doc.Save(file)
' close pdf document
doc.Close()

See Also
Reference
SelectPdf
Other Resources
Select.Pdf Website
Select.Pdf Online Demo with C# Sample Code
Select.Pdf Online Demo with Vb.Net Sample Code

10

SelectPdf Pdf Library for .NET

11

SelectPdf Pdf Library for .NET

Document Properties
Select.Pdf allows you to set the basic document information for the generated pdf
files:

Title

Author

Subject

Keywords

Creation Date

This can be done using DocumentInformation property of the PdfDocument object.

Code Sample
C#
// set the document properties
doc.DocumentInformation.Title = "Select.Pdf for .NET Sample";
doc.DocumentInformation.Author = "Select.Pdf Samples";
doc.DocumentInformation.Subject = "Select.Pdf Library Samples";
doc.DocumentInformation.Keywords = "pdf library, sample code";
doc.DocumentInformation.CreationDate = DateTime.Now;
VB
' set the document properties
doc.DocumentInformation.Title = "Select.Pdf for .NET Sample"
doc.DocumentInformation.Author = "Select.Pdf Samples"
doc.DocumentInformation.Subject = "Select.Pdf Library Samples"
doc.DocumentInformation.Keywords = "pdf library, sample code"
doc.DocumentInformation.CreationDate = DateTime.Now

See Also
Reference
PdfDocument
PdfDocumentInformation
Other Resources
Pdf Viewer Preferences

12

SelectPdf Pdf Library for .NET

Pdf Viewer Preferences


A pdf document can control the way it will be displayed when opened in a pdf
viewer. These properties can be set by Select.Pdf library using ViewerPreferences
property of the PdfDocument object.
The following customizations can be done using the PdfViewerPreferences object:
Property
HideToolbar

HideMenuBar

HideWindowUI

FitWindow

CenterWindow

DisplayDocTitle

PageMode

Description
A flag specifying whether to hide the
pdf viewer application's tool bars when
the document is active
A flag specifying whether to hide the
pdf viewer application's menu bar when
the document is active.
A flag specifying whether to hide user
interface elements in the document's
window (such as scroll bars and
navigation controls), leaving only the
document's contents displayed.
A flag specifying whether to resize the
document's window to fit the size of the
first displayed page.
A flag specifying whether to position the
document's window in the center of the
screen.
A flag specifying whether the window's
title bar should display the document
title.
The document page mode when the pdf
document is opened in a pdf viewer.
Possible values:
UseNone
Neither document
outline
(bookmarks) nor
thumbnail images
are visible.
UseOutlines
Document outline
(bookmarks) are
visible.
UseThumbs
Thumbnail
images are
visible.
FullScreen
Full-screen mode,
with no menu bar,
window controls
or any other

13

SelectPdf Pdf Library for .NET

PageLayout

NonFullScreenPageMode

window visible.
UseOC
Optional content
group panel is
visible.
UseAttachments
Document
attachments are
visible.
The page layout to be used when the
document is opened. Possible values:
SinglePage
Displays one
page at a time.
OneColumn
Displays the
pages in one
column.
TwoColumnLeft
Displays the
pages in two
columns, with
odd-numbered
pages on the left.
TwoColumnRight
Displays the
pages in two
columns, with
odd-numbered
pages on the
right.
The document page mode when the pdf
viewer application exits the full screen
mode. Possible values:
UseNone
Neither document
outline
(bookmarks) nor
thumbnail images
are visible.
UseOutlines
Document outline
(bookmarks) are
visible.
UseThumbs
Thumbnail
images are
visible.
UseOC
Optional content
group panel is
visible.

Code Sample
C#
// set the pdf viewer preferences

14

SelectPdf Pdf Library for .NET


doc.ViewerPreferences.CenterWindow = true;
doc.ViewerPreferences.DisplayDocTitle = true;
doc.ViewerPreferences.FitWindow = true;
doc.ViewerPreferences.HideMenuBar = true;
doc.ViewerPreferences.HideToolbar = true;
doc.ViewerPreferences.HideWindowUI = false;
doc.ViewerPreferences.NonFullScreenPageMode =
PdfViewerFullScreenExitMode.UseNone;
doc.ViewerPreferences.PageLayout = PdfViewerPageLayout.SinglePage;
doc.ViewerPreferences.PageMode = PdfViewerPageMode.UseNone;
VB
' set the pdf viewer preferences
doc.ViewerPreferences.CenterWindow = True
doc.ViewerPreferences.DisplayDocTitle = True
doc.ViewerPreferences.FitWindow = True
doc.ViewerPreferences.HideMenuBar = True
doc.ViewerPreferences.HideToolbar = True
doc.ViewerPreferences.HideWindowUI = False
doc.ViewerPreferences.NonFullScreenPageMode =
PdfViewerFullScreenExitMode.UseNone
doc.ViewerPreferences.PageLayout = PdfViewerPageLayout.SinglePage
doc.ViewerPreferences.PageMode = PdfViewerPageMode.UseNone

See Also
Reference
PdfDocument
PdfViewerPreferences
Other Resources
Document Properties

15

SelectPdf Pdf Library for .NET

Page Settings
Select.Pdf can be used to control how a page looks like when it is added to a pdf
document. The most important properties of a pdf page are:

Page size

Page orientation

Page margins

Page size
SelectPdf supports the following standard page sizes:

A0 to A10

B0 to B5

ArchA to ArchE

Letter, HalfLetter, Letter11x17, Note, Flsa, Ledger

Pages with custom page sizes can also be created using Select.Pdf.

Page orientation
SelectPdf supports the following page orientations:

Portrait

Landscape

Page margins
Page margins can be set using PdfMargins object.

Adding a page to a pdf document


The page settings described above can be set when a new page is added to the pdf
document.
C#
// add a new page to the document
// (with specific page size, margins and orientation)
PdfPage page = doc.AddPage(PdfCustomPageSize.A4, new PdfMargins(0f),
PdfPageOrientation.Portrait);

16

SelectPdf Pdf Library for .NET


VB
' add a new page to the document
' (with specific page size, margins and orientation)
Dim page As PdfPage = doc.AddPage(PdfCustomPageSize.A4, New
PdfMargins(0.0F), PdfPageOrientation.Portrait)
The page size and orientation can also be modified directly on PdfPage object, but
the page margins can be set only on the PdfDocument object, using either
AddPage(PdfMargins) method or the Margins property.
If there is a previous page in the pages collection when a new page is added with no
parameters specified, the orientation and size are inherited from that page,
otherwise a first page with the default A4 size and Portrait orientation is created.
The page margins are inherited from the default pdf document margins specified in
Margins property.

Sample Code
The sample code below create a first page with no margins, size A4 and Portrait
orientation and a second page with 20pt for all margins, Letter size and Landscape
orientation.
C#
// create a new pdf document
PdfDocument doc = new PdfDocument();
// create a new pdf font
PdfFont font = doc.AddFont(PdfStandardFont.Helvetica);
font.Size = 18;
// add a new page to the document
// (with specific page size, margins and orientation)
PdfPage page = doc.AddPage(PdfCustomPageSize.A4, new PdfMargins(0f),
PdfPageOrientation.Portrait);
// create a new text element and add it to the page
PdfTextElement text = new PdfTextElement(0, 0, Helper.SomeText(),
font);
page.Add(text);
// add a new page to the document
// (with specific page size, margins and orientation)
PdfPage page2 = doc.AddPage(PdfCustomPageSize.Letter, new
PdfMargins(20f), PdfPageOrientation.Landscape);
// create a new text element and add it to the page
PdfTextElement text2 = new PdfTextElement(0, 0, Helper.SomeText(),
font);
page2.Add(text2);

17

SelectPdf Pdf Library for .NET


// save pdf document
doc.Save(file);
// close pdf document
doc.Close();
VB
' create a new pdf document
Dim doc As New PdfDocument()
' create a new pdf font
Dim font As PdfFont = doc.AddFont(PdfStandardFont.Helvetica)
font.Size = 18
' add a new page to the document
' (with specific page size, margins and orientation)
Dim page As PdfPage = doc.AddPage(PdfCustomPageSize.A4, New
PdfMargins(0.0F), PdfPageOrientation.Portrait)
' create a new text element and add it to the page
Dim text As New PdfTextElement(0, 0, Helper.SomeText(), font)
page.Add(text)
' add a new page to the document
' (with specific page size, margins and orientation)
Dim page2 As PdfPage = doc.AddPage(PdfCustomPageSize.Letter, New
PdfMargins(20.0F), PdfPageOrientation.Landscape)
' create a new text element and add it to the page
Dim text2 As New PdfTextElement(0, 0, Helper.SomeText(), font)
page2.Add(text2)
' save pdf document
doc.Save(file)
' close pdf document
doc.Close()

See Also
Reference
PdfDocument
PdfPage
PdfCustomPageSize
PdfMargins
PdfPageOrientation

18

SelectPdf Pdf Library for .NET

Pdf Security
Select.Pdf can be used to set the basic security settings for the generated pdf files
and also manage different permissions:

Owner Password

User Password

Assemble Document permission

Copy Content permission

Edit Annotations permission

Edit Content permission

Fill Form Fields permission

Print permission

This can be done using Security property of the PdfDocument object.

Code Sample
C#
// set document passwords
doc.Security.OwnerPassword = "test1";
doc.Security.UserPassword = "test2";
//set document permissions
doc.Security.CanAssembleDocument = false;
doc.Security.CanCopyContent = true;
doc.Security.CanEditAnnotations = true;
doc.Security.CanEditContent = true;
doc.Security.CanFillFormFields = true;
doc.Security.CanPrint = true;
VB
' set document passwords
doc.Security.OwnerPassword = "test1"
doc.Security.UserPassword = "test2"
'set document permissions
doc.Security.CanAssembleDocument = False
doc.Security.CanCopyContent = True
doc.Security.CanEditAnnotations = True
doc.Security.CanEditContent = True
doc.Security.CanFillFormFields = True
doc.Security.CanPrint = True

19

SelectPdf Pdf Library for .NET

See Also
Reference
PdfDocument
PdfSecurityOptions

20

SelectPdf Pdf Library for .NET

Pdf Elements
Select.Pdf supports a large number of element types that can be added to the pdf
documents it manages:

Text Element (PdfTextElement)

Image Element (PdfImageElement)

HTML Element (PdfHtmlElement)

Graphic elements: Circle Element (PdfCircleElement), Ellipse Element


(PdfEllipseElement), Ellipse Slice Element (PdfEllipseSliceElement), Ellipse Arc
Element (PdfEllipseArcElement), Line Element (PdfLineElement), Polygon
Element (PdfPolygonElement), Rectangle Element (PdfRectangleElement),
Bezier Curve Element (PdfBezierCurveElement)

Annotation Element (PdfAnnotationElement)

Sound Link Element (PdfSoundLinkElement)

File Attachment Element (PdfFileAttachmentElement)

External File Element (PdfExternalFileElement)

Internal Link Element (PdfInternalLinkElement)

External Link Element (PdfExternalLinkElement)

Digital Signature Element (PdfDigitalSignatureElement)

Add Elements to Pdf


To add an element to a pdf document, at least one pdf page (instance of PdfPage)
needs to be defined. To create a pdf page into a new document, the following code
can be used:
C#
// create a new pdf document
PdfDocument doc = new PdfDocument();
// add a new page to the document
PdfPage page = doc.AddPage();
VB
' create a new pdf document
Dim doc As New PdfDocument()
' add a new page to the document
Dim page As PdfPage = doc.AddPage()

21

SelectPdf Pdf Library for .NET


Pdf elements are added to pdf pages using the Add(PdfPageElement) method of the
PdfPage object. Add(PdfPageElement) returns a PdfRenderingResult object that
contains information about the position where the pdf element was rendered.
The following code shows how to add a text element to a pdf page and how to
retrieve the rendering results object:
C#
// define a rendering result object
PdfRenderingResult result;
// create a new text element and add it to the page
// Important: get the rendering result returned by Add()
// into the PdfRenderingResult object
PdfTextElement text = new PdfTextElement(0, 0, "Hello world!", font);
result = page.Add(text);
VB
' define a rendering result object
Dim result As PdfRenderingResult
' create a new text element and add it to the page
' Important: get the rendering result returned by Add()
' into the PdfRenderingResult object
Dim text As New PdfTextElement(0, 0, "Hello world!", font)
result = page.Add(text)

Code Sample
The following sample code shows how to create a new PDF document using
Select.Pdf and add several text elements to it, for each additional element using the
finish position of the previous element, to introduce some space between the lines
of text.
C#
// create a new pdf document
PdfDocument doc = new PdfDocument();
// add a new page to the document
PdfPage page = doc.AddPage();
// create a new pdf font
PdfFont font = doc.AddFont(PdfStandardFont.Helvetica);
font.Size = 20;
// define a rendering result object
PdfRenderingResult result;
// create a new text element and add it to the page
// Important: get the rendering result returned by Add()
22

SelectPdf Pdf Library for .NET


// into the PdfRenderingResult object
PdfTextElement text = new PdfTextElement(0, 0, "Hello world!", font);
result = page.Add(text);
// add 10 more text element, leaving 30pt between the text lines
for (int i = 1; i <= 10; i++)
{
PdfTextElement elem = new PdfTextElement(0,
result.PdfPageLastRectangle.Bottom + 30, "Text line " + i, font);
result = page.Add(elem);
}
// save pdf document
doc.Save(file);
// close pdf document
doc.Close();
VB
' create a new pdf document
Dim doc As New PdfDocument()
' add a new page to the document
Dim page As PdfPage = doc.AddPage()
' create a new pdf font
Dim font As PdfFont = doc.AddFont(PdfStandardFont.Helvetica)
font.Size = 20
' define a rendering result object
Dim result As PdfRenderingResult
' create a new text element and add it to the page
' Important: get the rendering result returned by Add()
' into the PdfRenderingResult object
Dim text As New PdfTextElement(0, 0, "Hello world!", font)
result = page.Add(text)
' add 10 more text element, leaving 30pt between the text lines
For i As Integer = 1 To 10
Dim elem As New PdfTextElement(0,
result.PdfPageLastRectangle.Bottom + 30, "Text line " & i, font)
result = page.Add(elem)
Next
' save pdf document
doc.Save(file)

23

SelectPdf Pdf Library for .NET


' close pdf document
doc.Close()

See Also
Reference
PdfDocument
PdfPage
PdfRenderingResult

24

SelectPdf Pdf Library for .NET

Pdf Text Element


Text can be added to a pdf document using PdfTextElement objects. There are a lot
of settings that can be customized by Select.Pdf library when text is added to a
document. Here are some of them:

Position of the text element in the destination pdf page can be customize using X
and Y properties.
Size of the destination rectangle where the text will be rendered can be customized
using Width and Height properties.
Color - both foreground and background colors can be customized using the
ForeColor and BackColor properties of the PdfTextElement class.
Font - font family, size and style can be customized using Font property.
Text alignments can be controlled using HorizontalAlign and VerticalAlign
properties.
Other properties - CharacterSpacing, WordSpacing, RightToLeft, TextRise, Leading.

Sample Code
Sample code that shows how to create text elements with different settings. Read
the comments from the code for customization details.
C#
// create a new pdf document
PdfDocument doc = new PdfDocument();
// create a new pdf font (component standard font)
PdfFont font1 = doc.AddFont(PdfStandardFont.Helvetica);
font1.Size = 20;
// create a new pdf font (system font)
PdfFont font2 = doc.AddFont(new System.Drawing.Font("Verdana", 15));
// add a new page to the document
PdfPage page = doc.AddPage();
// define a rendering result object
PdfRenderingResult result;
// create text element
PdfTextElement text1 = new PdfTextElement(0, 0,
"Regular text using standard font Helvetica, size 20.", font1);
result = page.Add(text1);

25

SelectPdf Pdf Library for .NET


// create text element
PdfTextElement text2 = new PdfTextElement(0,
result.PdfPageLastRectangle.Bottom + 20,
"Regular text using system font Verdana, size 15.", font2);
result = page.Add(text2);
// create colored text element
PdfTextElement text3 = new PdfTextElement(0,
result.PdfPageLastRectangle.Bottom + 20, 200,
"Red text over light blue background, using system font Verdana,
size 15, limited at a width of 200 points.", font2);
text3.ForeColor = System.Drawing.Color.Red;
text3.BackColor = System.Drawing.Color.LightBlue;
result = page.Add(text3);
// create colored text element, right aligned
PdfTextElement text4 = new PdfTextElement(0,
result.PdfPageLastRectangle.Bottom + 20, 300,
"Red text over light green background, right aligned, using
system font Verdana, size 15, limited at a width of 300 points.",
font2);
text4.ForeColor = System.Drawing.Color.Red;
text4.BackColor = System.Drawing.Color.LightGreen;
text4.HorizontalAlign = PdfTextHorizontalAlign.Right;
result = page.Add(text4);
// create text element
PdfTextElement text5 = new PdfTextElement(0,
result.PdfPageLastRectangle.Bottom + 200, 300,
"Regular text using system font Verdana, size 15, rotated 45
degrees.", font2);
text5.Direction = 45; // rotate 45 degrees counter-clockwise
result = page.Add(text5);
// save pdf document
doc.Save(Response, false, "Sample.pdf");
// close pdf document
doc.Close();
VB
' create a new pdf document
Dim doc As New PdfDocument()
' create a new pdf font (component standard font)
Dim font1 As PdfFont = doc.AddFont(PdfStandardFont.Helvetica)
font1.Size = 20

26

SelectPdf Pdf Library for .NET


' create a new pdf font (system font)
Dim font2 As PdfFont = doc.AddFont(New System.Drawing.Font("Verdana",
15))
' add a new page to the document
Dim page As PdfPage = doc.AddPage()
' define a rendering result object
Dim result As PdfRenderingResult
' create text element
Dim text1 As New PdfTextElement(0, 0, _
"Regular text using standard font Helvetica, size 20.",
font1)
result = page.Add(text1)
' create text element
Dim text2 As New PdfTextElement(0, _
result.PdfPageLastRectangle.Bottom + 20, _
"Regular text using system font Verdana, size 15.", font2)
result = page.Add(text2)
' create colored text element
Dim text3 As New PdfTextElement(0, result.PdfPageLastRectangle.Bottom
+ 20, 200, _
"Red text over light blue background, using system font
Verdana, size 15, limited at a width of 200 points.", font2)
text3.ForeColor = System.Drawing.Color.Red
text3.BackColor = System.Drawing.Color.LightBlue
result = page.Add(text3)
' create colored text element, right aligned
Dim text4 As New PdfTextElement(0, result.PdfPageLastRectangle.Bottom
+ 20, 300, _
"Red text over light green background, right aligned, using
system font Verdana, size 15, limited at a width of 300 points.",
font2)
text4.ForeColor = System.Drawing.Color.Red
text4.BackColor = System.Drawing.Color.LightGreen
text4.HorizontalAlign = PdfTextHorizontalAlign.Right
result = page.Add(text4)
' create text element
Dim text5 As New PdfTextElement(0, result.PdfPageLastRectangle.Bottom
+ 200, 300, _
"Regular text using system font Verdana, size 15, rotated 45
degrees.", font2)
text5.Direction = 45

27

SelectPdf Pdf Library for .NET


' rotate 45 degrees counter-clockwise
result = page.Add(text5)
' save pdf document
doc.Save(Response, False, "Sample.pdf")
' close pdf document
doc.Close()

See Also
Reference
PdfTextElement

28

SelectPdf Pdf Library for .NET

Pdf Image Element


Images can be added to a pdf document using PdfImageElement objects. Here are
some of the setting that can be used to customized how an image will look in pdf:

Position of the image element in the destination pdf page can be customize using
X and Y properties.
Size of the image in the destination page can be customized using Width and
Height properties.
Image object - the underlying system image object can be customized using
Image property. The image can be specified as a file name if a constructor with the
specific parameter is used: PdfImageElement(Single, Single, String)
Transparency can be customized using Transparency property.

Sample Code
Sample code that shows how to create image elements with different settings. Read
the comments from the code for customization details.
C#
// create a new pdf document
PdfDocument doc = new PdfDocument();
// add a new page to the document
PdfPage page = doc.AddPage();
// get image path
string imgFile = Server.MapPath("~/files/logo.png");
// define a rendering result object
PdfRenderingResult result;
// create image element from file path with real image size
PdfImageElement img1 = new PdfImageElement(0, 0, imgFile);
result = page.Add(img1);
// create image element from system Image object with fixed size in
pdf
// (aspect ratio not preserved)
System.Drawing.Image img = System.Drawing.Image.FromFile(imgFile);
PdfImageElement img2 = new PdfImageElement(0,
result.PdfPageLastRectangle.Bottom + 50, 100, 100, img);
result = page.Add(img2);
// add text element
PdfFont font1 = doc.AddFont(PdfStandardFont.Helvetica);
29

SelectPdf Pdf Library for .NET


font1.Size = 10;
PdfTextElement text1 = new PdfTextElement(0,
result.PdfPageLastRectangle.Bottom + 50, Helper.SomeText(),
font1);
page.Add(text1);
// add image over text (no transparency)
PdfImageElement img3 = new PdfImageElement(0,
result.PdfPageLastRectangle.Bottom + 50, imgFile);
result = page.Add(img3);
// add image over text (with transparency) next to the previous image
PdfImageElement img4 = new PdfImageElement(
result.PdfPageLastRectangle.Right + 30,
result.PdfPageLastRectangle.Top, imgFile);
img4.Transparency = 50;
result = page.Add(img4);
// save pdf document
doc.Save(Response, false, "Sample.pdf");
// close pdf document
doc.Close();
VB
' create a new pdf document
Dim doc As New PdfDocument()
' add a new page to the document
Dim page As PdfPage = doc.AddPage()
' get image path
Dim imgFile As String = Server.MapPath("~/files/logo.png")
' define a rendering result object
Dim result As PdfRenderingResult
' create image element from file path with real image size
Dim img1 As New PdfImageElement(0, 0, imgFile)
result = page.Add(img1)
' create image element from system Image object with fixed size in
pdf
' (aspect ratio not preserved)
Dim img As System.Drawing.Image =
System.Drawing.Image.FromFile(imgFile)
Dim img2 As New PdfImageElement(0, result.PdfPageLastRectangle.Bottom
+ 50, _

30

SelectPdf Pdf Library for .NET


100, 100, img)
result = page.Add(img2)
' add text element
Dim font1 As PdfFont = doc.AddFont(PdfStandardFont.Helvetica)
font1.Size = 10
Dim text1 As New PdfTextElement(0, result.PdfPageLastRectangle.Bottom
+ 50, _
Helper.SomeText(), font1)
page.Add(text1)
' add image over text (no transparency)
Dim img3 As New PdfImageElement(0, result.PdfPageLastRectangle.Bottom
+ 50, imgFile)
result = page.Add(img3)
' add image over text (with transparency) next to the previous image
Dim img4 As New PdfImageElement(result.PdfPageLastRectangle.Right +
30, _
result.PdfPageLastRectangle.Top,
imgFile)
img4.Transparency = 50
result = page.Add(img4)
' save pdf document
doc.Save(Response, False, "Sample.pdf")
' close pdf document
doc.Close()

See Also
Reference
PdfImageElement

31

SelectPdf Pdf Library for .NET

Pdf Html Element


HTML content can be added to a pdf document in several ways. If a complex
document is created that will contain several types of pdf elements and the html
content that will be added is only a small part of the total content, PdfHtmlElement
objects can be used to convert web pages or raw html content and add the
conversion result to the pdf document.
If the pdf is generated mostly as a result of an html to pdf conversion, the HtmlToPdf
object should be used instead. This is described in details in the "Html to Pdf
Converter" section of our documentation that starts here.

Element properties
Both full web pages and html strings can be converted to pdf using PdfHtmlElement
with the appropriate constructor. PdfHtmlElement(String) can be used to convert a
full web page specified by an url or local file to pdf. PdfHtmlElement(String, String)
can be used to convert a raw html string to pdf.

Properties
Authentication - Handles authentication options if the web page being converted
requires authentication.
AutoFitHeight - Specifies the vertical auto fit mode.
AutoFitWidth - Specifies the horizontal auto fit mode.
CssMediaType - Indicates what css styles are used when the web page is rendered.
DrawBackground - Gets or sets a flag indicating if the web page background is
rendered in pdf.
HiddenWebElements - Gets a reference to the object that controls the visibility of
some web elements in the generated pdf document.
HttpCookies - Gets the collection of custom HTTP cookies used for the conversion.
HttpHeaders - Get the collection of custom HTTP headers used for the conversion.
JavaScriptEnabled - Enable scripts when rendering the url or html string.
KeepImagesTogether - This property instructs the converter whether to try to avoid
cutting off the images between pdf pages or not.
KeepTextsTogether - This property instructs the converter whether to try to avoid
cutting off the text lines between pdf pages or not.
MaxPageLoadTime - The web page navigation timeout in seconds.
MinPageLoadTime - An additional time in seconds to wait for asynchronous items to
be loaded before the web page is rendered.

32

SelectPdf Pdf Library for .NET


PdfBookmarkOptions - Gets a reference to the object that controls the bookmarks
creation for the generated pdf document.
ProxyOptions - Gets a reference to an object containing the proxy settings used to
access the web page that is being converted.
StartupMode - Use this property to specify how the conversion starts.
VisibleWebElementId - Use this property to convert only a certain section of the
page, specified by the html element ID.
WebPageWidth - Gets or sets the width of the converted web page as it would
appear in the internal browser used to render the html.
WebPageHeight - Gets or sets the height of the converted web page as it would
appear in the internal browser used to render the html.
WebPageFixedSize - Controls whether the web page is rendered with a fixed size
internal browser or the size automatically extends to make the whole content
visible.
WebPageInformation - Gets an object populated after conversion with the title,
keywords and description of the converted web page.

Sample Code
Sample code that shows how to use PdfHtmlElement object to convert a web page
to pdf.
C#
// create a new pdf document
PdfDocument doc = new PdfDocument();
// add a new page to the document
PdfPage page = doc.AddPage();
// create html element
PdfHtmlElement html = new PdfHtmlElement(TxtUrl.Text);
// add the html element to the document
page.Add(html);
// save pdf document
doc.Save(Response, false, "Sample.pdf");
// close pdf document
doc.Close();
VB
' create a new pdf document
Dim doc As New PdfDocument()

33

SelectPdf Pdf Library for .NET


' add a new page to the document
Dim page As PdfPage = doc.AddPage()
' create html element
Dim html As New PdfHtmlElement(TxtUrl.Text)
' add the html element to the document
page.Add(html)
' save pdf document
doc.Save(Response, False, "Sample.pdf")
' close pdf document
doc.Close()

See Also
Reference
PdfHtmlElement
HtmlToPdf
Other Resources
Getting Started with Html to Pdf Converter

34

SelectPdf Pdf Library for .NET

Pdf Graphic Elements


Select.Pdf has support to draw a variety of shapes, such as:

Circles: PdfCircleElement

Ellipses: PdfEllipseElement

Ellipse Slices: PdfEllipseSliceElement

Ellipse Arcs: PdfEllipseArcElement

Lines: PdfLineElement

Polygons: PdfPolygonElement

Rectangles: PdfRectangleElement

Bezier Curves: PdfBezierCurveElement

These graphic elements (all derived from PdfElement), share a number of properties
that can be used to modify their appearance:

Line style: LineStyle can be used to specify the line styles of the graphic
elements that draw lines. Using this, the line width, line dash style, line cap
style and line join style can be specified.

Gradient: Gradient can be used to specify the gradient used to fill a shape.

Line color: ForeColor can be used to specify the color of the drawn lines.

Background color: BackColor can be used to specify the background color.

Sample Code
The following code shows how to draw several graphic elements:
C#
// create a new pdf document
PdfDocument doc = new PdfDocument();
// add a new page to the document
PdfPage page = doc.AddPage();
// define a rendering result object
PdfRenderingResult result;
// simple horizontal line element
PdfLineElement line1 = new PdfLineElement(0, 0, 400, 0);
line1.LineStyle.LineWidth = 3;
result = page.Add(line1);

35

SelectPdf Pdf Library for .NET


// horizontal dotted red line element
PdfLineElement line2 = new PdfLineElement(0, 30, 400, 30);
line2.ForeColor = System.Drawing.Color.Red;
line2.LineStyle.LineWidth = 2;
line2.LineStyle.LineDashStyle = PdfLineDashStyle.Dot;
result = page.Add(line2);
// horizontal dashed blue line element with complex styles
PdfLineElement line3 = new PdfLineElement(0, 60, 400, 60);
line3.ForeColor = System.Drawing.Color.Blue;
line3.LineStyle.LineWidth = 2;
line3.LineStyle.LineDashStyle = PdfLineDashStyle.Dash;
line3.LineStyle.LineCapStyle = PdfLineCapStyle.RoundCap;
line3.LineStyle.LineJoinStyle = PdfLineJoinStyle.RoundJoin;
result = page.Add(line3);
// simple rectangle
PdfRectangleElement rect1 = new PdfRectangleElement(0, 90, 400, 100);
result = page.Add(rect1);
// simple circle
PdfCircleElement circ1 = new PdfCircleElement(50, 250, 50);
circ1.ForeColor = System.Drawing.Color.Green;
result = page.Add(circ1);
// ellipse filled with gradient background color
PdfEllipseElement elli1 = new PdfEllipseElement(300, 250, 100, 50);
elli1.ForeColor = System.Drawing.Color.Brown;
elli1.Gradient = new
PdfGradient(PdfGradientDirection.ForwardDiagonal,
System.Drawing.Color.LightBlue, System.Drawing.Color.DarkBlue);
elli1.LineStyle.LineWidth = 2;
result = page.Add(elli1);
// bezier curve
PdfBezierCurveElement bez1 = new PdfBezierCurveElement(
50, 350, 100, 400, 200, 350, 250, 370);
result = page.Add(bez1);
// save pdf document
doc.Save(Response, false, "Sample.pdf");
// close pdf document
doc.Close();
VB
' create a new pdf document
Dim doc As New PdfDocument()

36

SelectPdf Pdf Library for .NET

' add a new page to the document


Dim page As PdfPage = doc.AddPage()
' define a rendering result object
Dim result As PdfRenderingResult
' simple horizontal line element
Dim line1 As New PdfLineElement(0, 0, 400, 0)
line1.LineStyle.LineWidth = 3
result = page.Add(line1)
' horizontal dotted red line element
Dim line2 As New PdfLineElement(0, 30, 400, 30)
line2.ForeColor = System.Drawing.Color.Red
line2.LineStyle.LineWidth = 2
line2.LineStyle.LineDashStyle = PdfLineDashStyle.Dot
result = page.Add(line2)
' horizontal dashed blue line element with complex styles
Dim line3 As New PdfLineElement(0, 60, 400, 60)
line3.ForeColor = System.Drawing.Color.Blue
line3.LineStyle.LineWidth = 2
line3.LineStyle.LineDashStyle = PdfLineDashStyle.Dash
line3.LineStyle.LineCapStyle = PdfLineCapStyle.RoundCap
line3.LineStyle.LineJoinStyle = PdfLineJoinStyle.RoundJoin
result = page.Add(line3)
' simple rectangle
Dim rect1 As New PdfRectangleElement(0, 90, 400, 100)
result = page.Add(rect1)
' simple circle
Dim circ1 As New PdfCircleElement(50, 250, 50)
circ1.ForeColor = System.Drawing.Color.Green
result = page.Add(circ1)
' ellipse filled with gradient background color
Dim elli1 As New PdfEllipseElement(300, 250, 100, 50)
elli1.ForeColor = System.Drawing.Color.Brown
elli1.Gradient = New
PdfGradient(PdfGradientDirection.ForwardDiagonal, _
System.Drawing.Color.LightBlue, System.Drawing.Color.DarkBlue)
elli1.LineStyle.LineWidth = 2
result = page.Add(elli1)
' bezier curve
Dim bez1 As New PdfBezierCurveElement(50, 350, 100, 400, 200, 350, _

37

SelectPdf Pdf Library for .NET


250, 370)
result = page.Add(bez1)
' save pdf document
doc.Save(Response, False, "Sample.pdf")
' close pdf document
doc.Close()

38

SelectPdf Pdf Library for .NET

Pdf Links
Select.Pdf offers support to create clickable links in a pdf document. A link can be
used to navigate to another location within the same pdf document, open a web url
or a local file. Here are the objects that can be used to create links:

PdfInternalLinkElement - can be used to create a link that will help you


navigate to another location within the current pdf document.

PdfExternalLinkElement - can be used to create a link that will open an


external web url.

PdfExternalFileElement - can be used to create a link that will open a local file
from the disk.

All these elements use a common property (LinkRectangle) to define the clickable
area of the link. This area can be placed over a piece of text, image or any other pdf
element. If that specific element was previously added to the pdf page, the
rendering result object can be used to obtain its exact rendering rectangle specified
by the PdfPageLastRectangle property of the PdfRenderingResult object.
PdfInternalLinkElement defines the LinkDestination property to specify the location
that will be displayed when the link is clicked.
PdfExternalLinkElement defines the LinkURL property to specify the external url that
will be opened when the link is clicked.
PdfExternalFileElement defines the FileName property to specify the external file
that will be opened when the link is clicked.

Sample Code
This sample code shows how to create a new PDF document using Select.Pdf, how
to add 2 pages to the document and several internal and external links:
C#
// create a new pdf document
PdfDocument doc = new PdfDocument();
// add a new page to the document
PdfPage page1 = doc.AddPage();
// add a second page to the document
PdfPage page2 = doc.AddPage();
// define a rendering result object
PdfRenderingResult result;
// create a new pdf font
PdfFont font = doc.AddFont(PdfStandardFont.Helvetica);
font.Size = 14;

39

SelectPdf Pdf Library for .NET


font.IsUnderline = true;
// create a new text element and add it to the first page
PdfTextElement text1 = new PdfTextElement(0, 0,
"First page (no link on this text)", font);
page1.Add(text1);
// create a new text element and add it to the second page
PdfTextElement text2 = new PdfTextElement(0, 0,
"Second page (no link on this text)", font);
page2.Add(text2);
// create external link in 2 steps
// 1 - create the link text
PdfTextElement linkText1 = new PdfTextElement(0, 50,
"External link (click to go to selectpdf.com)", font);
result = page1.Add(linkText1);
// 2 - add the link using the text rendering rectangle
PdfExternalLinkElement extLink1 = new PdfExternalLinkElement(
result.PdfPageLastRectangle, "http://selectpdf.com");
page1.Add(extLink1);
// create internal link in 2 steps
// 1 - create the link text
PdfTextElement linkText2 = new PdfTextElement(0, 100,
"Internal link (click to go to the second page)", font);
result = page1.Add(linkText2);
// 2 - add the link using the text rendering rectangle
PdfInternalLinkElement intLink1 = new PdfInternalLinkElement(
result.PdfPageLastRectangle, new PdfDestination(page2));
page1.Add(intLink1);
// save pdf document
doc.Save(Response, false, "Sample.pdf");
// close pdf document
doc.Close();
VB
' create a new pdf document
Dim doc As New PdfDocument()
' add a new page to the document
Dim page1 As PdfPage = doc.AddPage()

40

SelectPdf Pdf Library for .NET

' add a second page to the document


Dim page2 As PdfPage = doc.AddPage()
' define a rendering result object
Dim result As PdfRenderingResult
' create a new pdf font
Dim font As PdfFont = doc.AddFont(PdfStandardFont.Helvetica)
font.Size = 14
font.IsUnderline = True
' create a new text element and add it to the first page
Dim text1 As New PdfTextElement(0, 0, "First page (no link on this
text)", font)
page1.Add(text1)
' create a new text element and add it to the second page
Dim text2 As New PdfTextElement(0, 0, "Second page (no link on this
text)", font)
page2.Add(text2)
' create external link in 2 steps
' 1 - create the link text
Dim linkText1 As New PdfTextElement(0, 50, _
"External link (click to go to selectpdf.com)", font)
result = page1.Add(linkText1)
' 2 - add the link using the text rendering rectangle
Dim extLink1 As New
PdfExternalLinkElement(result.PdfPageLastRectangle, _
"http://selectpdf.com")
page1.Add(extLink1)
' create internal link in 2 steps
' 1 - create the link text
Dim linkText2 As New PdfTextElement(0, 100, _
"Internal link (click to go to the second page)", font)
result = page1.Add(linkText2)
' 2 - add the link using the text rendering rectangle
Dim intLink1 As New PdfInternalLinkElement( _
result.PdfPageLastRectangle, New PdfDestination(page2))
page1.Add(intLink1)
' save pdf document

41

SelectPdf Pdf Library for .NET


doc.Save(Response, False, "Sample.pdf")
' close pdf document
doc.Close()

42

SelectPdf Pdf Library for .NET

Pdf Bookmarks
Large documents are difficult to navigate. To make the navigation and content
finding easier in a pdf document, pdf viewers can display a document outline
associated with the pdf document. The document outline consists of a treestructured hierarchy of bookmarks. This bookmarks tree serves as a table of
contents for the pdf document, displaying its entire structure. When a bookmark
item is clicked, the destination associated with it is displayed in the viewer.
Select.Pdf offers support for bookmarks creation and manipulation. A bookmark is
handled by the PdfBookmark class. PdfDocument object handles the collection of
bookmarks associated with it through the Bookmarks property and the
corresponding PdfBookmarksCollection class.
A bookmark can be added to a pdf document using one of the following methods:

AddBookmark(String, PdfDestination) - can be used to create a top level


bookmark in the pdf document. When the bookmark is clicked, the pdf viewer
will jump to the destination specified in second parameter of the method.

AddBookmark(String, PdfDestination, PdfBookmark) - can be used to create a


bookmark in the pdf document that has another existing bookmark as parent.
When the bookmark is clicked, the pdf viewer will jump to the destination
specified in second parameter of the method.

The bookmarks hierarchy can be changed using the Parent and ChildNodes
properties of the PdfBookmark object.
Bookmarks can be removed using the Bookmarks collection of the PdfDocument
object.
Bookmarks have styles and colors that can be specified using the Style and Color
properties of the PdfBookmark object.

Sample Code
This sample code shows how to create a new PDF document using Select.Pdf, how
to add several pages, texts and bookmarks to the document.
C#
// create a new pdf document
PdfDocument doc = new PdfDocument();
// instruct the document to show the bookmarks panel when opened in a
viewer
doc.ViewerPreferences.PageMode = PdfViewerPageMode.UseOutlines;
// add a new page to the document
PdfPage page1 = doc.AddPage();
// add a second page to the document

43

SelectPdf Pdf Library for .NET


PdfPage page2 = doc.AddPage();
// add a third page to the document
PdfPage page3 = doc.AddPage();
// define a rendering result object
PdfRenderingResult result;
// create a new pdf font
PdfFont font = doc.AddFont(PdfStandardFont.Helvetica);
font.Size = 14;
// create a new text element and add it to the first page
PdfTextElement text1 = new PdfTextElement(0, 0, "First page", font);
page1.Add(text1);
// create a new text element and add it to the second page
PdfTextElement text2 = new PdfTextElement(0, 0, "Second page", font);
page2.Add(text2);
// create a new text element and add it to the third page
PdfTextElement text3 = new PdfTextElement(0, 0, "Third page", font);
page3.Add(text3);
// create a first level bookmark pointing to the first page
PdfBookmark book1 = doc.AddBookmark("First page", new
PdfDestination(page1,
new System.Drawing.PointF(0, 0)));
// create a first level bookmark pointing to the second page
PdfBookmark book2 = doc.AddBookmark("Second page", new
PdfDestination(page2,
new System.Drawing.PointF(0, 0)));
// create a first level bookmark pointing to the third page
PdfBookmark book3 = doc.AddBookmark("Third page", new
PdfDestination(page3,
new System.Drawing.PointF(0, 0)));
// other text on page 2
PdfTextElement text21 = new PdfTextElement(0, 100, "Text 1 on page
2", font);
result = page2.Add(text21);
// add a level 2 bookmark to this text
// (using the bookmark for the page 2 as parent and
// the text rendering location as bookmark destination)
doc.AddBookmark("Text 1", new PdfDestination(page2,

44

SelectPdf Pdf Library for .NET


result.PdfPageLastRectangle.Location), book2);
// other text on page 2
PdfTextElement text22 = new PdfTextElement(0, 400, "Text 2 on page
2", font);
result = page2.Add(text22);
// add a level 2 bookmark to this text
// (using the bookmark for the page 2 as parent and the text
rendering
// location as bookmark destination) some styles are set for this
bookmark
PdfBookmark book = doc.AddBookmark("Text 2", new
PdfDestination(page2,
result.PdfPageLastRectangle.Location), book2);
book.Color = System.Drawing.Color.Red;
book.Style = PdfBookmarkStyle.Italic;
// save pdf document
doc.Save(Response, false, "Sample.pdf");
// close pdf document
doc.Close();
VB
' create a new pdf document
Dim doc As New PdfDocument()
' instruct the document to show the bookmarks panel when opened in a
pdf viewer
doc.ViewerPreferences.PageMode = PdfViewerPageMode.UseOutlines
' add a new page to the document
Dim page1 As PdfPage = doc.AddPage()
' add a second page to the document
Dim page2 As PdfPage = doc.AddPage()
' add a third page to the document
Dim page3 As PdfPage = doc.AddPage()
' define a rendering result object
Dim result As PdfRenderingResult
' create a new pdf font
Dim font As PdfFont = doc.AddFont(PdfStandardFont.Helvetica)
font.Size = 14

45

SelectPdf Pdf Library for .NET


' create a new text element and add it to the first page
Dim text1 As New PdfTextElement(0, 0, "First page", font)
page1.Add(text1)
' create a new text element and add it to the second page
Dim text2 As New PdfTextElement(0, 0, "Second page", font)
page2.Add(text2)
' create a new text element and add it to the third page
Dim text3 As New PdfTextElement(0, 0, "Third page", font)
page3.Add(text3)
' create a first level bookmark pointing to the first page
Dim book1 As PdfBookmark = doc.AddBookmark("First page", _
New PdfDestination(page1, New System.Drawing.PointF(0,
0)))
' create a first level bookmark pointing to the second page
Dim book2 As PdfBookmark = doc.AddBookmark("Second page", _
New PdfDestination(page2, New System.Drawing.PointF(0,
0)))
' create a first level bookmark pointing to the third page
Dim book3 As PdfBookmark = doc.AddBookmark("Third page", _
New PdfDestination(page3, New System.Drawing.PointF(0,
0)))
' other text on page 2
Dim text21 As New PdfTextElement(0, 100, "Text 1 on page 2", font)
result = page2.Add(text21)
' add a level 2 bookmark to this text
' (using the bookmark for the page 2 as parent and
' the text rendering location as bookmark destination)
doc.AddBookmark("Text 1", New PdfDestination(page2, _
result.PdfPageLastRectangle.Location),
book2)
' other text on page 2
Dim text22 As New PdfTextElement(0, 400, "Text 2 on page 2", font)
result = page2.Add(text22)
' add a level 2 bookmark to this text
' (using the bookmark for the page 2 as parent and
' the text rendering location as bookmark destination)
' some styles are set for this bookmark
Dim book As PdfBookmark = doc.AddBookmark("Text 2", _
New PdfDestination(page2,

46

SelectPdf Pdf Library for .NET


result.PdfPageLastRectangle.Location), book2)
book.Color = System.Drawing.Color.Red
book.Style = PdfBookmarkStyle.Italic
' save pdf document
doc.Save(Response, False, "Sample.pdf")
' close pdf document
doc.Close()

47

SelectPdf Pdf Library for .NET

Pdf Templates
As seen in the previous sections, pdf elements need to be added to a specific page
of the pdf document. But, there are cases when there is the need to display certain
pdf elements in all pages of a pdf document. Select.Pdf has suppport for this,
without the need to add those pdf elements in each individual page. This is done
using pdf templates.
A pdf template belongs to a pdf document and contains elements that will
automatically repeat on each page of the pdf document. The main object that
handles the pdf template is PdfTemplate.
Pdf templates can be added to a pdf document using AddTemplate(Single, Single)
and AddTemplate(RectangleF) methods of the PdfDocument class. Using these
methods, the location of the template in the pdf pages is specified.
PdfTemplate class has several properties that can be used to customize the pdf
template:

Docking - Gets or sets the template docking settings inside the pdf page.

Anchoring - Gets or sets the template anchoring settings inside the pdf page.

DisplayOnOddPages - Controls the visibility of the template on the odd


numbered pages of the pdf document.

DisplayOnEvenPages - Controls the visibility of the template on the even


numbered pages of the pdf document.

DisplayOnFirstPage - Controls the visibility of the template on the first page of


the generated pdf document.

FirstPageNumber - Controls the page number for the first page being
rendered. The page number is displayed setting a {page_number}
placeholder in a Text property of a PdfTextElement object that can be added
to the template. By default the page numbers start with 1. This can be
changed using the FirstPageNumber property.

TotalPagesOffset - Controls the total number of pages offset in the pdf


document. The total number of pages is displayed setting a {total_pages}
placeholder in the Text property of a PdfTextElement object that can be added
to the template. The total number of pages can be incremented with a value
specified by the TotalPagesOffset property. This could be useful when the
generated pdf will be merged with other documents.

Foreground - Controls whether the template is rendered in front of the page


main content or not.

Background - Controls whether the template is rendered behind the page


main content or not.

48

SelectPdf Pdf Library for .NET


PdfDocument has also 2 special templates: Header and Footer to manage custom
headers and footers that would appear in all pages of the pdf document. More about
this in the next section, that describes pdf document headers and footers.

Sample Code
This sample code shows how to create a new PDF document using Select.Pdf, how
to add several pages and pdf templates to the document.
C#
// create a new pdf document
PdfDocument doc = new PdfDocument();
// create a new pdf font
PdfFont font = doc.AddFont(PdfStandardFont.Helvetica);
font.Size = 24;
// add a new page to the document
PdfPage page = doc.AddPage();
// create a new text element and add it to the page
PdfTextElement text = new PdfTextElement(0, 0, Helper.SomeLongText(),
font);
page.Add(text);
// get image path
string imgFile = Server.MapPath("~/files/logo.png");
// add a template containing an image
// the image should repeat on all pdf pages automatically
PdfTemplate template1 = doc.AddTemplate(new RectangleF(100, 0, 400,
150));
PdfImageElement img1 = new PdfImageElement(0, 0, imgFile);
template1.Add(img1);
// add another template containing an image behind the existing page
elements
// (under the text) the image should repeat on all pdf pages
automatically
PdfTemplate template2 = doc.AddTemplate(new RectangleF(100, 200, 400,
150));
template2.Background = true;
PdfImageElement img2 = new PdfImageElement(0, 0, imgFile);
template2.Add(img2);
// save pdf document
doc.Save(Response, false, "Sample.pdf");
// close pdf document

49

SelectPdf Pdf Library for .NET


doc.Close();
VB
' create a new pdf document
Dim doc As New PdfDocument()
' create a new pdf font
Dim font As PdfFont = doc.AddFont(PdfStandardFont.Helvetica)
font.Size = 24
' add a new page to the document
Dim page As PdfPage = doc.AddPage()
' create a new text element and add it to the page
Dim text As New PdfTextElement(0, 0, Helper.SomeLongText(), font)
page.Add(text)
' get image path
Dim imgFile As String = Server.MapPath("~/files/logo.png")
' add a template containing an image
' the image should repeat on all pdf pages automatically
Dim template1 As PdfTemplate = doc.AddTemplate(New RectangleF(100, 0,
400, 150))
Dim img1 As New PdfImageElement(0, 0, imgFile)
template1.Add(img1)
' add another template containing an image behind the existing page
elements
' (under the text)
' the image should repeat on all pdf pages automatically
Dim template2 As PdfTemplate = doc.AddTemplate(New RectangleF(100,
200, 400, 150))
template2.Background = True
Dim img2 As New PdfImageElement(0, 0, imgFile)
template2.Add(img2)
' save pdf document
doc.Save(Response, False, "Sample.pdf")
' close pdf document
doc.Close()

See Also
Reference
PdfDocument
PdfTemplate

50

SelectPdf Pdf Library for .NET


Other Resources
Headers And Footers

51

SelectPdf Pdf Library for .NET

Headers And Footers


Headers and Footers are custom types of pdf templates. They can be handled using
the Header and Footer properties of the PdfDocument object.
Header is displayed at the top of the page. Footer is displayed at the bottom of the
page. They contains elements that repeat on each page of the pdf document.

Sample Code
This sample code shows how to create a new PDF document using Select.Pdf, how
to add several pages and set the header and footer of the pdf document.
C#
// create a new pdf document
PdfDocument doc = new PdfDocument();
doc.Margins = new PdfMargins(10, 10, 0, 0);
// create a new pdf font
PdfFont font = doc.AddFont(PdfStandardFont.Helvetica);
font.Size = 24;
// create a new pdf font
PdfFont font2 = doc.AddFont(PdfStandardFont.Helvetica);
font2.Size = 12;
font2.IsUnderline = true;
// add a new page to the document
PdfPage page = doc.AddPage();
// get image path
string imgFile = Server.MapPath("~/files/logo.png");
// header template (100 points in height) with image element
doc.Header = doc.AddTemplate(doc.Pages[0].ClientRectangle.Width,
100);
PdfImageElement img1 = new PdfImageElement(0, 0, imgFile);
doc.Header.Add(img1);
// footer template (100 points in height) with text element
doc.Footer = doc.AddTemplate(doc.Pages[0].ClientRectangle.Width,
100);
PdfTextElement text1 = new PdfTextElement(0, 50,
"Footer text: Document generated by Select.Pdf", font2);
text1.ForeColor = System.Drawing.Color.Blue;
doc.Footer.Add(text1);
// create a new text element and add it to the page if page elements
are added

52

SelectPdf Pdf Library for .NET


// after header and footer is set, they will not be displayed in
those areas.
PdfTextElement text = new PdfTextElement(0, 0, Helper.SomeLongText(),
font);
page.Add(text);
// save pdf document
doc.Save(Response, false, "Sample.pdf");
// close pdf document
doc.Close();
VB
' create a new pdf document
Dim doc As New PdfDocument()
doc.Margins = New PdfMargins(10, 10, 0, 0)
' create a new pdf font
Dim font As PdfFont = doc.AddFont(PdfStandardFont.Helvetica)
font.Size = 24
' create a new pdf font
Dim font2 As PdfFont = doc.AddFont(PdfStandardFont.Helvetica)
font2.Size = 12
font2.IsUnderline = True
' add a new page to the document
Dim page As PdfPage = doc.AddPage()
' get image path
Dim imgFile As String = Server.MapPath("~/files/logo.png")
' header template (100 points in height) with image element
doc.Header = doc.AddTemplate(doc.Pages(0).ClientRectangle.Width, 100)
Dim img1 As New PdfImageElement(0, 0, imgFile)
doc.Header.Add(img1)
' footer template (100 points in height) with text element
doc.Footer = doc.AddTemplate(doc.Pages(0).ClientRectangle.Width, 100)
Dim text1 As New PdfTextElement(0, 50, _
"Footer text: Document generated by Select.Pdf", font2)
text1.ForeColor = System.Drawing.Color.Blue
doc.Footer.Add(text1)
' create a new text element and add it to the page
' if page elements are added after header and footer is set,
' they will not be displayed in those areas.
Dim text As New PdfTextElement(0, 0, Helper.SomeLongText(), font)

53

SelectPdf Pdf Library for .NET


page.Add(text)
' save pdf document
doc.Save(Response, False, "Sample.pdf")
' close pdf document
doc.Close()

See Also
Reference
PdfDocument
PdfTemplate
Other Resources
Pdf Templates

54

SelectPdf Pdf Library for .NET

Pdf Stamps And Watermarks


Stamps and Watermarks are done using pdf templates that contain elements that
repeat on each page of the pdf document.

Pdf Stamps Sample Code


This sample code shows how to create a new PDF document using Select.Pdf, how
to add several pages and stamp all the pages with an image.
C#
// create a new pdf document
PdfDocument doc = new PdfDocument();
// create a new pdf font
PdfFont font = doc.AddFont(PdfStandardFont.Helvetica);
font.Size = 24;
// add a new page to the document
PdfPage page = doc.AddPage();
// create a new text element and add it to the page
PdfTextElement text = new PdfTextElement(0, 0, Helper.SomeLongText(),
font);
page.Add(text);
// get image path
string imgFile = Server.MapPath("~/files/logo.png");
// stamp all pages - add a template containing an image to the bottom
right of
// the page the image should repeat on all pdf pages automatically
PdfTemplate template = doc.AddTemplate(doc.Pages[0].ClientRectangle);
PdfImageElement img = new PdfImageElement(
doc.Pages[0].ClientRectangle.Width - 300,
doc.Pages[0].ClientRectangle.Height - 150, imgFile);
template.Add(img);
// save pdf document
doc.Save(Response, false, "Sample.pdf");
// close pdf document
doc.Close();
VB
' create a new pdf document
Dim doc As New PdfDocument()
' create a new pdf font

55

SelectPdf Pdf Library for .NET


Dim font As PdfFont = doc.AddFont(PdfStandardFont.Helvetica)
font.Size = 24
' add a new page to the document
Dim page As PdfPage = doc.AddPage()
' create a new text element and add it to the page
Dim text As New PdfTextElement(0, 0, Helper.SomeLongText(), font)
page.Add(text)
' get image path
Dim imgFile As String = Server.MapPath("~/files/logo.png")
' stamp all pages - add a template containing an image to the bottom
right of the page
' the image should repeat on all pdf pages automatically
Dim template As PdfTemplate =
doc.AddTemplate(doc.Pages(0).ClientRectangle)
Dim img As New PdfImageElement(doc.Pages(0).ClientRectangle.Width 300, _
doc.Pages(0).ClientRectangle.Height 150, imgFile)
template.Add(img)
' save pdf document
doc.Save(Response, False, "Sample.pdf")
' close pdf document
doc.Close()

Pdf Watermarks Sample Code


This sample code shows how to create a new PDF document using Select.Pdf, how
to add several pages and watermark all the pages with a transparent image in the
background.
C#
// create a new pdf document
PdfDocument doc = new PdfDocument();
// create a new pdf font
PdfFont font = doc.AddFont(PdfStandardFont.Helvetica);
font.Size = 24;
// add a new page to the document
PdfPage page = doc.AddPage();
// create a new text element and add it to the page
PdfTextElement text = new PdfTextElement(0, 0, Helper.SomeLongText(),

56

SelectPdf Pdf Library for .NET


font);
page.Add(text);
// get image path
string imgFile = Server.MapPath("~/files/logo.png");
// watermark all pages - add a template containing an image
// to the bottom right of the page
// the image should repeat on all pdf pages automatically
// the template should be rendered behind the rest of the page
elements
PdfTemplate template = doc.AddTemplate(doc.Pages[0].ClientRectangle);
PdfImageElement img = new PdfImageElement(
doc.Pages[0].ClientRectangle.Width - 300,
doc.Pages[0].ClientRectangle.Height - 150, imgFile);
img.Transparency = 50;
template.Background = true;
template.Add(img);
// save pdf document
doc.Save(Response, false, "Sample.pdf");
// close pdf document
doc.Close();
VB
' create a new pdf document
Dim doc As New PdfDocument()
' create a new pdf font
Dim font As PdfFont = doc.AddFont(PdfStandardFont.Helvetica)
font.Size = 24
' add a new page to the document
Dim page As PdfPage = doc.AddPage()
' create a new text element and add it to the page
Dim text As New PdfTextElement(0, 0, Helper.SomeLongText(), font)
page.Add(text)
' get image path
Dim imgFile As String = Server.MapPath("~/files/logo.png")
' watermark all pages - add a template containing an image
' to the bottom right of the page
' the image should repeat on all pdf pages automatically
' the template should be rendered behind the rest of the page
elements

57

SelectPdf Pdf Library for .NET


Dim template As PdfTemplate =
doc.AddTemplate(doc.Pages(0).ClientRectangle)
Dim img As New PdfImageElement(doc.Pages(0).ClientRectangle.Width 300, _
doc.Pages(0).ClientRectangle.Height 150, imgFile)
img.Transparency = 50
template.Background = True
template.Add(img)
' save pdf document
doc.Save(Response, False, "Sample.pdf")
' close pdf document
doc.Close()

See Also
Reference
PdfDocument
PdfTemplate
Other Resources
Pdf Templates

58

SelectPdf Pdf Library for .NET

Page Numbering
Large pdf documents usually display page numbers in the footer to make it easier
for users to identify content in the pdf document. Select.Pdf offers support for page
numbering using special placeholders that can be included in text elements that
repeat in all pdf pages using pdf templates.
There are 2 placeholders that can be included in any PdfTextElement that belongs to
a template:

{page_number} - represents the current page of the pdf document.

{total_pages} - represents the total number of pages of the pdf document.

A few properties of the PdfTemplate class can be used to customize page


numbering:

FirstPageNumber - Controls the page number for the first page being
rendered. The page number is displayed setting a {page_number}
placeholder in a Text property of a PdfTextElement object that can be added
to the template. By default the page numbers start with 1. This can be
changed using the FirstPageNumber property.

TotalPagesOffset - Controls the total number of pages offset in the pdf


document. The total number of pages is displayed setting a {total_pages}
placeholder in the Text property of a PdfTextElement object that can be added
to the template. The total number of pages can be incremented with a value
specified by the TotalPagesOffset property. This could be useful when the
generated pdf will be merged with other documents.

Sample Code
This sample code shows how to create a new PDF document using Select.Pdf, how
to add several pages and automatic page numbering in the document footer.
C#
// create a new pdf document
PdfDocument doc = new PdfDocument();
doc.Margins = new PdfMargins(10, 10, 0, 0);
// create a new pdf font
PdfFont font = doc.AddFont(PdfStandardFont.Helvetica);
font.Size = 24;
// add a new page to the document
PdfPage page = doc.AddPage();
// footer template (100 points in height) with text element
doc.Footer = doc.AddTemplate(doc.Pages[0].ClientRectangle.Width,
100);

59

SelectPdf Pdf Library for .NET


PdfTextElement text1 = new PdfTextElement(0, 50,
"Page: {page_number} of {total_pages}.", font);
text1.ForeColor = System.Drawing.Color.Blue;
doc.Footer.Add(text1);
// create a new text element and add it to the page
// if page elements are added after header and footer is set,
// they will not be displayed in those areas.
PdfTextElement text = new PdfTextElement(0, 0, Helper.SomeLongText(),
font);
page.Add(text);
// save pdf document
doc.Save(Response, false, "Sample.pdf");
// close pdf document
doc.Close();
VB
' create a new pdf document
Dim doc As New PdfDocument()
doc.Margins = New PdfMargins(10, 10, 0, 0)
' create a new pdf font
Dim font As PdfFont = doc.AddFont(PdfStandardFont.Helvetica)
font.Size = 24
' add a new page to the document
Dim page As PdfPage = doc.AddPage()
' footer template (100 points in height) with text element
doc.Footer = doc.AddTemplate(doc.Pages(0).ClientRectangle.Width, 100)
Dim text1 As New PdfTextElement(0, 50, "Page: {page_number} of
{total_pages}.", font)
text1.ForeColor = System.Drawing.Color.Blue
doc.Footer.Add(text1)
' create a new text element and add it to the page
' if page elements are added after header and footer is set,
' they will not be displayed in those areas.
Dim text As New PdfTextElement(0, 0, Helper.SomeLongText(), font)
page.Add(text)
' save pdf document
doc.Save(Response, False, "Sample.pdf")
' close pdf document
doc.Close()

60

SelectPdf Pdf Library for .NET

See Also
Reference
PdfDocument
PdfTemplate
PdfTextElement
Other Resources
Pdf Templates
Headers And Footers

61

SelectPdf Pdf Library for .NET

Pdf Merge
Select.Pdf can be used to merge several existing pdf documents into a single pdf
document.
To achive this task, individual pdf files need to be loaded into PdfDocument objects.
The following sample code shows how to load an existing file from the disk:
C#
// load pdf file from disk
PdfDocument doc = new PdfDocument(fileName);
VB
' load pdf file from disk
Dim doc As New PdfDocument(fileName)
Another important method that will be used by the pdf merge feature is
Append(PdfDocument) of the PdfDocument object. Using this method, a pdf
document can be appended to another pdf document:
C#
// append doc1 to doc2
doc2.Append(doc1);
VB
' append doc1 to doc2
doc2.Append(doc1)

Sample Code
This sample code shows how to use SelectPdf Library for .NET to merge 2 different
pdf documents into a new pdf document.
C#
// the 2 initial files
string file1 = Server.MapPath("~/files/doc1.pdf");
string file2 = Server.MapPath("~/files/doc2.pdf");
// load the 2 pdf documents
PdfDocument doc1 = new PdfDocument(file1);
PdfDocument doc2 = new PdfDocument(file2);
// create a new pdf document
PdfDocument doc = new PdfDocument();
// add the pages of those 2 documents to the new document
doc.Append(doc1);
doc.Append(doc2);
// save pdf document
62

SelectPdf Pdf Library for .NET


doc.Save(Response, false, "Sample.pdf");
// close pdf document
doc.Close();
// close the original pdf documents
doc1.Close();
doc2.Close();
VB
' the 2 initial files
Dim file1 As String = Server.MapPath("~/files/doc1.pdf")
Dim file2 As String = Server.MapPath("~/files/doc2.pdf")
' load the 2 pdf documents
Dim doc1 As New PdfDocument(file1)
Dim doc2 As New PdfDocument(file2)
' create a new pdf document
Dim doc As New PdfDocument()
' add the pages of those 2 documents to the new document
doc.Append(doc1)
doc.Append(doc2)
' save pdf document
doc.Save(Response, False, "Sample.pdf")
' close pdf document
doc.Close()
' close the original pdf documents
doc1.Close()
doc2.Close()

See Also
Reference
PdfDocument

63

SelectPdf Pdf Library for .NET

Pdf Split
Select.Pdf can be used to split an existing pdf document into several pdf documents
or extract only certain pages from a pdf document and create a new pdf document
only with them.
To achive this task, the pdf file needs to be loaded into a PdfDocument object. The
following sample code shows how to load an existing file from the disk:
C#
// load pdf file from disk
PdfDocument doc = new PdfDocument(fileName);
VB
' load pdf file from disk
Dim doc As New PdfDocument(fileName)
Another important property that will be used by the pdf split feature is the Pages
property of the PdfDocument object. Using this property, the full collection of pdf
pages from the pdf document can be accessed:
C#
// get the first page from a pdf document
PdfPage page = doc.Pages[0];
VB
' get the first page from a pdf document
Dim page As PdfPage = doc.Pages(0)

Sample Code
This sample code shows how to create a new pdf document containing only pages 2
and 3 from the original pdf document.
C#
// the initial file
string file1 = Server.MapPath("~/files/doc.pdf");
// load the pdf document
PdfDocument doc1 = new PdfDocument(file1);
// create a new pdf document
PdfDocument doc = new PdfDocument();
// add 2 pages to the new document
if (doc1.Pages.Count > 2)
{
doc.AddPage(doc1.Pages[1]);
doc.AddPage(doc1.Pages[2]);
}
64

SelectPdf Pdf Library for .NET

// save pdf document


doc.Save(Response, false, "Sample.pdf");
// close pdf document
doc.Close();
// close the original pdf document
doc1.Close();
VB
' the initial file
Dim file1 As String = Server.MapPath("~/files/doc.pdf")
' load the pdf document
Dim doc1 As New PdfDocument(file1)
' create a new pdf document
Dim doc As New PdfDocument()
' add 2 pages to the new document
If doc1.Pages.Count > 2 Then
doc.AddPage(doc1.Pages(1))
doc.AddPage(doc1.Pages(2))
End If
' save pdf document
doc.Save(Response, False, "Sample.pdf")
' close pdf document
doc.Close()
' close the original pdf document
doc1.Close()

See Also
Reference
PdfDocument

65

SelectPdf Pdf Library for .NET

Digital Signatures
Digital signatures can be added to a PDF document using
PdfDigitalSignatureElement objects. Adding a digital signature requires a PKCS#12
certificate (provided as a .pfx or a .p12 file).

Sample Code
The following sample code shows how to add a digital signature to a pdf document
using Select.Pdf Library for .NET.
C#
// create a new pdf document
PdfDocument doc = new PdfDocument();
// add a new page to the document
PdfPage page = doc.AddPage();
// get image path
// the image will be used to display the digital signature over it
string imgFile = Server.MapPath("~/files/logo.png");
// get certificate path
string certFile = Server.MapPath("~/files/selectpdf.pfx");
// define a rendering result object
PdfRenderingResult result;
// create image element from file path
PdfImageElement img = new PdfImageElement(0, 0, imgFile);
result = page.Add(img);
// get the #PKCS12 certificate from file
PdfDigitalCertificatesCollection certificates =
PdfDigitalCertificatesStore.GetCertificates(certFile,
"selectpdf");
PdfDigitalCertificate certificate = certificates[0];
// create the digital signature object
PdfDigitalSignatureElement signature =
new PdfDigitalSignatureElement(result.PdfPageLastRectangle,
certificate);
signature.Reason = "SelectPdf";
signature.ContactInfo = "SelectPdf";
signature.Location = "SelectPdf";
page.Add(signature);
// save pdf document
doc.Save(Response, false, "Sample.pdf");

66

SelectPdf Pdf Library for .NET

// close pdf document


doc.Close();
VB
' create a new pdf document
Dim doc As New PdfDocument()
' add a new page to the document
Dim page As PdfPage = doc.AddPage()
' get image path
' the image will be used to display the digital signature over it
Dim imgFile As String = Server.MapPath("~/files/logo.png")
' get certificate path
Dim certFile As String = Server.MapPath("~/files/selectpdf.pfx")
' define a rendering result object
Dim result As PdfRenderingResult
' create image element from file path
Dim img As New PdfImageElement(0, 0, imgFile)
result = page.Add(img)
' get the #PKCS12 certificate from file
Dim certificates As PdfDigitalCertificatesCollection = _
PdfDigitalCertificatesStore.GetCertificates(certFile,
"selectpdf")
Dim certificate As PdfDigitalCertificate = certificates(0)
' create the digital signature object
Dim signature As New PdfDigitalSignatureElement( _
result.PdfPageLastRectangle, certificate)
signature.Reason = "SelectPdf"
signature.ContactInfo = "SelectPdf"
signature.Location = "SelectPdf"
page.Add(signature)
' save pdf document
doc.Save(Response, False, "Sample.pdf")
' close pdf document
doc.Close()

67

SelectPdf Pdf Library for .NET

See Also
Reference
PdfDigitalSignatureElement

68

SelectPdf Pdf Library for .NET

Modify Existing Pdf Documents


Select.Pdf Library for .NET can be used to load and modify existing pdf documents.
The following sample code shows how to load a pdf document from a local file from
the disk:
C#
// load pdf file from disk
PdfDocument doc = new PdfDocument(fileName);
VB
' load pdf file from disk
Dim doc As New PdfDocument(fileName)
The PdfDocument object also provides constructors that can be used to load the pdf
document from a stream.

Once a pdf document is loaded, all operations described in this documentation can
applied to it: add new pages to the document, remove existing pages, add new
elements to new or existing pages, add new pdf templates.

Sample Code
This sample code shows how to use SelectPdf Library for .NET to load an existing
document, add a new page to it and a new text element.
C#
// the initial file
string file = Server.MapPath("~/files/doc1.pdf");
// load the pdf document
PdfDocument doc = new PdfDocument(file);
// add a new page to the document
PdfPage page = doc.AddPage();
// create a new pdf font (component standard font)
PdfFont font = doc.AddFont(PdfStandardFont.Helvetica);
font.Size = 20;
// create text element and add it to the new page
PdfTextElement text = new PdfTextElement(100, 100,
"Sample text added to an existing pdf document.", font);
page.Add(text);
// save pdf document
doc.Save(Response, false, "Sample.pdf");

69

SelectPdf Pdf Library for .NET


// close pdf document
doc.Close();
VB
' the initial file
Dim file As String = Server.MapPath("~/files/doc1.pdf")
' load the pdf document
Dim doc As New PdfDocument(file)
' add a new page to the document
Dim page As PdfPage = doc.AddPage()
' create a new pdf font (component standard font)
Dim font As PdfFont = doc.AddFont(PdfStandardFont.Helvetica)
font.Size = 20
' create text element and add it to the new page
Dim text As New PdfTextElement(100, 100, _
"Sample text added to an existing pdf document.", font)
page.Add(text)
' save pdf document
doc.Save(Response, False, "Sample.pdf")
' close pdf document
doc.Close()

See Also
Reference
PdfDocument

70

SelectPdf Pdf Library for .NET

Pdf Compression
Select.Pdf Library for .NET offers the possibility to reduce the size of the generated
pdf document using compression.

Compression Levels
Select.Pdf offers 3 compression levels that can be controlled using
CompressionLevel property of the PdfDocument object:

NoCompression: PDF file is generated without any compression.

Normal: PDF compression at normal speed with normal reduction of data size.

Best: PDF best compression, but more time consuming.

Sample Code
This sample code shows how to create a new PDF document using Select.Pdf, how
to add a text element to it and use compression to reduce the size of the generated
pdf document.
C#
// create a new pdf document
PdfDocument doc = new PdfDocument();
doc.Margins = new PdfMargins(20, 20, 20, 20);
// set compression level
doc.CompressionLevel = (PdfCompressionLevel)Enum.Parse(
typeof(PdfCompressionLevel),
DdlPdfCompressionLevel.SelectedValue, true);
// create a new pdf font
PdfFont font = doc.AddFont(PdfStandardFont.Helvetica);
font.Size = 16;
// add a new page to the document
PdfPage page = doc.AddPage();
// create a new text element and add it to the page
PdfTextElement text = new PdfTextElement(0, 0,
Helper.SomeVeryLongText(), font);
page.Add(text);
// save pdf document
doc.Save(Response, false, "Sample.pdf");
// close pdf document
doc.Close();

71

SelectPdf Pdf Library for .NET

VB
' create a new pdf document
Dim doc As New PdfDocument()
doc.Margins = New PdfMargins(20, 20, 20, 20)
' set compression level
doc.CompressionLevel =
DirectCast([Enum].Parse(GetType(PdfCompressionLevel), _
DdlPdfCompressionLevel.SelectedValue, True), PdfCompressionLevel)
' create a new pdf font
Dim font As PdfFont = doc.AddFont(PdfStandardFont.Helvetica)
font.Size = 16
' add a new page to the document
Dim page As PdfPage = doc.AddPage()
' create a new text element and add it to the page
Dim text As New PdfTextElement(0, 0, _
SelectPdf.Samples.Helper.SomeVeryLongText(), font)
page.Add(text)
' save pdf document
doc.Save(Response, False, "Sample.pdf")
' close pdf document
doc.Close()

See Also
Reference
PdfDocument
PdfCompressionLevel

72

SelectPdf Pdf Library for .NET

Pdf Open Actions


Select.Pdf Library for .NET can create pdf documents that will perform a certain
action when the document is opened in a pdf viewer.
To set a pdf document open action, the OpenAction property of the PdfDocument
object must be used. This is an instance of PdfDocumentOpenAction class that
exposes the Action property.
The pdf document can perform 2 types of actions when it is opened:

PdfActionGoTo - The pdf document opens at a specific PdfDestination


specified in the Destination property.

PdfActionJavaScript - The pdf document will run a specific javascript.

GoTo Action
To instruct the pdf viewer to open the pdf document at a certain page, location on
that page and zoom factor, the Action property needs to be set to an instance of
PdfActionGoTo class.
The following sample code shows how to generate a pdf document from a html to
pdf conversion and open the pdf document on page 2 directly in a pdf viewer.
C#
// instantiate a html to pdf converter object
HtmlToPdf converter = new HtmlToPdf();
// create a new pdf document converting an url
PdfDocument doc = converter.ConvertUrl(TxtUrl.Text);
// set the second page as open action destination
if (doc.Pages.Count > 1)
{
PdfPage secondPage = doc.Pages[1];
PdfDestination secondPageDestination = new
PdfDestination(secondPage);
doc.OpenAction.Action = new PdfActionGoTo(secondPageDestination);
}
// save pdf document
doc.Save(Response, false, "Sample.pdf");
// close pdf document
doc.Close();
VB
' instantiate a html to pdf converter object
Dim converter As New HtmlToPdf()

73

SelectPdf Pdf Library for .NET


' create a new pdf document converting an url
Dim doc As PdfDocument = converter.ConvertUrl(TxtUrl.Text)
' set the second page as open action destination
If doc.Pages.Count > 1 Then
Dim secondPage As PdfPage = doc.Pages(1)
Dim secondPageDestination As New PdfDestination(secondPage)
doc.OpenAction.Action = New PdfActionGoTo(secondPageDestination)
End If
' save pdf document
doc.Save(Response, False, "Sample.pdf")
' close pdf document
doc.Close()

Javascript Action
To instruct the pdf viewer to execute a Javascript when the pdf document is opened
in a pdf viewer, the Action property needs to be set to an instance of
PdfActionJavaScript class.
The following sample code shows how to generate a pdf document from a html to
pdf conversion and display the print dialog when the pdf file is opened in a viewer.
C#
// instantiate a html to pdf converter object
HtmlToPdf converter = new HtmlToPdf();
// create a new pdf document converting an url
PdfDocument doc = converter.ConvertUrl(url);
// set the javascript open action
doc.OpenAction.Action = new PdfActionJavaScript("print()");
// save pdf document
doc.Save(Response, false, "Sample.pdf");
// close pdf document
doc.Close();
VB
' instantiate a html to pdf converter object
Dim converter As New HtmlToPdf()
' create a new pdf document converting an url
Dim doc As PdfDocument = converter.ConvertUrl(url)
' set the javascript open action

74

SelectPdf Pdf Library for .NET


doc.OpenAction.Action = New PdfActionJavaScript("print()")
' save pdf document
doc.Save(Response, False, "Sample.pdf")
' close pdf document
doc.Close()

Here are some common JavaScript methods or properties supported by Adobe


Acrobat Javascript. These should server as a parameter for PdfActionJavaScript.

The following javascript can be used to display an alert popup when the pdf
document is displayed in a pdf viewer:
JavaScript
app.alert("Alert Message")

The following javascript can be used to open the print dialog when the pdf
document is displayed in a pdf viewer:
JavaScript
print()

The following javascript can be used to print silently (viewer should only ask for
permission) when the pdf document is displayed in a pdf viewer:
JavaScript
print({bUI: false, bSilent: true, bShrinkToFit: true})

The following javascript can be used to set the zoom to a certain level when the pdf
document is displayed in a pdf viewer:
JavaScript
zoom = 150

See Also
Reference
PdfDocument
PdfDocumentOpenAction
PdfActionGoTo
PdfActionJavaScript

75

SelectPdf Pdf Library for .NET

76

SelectPdf Pdf Library for .NET

Getting Started with Html to Pdf Converter for .NET


One of the most important features of Select.Pdf Library for .NET is the Html to Pdf
Converter.
HTML content can be added to a pdf document in several ways. If a complex
document is created that will contain several types of pdf elements and the html
content that will be added is only a small part of the total content, PdfHtmlElement
objects can be used to convert web pages or raw html content and add the
conversion result to the pdf document. This is better described here.
If the pdf is generated mostly as a result of an html to pdf conversion, the HtmlToPdf
object should be used instead. The HtmlToPdf and related classes and properties will
be described in this page and in all pages under "Html to Pdf Converter" of
Select.Pdf Developers Guide.

Quick Start
Using the Html to Pdf Converter is very easy. The first thing that needs to be done is
the namespace importing.
C#
using SelectPdf;
VB
Imports SelectPdf

Sample code that shows how to convert an url to pdf using Select.Pdf Library for
.NET:
C#
// instantiate a html to pdf converter object
HtmlToPdf converter = new HtmlToPdf();
// create a new pdf document converting an url
PdfDocument doc = converter.ConvertUrl(TxtUrl.Text);
// save pdf document
doc.Save(Response, false, "Sample.pdf");
// close pdf document
doc.Close();
VB
' instantiate a html to pdf converter object
Dim converter As New HtmlToPdf()
' create a new pdf document converting an url

77

SelectPdf Pdf Library for .NET


Dim doc As PdfDocument = converter.ConvertUrl(TxtUrl.Text)
' save pdf document
doc.Save(Response, False, "Sample.pdf")
' close pdf document
doc.Close()
Sample code that shows how to convert raw html code to pdf using Select.Pdf
Library for .NET:
C#
// instantiate a html to pdf converter object
HtmlToPdf converter = new HtmlToPdf();
// create a new pdf document converting the html code
PdfDocument doc = converter.ConvertHtmlString(htmlString, baseUrl);
// save pdf document
doc.Save(Response, false, "Sample.pdf");
// close pdf document
doc.Close();
VB
' instantiate a html to pdf converter object
Dim converter As New HtmlToPdf()
' create a new pdf document converting the html code
Dim doc As PdfDocument = converter.ConvertHtmlString(htmlString,
baseUrl)
' save pdf document
doc.Save(Response, False, "Sample.pdf")
' close pdf document
doc.Close()

Html to Pdf Converter Properties


Options - controls the html to pdf conversion process and the generated pdf
document properties.
Header - controls the properties of the custom header of the generated pdf
document.
Footer - controls the properties of the custom footer of the generated pdf document.
ConversionResult - offers information about the result of the html to pdf conversion
process.

78

SelectPdf Pdf Library for .NET


These properties will be described in details in the next sections of the Developers
Guide.

See Also
Reference
SelectPdf
HtmlToPdf
Other Resources
Select.Pdf Online Demo with C# Sample Code
Select.Pdf Online Demo with Vb.Net Sample Code

79

SelectPdf Pdf Library for .NET

Setting Pdf Page Properties with Html to Pdf Converter for


.NET
Select.Pdf Html to Pdf Converter can be used to control how the pdf pages look like
when the pdf document is generated from the conversion of a web page. The most
important properties of a pdf page are:

Page size

Page orientation

Page margins

Page size
SelectPdf supports the following standard page sizes:

A0 to A10

B0 to B5

ArchA to ArchE

Letter, HalfLetter, Letter11x17, Note, Flsa, Ledger

To set the page size for the html to pdf conversion, the PdfPageSize property of the
HtmlToPdfOptions object needs to be used. Pages with custom page sizes can also
be created using Select.Pdf. A custom page size can be set using the
PdfPageCustomSize property.

Page orientation
SelectPdf supports the following page orientations:

Portrait

Landscape

To set the page orientation for the html to pdf conversion, the PdfPageOrientation
property of the HtmlToPdfOptions object needs to be used.

Page margins
Page margins can be set using MarginLeft, MarginRight, MarginTop, MarginBottom
properties of the HtmlToPdfOptions object.

80

SelectPdf Pdf Library for .NET

Sample Code
This sample code shows how to use Select.Pdf html to pdf converter to convert an
url to pdf, also setting page size, orientation and margins.
C#
// instantiate a html to pdf converter object
HtmlToPdf converter = new HtmlToPdf();
// set converter options
converter.Options.PdfPageSize = PdfPageSize.A4;
converter.Options.PdfPageOrientation = PdfPageOrientation.Portrait;
converter.Options.MarginLeft = 10;
converter.Options.MarginRight = 10;
converter.Options.MarginTop = 20;
converter.Options.MarginBottom = 20;
// create a new pdf document converting an url
PdfDocument doc = converter.ConvertUrl(url);
// save pdf document
doc.Save(Response, false, "Sample.pdf");
// close pdf document
doc.Close();
VB
' instantiate a html to pdf converter object
Dim converter As New HtmlToPdf()
' set converter options
converter.Options.PdfPageSize = PdfPageSize.A4
converter.Options.PdfPageOrientation = PdfPageOrientation.Portrait
converter.Options.MarginLeft = 10
converter.Options.MarginRight = 10
converter.Options.MarginTop = 20
converter.Options.MarginBottom = 20
' create a new pdf document converting an url
Dim doc As PdfDocument = converter.ConvertUrl(url)
' save pdf document
doc.Save(Response, False, "Sample.pdf")
' close pdf document
doc.Close()

81

SelectPdf Pdf Library for .NET

See Also
Reference
SelectPdf
HtmlToPdf
HtmlToPdfOptions

82

SelectPdf Pdf Library for .NET

Convert Url To Pdf


Using Select.Pdf Html to Pdf Converter for .NET any web page can be converted to
pdf. The web page can be specified by an external url or can be a local html file on
the disk.
To convert an url (or local file) to pdf, HtmlToPdf class exposes the
ConvertUrl(String) method.

Sample Code
This sample code shows how to use Select.Pdf html to pdf converter to convert an
url to pdf, also setting a few properties.
C#
// instantiate a html to pdf converter object
HtmlToPdf converter = new HtmlToPdf();
// set converter options
converter.Options.PdfPageSize = pageSize;
converter.Options.PdfPageOrientation = pdfOrientation;
converter.Options.WebPageWidth = webPageWidth;
converter.Options.WebPageHeight = webPageHeight;
// create a new pdf document converting an url
PdfDocument doc = converter.ConvertUrl(url);
// save pdf document
doc.Save(Response, false, "Sample.pdf");
// close pdf document
doc.Close();
VB
' instantiate a html to pdf converter object
Dim converter As New HtmlToPdf()
' set converter options
converter.Options.PdfPageSize = pageSize
converter.Options.PdfPageOrientation = pdfOrientation
converter.Options.WebPageWidth = webPageWidth
converter.Options.WebPageHeight = webPageHeight
' create a new pdf document converting an url
Dim doc As PdfDocument = converter.ConvertUrl(url)
' save pdf document
doc.Save(Response, False, "Sample.pdf")

83

SelectPdf Pdf Library for .NET


' close pdf document
doc.Close()

See Also
Reference
SelectPdf
HtmlToPdf
HtmlToPdfOptions
Other Resources
Select.Pdf Online Demo with C# Sample Code
Select.Pdf Online Demo with Vb.Net Sample Code

84

SelectPdf Pdf Library for .NET

Convert Html Code To Pdf


Using Select.Pdf Html to Pdf Converter for .NET any html code can be converted to
pdf. Select.Pdf Library supports the latest HTML5 with CSS3 style sheets.
To convert a raw html string to pdf, HtmlToPdf class exposes the
ConvertHtmlString(String) and ConvertHtmlString(String, String) methods.
The first method, that has only the url parameter, can be used to convert html
strings that don't have external references to javascript, css files or images. In case
the html string contains references to external resources specified using relative
paths, the second method needs to be used. ConvertHtmlString(String, String)
contains an additional parameter: baseUrl. The baseUrl parameter allows the
converter to resolve relative urls. Basically, baseUrl + relative image/css url = full
absolute url.

Sample Code
This sample code shows how to use Select.Pdf html to pdf converter to convert an
html string to pdf, also setting a few properties.
C#
// instantiate a html to pdf converter object
HtmlToPdf converter = new HtmlToPdf();
// set converter options
converter.Options.PdfPageSize = pageSize;
converter.Options.PdfPageOrientation = pdfOrientation;
converter.Options.WebPageWidth = webPageWidth;
converter.Options.WebPageHeight = webPageHeight;
// create a new pdf document converting an html string
PdfDocument doc = converter.ConvertHtmlString(htmlString, baseUrl);
// save pdf document
doc.Save(Response, false, "Sample.pdf");
// close pdf document
doc.Close();
VB
' instantiate a html to pdf converter object
Dim converter As New HtmlToPdf()
' set converter options
converter.Options.PdfPageSize = pageSize
converter.Options.PdfPageOrientation = pdfOrientation
converter.Options.WebPageWidth = webPageWidth
converter.Options.WebPageHeight = webPageHeight

85

SelectPdf Pdf Library for .NET


' create a new pdf document converting an html string
Dim doc As PdfDocument = converter.ConvertHtmlString(htmlString,
baseUrl)
' save pdf document
doc.Save(Response, False, "Sample.pdf")
' close pdf document
doc.Close()

See Also
Reference
SelectPdf
HtmlToPdf
HtmlToPdfOptions
Other Resources
Select.Pdf Online Demo with C# Sample Code
Select.Pdf Online Demo with Vb.Net Sample Code

86

SelectPdf Pdf Library for .NET

Resizing Content During Conversion with Select.Pdf Html


to Pdf Converter
Html pages that are converted to pdf and pdf pages in the generated document
usually do not have the same size. Because of that, Select.Pdf Library needs to
perform some operations on the content rendered from the web page to be able to
display it in the pdf page.

Pdf Page Size


The size of the pdf pages can be specified using PdfPageSize property of the
HtmlToPdfOptions object. More details about this in the following section: Setting Pdf
Page Properties.

Web Page Size


Select.Pdf Html to Pdf Converter has an internal browser that renders the web page
just like a regular browser. There are some properties that control how the web page
will look in the internal browser:

WebPageWidth - Gets or sets the width of the converted web page as it would
appear in the internal browser used to render the html.
The web page width is specified in pixels and the default value is 1024px. The
page width is only an indication of the minimum page width recommended
for conversion. If the content does not fit this width, the converter will
automatically resize the internal browser to fit the whole html content. To
avoid this, the WebPageFixedSize property needs to be set to true. When
WebPageFixedSize is true, the web page will be rendered with the specified
WebPageWidth and WebPageHeight even though the content might be
truncated.
If WebPageWidth is set to 0, the converter will automatically determine the
page width, finding the width that will fit the html content.
This property can also be set directly in the constructor of HtmlToPdf class.

WebPageHeight - Gets or sets the height of the converted web page as it


would appear in the internal browser used to render the html.
The web page height is specified in pixels and the default value is 0px. This
means that the converter will automatically calculate the page height.
Generally this property does not need to be changed, but there are situations
when the converter cannot calculate correctly the web page height (for
example for web pages with frames) and in that case, WebPageHeight needs
to be set, otherwise no content might appear in the generated pdf.

87

SelectPdf Pdf Library for .NET


Note: If the WebPageHeight is set, the content that exceeds this page height
is truncated and will not appear in the generated pdf document. Only using
the default 0 value will allow the whole page content to be rendered all the
time in the generated pdf document.
This property can also be set directly in the constructor of HtmlToPdf class.

WebPageFixedSize - Controls whether the web page is rendered with a fixed


size internal browser or the size automatically extends to make the whole
content visible.
The default value of this property is false.
If the web page does not fit the dimensions specified by the WebPageWidth
and WebPageHeight properties and WebPageFixedSize is set to false, the
converter will try to automatically calculate a larger width and height to be
able to display the whole html content.
If WebPageFixedSize is set to true, this will indicate the converter not to
calculate another width and height, but use width and height specified by
WebPageWidth and WebPageHeight. These dimensions with be used even
though the content will not fit the available space and it will be truncated.
Note: If WebPageFixedSize is set to true, a page height needs to be set using
WebPageHeight, because the default value (0) will make the converter fail
(cannot render a web page with no height).

Content Resizing
Because a web page has generally a different width compared with a standard pdf
page, the content will not fit perfectly when the web page content is rendered into
pdf. As an example, most web sites are optimized for browsers with page widths of
at least 1024px or 1280px. A standard A4 page has 595 x 842 points. 1 point is 1/72
inch. 1 pixel is 1/96 inch. This means that an A4 page width is 793px. Because the
web page width (1024px or more) is larger than this pdf page width, when the
content is rendered into pdf, it will either get trucated or it needs to be resized
(shrinked) to fit the pdf page width.
Select.Pdf Html to Pdf Converter has a few properties that control how the content
from the web page is resized during the rendering into the pdf document:

AutoFitWidth - Specifies the html content horizontal auto fit mode.


The converter considers both AutoFitWidth and AutoFitHeight when the html
content is rendered in the pdf page or specified rectangle.
If this property is set to NoAdjustment, the html content is not resized
horizontally in any way to fit the available space. If the content is larger, it
will be cut and not all of it will be displayed in the generated pdf file.

88

SelectPdf Pdf Library for .NET


If this property is set to ShrinkOnly, the html content is resized only if the
content width is larger than the destination space (pdf page or rectangle)
width. In this case, the content is shrunk to fit the destination space width
and the elements that it contains (texts, images) will appear smaller in the
generated pdf document than in the original web page. If the original content
width is smaller than the destination width, no adjustments will be done and
the content will be rendered exactly as it is, even though some additional
white space might appear to its right.
If this property is set to AutoFit, the html content is resized to fit the available
width of the destination space. If the original content width is smaller than
the destination width, the elements rendered (texts, images) will appear
larger in the generated pdf document. If the original content width is larger
than the destination width, the elements rendered (texts, images) will appear
smaller in the generated pdf document.
The default value of this property is ShrinkOnly.

AutoFitHeight - Specifies the html content vertical auto fit mode.


The converter considers both AutoFitWidth and AutoFitHeight when the html
content is rendered in the pdf page or specified rectangle.
If this property is set to NoAdjustment, the html content is not resized
vertically in any way to fit the available space. If the content is larger, it will
be cut and not all of it will be displayed in the generated pdf file.
If this property is set to ShrinkOnly, the html content is resized only if the
content height is larger than the destination space (pdf page or rectangle)
height. In this case, the content is shrunk to fit the destination space height
and the elements that it contains (texts, images) will appear smaller in the
generated pdf document than in the original web page. If the original content
height is smaller than the destination height, no adjustments will be done and
the content will be rendered exactly as it is, even though some additional
white space might appear at the bottom.
If this property is set to AutoFit, the converter will treat it like ShrinkOnly.
The default value of this property is NoAdjustment and for rendering, the
converter will only take AutoFitWidth into consideration.

Sample Code
The following sample code shows the simplest code that can be used to convert an
url to pdf:
C#
// instantiate a html to pdf converter object
HtmlToPdf converter = new HtmlToPdf();
// create a new pdf document converting an url
PdfDocument doc = converter.ConvertUrl(url);
89

SelectPdf Pdf Library for .NET

VB
' instantiate a html to pdf converter object
Dim converter As New HtmlToPdf()
' create a new pdf document converting an url
Dim doc As PdfDocument = converter.ConvertUrl(url)
The above code is equivalent with the following sample code where the default
values are explicitly specified:
C#
// instantiate a html to pdf converter object
HtmlToPdf converter = new HtmlToPdf();
// set converter options
converter.Options.PdfPageSize = PdfPageSize.A4;
converter.Options.PdfPageOrientation = PdfPageOrientation.Portrait;
converter.Options.WebPageWidth = 1024;
converter.Options.WebPageHeight = 0;
converter.Options.WebPageFixedSize = false;
converter.Options.AutoFitWidth = HtmlToPdfPageFitMode.ShrinkOnly;
converter.Options.AutoFitHeight = HtmlToPdfPageFitMode.NoAdjustment;
// create a new pdf document converting an url
PdfDocument doc = converter.ConvertUrl(url);
VB
' instantiate a html to pdf converter object
Dim converter As New HtmlToPdf()
' set converter options
converter.Options.PdfPageSize = PdfPageSize.A4
converter.Options.PdfPageOrientation = PdfPageOrientation.Portrait
converter.Options.WebPageWidth = 1024
converter.Options.WebPageHeight = 0
converter.Options.WebPageFixedSize = False
converter.Options.AutoFitWidth = HtmlToPdfPageFitMode.ShrinkOnly
converter.Options.AutoFitHeight = HtmlToPdfPageFitMode.NoAdjustment
' create a new pdf document converting an url
Dim doc As PdfDocument = converter.ConvertUrl(url)

90

SelectPdf Pdf Library for .NET

Pdf Document Properties


As described in Document Properties page, Select.Pdf Library for .NET can be used
to set pdf document properties, such as:

Title

Author

Subject

Keywords

Creation Date

This can be done using DocumentInformation property of the PdfDocument object.


What's interesting when it comes to the Html to Pdf Converter, is that Select.Pdf
Library can take advantage of the web page properties it converts and set the
document properties title, subject and keywords with the corresponding web page
properties (title, description, keywords).
To access the web page properties, after the conversion, the HtmlToPdf object
exposes a property called ConversionResult. This is an instance of HtmlToPdfResult
class and contains details about conversion, including details about the original web
page in WebPageInformation property.

Sample Code
This sample code shows how to convert a web page to pdf using Select.Pdf and set
the basic pdf document information (title, subject, keywords) with the values taken
from the webpage.
C#
// instantiate a html to pdf converter object
HtmlToPdf converter = new HtmlToPdf();
// create a new pdf document converting an url
PdfDocument doc = converter.ConvertUrl(TxtUrl.Text);
// get conversion result (contains document info from the web page)
HtmlToPdfResult result = converter.ConversionResult;
// set the document properties
doc.DocumentInformation.Title = result.WebPageInformation.Title;
doc.DocumentInformation.Subject =
result.WebPageInformation.Description;
doc.DocumentInformation.Keywords =
result.WebPageInformation.Keywords;
doc.DocumentInformation.Author = "Select.Pdf Samples";

91

SelectPdf Pdf Library for .NET


doc.DocumentInformation.CreationDate = DateTime.Now;
// save pdf document
doc.Save(Response, false, "Sample.pdf");
// close pdf document
doc.Close();
VB
' instantiate a html to pdf converter object
Dim converter As New HtmlToPdf()
' create a new pdf document converting an url
Dim doc As PdfDocument = converter.ConvertUrl(TxtUrl.Text)
' get conversion result (contains document info from the web page)
Dim result As HtmlToPdfResult = converter.ConversionResult
' set the document properties
doc.DocumentInformation.Title = result.WebPageInformation.Title
doc.DocumentInformation.Subject =
result.WebPageInformation.Description
doc.DocumentInformation.Keywords = result.WebPageInformation.Keywords
doc.DocumentInformation.Author = "Select.Pdf Samples"
doc.DocumentInformation.CreationDate = DateTime.Now
' save pdf document
doc.Save(Response, False, "Sample.pdf")
' close pdf document
doc.Close()

See Also
Reference
PdfDocument
HtmlToPdf
HtmlToPdfResult

92

SelectPdf Pdf Library for .NET

Pdf Viewer Preferences


A pdf document can control the way it will be displayed when opened in a pdf
viewer. When the pdf document is generated as a result of an html to pdf
conversion, these properties can be set using ViewerPreferences property of the
HtmlToPdfOptions object.
The following customizations can be done using the HtmlToPdfViewerPreferences
object:
Property
HideToolbar

HideMenuBar

HideWindowUI

FitWindow

CenterWindow

DisplayDocTitle

PageMode

Description
A flag specifying whether to hide the
pdf viewer application's tool bars when
the document is active
A flag specifying whether to hide the
pdf viewer application's menu bar when
the document is active.
A flag specifying whether to hide user
interface elements in the document's
window (such as scroll bars and
navigation controls), leaving only the
document's contents displayed.
A flag specifying whether to resize the
document's window to fit the size of the
first displayed page.
A flag specifying whether to position the
document's window in the center of the
screen.
A flag specifying whether the window's
title bar should display the document
title.
The document page mode when the pdf
document is opened in a pdf viewer.
Possible values:
UseNone
Neither document
outline
(bookmarks) nor
thumbnail images
are visible.
UseOutlines
Document outline
(bookmarks) are
visible.
UseThumbs
Thumbnail
images are
visible.
FullScreen
Full-screen mode,
with no menu bar,

93

SelectPdf Pdf Library for .NET

PageLayout

NonFullScreenPageMode

window controls
or any other
window visible.
UseOC
Optional content
group panel is
visible.
UseAttachments
Document
attachments are
visible.
The page layout to be used when the
document is opened. Possible values:
SinglePage
Displays one
page at a time.
OneColumn
Displays the
pages in one
column.
TwoColumnLeft
Displays the
pages in two
columns, with
odd-numbered
pages on the left.
TwoColumnRight
Displays the
pages in two
columns, with
odd-numbered
pages on the
right.
The document page mode when the pdf
viewer application exits the full screen
mode. Possible values:
UseNone
Neither document
outline
(bookmarks) nor
thumbnail images
are visible.
UseOutlines
Document outline
(bookmarks) are
visible.
UseThumbs
Thumbnail
images are
visible.
UseOC
Optional content
group panel is
visible.

94

SelectPdf Pdf Library for .NET

Code Sample
This sample code shows how to convert from html to pdf using Select.Pdf and set
the pdf viewer preferences.
C#
// instantiate a html to pdf converter object
HtmlToPdf converter = new HtmlToPdf();
// set converter options
converter.Options.ViewerPreferences.CenterWindow = true;
converter.Options.ViewerPreferences.DisplayDocTitle = true;
converter.Options.ViewerPreferences.FitWindow = true;
converter.Options.ViewerPreferences.HideMenuBar = true;
converter.Options.ViewerPreferences.HideToolbar = true;
converter.Options.ViewerPreferences.HideWindowUI = true;
converter.Options.ViewerPreferences.PageLayout =
PdfViewerPageLayout.SinglePage;
converter.Options.ViewerPreferences.PageMode =
PdfViewerPageMode.UseNone;
converter.Options.ViewerPreferences.NonFullScreenPageMode =
PdfViewerFullScreenExitMode.UseNone;
// create a new pdf document converting an url
PdfDocument doc = converter.ConvertUrl(url);
// save pdf document
doc.Save(Response, false, "Sample.pdf");
// close pdf document
doc.Close();
VB
' instantiate a html to pdf converter object
Dim converter As New HtmlToPdf()
' set converter options
converter.Options.ViewerPreferences.CenterWindow = True
converter.Options.ViewerPreferences.DisplayDocTitle = True
converter.Options.ViewerPreferences.FitWindow = True
converter.Options.ViewerPreferences.HideMenuBar = True
converter.Options.ViewerPreferences.HideToolbar = True
converter.Options.ViewerPreferences.HideWindowUI = True
converter.Options.ViewerPreferences.PageLayout =
PdfViewerPageLayout.SinglePage
converter.Options.ViewerPreferences.PageMode =
PdfViewerPageMode.UseNone

95

SelectPdf Pdf Library for .NET


converter.Options.ViewerPreferences.NonFullScreenPageMode =
PdfViewerFullScreenExitMode.UseNone
' create a new pdf document converting an url
Dim doc As PdfDocument = converter.ConvertUrl(url)
' save pdf document
doc.Save(Response, False, "Sample.pdf")
' close pdf document
doc.Close()

See Also
Reference
PdfDocument
HtmlToPdf
HtmlToPdfOptions
HtmlToPdfViewerPreferences

96

SelectPdf Pdf Library for .NET

Pdf Security Settings


Select.Pdf can be used to set the basic security settings for the generated pdf files
and also manage different permissions:

Owner Password

User Password

Assemble Document permission

Copy Content permission

Edit Annotations permission

Edit Content permission

Fill Form Fields permission

Print permission

When the pdf document is generated as a result of an html to pdf conversion, these
properties can be set using SecurityOptions property of the HtmlToPdfOptions
object.

Code Sample
This sample code shows how to convert from html to pdf using Select.Pdf, how to
set a password to be able to view or modify the document and also specify user
permissions for the pdf document (if the user can print, copy content, fill forms,
modify, etc).
C#
// instantiate a html to pdf converter object
HtmlToPdf converter = new HtmlToPdf();
// set document passwords
converter.Options.SecurityOptions.OwnerPassword = "test1";
converter.Options.SecurityOptions.UserPassword = "test2";
//set document permissions
converter.Options.SecurityOptions.CanAssembleDocument = false;
converter.Options.SecurityOptions.CanCopyContent = true;
converter.Options.SecurityOptions.CanEditAnnotations = true;
converter.Options.SecurityOptions.CanEditContent = true;
converter.Options.SecurityOptions.CanFillFormFields = true;
converter.Options.SecurityOptions.CanPrint = true;
// create a new pdf document converting an url
PdfDocument doc = converter.ConvertUrl(url);

97

SelectPdf Pdf Library for .NET


// save pdf document
doc.Save(Response, false, "Sample.pdf");
// close pdf document
doc.Close();
VB
' instantiate a html to pdf converter object
Dim converter As New HtmlToPdf()
' set document passwords
converter.Options.SecurityOptions.OwnerPassword = "test1"
converter.Options.SecurityOptions.UserPassword = "test2"
'set document permissions
converter.Options.SecurityOptions.CanAssembleDocument = False
converter.Options.SecurityOptions.CanCopyContent = True
converter.Options.SecurityOptions.CanEditAnnotations = True
converter.Options.SecurityOptions.CanEditContent = True
converter.Options.SecurityOptions.CanFillFormFields = True
converter.Options.SecurityOptions.CanPrint = True
' create a new pdf document converting an url
Dim doc As PdfDocument = converter.ConvertUrl(url)
' save pdf document
doc.Save(Response, False, "Sample.pdf")
' close pdf document
doc.Close()

See Also
Reference
PdfDocument
HtmlToPdf
HtmlToPdfOptions
PdfSecurityOptions

98

SelectPdf Pdf Library for .NET

Multiple Urls to one Pdf Document


Select.Pdf Library for .NET can be used to convert multiple urls (or html strings) into
the same pdf document. There are 2 approaches to this task:

Using HtmlToPdf main converter object to generate individual documents for


each web page and then using the method described here to merge the the
individual pdf documents into a final pdf document.

Using PdfHtmlElement described here, adding several objects of this type,


one for each conversion, to the same PdfDocument object.

The first method has the disadvange that all individual web page conversions will
appear in the final pdf starting with a new page, while using the second method, the
successive conversions can be added on new pages or at the end of the previous
content on the same page of the pdf document.

Sample Code
This sample code shows how to convert 3 individual urls into the same pdf
document using HtmlToPdf approach.
C#
// instantiate a html to pdf converter object
HtmlToPdf converter = new HtmlToPdf();
// convert individual urls
PdfDocument doc1 = converter.ConvertUrl(url1);
PdfDocument doc2 = converter.ConvertUrl(url2);
PdfDocument doc3 = converter.ConvertUrl(url3);
// create a new pdf document
PdfDocument doc = new PdfDocument();
// add the pages of those 3 documents to the new document
doc.Append(doc1);
doc.Append(doc2);
doc.Append(doc3);
// save pdf document
doc.Save(Response, false, "Sample.pdf");
// close pdf document
doc.Close();
// close the original pdf documents
doc1.Close();
doc2.Close();
doc3.Close();

99

SelectPdf Pdf Library for .NET


VB
' instantiate a html to pdf converter object
Dim converter As New HtmlToPdf()
' convert individual urls
Dim doc1 As PdfDocument = converter.ConvertUrl(url1)
Dim doc2 As PdfDocument = converter.ConvertUrl(url2)
Dim doc3 As PdfDocument = converter.ConvertUrl(url3)
' create a new pdf document
Dim doc As New PdfDocument()
' add the pages of those 3 documents to the new document
doc.Append(doc1)
doc.Append(doc2)
doc.Append(doc3)
' save pdf document
doc.Save(Response, False, "Sample.pdf")
' close pdf document
doc.Close()
' close the original pdf documents
doc1.Close()
doc2.Close()
doc3.Close()

This sample code shows how to convert 3 individual urls into the same pdf
document using PdfHtmlElement approach.
C#
// create a new pdf document
PdfDocument doc = new PdfDocument();
// add a new page to the document
PdfPage page = doc.AddPage();
// add the first url
PdfHtmlElement html1 = new PdfHtmlElement(url1);
PdfRenderingResult result = page.Add(html1);
// get the last page of the previous conversion
PdfPage page2 = doc.Pages[result.PdfPageLastIndex];
// add the second url
PdfHtmlElement html2 = new
100

SelectPdf Pdf Library for .NET


PdfHtmlElement(result.PdfPageLastRectangle.Left,
result.PdfPageLastRectangle.Bottom, url2);
result = page2.Add(html2);
// get the last page of the previous conversion
PdfPage page3 = doc.Pages[result.PdfPageLastIndex];
// add the third url
PdfHtmlElement html3 = new
PdfHtmlElement(result.PdfPageLastRectangle.Left,
result.PdfPageLastRectangle.Bottom, url3);
result = page3.Add(html3);
// save pdf document
doc.Save(Response, false, "Sample.pdf");
// close pdf document
doc.Close();
VB
' create a new pdf document
Dim doc As New PdfDocument()
' add a new page to the document
Dim page As PdfPage = doc.AddPage()
' add the first url
Dim html1 As New PdfHtmlElement(url1)
Dim result As PdfRenderingResult = page.Add(html1)
' get the last page of the previous conversion
Dim page2 As PdfPage = doc.Pages(result.PdfPageLastIndex)
' add the second url
Dim html2 As New PdfHtmlElement(result.PdfPageLastRectangle.Left, _
result.PdfPageLastRectangle.Bottom,
url2)
result = page2.Add(html2)
' get the last page of the previous conversion
Dim page3 As PdfPage = doc.Pages(result.PdfPageLastIndex)
' add the third url
Dim html3 As New PdfHtmlElement(result.PdfPageLastRectangle.Left, _
result.PdfPageLastRectangle.Bottom,
url3)
result = page3.Add(html3)

101

SelectPdf Pdf Library for .NET


' save pdf document
doc.Save(Response, False, "Sample.pdf")
' close pdf document
doc.Close()

See Also
Reference
PdfDocument
HtmlToPdf
PdfHtmlElement
Other Resources
Getting Started with Html to Pdf Converter
Pdf Html Element
Pdf Merge

102

SelectPdf Pdf Library for .NET

Conversion Delay and Web Page Timeout with Html to Pdf


Converter for .NET
For pages that use javascripts heavily, the conversion can be delayed a number of
seconds using MinPageLoadTime property of the HtmlToPdfOptions object, to allow
the content to be fully rendered.
In a similar way, if a page takes too much time to load, the converter can specify
the amount of time in seconds when the page load will timeout using the property
MaxPageLoadTime property of the HtmlToPdfOptions object.

Sample Code
This sample code shows how the html to pdf converter can be used to convert a
web page to pdf using Select.Pdf Pdf Library for .NET and how to set the conversion
delay and timeout properties.
C#
// instantiate a html to pdf converter object
HtmlToPdf converter = new HtmlToPdf();
// specify the number of seconds the conversion is delayed
converter.Options.MinPageLoadTime = 2;
// set the page timeout (in seconds)
converter.Options.MaxPageLoadTime = 30;
// create a new pdf document converting an url
PdfDocument doc = converter.ConvertUrl(TxtUrl.Text);
// save pdf document
doc.Save(Response, false, "Sample.pdf");
// close pdf document
doc.Close();
VB
' instantiate a html to pdf converter object
Dim converter As New HtmlToPdf()
' specify the number of seconds the conversion is delayed
converter.Options.MinPageLoadTime = 2
' set the page timeout (in seconds)
converter.Options.MaxPageLoadTime = 30
' create a new pdf document converting an url
Dim doc As PdfDocument = converter.ConvertUrl(TxtUrl.Text)

103

SelectPdf Pdf Library for .NET


' save pdf document
doc.Save(Response, False, "Sample.pdf")
' close pdf document
doc.Close()

See Also
Reference
HtmlToPdf
HtmlToPdfOptions

104

SelectPdf Pdf Library for .NET

Headers and Footers with SelectPdf HtmlToPdf Converter


The Headers And Footers page describes how to add headers and footers to a
PdfDocument using Pdf Templates. That is the approach to be used if the html to pdf
conversion is done using PdfHtmlElement objects as described here.
When the pdf conversion is done using the main HtmlToPdf converter object, there
is another way of adding headers and footers to the generated pdf document. That
is done using the Header and Footer properties of the HtmlToPdf converter object.
Header and Footer Options are covered in more details in the following sections:

Header Options
Footer Options
Setting a Different Header or Footer for a Specific Pdf Page

Header Options
To display a custom header in the generated pdf, the DisplayHeader property of the
HtmlToPdfOptions object must be set to true. If the DisplayHeader property of the
Options object is false, the header will not be displayed and all the options set for
the header will have no effect.
The header of the pdf document generated from the html to pdf conversion can be
customized using the Header property of the HtmlToPdf converter object. That is an
instance of PdfHeader class and has the following properties:

Height - The height of the pdf document header.

DisplayOnFirstPage - Controls the visibility of the header on the first page of


the generated pdf document.

DisplayOnOddPages - Controls the visibility of the header on the odd


numbered pages of the generated pdf document.

DisplayOnEvenPages - Controls the visibility of the header on the even


numbered pages of the generated pdf document.

FirstPageNumber - Controls the page number for the first page being
rendered.

TotalPagesOffset - Controls the total number of pages offset in the generated


pdf document.

To add content to the pdf header, PdfHeader class exposes the


Add(PdfSectionElement) method. That can be used to add 3 types of objects to the
header:

Text - using PdfTextSection objects. This type of object is very similar with
PdfTextElement described here.

105

SelectPdf Pdf Library for .NET

Image - using PdfImageSection objects. This type of object is very similar with
PdfImageElement described here.

HTML using PdfHtmlSection objects. This type of object is very similar with
PdfHtmlElement described here.

Page numbers can be added to pdf document headers using PdfTextSection objects.
The page number is displayed setting a {page_number} placeholder in a Text
property of a PdfTextSection object that can be added to the header. By default the
page numbers start with 1. This can be changed using the FirstPageNumber
property of the PdfHeader object.
The total number of pages is displayed setting a {total_pages} placeholder in the
Text property of a PdfTextSection object that can be added to the header. The total
number of pages can be incremented with a value specified by the TotalPagesOffset
property of the PdfHeader object. This could be useful when the generated pdf will
be merged with other documents.

The following code sample shows how to add a custom header to the pdf document
generated from a html to pdf conversion:
C#
// instantiate a html to pdf converter object
HtmlToPdf converter = new HtmlToPdf();
// header settings
converter.Options.DisplayHeader = true;
converter.Header.DisplayOnFirstPage = true;
converter.Header.DisplayOnOddPages = true;
converter.Header.DisplayOnEvenPages = true;
converter.Header.Height = 50;
// add some html content to the header
PdfHtmlSection headerHtml = new PdfHtmlSection(headerUrl);
headerHtml.AutoFitHeight = HtmlToPdfPageFitMode.AutoFit;
converter.Header.Add(headerHtml);
// create a new pdf document converting an url
PdfDocument doc = converter.ConvertUrl(url);
// save pdf document
doc.Save(Response, false, "Sample.pdf");
// close pdf document
doc.Close();
VB
' instantiate a html to pdf converter object
106

SelectPdf Pdf Library for .NET


Dim converter As New HtmlToPdf()
' header settings
converter.Options.DisplayHeader = True
converter.Header.DisplayOnFirstPage = True
converter.Header.DisplayOnOddPages = True
converter.Header.DisplayOnEvenPages = True
converter.Header.Height = 50
' add some html content to the header
Dim headerHtml As New PdfHtmlSection(headerUrl)
headerHtml.AutoFitHeight = HtmlToPdfPageFitMode.AutoFit
converter.Header.Add(headerHtml)
' create a new pdf document converting an url
Dim doc As PdfDocument = converter.ConvertUrl(url)
' save pdf document
doc.Save(Response, False, "Sample.pdf")
' close pdf document
doc.Close()

Footer Options
To display a custom footer in the generated pdf, the DisplayFooter property of the
HtmlToPdfOptions object must be set to true. If the DisplayFooter property of the
Options object is false, the footer will not be displayed and all the options set for the
footer will have no effect.
The footer of the pdf document generated from the html to pdf conversion can be
customized using the Footer property of the HtmlToPdf converter object. That is an
instance of PdfFooter class and has the following properties:

Height - The height of the pdf document footer.

DisplayOnFirstPage - Controls the visibility of the footer on the first page of


the generated pdf document.

DisplayOnOddPages - Controls the visibility of the footer on the odd


numbered pages of the generated pdf document.

DisplayOnEvenPages - Controls the visibility of the footer on the even


numbered pages of the generated pdf document.

FirstPageNumber - Controls the page number for the first page being
rendered.

TotalPagesOffset - Controls the total number of pages offset in the generated


pdf document.

107

SelectPdf Pdf Library for .NET


To add content to the pdf footer, PdfFooter class exposes the
Add(PdfSectionElement) method. That can be used to add 3 types of objects to the
footer:

Text - using PdfTextSection objects. This type of object is very similar with
PdfTextElement described here.

Image - using PdfImageSection objects. This type of object is very similar with
PdfImageElement described here.

HTML using PdfHtmlSection objects. This type of object is very similar with
PdfHtmlElement described here.

Page numbers can be added to pdf document footer using PdfTextSection objects.
The page number is displayed setting a {page_number} placeholder in a Text
property of a PdfTextSection object that can be added to the footer. By default the
page numbers start with 1. This can be changed using the FirstPageNumber
property of the PdfFooter object.
The total number of pages is displayed setting a {total_pages} placeholder in the
Text property of a PdfTextSection object that can be added to the footer. The total
number of pages can be incremented with a value specified by the TotalPagesOffset
property of the PdfFooter object. This could be useful when the generated pdf will
be merged with other documents.

The following code sample shows how to add a custom footer to the pdf document
generated from a html to pdf conversion:
C#
// instantiate a html to pdf converter object
HtmlToPdf converter = new HtmlToPdf();
// footer settings
converter.Options.DisplayFooter = true;
converter.Footer.DisplayOnFirstPage = true;
converter.Footer.DisplayOnOddPages = true;
converter.Footer.DisplayOnEvenPages = true;
converter.Footer.Height = 50;
// add some html content to the footer
PdfHtmlSection footerHtml = new PdfHtmlSection(footerUrl);
footerHtml.AutoFitHeight = HtmlToPdfPageFitMode.AutoFit;
converter.Footer.Add(footerHtml);
// page numbers can be added using a PdfTextSection object
PdfTextSection text = new PdfTextSection(0, 10, "Page: {page_number}
of {total_pages} ", new System.Drawing.Font("Arial", 8));
text.HorizontalAlign = PdfTextHorizontalAlign.Right;

108

SelectPdf Pdf Library for .NET


converter.Footer.Add(text);
// create a new pdf document converting an url
PdfDocument doc = converter.ConvertUrl(url);
// save pdf document
doc.Save(Response, false, "Sample.pdf");
// close pdf document
doc.Close();
VB
' instantiate a html to pdf converter object
Dim converter As New HtmlToPdf()
' header settings
converter.Options.DisplayFooter = True
converter.Footer.DisplayOnFirstPage = True
converter.Footer.DisplayOnOddPages = True
converter.Footer.DisplayOnEvenPages = True
converter.Footer.Height = 50
' add some html content to the footer
Dim footerHtml As New PdfHtmlSection(footerUrl)
footerHtml.AutoFitHeight = HtmlToPdfPageFitMode.AutoFit
converter.Footer.Add(footerHtml)
' page numbers can be added using a PdfTextSection object
Dim text As New PdfTextSection(0, 10, "Page: {page_number} of
{total_pages} ", New System.Drawing.Font("Arial", 8))
text.HorizontalAlign = PdfTextHorizontalAlign.Right
converter.Footer.Add(text)
' create a new pdf document converting an url
Dim doc As PdfDocument = converter.ConvertUrl(url)
' save pdf document
doc.Save(Response, False, "Sample.pdf")
' close pdf document
doc.Close()

Setting a Different Header or Footer for a Specific Pdf Page


With Select.Pdf Library for .NET it is possible to customize headers and footers of
the generated pdf document and have different headers and footers on specific
pages. This can be done using CustomHeader and CustomFooter properties of the
PdfPage objects from the generated pdf document.

109

SelectPdf Pdf Library for .NET


The following sample code shows how to customize the header of the 3rd page of a
generated pdf document:
C#
// instantiate a html to pdf converter object
HtmlToPdf converter = new HtmlToPdf();
// header settings
converter.Options.DisplayHeader = true;
converter.Header.DisplayOnFirstPage = true;
converter.Header.DisplayOnOddPages = true;
converter.Header.DisplayOnEvenPages = true;
converter.Header.Height = 50;
// add some html content to the header
PdfHtmlSection headerHtml = new PdfHtmlSection(headerUrl);
headerHtml.AutoFitHeight = HtmlToPdfPageFitMode.AutoFit;
converter.Header.Add(headerHtml);
// create a new pdf document converting an url
PdfDocument doc = converter.ConvertUrl(url);
// custom header on page 3
if (doc.Pages.Count >= 3)
{
PdfPage page = doc.Pages[2];
PdfTemplate customHeader = doc.AddTemplate(page.PageSize.Width,
headerHeight);
PdfHtmlElement customHtml = new PdfHtmlElement(
"<div><b>This is the custom header that will appear only on
page 3!</b></div>",
string.Empty);
customHeader.Add(customHtml);
page.CustomHeader = customHeader;
}
// save pdf document
doc.Save(Response, false, "Sample.pdf");
// close pdf document
doc.Close();
VB
' instantiate a html to pdf converter object
Dim converter As New HtmlToPdf()

110

SelectPdf Pdf Library for .NET


' header settings
converter.Options.DisplayHeader = True
converter.Header.DisplayOnFirstPage = True
converter.Header.DisplayOnOddPages = True
converter.Header.DisplayOnEvenPages = True
converter.Header.Height = 50
' add some html content to the header
Dim headerHtml As New PdfHtmlSection(headerUrl)
headerHtml.AutoFitHeight = HtmlToPdfPageFitMode.AutoFit
converter.Header.Add(headerHtml)
' create a new pdf document converting an url
Dim doc As PdfDocument = converter.ConvertUrl(url)
' custom header on page 3
If doc.Pages.Count >= 3 Then
Dim page As PdfPage = doc.Pages(2)
Dim customHeader As PdfTemplate =
doc.AddTemplate(page.PageSize.Width, headerHeight)
Dim customHtml As New PdfHtmlElement( _
"<div><b>This is the custom header that will appear only on
page 3!</b></div>", _
String.Empty)
customHeader.Add(customHtml)
page.CustomHeader = customHeader
End If
' save pdf document
doc.Save(Response, False, "Sample.pdf")
' close pdf document
doc.Close()

See Also
Reference
HtmlToPdf
PdfHeader
PdfFooter
Other Resources
Headers And Footers
Pdf Templates

111

SelectPdf Pdf Library for .NET

Page Breaks
By default, the html to pdf converter offered by Select.Pdf Library automatically
pages the content. There are 2 properties that can be used to customize the
content pagination:

KeepTextsTogether - This property instructs the converter whether to try to


avoid cutting off the text lines between pdf pages or not. The default value
for this property is True.

KeepImagesTogether - This property instructs the converter whether to try to


avoid cutting off the images between pdf pages or not. Due to the fact that
images could be large and avoiding cutting them would great large gaps in
the pdf pages, the default value for this property is False.

Manual Paging
Content pagination can be controlled from HTML/CSS. CSS styles can be used to
manually change the pagination:

page-break-before: always
The "page-break-before" property sets whether a page break should occur BEFORE
a specified element. The element can be anything (image, table, table row, div,
text, etc).
HTML
<div style="page-break-before: always">
A page break will be inserted BEFORE this div element because "pagebreak-before" property is set to "always".
</div>

page-break-after: always
The "page-break-after" property sets whether a page break should occur AFTER a
specified element. The element can be anything (image, table, table row, div, text,
etc).
HTML
<div style="page-break-after: always">
A page break will be inserted AFTER this div element because "pagebreak-after" property is set to "always".
</div>

page-break-inside: avoid

112

SelectPdf Pdf Library for .NET


The "page-break-inside" property sets whether a page break is allowed INSIDE a
specified element. The element can be anything (image, table, table row, div, text,
etc).
HTML
<div style="page-break-inside: avoid">
The content of this div element will not be split into several pages
(if possible) because "page-break-inside" property is set to "avoid".
</div>

See Also
Reference
PdfDocument
HtmlToPdf
HtmlToPdfOptions

113

SelectPdf Pdf Library for .NET

Repeat Table Headers


Some web pages might contain large html tables that will split over several pages.
Select.Pdf Library can be set to repeat the header of the html table at the top of
every pdf page that contains a part of that table.
This can be done setting a CSS property for the thead element of the html table.
The property that needs to be set is: display: table-header-group.

Sample Code
The following html table will repeat the table header at the top of each pdf page
when converted to pdf.
HTML
<table>
<thead style="display: table-header-group;">
<tr>
<th>Month</th>
<th>Savings</th>
</tr>
</thead>
<tbody>
<tr>
<td>January 2009</td>
<td>$100</td>
</tr>
<tr>
<td>February 2009</td>
<td>$80</td>
</tr>
<!--// ..... many table rows that will split over several
pages ...... -->
<tr>
<td>February 2015</td>
<td>$200</td>
</tr>
</tbody>
</table>

114

SelectPdf Pdf Library for .NET

Media Types
Many web pages define different sets of css styles for browser viewing (@media
screen) and for printing (@media print). Select.Pdf Html to Pdf Converter for .NET
can take advantage of this and generate the pdf using the specified media type.
Media type can be set using the CssMediaType property of the HtmlToPdfOptions
object. The default value is Screen. The other possible value is Print.

Sample Code
This sample code shows how to convert an url to pdf using Select.Pdf Pdf Library
for .NET and also use a media type during the conversion.
C#
// instantiate a html to pdf converter object
HtmlToPdf converter = new HtmlToPdf();
// set css @media print
converter.Options.CssMediaType = HtmlToPdfCssMediaType.Print;
// create a new pdf document converting an url
PdfDocument doc = converter.ConvertUrl(TxtUrl.Text);
// save pdf document
doc.Save(Response, false, "Sample.pdf");
// close pdf document
doc.Close();
VB
' instantiate a html to pdf converter object
Dim converter As New HtmlToPdf()
' set css @media print
converter.Options.CssMediaType = HtmlToPdfCssMediaType.Print
' create a new pdf document converting an url
Dim doc As PdfDocument = converter.ConvertUrl(TxtUrl.Text)
' save pdf document
doc.Save(Response, False, "Sample.pdf")
' close pdf document
doc.Close()

See Also
Reference
HtmlToPdfOptions
115

SelectPdf Pdf Library for .NET


HtmlToPdfCssMediaType

116

SelectPdf Pdf Library for .NET

Internal and External Links


Select.Pdf Library can convert internal html links to internal pdf links and keep
external html links (hyperlinks to other pages) the same in pdf (external links).
These links can be disabled in pdf if needed.
There are 2 properties that can be used to enable and disable internal and external
links:

InternalLinksEnabled - Controls the conversion of internal html links to


internal pdf links. The default value for this property is True.

ExternalLinksEnabled - Controls the rendering of external hyperlinks in pdf.


The default value for this property is True.

Sample Code
This sample code shows how the html to pdf converter can handle internal and
external links from the web page when converted to pdf using Select.Pdf Pdf Library
for .NET.
C#
// instantiate a html to pdf converter object
HtmlToPdf converter = new HtmlToPdf();
// set links options
converter.Options.InternalLinksEnabled = true;
converter.Options.ExternalLinksEnabled = true;
// create a new pdf document converting an url
PdfDocument doc = converter.ConvertUrl(TxtUrl.Text);
// save pdf document
doc.Save(Response, false, "Sample.pdf");
// close pdf document
doc.Close();
VB
' instantiate a html to pdf converter object
Dim converter As New HtmlToPdf()
' set links options
converter.Options.InternalLinksEnabled = True
converter.Options.ExternalLinksEnabled = True
' create a new pdf document converting an url
Dim doc As PdfDocument = converter.ConvertUrl(TxtUrl.Text)
' save pdf document
117

SelectPdf Pdf Library for .NET


doc.Save(Response, False, "Sample.pdf")
' close pdf document
doc.Close()

See Also
Reference
HtmlToPdfOptions

118

SelectPdf Pdf Library for .NET

Automatic Bookmarks with Html to Pdf Converter


As described in Pdf Bookmarks section, Select.Pdf Library for .NET offers support for
pdf bookmarks. The html to pdf converter offers additional features and can
automatically generate pdf bookmarks based on some html elements selection.
The elements that will be bookmarked are defined using the PdfBookmarkOptions
property of the HtmlToPdfOptions object. This is an instance of the
PdfBookmarkOptions class, whose single property is CssSelectors.
In other words, the elements that will be bookmarked are defined using CSS
selectors. For example, the selector for all the H1 elements is "H1", the selector for
all the elements with the CSS class name 'myclass' is "*.myclass" and the selector
for the elements with the id 'myid' is "*#myid". Read more about CSS selectors
here.

Sample Code
This sample code shows how the html to pdf converter can automatically generate
pdf bookmarks based on H1 and H2 elements from the web page using Select.Pdf
Pdf Library for .NET.
C#
// instantiate a html to pdf converter object
HtmlToPdf converter = new HtmlToPdf();
// set the css selectors for the automatic bookmarks
converter.Options.PdfBookmarkOptions.CssSelectors = new string[]
{"H1", "H2"};
// display the bookmarks when the document is opened in a viewer
converter.Options.ViewerPreferences.PageMode =
PdfViewerPageMode.UseOutlines;
// create a new pdf document converting an url
PdfDocument doc = converter.ConvertUrl(TxtUrl.Text);
// save pdf document
doc.Save(Response, false, "Sample.pdf");
// close pdf document
doc.Close();
VB
' instantiate a html to pdf converter object
Dim converter As New HtmlToPdf()
' set the css selectors for the automatic bookmarks
converter.Options.PdfBookmarkOptions.CssSelectors = New String()
{"H1", "H2"}
119

SelectPdf Pdf Library for .NET

' display the bookmarks when the document is opened in a viewer


converter.Options.ViewerPreferences.PageMode =
PdfViewerPageMode.UseOutlines
' create a new pdf document converting an url
Dim doc As PdfDocument = converter.ConvertUrl(TxtUrl.Text)
' save pdf document
doc.Save(Response, False, "Sample.pdf")
' close pdf document
doc.Close()

See Also
Reference
HtmlToPdfOptions
PdfBookmarkOptions
Other Resources
CSS Selectors

120

SelectPdf Pdf Library for .NET

Sending HTTP Headers with Html to Pdf Converter


Select.Pdf Library for .NET can be used to send additional HTTP headers to the web
page that is converted.
This can be done using the HttpHeaders property of the HtmlToPdfOptions object.

Sample Code
This sample code shows how to send HTTP headers to the page that will be
converted using the html to pdf converter from Select.Pdf Pdf Library for .NET.
C#
// instantiate a html to pdf converter object
HtmlToPdf converter = new HtmlToPdf();
// set the HTTP headers
converter.Options.HttpHeaders.Add(TxtName1.Text,
converter.Options.HttpHeaders.Add(TxtName2.Text,
converter.Options.HttpHeaders.Add(TxtName3.Text,
converter.Options.HttpHeaders.Add(TxtName4.Text,

TxtValue1.Text);
TxtValue2.Text);
TxtValue3.Text);
TxtValue4.Text);

// create a new pdf document converting an url


PdfDocument doc = converter.ConvertUrl(TxtUrl.Text);
// save pdf document
doc.Save(Response, false, "Sample.pdf");
// close pdf document
doc.Close();
VB
' instantiate a html to pdf converter object
Dim converter As New HtmlToPdf()
' set the HTTP headers
converter.Options.HttpHeaders.Add(TxtName1.Text,
converter.Options.HttpHeaders.Add(TxtName2.Text,
converter.Options.HttpHeaders.Add(TxtName3.Text,
converter.Options.HttpHeaders.Add(TxtName4.Text,

TxtValue1.Text)
TxtValue2.Text)
TxtValue3.Text)
TxtValue4.Text)

' create a new pdf document converting an url


Dim doc As PdfDocument = converter.ConvertUrl(TxtUrl.Text)
' save pdf document
doc.Save(Response, False, "Sample.pdf")
' close pdf document
doc.Close()

121

SelectPdf Pdf Library for .NET

See Also
Reference
HtmlToPdfOptions

122

SelectPdf Pdf Library for .NET

Sending HTTP Cookies with Html to Pdf Converter


Select.Pdf Library for .NET can be used to send additional HTTP cookies to the web
page that is converted.
This can be done using the HttpCookies property of the HtmlToPdfOptions object.

Sample Code
This sample code shows how to send HTTP cookies to the page that will be
converted using the html to pdf converter from Select.Pdf Pdf Library for .NET.
C#
// instantiate a html to pdf converter object
HtmlToPdf converter = new HtmlToPdf();
// set the HTTP cookies
converter.Options.HttpCookies.Add(TxtName1.Text,
converter.Options.HttpCookies.Add(TxtName2.Text,
converter.Options.HttpCookies.Add(TxtName3.Text,
converter.Options.HttpCookies.Add(TxtName4.Text,

TxtValue1.Text);
TxtValue2.Text);
TxtValue3.Text);
TxtValue4.Text);

// create a new pdf document converting an url


PdfDocument doc = converter.ConvertUrl(TxtUrl.Text);
// save pdf document
doc.Save(Response, false, "Sample.pdf");
// close pdf document
doc.Close();
VB
' instantiate a html to pdf converter object
Dim converter As New HtmlToPdf()
' set the HTTP cookies
converter.Options.HttpCookies.Add(TxtName1.Text,
converter.Options.HttpCookies.Add(TxtName2.Text,
converter.Options.HttpCookies.Add(TxtName3.Text,
converter.Options.HttpCookies.Add(TxtName4.Text,

TxtValue1.Text)
TxtValue2.Text)
TxtValue3.Text)
TxtValue4.Text)

' create a new pdf document converting an url


Dim doc As PdfDocument = converter.ConvertUrl(TxtUrl.Text)
' save pdf document
doc.Save(Response, False, "Sample.pdf")
' close pdf document
doc.Close()

123

SelectPdf Pdf Library for .NET

See Also
Reference
HtmlToPdfOptions

124

SelectPdf Pdf Library for .NET

Start Conversion from Javascript


Select.Pdf exposes a global Javascript variable called selectpdf in the page that is
being converted. Using this variable you can check if the javascript code is executed
inside the converter (check if typeof(selectpdf) == "object"). The converter version
can also be checked using selectpdf.version.
The most important feature of the Javascript interface is the possibility to manually
start the page conversion to pdf with a javascript call. To do that, you must:
1. Set the StartupMode property of the HtmlToPdfOptions object to Manual.
2. Call selectpdf.start() from javascript.
Important:

If StartupMode is set to Manual and selectpdf.start() is not called from


javascript, the conversion will timeout.

If StartupMode is set to the default value Automatic, the conversion will start
without waiting for any javascript calls.

Sample Code
Below it's the html of a test page that waits for 3 seconds after it loads and then
calls the javascript conversion method. Converting it in Manual mode will display
the time elapsed. Converting it in Automatic mode will not show that 3 seconds time
interval.
HTML
<!DOCTYPE html>
<html>
<head>
<title>Test document for Select.Pdf Sample</title>
</head>
<body>
<h1>Select.Pdf for .NET - Start Conversion from
Javascript</h1>
<p>
This is a sample page that will demonstrate how a html to
pdf conversion can be triggered from a javascript call
using Select.Pdf Library for .NET.
<br />
The page increments a timer until it reaches 3 and then
it calls the conversion from javascript.
If the conversion is manually started from javascript,
the timer below should be 3 in pdf.
If the conversion is automatically started when the page
loads, the timer below should be 1 in pdf.
</p>
<p>

125

SelectPdf Pdf Library for .NET


Library version: <span id="idVersion"></span><br />
Timer: <span id="idTimer"></span><br />
</p>
<script type="text/javascript" src="jquery.js"> </script>
<script type="text/javascript">
var timer = 0;
function incrementTimer() {
timer = timer + 1;
if (typeof (selectpdf) == "object") {
$("*#idVersion").html(selectpdf.version);
}
else {
$("*#idVersion").html("Not in converter.");
}
$("*#idTimer").text(timer);
if (timer == 3) {
// 3 seconds elapsed - start conversion
if (typeof (selectpdf) == "object") {
selectpdf.start();
}
}
else {
// wait another second
setTimeout("incrementTimer()", 1000);
}
}
$(document).ready(function () {
incrementTimer();
});
</script>
</body>
</html>

This sample code shows how to manually start the html to pdf conversion of the
Select.Pdf Library for .NET using a Javascript call. The url parameter points to the
page above.
C#
// instantiate a html to pdf converter object
HtmlToPdf converter = new HtmlToPdf();

126

SelectPdf Pdf Library for .NET


// set startup mode
converter.Options.StartupMode = HtmlToPdfStartupMode.Manual;
// set timeout
converter.Options.MaxPageLoadTime = 10;
// create a new pdf document converting an url
PdfDocument doc = converter.ConvertUrl(url);
// save pdf document
doc.Save(Response, false, "Sample.pdf");
// close pdf document
doc.Close();
VB
' instantiate a html to pdf converter object
Dim converter As New HtmlToPdf()
' set startup mode
converter.Options.StartupMode = HtmlToPdfStartupMode.Manual
' set timeout
converter.Options.MaxPageLoadTime = 10
' create a new pdf document converting an url
Dim doc As PdfDocument = converter.ConvertUrl(url)
' save pdf document
doc.Save(Response, False, "Sample.pdf")
' close pdf document
doc.Close()

See Also
Reference
HtmlToPdf
HtmlToPdfOptions
HtmlToPdfStartupMode

127

SelectPdf Pdf Library for .NET

Web Page Authentication


Select.Pdf HTML to PDF Converter can convert any web page a browser can open,
however some web pages may require authentication before access can be granted.
In such cases additional information must be supplied to the converter so that the
converter can login to be granted access to the page.

Authentication Types:

HTTP Authentication
Integrated Windows Authentication
Forms Authentication
Custom Login Page Authentication

HTTP Authentication
HTTP authentication is handled on the HTTP protocol level. When a page that
requires HTTP authentication is accessed, the browser will display a login dialog
where the user can enter an username and password. Once the correct user name
and password is entered, access is granted and the page is displayed.
Select.Pdf HTML to PDF converter can automatically access pages that require HTTP
authentication. To enable this feature, the Username and Password properties of
HtmlToPdfAuthenticationOptions object need to be set with a valid user name and
password for the page. Select.Pdf HTML to PDF converter will automatically use this
information to login and access the page.

The following sample code shows how to convert an url that requires HTTP
authentication:
C#
// instantiate a html to pdf converter object
HtmlToPdf converter = new HtmlToPdf();
// set authentication options
converter.Options.Authentication.Username = username;
converter.Options.Authentication.Password = password;
// create a new pdf document converting an url
PdfDocument doc = converter.ConvertUrl(url);
// save pdf document
doc.Save(Response, false, "Sample.pdf");
// close pdf document
doc.Close();

128

SelectPdf Pdf Library for .NET


VB
' instantiate a html to pdf converter object
Dim converter As New HtmlToPdf()
// set authentication options
converter.Options.Authentication.Username = username
converter.Options.Authentication.Password = password
' create a new pdf document converting an url
Dim doc As PdfDocument = converter.ConvertUrl(url)
' save pdf document
doc.Save(Response, False, "Sample.pdf")
' close pdf document
doc.Close()

Integrated Windows Authentication


Select.Pdf HTML to PDF supports Integrated Windows Authentication if the NTML
provider is used. The current user credentials will be used by the converter to
authenticate automatically.
If the automatic windows authentication does not work and the converter cannot
resolve the authentication using the current user credentials, the
HtmlToPdfAuthenticationOptions object can be used to specify an username and a
valid password, like in the above HTTP Authentication section.

Forms Authentication
Select.Pdf Library for .NET can convert web pages that use the ASP.NET Forms
Authentication mechanism to login.
In this case, if the Forms Authentication is set to use cookies to store the formsauthentication ticket, the corresponding cookie (identified by
FormsAuthentication.FormsCookieName) needs to be sent by the converter to the
page that will be converted.

This sample code shows how to convert an url that requires Forms authentication
from a page of the same application:
C#
// instantiate a html to pdf converter object
HtmlToPdf converter = new HtmlToPdf();
// set authentication cookie
converter.Options.HttpCookies.Add(
System.Web.Security.FormsAuthentication.FormsCookieName,
Request.Cookies[FormsAuthentication.FormsCookieName].Value);

129

SelectPdf Pdf Library for .NET


// create a new pdf document converting an url
PdfDocument doc = converter.ConvertUrl(url);
// save pdf document
doc.Save(Response, false, "Sample.pdf");
// close pdf document
doc.Close();
VB
' instantiate a html to pdf converter object
Dim converter As New HtmlToPdf()
// set authentication cookie
converter.Options.HttpCookies.Add( _
System.Web.Security.FormsAuthentication.FormsCookieName, _
Request.Cookies[FormsAuthentication.FormsCookieName].Value)
' create a new pdf document converting an url
Dim doc As PdfDocument = converter.ConvertUrl(url)
' save pdf document
doc.Save(Response, False, "Sample.pdf")
' close pdf document
doc.Close()

Custom Login Page Authentication


In case the web page to be converted is protected by a general login mechanism,
the Select.Pdf Html To Pdf Converter will not be able to access the page. To work
around this problem, instead of converting the url directly, the page html code
should be retrieve using some other method and that html code should be
converted to pdf instead of the full url.
In ASP.NET, Server.Execute is the method that can be used to get the html code
from an url.
IMPORTANT: If external resources (such as javascript/css files or images) are
referenced in the html code, they must be placed into a location where anonymous
access is granted, otherwise they will have the same authentication problems and
they will not be rendered.

This sample code shows how to get the html code from an url and convert it to pdf:
C#
// instantiate a html to pdf converter object
HtmlToPdf converter = new HtmlToPdf();

130

SelectPdf Pdf Library for .NET

// get html code from url


TextWriter writer = new StringWriter();
Server.Execute(url, writer);
string htmlString = writer.ToString();
// get base url (to resolve relative links to external resources)
string baseUrl = HttpContext.Current.Request.Url.AbsoluteUri;
// create a new pdf document converting the html string
PdfDocument doc = converter.ConvertHtmlString(htmlString, baseUrl);
// save pdf document
doc.Save(Response, false, "Sample.pdf");
// close pdf document
doc.Close();
VB
' instantiate a html to pdf converter object
Dim converter As New HtmlToPdf()
' get html code from url
Dim writer as New TextWriter()
Server.Execute(url, writer)
Dim htmlString as String = writer.ToString()
' get base url (to resolve relative links to external resources)
Dim baseUrl as String = HttpContext.Current.Request.Url.AbsoluteUri
' create a new pdf document converting the html string
Dim doc As PdfDocument = converter.ConvertHtmlString(htmlString,
baseUrl)
' save pdf document
doc.Save(Response, False, "Sample.pdf")
' close pdf document
doc.Close()

See Also
Reference
HtmlToPdf
HtmlToPdfOptions
HtmlToPdfAuthenticationOptions

131

SelectPdf Pdf Library for .NET

Accessing Web Pages through a Proxy with SelectPdf


Library
Sometime a system is setup to be able to access the internet through a proxy.
Select.Pdf Html to Pdf Converter supports this option and can convert web pages
that can be accessed only though a proxy server.
To enable this feature the ProxyOptions property of the HtmlToPdfOptions object
needs to be set. This is an instance of HtmlToPdfProxyOptions class that allows to
set:

Proxy Host Name

Proxy Port Number

Username

Password

Proxy Type

Sample Code
This sample code shows how to convert an url to pdf using Select.Pdf Pdf Library
for .NET and use a proxy to access the web page.
C#
// instantiate a html to pdf converter object
HtmlToPdf converter = new HtmlToPdf();
// set the proxy options
converter.Options.ProxyOptions.HostName = "proxy.server.name";
converter.Options.ProxyOptions.PortNumber = 1122;
converter.Options.ProxyOptions.Username = "proxyuser";
converter.Options.ProxyOptions.Password = "proxypassword";
converter.Options.ProxyOptions.Type = NetworkProxyType.Http;
// create a new pdf document converting an url
PdfDocument doc = converter.ConvertUrl(TxtUrl.Text);
// save pdf document
doc.Save(Response, false, "Sample.pdf");
// close pdf document
doc.Close();
VB
' instantiate a html to pdf converter object
Dim converter As New HtmlToPdf()

132

SelectPdf Pdf Library for .NET


' set the proxy options
converter.Options.ProxyOptions.HostName = "proxy.server.name"
converter.Options.ProxyOptions.PortNumber = 1122
converter.Options.ProxyOptions.Username = "proxyuser"
converter.Options.ProxyOptions.Password = "proxypassword"
converter.Options.ProxyOptions.Type = NetworkProxyType.Http
' create a new pdf document converting an url
Dim doc As PdfDocument = converter.ConvertUrl(TxtUrl.Text)
' save pdf document
doc.Save(Response, False, "Sample.pdf")
' close pdf document
doc.Close()

See Also
Reference
HtmlToPdfOptions
HtmlToPdfProxyOptions

133

SelectPdf Pdf Library for .NET

Partial Page Conversion with Html to Pdf Converter


Select.Pdf Html to Pdf Converter for .NET can be used to convert only a specific
section of a web page to pdf.
The section that will be converted to pdf is specified by the html element ID. The
element can be anything (image, table, table row, div, text, etc). To set the element
id in Select.Pdf Library, the VisibleWebElementId property of the HtmlToPdfOptions
object must be used.

Sample Code
This sample code shows how the html to pdf converter can be used to convert only
a section of a web page using Select.Pdf Pdf Library for .NET.
C#
// instantiate a html to pdf converter object
HtmlToPdf converter = new HtmlToPdf();
// specify the id of the section that will be converted to pdf
converter.Options.VisibleWebElementId = elementId;
// create a new pdf document converting an url
PdfDocument doc = converter.ConvertUrl(url);
// save pdf document
doc.Save(Response, false, "Sample.pdf");
// close pdf document
doc.Close();
VB
' instantiate a html to pdf converter object
Dim converter As New HtmlToPdf()
' specify the id of the section that will be converted to pdf
converter.Options.VisibleWebElementId = elementId
' create a new pdf document converting an url
Dim doc As PdfDocument = converter.ConvertUrl(url)
' save pdf document
doc.Save(Response, False, "Sample.pdf")
' close pdf document
doc.Close()

134

SelectPdf Pdf Library for .NET

See Also
Reference
HtmlToPdf
HtmlToPdfOptions

135

SelectPdf Pdf Library for .NET

Exclude Elements from Conversion


Select.Pdf Html to Pdf Converter for .NET can be used to exclude certain elements
from the conversion when a web page is converted to pdf.
The elements that will be excluded are defined using the HiddenWebElements
property of the HtmlToPdfOptions object. This is an instance of the
HiddenWebElements class, whose single property is CssSelectors.
In other words, the elements that will be excluded are defined using CSS selectors.
For example, the selector for all the H1 elements is "H1", the selector for all the
elements with the CSS class name 'myclass' is "*.myclass" and the selector for the
elements with the id 'myid' is "*#myid". Read more about CSS selectors here.

Sample Code
This sample code shows how the html to pdf converter can exclude all images when
the web page is converted to pdf.
C#
// instantiate a html to pdf converter object
HtmlToPdf converter = new HtmlToPdf();
// exclude all images
converter.Options.HiddenWebElements.CssSelectors = new string[]
{"img"};
// create a new pdf document converting an url
PdfDocument doc = converter.ConvertUrl(TxtUrl.Text);
// save pdf document
doc.Save(Response, false, "Sample.pdf");
// close pdf document
doc.Close();
VB
' instantiate a html to pdf converter object
Dim converter As New HtmlToPdf()
' exclude all images
converter.Options.HiddenWebElements.CssSelectors = New String()
{"img"}
' create a new pdf document converting an url
Dim doc As PdfDocument = converter.ConvertUrl(TxtUrl.Text)
' save pdf document
doc.Save(Response, False, "Sample.pdf")

136

SelectPdf Pdf Library for .NET


' close pdf document
doc.Close()

See Also
Reference
HtmlToPdfOptions
HiddenWebElements
Other Resources
CSS Selectors

137

SelectPdf Pdf Library for .NET

Current WebPage to Pdf in Asp.Net


Sometimes, there is a need in an ASP.NET application to convert a web page to pdf
with a click of a button, taken into consideration the changes done to the data from
that page (form filling for example).
Select.Pdf Html to Pdf Converter and an ASP.NET trick can be used to achive this
task. Take a look at the sample code below.

Sample Code
This sample code shows how to use Select.Pdf html to pdf converter to convert the
current asp.net page to pdf preserving the values entered in the page controls
before hitting the Convert button.
C#
namespace SelectPdf.Samples
{
public partial class convert_current_page_to_pdf :
System.Web.UI.Page
{
private bool startConversion = false;
protected void BtnCreatePdf_Click(object sender, EventArgs e)
{
startConversion = true;
}
protected override void Render(HtmlTextWriter writer)
{
if (startConversion)
{
// get html of the page
TextWriter myWriter = new StringWriter();
HtmlTextWriter htmlWriter = new
HtmlTextWriter(myWriter);
base.Render(htmlWriter);
// instantiate a html to pdf converter object
HtmlToPdf converter = new HtmlToPdf();
// create a new pdf document converting the html
string of the page
PdfDocument doc = converter.ConvertHtmlString(
myWriter.ToString(), Request.Url.AbsoluteUri);
// save pdf document
doc.Save(Response, false, "Sample.pdf");

138

SelectPdf Pdf Library for .NET


// close pdf document
doc.Close();
}
else
{
// render web page in browser
base.Render(writer);
}
}
}
}
VB
Namespace SelectPdf.Samples
Partial Public Class convert_current_page_to_pdf
Inherits System.Web.UI.Page
Private startConversion As Boolean = False
Protected Sub BtnCreatePdf_Click(sender As Object, e As
EventArgs)
startConversion = True
End Sub
Protected Overrides Sub Render(writer As HtmlTextWriter)
If startConversion Then
' get html of the page
Dim myWriter As TextWriter = New StringWriter()
Dim htmlWriter As New HtmlTextWriter(myWriter)
MyBase.Render(htmlWriter)
' instantiate a html to pdf converter object
Dim converter As New HtmlToPdf()
' create a new pdf document converting the html
string of the page
Dim doc As PdfDocument =
converter.ConvertHtmlString(myWriter.ToString(), _
Request.Url.AbsoluteUri)
' save pdf document
doc.Save(Response, False, "Sample.pdf")
' close pdf document
doc.Close()
Else
' render web page in browser

139

SelectPdf Pdf Library for .NET


MyBase.Render(writer)
End If
End Sub
End Class
End Namespace

140

SelectPdf Pdf Library for .NET

Html To Pdf Converter Options Review


Select.Pdf Html to Pdf Converter for .NET offers a lot of customization options. Most
of them were described in our developer's guide.

Here is a full list with all html to pdf converter options:


Header - controls the properties of the custom header of the generated pdf
document. This was covered in more details in Headers and Footers section.
Footer - controls the properties of the custom footer of the generated pdf document.
This was covered in more details in Headers and Footers section.
Authentication - Handles authentication options if the web page being converted
requires authentication. This was covered in more details in Web Page
Authentication section.
AutoFitHeight - Specifies the html content vertical auto fit mode. This was covered
in more details in Resizing Content During Conversion section.
AutoFitWidth - Specifies the html content horizontal auto fit mode. This was covered
in more details in Resizing Content During Conversion section.
ColorSpace - Gets or sets the color space of the generated pdf document. This is an
instance of PdfColorSpace type.
CssMediaType - Indicates what css styles are used when the web page is rendered.
This was covered in more details in Media Types section.
DisplayFooter - Controls if a custom footer is displayed in the generated pdf
document. This was covered in more details in Headers and Footers section.
DisplayHeader - Controls if a custom header is displayed in the generated pdf
document. This was covered in more details in Headers and Footers section.
EmbedFonts - Instructs the converter to embed all the needed fonts into the pdf
document or not.
ExternalLinksEnabled - Controls the rendering of external hyperlinks in pdf. This was
covered in more details in Internal and External Links section.
HiddenWebElements - Gets a reference to the object that controls the visibility of
some web elements in the generated pdf document. This was covered in more
details in Exclude Elements from Conversion section.
HttpCookies - Gets the collection of custom HTTP cookies used for the conversion.
This was covered in more details in HTTP Cookies section.
HttpHeaders - Get the collection of custom HTTP headers used for the conversion.
This was covered in more details in HTTP Headers section.

141

SelectPdf Pdf Library for .NET


InternalLinksEnabled - Controls the conversion of internal html links to internal pdf
links. This was covered in more details in Internal and External Links section.
JavaScriptEnabled - Enable scripts when rendering the url or html string.
JpegCompressionEnabled - Gets or sets a flag indicating if the JPEG compression is
enabled or not for the images in the generated pdf document.
JpegCompressionLevel - Gets or sets the compression level of images in the
generated pdf document.
KeepImagesTogether - This property instructs the converter whether to try to avoid
cutting off the images between pdf pages or not. This was covered in more details
in Page Breaks section.
KeepTextsTogether - This property instructs the converter whether to try to avoid
cutting off the text lines between pdf pages or not. This was covered in more details
in Page Breaks section.
MarginBottom - The bottom margin of the pdf document. The margin is specified in
points. 1 point is 1/72 inch.
MarginLeft - The left margin of the pdf document. The margin is specified in points.
1 point is 1/72 inch.
MarginRight - The right margin of the pdf document. The margin is specified in
points. 1 point is 1/72 inch.
MarginTop - The top margin of the pdf document. The margin is specified in points. 1
point is 1/72 inch.
MaximumConcurrentConversions - This parameter must be set before the first
conversion performed by the application. When this property is set with a negative
value or zero, the concurrency level is maximum. The default value is 4. If the
maximum number is reached and more conversion requests arrive, they will wait in
a queue for an available spot.
MaxPageLoadTime - The web page navigation timeout in seconds. This was covered
in more details in Conversion Delay and Timeout section.
MinPageLoadTime - An additional time in seconds to wait for asynchronous items to
be loaded before the web page is rendered. This was covered in more details in
Conversion Delay and Timeout section.
PdfBookmarkOptions - Gets a reference to the object that controls the bookmarks
creation for the generated pdf document. This was covered in more details in
Automatic Bookmarks section.
PdfCompressionLevel - This property controls the compression level of the
generated pdf document.

142

SelectPdf Pdf Library for .NET


PdfDocumentInformation - Gets a reference to the object that specifies the
generated pdf document properties. This was covered in more details in Pdf
Document Properties section.
PdfPageCustomSize - This property can be used to specify a custom pdf document
page size. This was covered in more details in Setting Pdf Page Properties section.
PdfPageOrientation - This property controls the page orientation of the generated
pdf document pages. This was covered in more details in Setting Pdf Page Properties
section.
PdfPageSize - This property controls the size of the generated document pages. This
was covered in more details in Setting Pdf Page Properties section.
PdfStandard - Defines the pdf standard used by the generated pdf document. This is
an instance of PdfStandard type.
PluginsEnabled - A flag indicating if plugins (like Flash players) are enabled in the
converter.
ProxyOptions - Gets a reference to an object containing the proxy settings used to
access the web page that is being converted. This was covered in more details in
Proxy Options section.
SecurityOptions - Gets a reference to the object that specifies the generated pdf
document security settings. This was covered in more details in Pdf Security
Settings section.
StartupMode - Use this property to specify how the conversion starts. This was
covered in more details in Start Conversion from Javascript section.
StartupScript - Use this property to specify some JavaScript code that will be
injected into the page that is converted.
ViewerPreferences - Controls how the pdf document will appear in a pdf viewer (like
Adobe Reader). This was covered in more details in Pdf Viewer Preferences section.
VisibleWebElementId - Use this property to convert only a certain section of the
page, specified by the html element ID. This was covered in more details in Partial
Page Conversion section.
WebPageFixedSize - Controls whether the web page is rendered with a fixed size
internal browser or the size automatically extends to make the whole content visible
This was covered in more details in Resizing Content During Conversion section.
WebPageHeight - Gets or sets the height of the converted web page as it would
appear in the internal browser used to render the html. This was covered in more
details in Resizing Content During Conversion section.
WebPageWidth - Gets or sets the width of the converted web page as it would
appear in the internal browser used to render the html. This was covered in more
details in Resizing Content During Conversion section.

143

SelectPdf Pdf Library for .NET

See Also
Reference
HtmlToPdf
HtmlToPdfOptions

144

SelectPdf Pdf Library for .NET

SelectPdf Namespace
SelectPdf offers an API to create, modify, merge, split pdf documents. It also
contains a powerful html to pdf converter that supports modern html5/css3.

Classes
Class
GlobalProperties
HiddenWebElements

HtmlToImage

HtmlToPdf

HtmlToPdfAuthenticationO
ptions

HtmlToPdfDocumentInfor
mation
HtmlToPdfException

HtmlToPdfOptions

HtmlToPdfProxyOptions

HtmlToPdfResult

HtmlToPdfViewerPreferen
ces

Description
Global properties for
SelectPdf SDK.
Helps defining a set of
html elements that will
not be displayed in the
generated pdf document.
Html to Image Converter.
This class offers the API
needed to create images
in various formats from a
specified web page or
html string.
Html To Pdf Converter.
This class offers the API
needed to convert any
web page url or html
string to pdf.
Authentication options
needed when the web
page to be converted
requires authentication.
This class provides the
possibility to control the
pdf document properties.
Exception thrown by the
html to pdf converter
related objects.
This class contains
various options used for
the html to pdf
conversion.
The proxy settings used
to resolve the HTTP
requests.
Offers information about
the html to pdf
conversion process.
The pdf viewer
preferences. Controls how
the pdf document
145

SelectPdf Pdf Library for .NET

PdfAction
PdfActionGoTo
PdfActionJavaScript
PdfAnnotationElement

PdfBezierCurveElement
PdfBookmark
PdfBookmarkOptions

PdfBookmarksCollection

PdfCanvas

PdfCircleElement
PdfColor
PdfCustomPageSize
PdfDestination
PdfDigitalCertificate

PdfDigitalCertificatesColle
ction

PdfDigitalCertificatesStor
e

PdfDigitalSignatureEleme

appears in a pdf viewer


(like Adobe Reader).
Base class for the pdf
actions.
Represents a Go To action
in a pdf document.
Represents a JavaScript
action in a pdf document.
Represents a text
annotation in a pdf
document.
Represents a Bezier curve
drawn in a pdf document.
Represents a bookmark in
a pdf document.
Helps defining a set of
html elements that will be
associated with
bookmarks in the
generated pdf document.
Represents the collection
of bookmarks in a pdf
document.
Base class for classes
that can render pdf page
elements.
Represents a circle shape
drawn in a pdf document.
Represents a pdf color.
The pdf page size
expressed in points.
Represents a destination
in a pdf document.
This class represents a
certificate used for digital
signatures in a pdf
document.
Represents a collection of
digital certificates that
can be used to sign a pdf
document.
Provides an interface for
getting digital certificates
from system certificates
store or from a password
protected PKCS#12 file.
Represents a digital
146

SelectPdf Pdf Library for .NET


nt
PdfDocument
PdfDocumentException

PdfDocumentInformation

PdfDocumentOpenAction

PdfDocumentSecurity

PdfElement

PdfEllipseArcElement

PdfEllipseElement

PdfEllipseSliceElement

PdfExternalFileElement

PdfExternalLinkElement

PdfFileAttachmentElemen
t
PdfFont
PdfFontCollection
PdfFooter

PdfGradient
PdfHeader

signature in a document.
Represents a pdf
document.
Exception thrown by the
pdf document related
objects.
This class provides the
possibility to control the
pdf document properties.
Encapsulates an action to
be performed when the
pdf document is opened.
This class provides the
options to control the pdf
document security.
The base class for some
graphic elements from a
pdf document.
Represents an ellipse arc
element drawn in a pdf
document.
Represents an ellipse
shape drawn in a pdf
document.
Represents a slice from
an ellipse drawn in a pdf
document.
Represents a link to an
external file in a pdf
document.
Represents a link to an
external url in a pdf
document.
Represents a file
attachment in a pdf
document.
Represents a font in a pdf
document.
Represents a collection of
fonts in a pdf document.
Handles the properties of
the footer of the
generated pdf document.
Defines a brush used to
fill a space.
Handles the properties of
the header of the
147

SelectPdf Pdf Library for .NET

PdfHtmlElement

PdfHtmlSection

PdfImageElement

PdfImageSection

PdfInternalLinkElement
PdfLineElement
PdfLineStyle

PdfMargins
PdfPage
PdfPageCollection

PdfPageElement

PdfPolygonElement
PdfRectangleElement
PdfRenderingResult

PdfSectionElement

PdfSecurityOptions

generated pdf document.


Represents a html
element that can be
added to a pdf document.
Represents a html
element that can be
added to the header or
footer templates of a pdf
document.
Represents an image that
can be added to a pdf
document.
Represents an image that
can be added to the
header or footer
templates of a pdf
document.
Represents an internal
link in a pdf document.
Represents a line drawn
in a pdf document.
The line style for pdf
graphic elements that
draw lines.
Represents the settings
for a pdf page margins.
Represents a page in a
pdf document.
Represents the collection
of pages in a pdf
document.
The base class for all
graphic elements from a
pdf document.
Represents a polygon
drawn in a pdf document.
Represents a rectangle
drawn in a pdf document.
The result of adding a pdf
element to a pdf page or
template.
The base class for pdf
elements that can be
added to header and
footer of a pdf document.
This class provides the
options to control the pdf
148

SelectPdf Pdf Library for .NET

PdfSoundLinkElement

PdfTemplate

PdfTemplateCollection

PdfTextElement

PdfTextElementRendering
Result
PdfTextSection

PdfViewerPreferences

WebPageInformation

document security.
Represents a link to an
external sound file in a
pdf document.
Represents a template in
a pdf document. A
template contains
elements that are
repeated on each page of
the pdf document.
Represents the collection
of pages in a pdf
document. A pdf template
is repeated on each page
of the pdf document.
Represents a text that
can be added to a pdf
document.
The result of adding a pdf
text element to a pdf
page or template.
Represents a text that
can be added to the
header or footer
templates of a pdf
document.
The pdf viewer
preferences. Controls how
the pdf document
appears in a pdf viewer
(like Adobe Reader).
This class provides
information about the
converted web page
(title, description,
keywords).

Enumerations
Enumeration
HtmlToPdfCssMediaType

HtmlToPdfPageFitMode

HtmlToPdfStartupMode

Description
Specifies what css styles
are loaded when the html
is rendered
Specifies how the html
content is rendered in a
pdf page.
Specifies the converter

149

SelectPdf Pdf Library for .NET

NetworkProxyType

PdfAnnotationIcon
PdfBlending

PdfBookmarkStyle
PdfCertificateSystem
PdfColorSpace

PdfCompressionLevel
PdfDestinationFitMode

PdfEncryptionKeySize
PdfFontType
PdfGradientDirection
PdfLineCapStyle
PdfLineDashStyle

PdfLineJoinStyle
PdfPageOrientation
PdfPageRotation
PdfPageSize
PdfStandard
PdfStandardCJKFont

PdfStandardFont

startup mode.
The list of available proxy
types used by the
converter to resolve HTTP
requests.
Defines a set of text
annotation types.
The blending settings for
transparent renderings in
a pdf document.
The pdf bookmark text
style.
The types of system
certificates stores.
The list of possible color
spaces for the pdf
document.
The pdf document
compression level.
Specifies the auto-fit
mode for a PdfDestination
object.
The length of the pdf
encryption key.
The list of supported fonts
for the header and footer
The direction of the pdf
gradient brush.
The line cap styles in a
pdf document.
Specifies the style of a
dashed line in a pdf
document.
Line join styles in a pdf
document.
The list of pdf pages
available orientations.
Standard rotation angles
for pdf pages.
The list of pdf standard
page sizes.
The list of pdf standards
available.
The Korean-JapanesseChinese (CJK) predefined
fonts.
Standard PDF font

150

SelectPdf Pdf Library for .NET

PdfTemplateAnchoring
PdfTemplateDocking
PdfTextHorizontalAlign
PdfTextVerticalAlign
PdfViewerFullScreenExitM
ode
PdfViewerPageLayout

PdfViewerPageMode
PdfViewerTextOrder

families.
The anchoring position of
a pdf template.
The docking style of a pdf
template.
Specifies horizontal
alignment of text.
Specifies vertical
alignment of text.
Specifies how to display
the pdf document on
exiting full-screen mode.
Specifies the page layout
to be used when the pdf
document is opened in a
viewer.
Specifies the pdf
document's page mode.
Used in pdf document
viewer preferences to
specify the reading order
for texts.

151

SelectPdf Pdf Library for .NET

GlobalProperties Class
Global properties for SelectPdf SDK.

Inheritance Hierarchy
System.Object SelectPdf.GlobalProperties
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public class GlobalProperties
VB
Public Class GlobalProperties
The GlobalProperties type exposes the following members.

Constructors
Name
GlobalProperties

Description

Name
HtmlEngineFullPath

Description
Gets or sets the full path
of the html rendering
engine helper file.
Internal use only.
Gets or sets the license
key string received when
the library is purchased.

Properties

LFN
LicenseKey

See Also
SelectPdf Namespace

152

SelectPdf Pdf Library for .NET

GlobalProperties Constructor
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public GlobalProperties()
VB
Public Sub New

See Also
GlobalProperties Class
SelectPdf Namespace

153

SelectPdf Pdf Library for .NET

GlobalProperties.GlobalProperties Properties
The GlobalProperties type exposes the following members.

Properties
Name
HtmlEngineFullPath

LFN
LicenseKey

Description
Gets or sets the full path
of the html rendering
engine helper file.
Internal use only.
Gets or sets the license
key string received when
the library is purchased.

See Also
GlobalProperties Class
SelectPdf Namespace

154

SelectPdf Pdf Library for .NET

GlobalProperties.HtmlEngineFullPath Property
Gets or sets the full path of the html rendering engine helper file.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public static string HtmlEngineFullPath { get; set; }
VB
Public Shared Property HtmlEngineFullPath As String
Get
Set
Property Value
Type: String

See Also
GlobalProperties Class
SelectPdf Namespace

155

SelectPdf Pdf Library for .NET

GlobalProperties.LFN Property
Internal use only.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public static string LFN { set; }
VB
Public Shared WriteOnly Property LFN As String
Set
Property Value
Type: String

See Also
GlobalProperties Class
SelectPdf Namespace

156

SelectPdf Pdf Library for .NET

GlobalProperties.LicenseKey Property
Gets or sets the license key string received when the library is purchased.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public static string LicenseKey { get; set; }
VB
Public Shared Property LicenseKey As String
Get
Set
Property Value
Type: String

Remarks
If this property is null the converter will automatically enter in evaluation mode and
a demo watermark is displayed on the generated pdf document.

See Also
GlobalProperties Class
SelectPdf Namespace

157

SelectPdf Pdf Library for .NET

HiddenWebElements Class
Helps defining a set of html elements that will not be displayed in the generated pdf
document.

Inheritance Hierarchy
System.Object SelectPdf.HiddenWebElements
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public class HiddenWebElements
VB
Public Class HiddenWebElements
The HiddenWebElements type exposes the following members.

Constructors
Name
HiddenWebElements

Description

Name
CssSelectors

Description
This property is used to
define an array
containing the selectors
of the html elements that
will not be displayed in
the final pdf document.
For example, the selector
for all the image
elements is "img", the
selector for all the
elements with the CSS
class name 'myclass' is
"*.myclass" and the
selector for the elements
with the id 'myid' is
"*#myid".

Properties

See Also
SelectPdf Namespace

158

SelectPdf Pdf Library for .NET

HiddenWebElements Constructor
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public HiddenWebElements()
VB
Public Sub New

See Also
HiddenWebElements Class
SelectPdf Namespace

159

SelectPdf Pdf Library for .NET

HiddenWebElements.HiddenWebElements Properties
The HiddenWebElements type exposes the following members.

Properties
Name
CssSelectors

Description
This property is used to
define an array
containing the selectors
of the html elements that
will not be displayed in
the final pdf document.
For example, the selector
for all the image
elements is "img", the
selector for all the
elements with the CSS
class name 'myclass' is
"*.myclass" and the
selector for the elements
with the id 'myid' is
"*#myid".

See Also
HiddenWebElements Class
SelectPdf Namespace

160

SelectPdf Pdf Library for .NET

HiddenWebElements.CssSelectors Property
This property is used to define an array containing the selectors of the html
elements that will not be displayed in the final pdf document. For example, the
selector for all the image elements is "img", the selector for all the elements with
the CSS class name 'myclass' is "*.myclass" and the selector for the elements with
the id 'myid' is "*#myid".
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public string[] CssSelectors { get; set; }
VB
Public Property CssSelectors As String()
Get
Set
Property Value
Type: String[]

See Also
HiddenWebElements Class
SelectPdf Namespace

161

SelectPdf Pdf Library for .NET

HtmlToImage Class
Html to Image Converter. This class offers the API needed to create images in
various formats from a specified web page or html string.

Inheritance Hierarchy
System.Object SelectPdf.HtmlToImage
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public class HtmlToImage
VB
Public Class HtmlToImage
The HtmlToImage type exposes the following members.

Constructors
Name
HtmlToImage()

HtmlToImage(Int32)

HtmlToImage(Int32,
Int32)

Description
Creates an html to image
converter. Width and
height of the web page
are automatically
detected.
Creates an html to image
converter. The width of
the web page is specified.
The height of the web
page is automatically
detected.
Creates an html to image
converter for a web page
with the specified width
and height.

Methods
Name
ConvertHtmlString(String)

ConvertHtmlString(String,
String)
ConvertUrl

Description
Gets an Image object
from the specified html
string.
Gets an Image object
from the specified html
string.
Gets an Image object
from the specified url.

162

SelectPdf Pdf Library for .NET

Properties
Name
AuthenticationPassword

AuthenticationUsername

HttpCookies

HttpHeaders

JavaScriptEnabled

MaxPageLoadTime
MinPageLoadTime

PluginsEnabled

ProxyOptions

StartupMode

StartupScript

VisibleWebElementId

Description
Specifies the password if
the web page being
converted requires
authentication.
Specifies the username if
the web page being
converted requires
authentication.
Gets the collection of
custom HTTP cookies
used for the conversion.
Get the collection of
custom HTTP headers
used for the conversion.
Enable scripts when
rendering the url or html
string.
The web page navigation
timeout in seconds.
An additional time in
seconds to wait for
asynchronous items to be
loaded before the web
page is rendered.
A flag indicating if plugins
(like Flash players) are
enabled in the converter.
Gets a reference to an
object containing the
proxy settings used to
access the web page that
is being converted.
Use this property to
specify how the
conversion starts.
Use this property to
specify some JavaScript
code that will be injected
into the page that is
converted.
Use this property to
convert only a certain
section of the web page,

163

SelectPdf Pdf Library for .NET

WebPageFixedSize

WebPageHeight

WebPageWidth

specified by the html


element ID.
Controls whether the web
page is rendered with a
fixed size internal browser
or the size automatically
extends to make the
whole content visible.
Gets or sets the web page
height. If the width was
not set, this property has
no effect.
Gets or sets the web page
width.

See Also
SelectPdf Namespace

164

SelectPdf Pdf Library for .NET

HtmlToImage Constructor
Overload List
Name
HtmlToImage()

HtmlToImage(Int32)

HtmlToImage(Int32,
Int32)

Description
Creates an html to image
converter. Width and
height of the web page
are automatically
detected.
Creates an html to image
converter. The width of
the web page is specified.
The height of the web
page is automatically
detected.
Creates an html to image
converter for a web page
with the specified width
and height.

See Also
HtmlToImage Class
SelectPdf Namespace

165

SelectPdf Pdf Library for .NET

HtmlToImage Constructor
Creates an html to image converter. Width and height of the web page are
automatically detected.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public HtmlToImage()
VB
Public Sub New

See Also
HtmlToImage Class
HtmlToImage Overload
SelectPdf Namespace

166

SelectPdf Pdf Library for .NET

HtmlToImage Constructor (Int32)


Creates an html to image converter. The width of the web page is specified. The
height of the web page is automatically detected.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public HtmlToImage(
int webPageWidth
)
VB
Public Sub New (
webPageWidth As Integer
)
Parameters
webPageWidth
Type: System.Int32
The web page width.

See Also
HtmlToImage Class
HtmlToImage Overload
SelectPdf Namespace

167

SelectPdf Pdf Library for .NET

HtmlToImage Constructor (Int32, Int32)


Creates an html to image converter for a web page with the specified width and
height.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public HtmlToImage(
int webPageWidth,
int webPageHeight
)
VB
Public Sub New (
webPageWidth As Integer,
webPageHeight As Integer
)
Parameters
webPageWidth
Type: System.Int32
The web page width.
webPageHeight
Type: System.Int32
The web page height.

See Also
HtmlToImage Class
HtmlToImage Overload
SelectPdf Namespace

168

SelectPdf Pdf Library for .NET

HtmlToImage.HtmlToImage Methods
The HtmlToImage type exposes the following members.

Methods
Name
ConvertHtmlString(String)

ConvertHtmlString(String,
String)
ConvertUrl

Description
Gets an Image object
from the specified html
string.
Gets an Image object
from the specified html
string.
Gets an Image object
from the specified url.

See Also
HtmlToImage Class
SelectPdf Namespace

169

SelectPdf Pdf Library for .NET

HtmlToImage.ConvertHtmlString Method
Overload List
Name
ConvertHtmlString(String)

ConvertHtmlString(String,
String)

Description
Gets an Image object
from the specified html
string.
Gets an Image object
from the specified html
string.

See Also
HtmlToImage Class
SelectPdf Namespace

170

SelectPdf Pdf Library for .NET

HtmlToImage.ConvertHtmlString Method (String)


Gets an Image object from the specified html string.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public Image ConvertHtmlString(
string htmlString
)
VB
Public Function ConvertHtmlString (
htmlString As String
) As Image
Parameters
htmlString
Type: System.String
The html string to be converted to image.
Return Value
Type: ImageThe rendered Image object.

Remarks
The Image object can be further manipulated to have the format changed, saved to
disk, etc.

See Also
HtmlToImage Class
ConvertHtmlString Overload
SelectPdf Namespace

171

SelectPdf Pdf Library for .NET

HtmlToImage.ConvertHtmlString Method (String, String)


Gets an Image object from the specified html string.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public Image ConvertHtmlString(
string htmlString,
string baseUrl
)
VB
Public Function ConvertHtmlString (
htmlString As String,
baseUrl As String
) As Image
Parameters
htmlString
Type: System.String
The html string to be converted to image.
baseUrl
Type: System.String
This parameter allows the converter to resolve relative urls. Basically, baseUrl +
relative image/css url = full absolute url.
Return Value
Type: ImageThe rendered Image object.

Remarks
The baseUrl parameter allows the converter to determine the full absolute urls from
relative urls for images and css files appearing in the html string.

The Image object can be further manipulated to have the format changed, saved to
disk, etc.

See Also
HtmlToImage Class
ConvertHtmlString Overload
SelectPdf Namespace

172

SelectPdf Pdf Library for .NET

HtmlToImage.ConvertUrl Method
Gets an Image object from the specified url.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public Image ConvertUrl(
string url
)
VB
Public Function ConvertUrl (
url As String
) As Image
Parameters
url
Type: System.String
The full url of the web page to be converted to image. The url can be also the full
path of a html file from the local file system.
Return Value
Type: ImageThe rendered Image object.

Remarks
The Image object can be further manipulated to have the format changed, saved to
disk, etc.

See Also
HtmlToImage Class
SelectPdf Namespace

173

SelectPdf Pdf Library for .NET

HtmlToImage.HtmlToImage Properties
The HtmlToImage type exposes the following members.

Properties
Name
AuthenticationPassword

AuthenticationUsername

HttpCookies

HttpHeaders

JavaScriptEnabled

MaxPageLoadTime
MinPageLoadTime

PluginsEnabled

ProxyOptions

StartupMode

StartupScript

VisibleWebElementId

Description
Specifies the password if
the web page being
converted requires
authentication.
Specifies the username if
the web page being
converted requires
authentication.
Gets the collection of
custom HTTP cookies
used for the conversion.
Get the collection of
custom HTTP headers
used for the conversion.
Enable scripts when
rendering the url or html
string.
The web page navigation
timeout in seconds.
An additional time in
seconds to wait for
asynchronous items to be
loaded before the web
page is rendered.
A flag indicating if plugins
(like Flash players) are
enabled in the converter.
Gets a reference to an
object containing the
proxy settings used to
access the web page that
is being converted.
Use this property to
specify how the
conversion starts.
Use this property to
specify some JavaScript
code that will be injected
into the page that is
converted.
Use this property to
174

SelectPdf Pdf Library for .NET

WebPageFixedSize

WebPageHeight

WebPageWidth

convert only a certain


section of the web page,
specified by the html
element ID.
Controls whether the web
page is rendered with a
fixed size internal browser
or the size automatically
extends to make the
whole content visible.
Gets or sets the web page
height. If the width was
not set, this property has
no effect.
Gets or sets the web page
width.

See Also
HtmlToImage Class
SelectPdf Namespace

175

SelectPdf Pdf Library for .NET

HtmlToImage.AuthenticationPassword Property
Specifies the password if the web page being converted requires authentication.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public string AuthenticationPassword { get; set; }
VB
Public Property AuthenticationPassword As String
Get
Set
Property Value
Type: String

See Also
HtmlToImage Class
SelectPdf Namespace

176

SelectPdf Pdf Library for .NET

HtmlToImage.AuthenticationUsername Property
Specifies the username if the web page being converted requires authentication.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public string AuthenticationUsername { get; set; }
VB
Public Property AuthenticationUsername As String
Get
Set
Property Value
Type: String

See Also
HtmlToImage Class
SelectPdf Namespace

177

SelectPdf Pdf Library for .NET

HtmlToImage.HttpCookies Property
Gets the collection of custom HTTP cookies used for the conversion.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public NameValueCollection HttpCookies { get; }
VB
Public ReadOnly Property HttpCookies As NameValueCollection
Get
Property Value
Type: NameValueCollection

Remarks
This property returns a reference to the collection of custom HTTP cookies to be
sent by the converter to the web server when the web page is rendered. A cookie is
defined by a name/value pair that can be added to the collection using the
Add(String, String) method of the HttpCookies property.

See Also
HtmlToImage Class
SelectPdf Namespace

178

SelectPdf Pdf Library for .NET

HtmlToImage.HttpHeaders Property
Get the collection of custom HTTP headers used for the conversion.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public NameValueCollection HttpHeaders { get; }
VB
Public ReadOnly Property HttpHeaders As NameValueCollection
Get
Property Value
Type: NameValueCollection

Remarks
This property returns a reference to the collection of custom HTTP headers to be
sent by the converter to the web server when the web page is rendered. A custom
HTTP header is defined by a name/value pair that can be added to the collection
using the Add(String, String) method of the HttpHeaders property.

See Also
HtmlToImage Class
SelectPdf Namespace

179

SelectPdf Pdf Library for .NET

HtmlToImage.JavaScriptEnabled Property
Enable scripts when rendering the url or html string.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public bool JavaScriptEnabled { get; set; }
VB
Public Property JavaScriptEnabled As Boolean
Get
Set
Property Value
Type: Boolean

Remarks
The default value of this property is true and the converter will run any javascript
available when the page loads.

Note: If the javascript requires some time to load, MinPageLoadTime property should
be set to delay the conversion with the specified number of seconds and allow the
javascript to run.

See Also
HtmlToImage Class
SelectPdf Namespace

180

SelectPdf Pdf Library for .NET

HtmlToImage.MaxPageLoadTime Property
The web page navigation timeout in seconds.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public int MaxPageLoadTime { get; set; }
VB
Public Property MaxPageLoadTime As Integer
Get
Set
Property Value
Type: Int32

Remarks
Default value is 60 seconds. This value should be increased if large web pages are
loaded.

See Also
HtmlToImage Class
SelectPdf Namespace

181

SelectPdf Pdf Library for .NET

HtmlToImage.MinPageLoadTime Property
An additional time in seconds to wait for asynchronous items to be loaded before
the web page is rendered.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public int MinPageLoadTime { get; set; }
VB
Public Property MinPageLoadTime As Integer
Get
Set
Property Value
Type: Int32

Remarks
A delay of this type could be necessary if javascripts are loaded when the page is
rendered or if Flash movies are played.

See Also
HtmlToImage Class
SelectPdf Namespace

182

SelectPdf Pdf Library for .NET

HtmlToImage.PluginsEnabled Property
A flag indicating if plugins (like Flash players) are enabled in the converter.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public bool PluginsEnabled { get; set; }
VB
Public Property PluginsEnabled As Boolean
Get
Set
Property Value
Type: Boolean

Remarks
The default value for this property is true.

See Also
HtmlToImage Class
SelectPdf Namespace

183

SelectPdf Pdf Library for .NET

HtmlToImage.ProxyOptions Property
Gets a reference to an object containing the proxy settings used to access the web
page that is being converted.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public HtmlToPdfProxyOptions ProxyOptions { get; }
VB
Public ReadOnly Property ProxyOptions As HtmlToPdfProxyOptions
Get
Property Value
Type: HtmlToPdfProxyOptions

See Also
HtmlToImage Class
SelectPdf Namespace

184

SelectPdf Pdf Library for .NET

HtmlToImage.StartupMode Property
Use this property to specify how the conversion starts.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public HtmlToPdfStartupMode StartupMode { get; set; }
VB
Public Property StartupMode As HtmlToPdfStartupMode
Get
Set
Property Value
Type: HtmlToPdfStartupMode

Remarks
By default this is set to Automatic and the conversion is started as soon as the page
loads (and MinPageLoadTime elapses). If set to Manual, the conversion is started
only by a javascript call to SelectPdf.startConversion() from within the web page.

See Also
HtmlToImage Class
SelectPdf Namespace

185

SelectPdf Pdf Library for .NET

HtmlToImage.StartupScript Property
Use this property to specify some JavaScript code that will be injected into the page
that is converted.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public string StartupScript { get; set; }
VB
Public Property StartupScript As String
Get
Set
Property Value
Type: String

Remarks
The JavaScript code specified here will run before any other script on the page.

See Also
HtmlToImage Class
SelectPdf Namespace

186

SelectPdf Pdf Library for .NET

HtmlToImage.VisibleWebElementId Property
Use this property to convert only a certain section of the web page, specified by the
html element ID.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public string VisibleWebElementId { set; }
VB
Public WriteOnly Property VisibleWebElementId As String
Set
Property Value
Type: String

See Also
HtmlToImage Class
SelectPdf Namespace

187

SelectPdf Pdf Library for .NET

HtmlToImage.WebPageFixedSize Property
Controls whether the web page is rendered with a fixed size internal browser or the
size automatically extends to make the whole content visible.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public bool WebPageFixedSize { get; set; }
VB
Public Property WebPageFixedSize As Boolean
Get
Set
Property Value
Type: Boolean

Remarks
If the html content is not entirely visible in the web page viewer (browser) at the
specified width, this property will control whether the html content is clipped or the
web page browser width is automatically extended to make visible the whole html
content.

The html browser width is given by the WebPageWidth property.

The default value of this property is false.

See Also
HtmlToImage Class
SelectPdf Namespace

188

SelectPdf Pdf Library for .NET

HtmlToImage.WebPageHeight Property
Gets or sets the web page height. If the width was not set, this property has no
effect.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public int WebPageHeight { get; set; }
VB
Public Property WebPageHeight As Integer
Get
Set
Property Value
Type: Int32

See Also
HtmlToImage Class
SelectPdf Namespace

189

SelectPdf Pdf Library for .NET

HtmlToImage.WebPageWidth Property
Gets or sets the web page width.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public int WebPageWidth { get; set; }
VB
Public Property WebPageWidth As Integer
Get
Set
Property Value
Type: Int32

See Also
HtmlToImage Class
SelectPdf Namespace

190

SelectPdf Pdf Library for .NET

HtmlToPdf Class
Html To Pdf Converter. This class offers the API needed to convert any web page url
or html string to pdf.

Inheritance Hierarchy
System.Object SelectPdf.HtmlToPdf
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public class HtmlToPdf
VB
Public Class HtmlToPdf
The HtmlToPdf type exposes the following members.

Constructors
Name
HtmlToPdf()
HtmlToPdf(Int32)
HtmlToPdf(Int32, Int32)

Description
Initializes an instance of
the HtmlToPdf Converter.
Initializes an instance of
the HtmlToPdf Converter.
Initializes an instance of
the HtmlToPdf Converter.

Methods
Name
ConvertHtmlString(String)

ConvertHtmlString(String,
String)

ConvertUrl

Description
Gets a PdfDocument
object representing the
result of the conversion of
the specified html string
to pdf.
Gets a PdfDocument
object representing the
result of the conversion of
the specified html string
to pdf.
Gets a PdfDocument
object representing the
result of the conversion of
the specified url to pdf.

191

SelectPdf Pdf Library for .NET

Properties
Name
ConversionResult

Footer

Header

Options

Description
Gets a reference to an
object that offers
information about the
result of the html to pdf
conversion process.
Gets a reference to an
object that controls the
properties of the custom
footer of the generated
pdf document.
Gets a reference to an
object that controls the
properties of the custom
header of the generated
pdf document.
Gets a reference to an
object that controls the
html to pdf conversion
process and the
generated pdf document
properties.

Remarks
The result of conversion is a PdfDocument object that can be further modified,
saved to memory or into a file on the disk.

Examples
The following sample code shows how an HtmlToPdf Converter can be instantiated
and a basic conversion performed.
C#
using SelectPdf;
HtmlToPdf converter = new HtmlToPdf();
PdfDocument doc = converter.ConvertUrl(url);
doc.Save(file);
doc.Close();
VB
Imports SelectPdf
Dim converter as HtmlToPdf = New HtmlToPdf()
Dim doc as PdfDocument = converter.ConvertUrl(url)
doc.Save(file)
doc.Close()

192

SelectPdf Pdf Library for .NET

See Also
SelectPdf Namespace

193

SelectPdf Pdf Library for .NET

HtmlToPdf Constructor
Overload List
Name
HtmlToPdf()
HtmlToPdf(Int32)
HtmlToPdf(Int32, Int32)

Description
Initializes an instance of
the HtmlToPdf Converter.
Initializes an instance of
the HtmlToPdf Converter.
Initializes an instance of
the HtmlToPdf Converter.

See Also
HtmlToPdf Class
SelectPdf Namespace

194

SelectPdf Pdf Library for .NET

HtmlToPdf Constructor
Initializes an instance of the HtmlToPdf Converter.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public HtmlToPdf()
VB
Public Sub New

Remarks
The web page is rendered by an internal browser having the default width of
1024px. The height of the page is automatically calculated. The width and height
can be set using WebPageWidth and WebPageHeight properties of Options property.
Usually, the web page width and height do not need to be set and the converter
automatically calculates them, but there are some situations (web pages with
frames for example) when the converter cannot calculate the page size correctly. In
this case, the web page width and height needs to be set, otherwise no content will
appear in the generated pdf document.

Examples
The following sample code shows how an HtmlToPdf Converter can be instantiated
and a basic conversion performed.
C#
HtmlToPdf converter = new HtmlToPdf();
PdfDocument doc = converter.ConvertUrl(url);
doc.Save(file);
doc.Close();
VB
Dim converter as HtmlToPdf = New HtmlToPdf()
Dim doc as PdfDocument = converter.ConvertUrl(url)
doc.Save(file)
doc.Close()

See Also
HtmlToPdf Class
HtmlToPdf Overload
SelectPdf Namespace
HtmlToPdfOptions.WebPageWidth
HtmlToPdfOptions.WebPageHeight

195

SelectPdf Pdf Library for .NET

HtmlToPdf Constructor (Int32)


Initializes an instance of the HtmlToPdf Converter.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public HtmlToPdf(
int webPageWidth
)
VB
Public Sub New (
webPageWidth As Integer
)
Parameters
webPageWidth
Type: System.Int32
Width in pixels of the internal browser that renders the web page.

Remarks
The web page is rendered by an internal browser having the width specified by the
webPageWidth parameter and the height automatically calculated. The width and
height can be also set using WebPageWidth and WebPageHeight properties of
Options property.
Usually, the web page height does not need to be set and the converter
automatically calculates it, but there are some situations (web pages with frames
for example) when the converter cannot calculate the page height correctly. In this
case, the web page needs to be set, otherwise no content will appear in the
generated pdf document.

Examples
The following sample code shows how an HtmlToPdf Converter can be instantiated
and a basic conversion performed.
C#
HtmlToPdf converter = new HtmlToPdf(width);
PdfDocument doc = converter.ConvertUrl(url);
doc.Save(file);
doc.Close();
VB
Dim converter as HtmlToPdf = New HtmlToPdf(width)
Dim doc as PdfDocument = converter.ConvertUrl(url)
doc.Save(file)
doc.Close()
196

SelectPdf Pdf Library for .NET

See Also
HtmlToPdf Class
HtmlToPdf Overload
SelectPdf Namespace
HtmlToPdfOptions.WebPageWidth
HtmlToPdfOptions.WebPageHeight

197

SelectPdf Pdf Library for .NET

HtmlToPdf Constructor (Int32, Int32)


Initializes an instance of the HtmlToPdf Converter.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public HtmlToPdf(
int webPageWidth,
int webPageHeight
)
VB
Public Sub New (
webPageWidth As Integer,
webPageHeight As Integer
)
Parameters
webPageWidth
Type: System.Int32
Width in pixels of the internal browser that renders the web page.
webPageHeight
Type: System.Int32
Height in pixels of the internal browser that renders the web page.

Remarks
The web page is rendered by an internal browser having the width specified by the
webPageWidth parameter and the height of the page specified by the webPageHeight
parameter. The width and height can be also set using WebPageWidth and
WebPageHeight properties of Options property.
If webPageHeight is set, the web page will be truncated to the specified height.
Usually, webPageHeight should be set to 0 to determine the converter to
automatically calculate the page height, but there are some situations (web pages
with frames for example) when the converter cannot calculate the page height
correctly. In this case, webPageHeight needs to be set, otherwise no content will
appear in the generated pdf document.

Examples
The following sample code shows how an HtmlToPdf Converter can be instantiated
and a basic conversion performed.
C#
HtmlToPdf converter = new HtmlToPdf(width, height);
PdfDocument doc = converter.ConvertUrl(url);
doc.Save(file);

198

SelectPdf Pdf Library for .NET


doc.Close();
VB
Dim converter as HtmlToPdf = New HtmlToPdf(width, height)
Dim doc as PdfDocument = converter.ConvertUrl(url)
doc.Save(file)
doc.Close()

See Also
HtmlToPdf Class
HtmlToPdf Overload
SelectPdf Namespace
HtmlToPdfOptions.WebPageWidth
HtmlToPdfOptions.WebPageHeight

199

SelectPdf Pdf Library for .NET

HtmlToPdf.HtmlToPdf Methods
The HtmlToPdf type exposes the following members.

Methods
Name
ConvertHtmlString(String)

ConvertHtmlString(String,
String)

ConvertUrl

Description
Gets a PdfDocument
object representing the
result of the conversion of
the specified html string
to pdf.
Gets a PdfDocument
object representing the
result of the conversion of
the specified html string
to pdf.
Gets a PdfDocument
object representing the
result of the conversion of
the specified url to pdf.

See Also
HtmlToPdf Class
SelectPdf Namespace

200

SelectPdf Pdf Library for .NET

HtmlToPdf.ConvertHtmlString Method
Overload List
Name
ConvertHtmlString(String)

ConvertHtmlString(String,
String)

Description
Gets a PdfDocument
object representing the
result of the conversion of
the specified html string
to pdf.
Gets a PdfDocument
object representing the
result of the conversion of
the specified html string
to pdf.

See Also
HtmlToPdf Class
SelectPdf Namespace

201

SelectPdf Pdf Library for .NET

HtmlToPdf.ConvertHtmlString Method (String)


Gets a PdfDocument object representing the result of the conversion of the
specified html string to pdf.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public PdfDocument ConvertHtmlString(
string htmlString
)
VB
Public Function ConvertHtmlString (
htmlString As String
) As PdfDocument
Parameters
htmlString
Type: System.String
The html string to be converted to pdf.
Return Value
Type: PdfDocumentThe PdfDocument object that can be modified and saved to a
file, to a stream, to a memory buffer or to a HTTP response.

Remarks
The resulted PdfDocument object can be modified and saved to a file, to a stream,
to a memory buffer or to a HTTP response. The PdfDocument object must be closed
after save to release the system resources used during conversion.
This method does not use any base url and therefore the images or css files
referenced by relative urls in the html string cannot be resolved by the converter to
an absolute url. If there are external resources referenced by relative urls, the
ConvertHtmlString(String, String) method with the baseUrl additional parameter
should be used.

Examples
The following sample code shows how an HtmlToPdf Converter can be instantiated
and a basic conversion performed.
C#
HtmlToPdf converter = new HtmlToPdf();
PdfDocument doc = converter.ConvertHtmlString(html);
doc.Save(file);
doc.Close();

202

SelectPdf Pdf Library for .NET


VB
Dim converter as HtmlToPdf = New HtmlToPdf()
Dim doc as PdfDocument = converter.ConvertString(html)
doc.Save(file)
doc.Close()

See Also
HtmlToPdf Class
ConvertHtmlString Overload
SelectPdf Namespace

203

SelectPdf Pdf Library for .NET

HtmlToPdf.ConvertHtmlString Method (String, String)


Gets a PdfDocument object representing the result of the conversion of the
specified html string to pdf.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public PdfDocument ConvertHtmlString(
string htmlString,
string baseUrl
)
VB
Public Function ConvertHtmlString (
htmlString As String,
baseUrl As String
) As PdfDocument
Parameters
htmlString
Type: System.String
The html string to be converted to pdf.
baseUrl
Type: System.String
This parameter allows the converter to resolve relative urls. Basically, baseUrl +
relative image/css url = full absolute url.
Return Value
Type: PdfDocumentThe PdfDocument object that can be modified and saved to a
file, to a stream, to a memory buffer or to a HTTP response.

Remarks
The resulted PdfDocument object can be modified and saved to a file, to a stream,
to a memory buffer or to a HTTP response. The PdfDocument object must be closed
after save to release the system resources used during conversion.
The baseUrl parameter allows the converter to determine the full absolute urls from
relative urls for images and css files appearing in the html string.

Examples
The following sample code shows how an HtmlToPdf Converter can be instantiated
and a basic conversion performed.
C#
HtmlToPdf converter = new HtmlToPdf();
PdfDocument doc = converter.ConvertHtmlString(html, baseUrl);

204

SelectPdf Pdf Library for .NET


doc.Save(file);
doc.Close();
VB
Dim converter as HtmlToPdf = New HtmlToPdf()
Dim doc as PdfDocument = converter.ConvertString(html, baseUrl)
doc.Save(file)
doc.Close()

See Also
HtmlToPdf Class
ConvertHtmlString Overload
SelectPdf Namespace

205

SelectPdf Pdf Library for .NET

HtmlToPdf.ConvertUrl Method
Gets a PdfDocument object representing the result of the conversion of the
specified url to pdf.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public PdfDocument ConvertUrl(
string url
)
VB
Public Function ConvertUrl (
url As String
) As PdfDocument
Parameters
url
Type: System.String
The full url of the web page to be converted to pdf. The url can be also the full path
of a html file from the local file system.
Return Value
Type: PdfDocumentThe PdfDocument object that can be modified and saved to a
file, to a stream, to a memory buffer or to a HTTP response.

Remarks
The resulted PdfDocument object can be modified and saved to a file, to a stream,
to a memory buffer or to a HTTP response. The PdfDocument object must be closed
after save to release the system resources used during conversion.

Examples
The following sample code shows how an HtmlToPdf Converter can be instantiated
and a basic conversion performed.
C#
HtmlToPdf converter = new HtmlToPdf();
PdfDocument doc = converter.ConvertUrl(url);
doc.Save(file);
doc.Close();
VB
Dim converter as HtmlToPdf = New HtmlToPdf()
Dim doc as PdfDocument = converter.ConvertUrl(url)
doc.Save(file)
doc.Close()

206

SelectPdf Pdf Library for .NET

See Also
HtmlToPdf Class
SelectPdf Namespace

207

SelectPdf Pdf Library for .NET

HtmlToPdf.HtmlToPdf Properties
The HtmlToPdf type exposes the following members.

Properties
Name
ConversionResult

Footer

Header

Options

Description
Gets a reference to an
object that offers
information about the
result of the html to pdf
conversion process.
Gets a reference to an
object that controls the
properties of the custom
footer of the generated
pdf document.
Gets a reference to an
object that controls the
properties of the custom
header of the generated
pdf document.
Gets a reference to an
object that controls the
html to pdf conversion
process and the
generated pdf document
properties.

See Also
HtmlToPdf Class
SelectPdf Namespace

208

SelectPdf Pdf Library for .NET

HtmlToPdf.ConversionResult Property
Gets a reference to an object that offers information about the result of the html to
pdf conversion process.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public HtmlToPdfResult ConversionResult { get; }
VB
Public ReadOnly Property ConversionResult As HtmlToPdfResult
Get
Property Value
Type: HtmlToPdfResult

Remarks
After a successful conversion this property is initialized with an instance of the
HtmlToPdfResult class. If the conversion failed this property returns a null value.

See Also
HtmlToPdf Class
SelectPdf Namespace

209

SelectPdf Pdf Library for .NET

HtmlToPdf.Footer Property
Gets a reference to an object that controls the properties of the custom footer of the
generated pdf document.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public PdfFooter Footer { get; }
VB
Public ReadOnly Property Footer As PdfFooter
Get
Property Value
Type: PdfFooter

Remarks
The footer is displayed in the generated pdf document only if the DisplayFooter
property is set to true.

See Also
HtmlToPdf Class
SelectPdf Namespace

210

SelectPdf Pdf Library for .NET

HtmlToPdf.Header Property
Gets a reference to an object that controls the properties of the custom header of
the generated pdf document.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public PdfHeader Header { get; }
VB
Public ReadOnly Property Header As PdfHeader
Get
Property Value
Type: PdfHeader

Remarks
The header is displayed in the generated pdf document only if the DisplayHeader
property is set to true.

See Also
HtmlToPdf Class
SelectPdf Namespace

211

SelectPdf Pdf Library for .NET

HtmlToPdf.Options Property
Gets a reference to an object that controls the html to pdf conversion process and
the generated pdf document properties.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public HtmlToPdfOptions Options { get; }
VB
Public ReadOnly Property Options As HtmlToPdfOptions
Get
Property Value
Type: HtmlToPdfOptions

Remarks
This property can be used to control the generated pdf header, footer, margins,
page size and orientation, compression level, content resizing and many more.
Check HtmlToPdfOptions for complete details.

See Also
HtmlToPdf Class
SelectPdf Namespace

212

SelectPdf Pdf Library for .NET

HtmlToPdfAuthenticationOptions Class
Authentication options needed when the web page to be converted requires
authentication.

Inheritance Hierarchy
System.Object SelectPdf.HtmlToPdfAuthenticationOptions
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public class HtmlToPdfAuthenticationOptions
VB
Public Class HtmlToPdfAuthenticationOptions
The HtmlToPdfAuthenticationOptions type exposes the following members.

Constructors
Name
HtmlToPdfAuthenticationO
ptions

Description

Name
Password

Description
Specifies the password if
the web page to be
converted requires
authentication.
Specifies the user name if
the web page to be
converted requires
authentication.

Properties

Username

See Also
SelectPdf Namespace

213

SelectPdf Pdf Library for .NET

HtmlToPdfAuthenticationOptions Constructor
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public HtmlToPdfAuthenticationOptions()
VB
Public Sub New

See Also
HtmlToPdfAuthenticationOptions Class
SelectPdf Namespace

214

SelectPdf Pdf Library for .NET

HtmlToPdfAuthenticationOptions.HtmlToPdfAuthentication
Options Properties
The HtmlToPdfAuthenticationOptions type exposes the following members.

Properties
Name
Password

Username

Description
Specifies the password if
the web page to be
converted requires
authentication.
Specifies the user name if
the web page to be
converted requires
authentication.

See Also
HtmlToPdfAuthenticationOptions Class
SelectPdf Namespace

215

SelectPdf Pdf Library for .NET

HtmlToPdfAuthenticationOptions.Password Property
Specifies the password if the web page to be converted requires authentication.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public string Password { get; set; }
VB
Public Property Password As String
Get
Set
Property Value
Type: String

See Also
HtmlToPdfAuthenticationOptions Class
SelectPdf Namespace

216

SelectPdf Pdf Library for .NET

HtmlToPdfAuthenticationOptions.Username Property
Specifies the user name if the web page to be converted requires authentication.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public string Username { get; set; }
VB
Public Property Username As String
Get
Set
Property Value
Type: String

See Also
HtmlToPdfAuthenticationOptions Class
SelectPdf Namespace

217

SelectPdf Pdf Library for .NET

HtmlToPdfCssMediaType Enumeration
Specifies what css styles are loaded when the html is rendered
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public enum HtmlToPdfCssMediaType
VB
Public Enumeration HtmlToPdfCssMediaType

Members
Member name
Screen

Value
0

Print

Description
Default (screen)
css styles are
loaded
Print css styles are
loaded

See Also
SelectPdf Namespace

218

SelectPdf Pdf Library for .NET

HtmlToPdfDocumentInformation Class
This class provides the possibility to control the pdf document properties.

Inheritance Hierarchy
System.Object SelectPdf.HtmlToPdfDocumentInformation
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public class HtmlToPdfDocumentInformation
VB
Public Class HtmlToPdfDocumentInformation
The HtmlToPdfDocumentInformation type exposes the following members.

Constructors
Name
HtmlToPdfDocumentInfor
mation

Description

Name
Author

Description
Gets or sets the name of
the pdf document author.
Gets or sets the date and
time when the pdf
document was created.
Gets or sets the pdf
document keywords.
Gets the name of the
application that
generated the pdf
document (Select.Pdf
SDK).
Gets or sets the subject
of the pdf document.
Gets or sets the pdf
document title.

Properties

CreationDate

Keywords
Producer

Subject
Title

Remarks
Using this class, the pdf document properties (author, title, keywords, etc) can be
controlled. The HtmlToPdfOptions class defines a reference to an object of this type.

219

SelectPdf Pdf Library for .NET

See Also
SelectPdf Namespace

220

SelectPdf Pdf Library for .NET

HtmlToPdfDocumentInformation Constructor
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public HtmlToPdfDocumentInformation()
VB
Public Sub New

See Also
HtmlToPdfDocumentInformation Class
SelectPdf Namespace

221

SelectPdf Pdf Library for .NET

HtmlToPdfDocumentInformation.HtmlToPdfDocumentInfor
mation Properties
The HtmlToPdfDocumentInformation type exposes the following members.

Properties
Name
Author
CreationDate

Keywords
Producer

Subject
Title

Description
Gets or sets the name of
the pdf document author.
Gets or sets the date and
time when the pdf
document was created.
Gets or sets the pdf
document keywords.
Gets the name of the
application that
generated the pdf
document (Select.Pdf
SDK).
Gets or sets the subject
of the pdf document.
Gets or sets the pdf
document title.

See Also
HtmlToPdfDocumentInformation Class
SelectPdf Namespace

222

SelectPdf Pdf Library for .NET

HtmlToPdfDocumentInformation.Author Property
Gets or sets the name of the pdf document author.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public string Author { get; set; }
VB
Public Property Author As String
Get
Set
Property Value
Type: String

See Also
HtmlToPdfDocumentInformation Class
SelectPdf Namespace

223

SelectPdf Pdf Library for .NET

HtmlToPdfDocumentInformation.CreationDate Property
Gets or sets the date and time when the pdf document was created.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public DateTime CreationDate { get; set; }
VB
Public Property CreationDate As DateTime
Get
Set
Property Value
Type: DateTime

See Also
HtmlToPdfDocumentInformation Class
SelectPdf Namespace

224

SelectPdf Pdf Library for .NET

HtmlToPdfDocumentInformation.Keywords Property
Gets or sets the pdf document keywords.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public string Keywords { get; set; }
VB
Public Property Keywords As String
Get
Set
Property Value
Type: String

See Also
HtmlToPdfDocumentInformation Class
SelectPdf Namespace

225

SelectPdf Pdf Library for .NET

HtmlToPdfDocumentInformation.Producer Property
Gets the name of the application that generated the pdf document (Select.Pdf SDK).
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public string Producer { get; }
VB
Public ReadOnly Property Producer As String
Get
Property Value
Type: String

See Also
HtmlToPdfDocumentInformation Class
SelectPdf Namespace

226

SelectPdf Pdf Library for .NET

HtmlToPdfDocumentInformation.Subject Property
Gets or sets the subject of the pdf document.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public string Subject { get; set; }
VB
Public Property Subject As String
Get
Set
Property Value
Type: String

See Also
HtmlToPdfDocumentInformation Class
SelectPdf Namespace

227

SelectPdf Pdf Library for .NET

HtmlToPdfDocumentInformation.Title Property
Gets or sets the pdf document title.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public string Title { get; set; }
VB
Public Property Title As String
Get
Set
Property Value
Type: String

See Also
HtmlToPdfDocumentInformation Class
SelectPdf Namespace

228

SelectPdf Pdf Library for .NET

HtmlToPdfException Class
Exception thrown by the html to pdf converter related objects.

Inheritance Hierarchy
System.Object System.Exception

SelectPdf.HtmlToPdfException

Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public class HtmlToPdfException : Exception
VB
Public Class HtmlToPdfException
Inherits Exception

Constructors
Name
HtmlToPdfException(Strin
g)
HtmlToPdfException(Strin
g, Exception)

Description
Initializes a
HtmlToPdfException
object.
Initializes a
HtmlToPdfException
object.

See Also
SelectPdf Namespace

229

SelectPdf Pdf Library for .NET

HtmlToPdfException Constructor
Overload List
Name
HtmlToPdfException(Strin
g)
HtmlToPdfException(Strin
g, Exception)

Description
Initializes a
HtmlToPdfException
object.
Initializes a
HtmlToPdfException
object.

See Also
HtmlToPdfException Class
SelectPdf Namespace

230

SelectPdf Pdf Library for .NET

HtmlToPdfException Constructor (String)


Initializes a HtmlToPdfException object.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public HtmlToPdfException(
string message
)
VB
Public Sub New (
message As String
)
Parameters
message
Type: System.String
The exception message.

See Also
HtmlToPdfException Class
HtmlToPdfException Overload
SelectPdf Namespace

231

SelectPdf Pdf Library for .NET

HtmlToPdfException Constructor (String, Exception)


Initializes a HtmlToPdfException object.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public HtmlToPdfException(
string message,
Exception innerException
)
VB
Public Sub New (
message As String,
innerException As Exception
)
Parameters
message
Type: System.String
The exception message.
innerException
Type: System.Exception
The inner exception that triggered this exception.

See Also
HtmlToPdfException Class
HtmlToPdfException Overload
SelectPdf Namespace

232

SelectPdf Pdf Library for .NET

HtmlToPdfOptions Class
This class contains various options used for the html to pdf conversion.

Inheritance Hierarchy
System.Object SelectPdf.HtmlToPdfOptions
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public class HtmlToPdfOptions
VB
Public Class HtmlToPdfOptions
The HtmlToPdfOptions type exposes the following members.

Constructors
Name
HtmlToPdfOptions

Description

Name
Authentication

Description
Handles authentication
options if the web page
being converted requires
authentication.
Specifies the html
content vertical auto fit
mode.
Specifies the html
content horizontal auto fit
mode.
Gets or sets the color
space of the generated
pdf document.
Indicates what css styles
are used when the web
page is rendered.
Controls if a custom
footer is displayed in the
generated pdf document.
Controls if a custom
header is displayed in the
generated pdf document.
Gets or sets a flag

Properties

AutoFitHeight

AutoFitWidth

ColorSpace

CssMediaType

DisplayFooter

DisplayHeader

DrawBackground

233

SelectPdf Pdf Library for .NET

EmbedFonts

ExternalLinksEnabled
HiddenWebElements

HttpCookies

HttpHeaders

InternalLinksEnabled

JavaScriptEnabled

JpegCompressionEnabled

JpegCompressionLevel

KeepImagesTogether

KeepTextsTogether

MarginBottom

indicating if the web page


background is rendered in
pdf.
Instructs the converter to
embed all the needed
fonts into the pdf
document or not.
Controls the rendering of
external hyperlinks in pdf.
Gets a reference to the
object that controls the
visibility of some web
elements in the
generated pdf document.
Gets the collection of
custom HTTP cookies
used for the conversion.
Get the collection of
custom HTTP headers
used for the conversion.
Controls the conversion of
internal html links to
internal pdf links.
Enable scripts when
rendering the url or html
string.
Gets or sets a flag
indicating if the JPEG
compression is enabled or
not for the images in the
generated pdf document.
Gets or sets the
compression level of
images in the generated
pdf document.
This property instructs
the converter whether to
try to avoid cutting off
the images between pdf
pages or not.
This property instructs
the converter whether to
try to avoid cutting off
the text lines between pdf
pages or not.
The bottom margin of the
pdf document.
234

SelectPdf Pdf Library for .NET


MarginLeft
MarginRight
MarginTop
MaximumConcurrentConv
ersions

MaxPageLoadTime
MinPageLoadTime

PdfBookmarkOptions

PdfCompressionLevel

PdfDocumentInformation

PdfPageCustomSize

PdfPageOrientation

PdfPageSize

PdfStandard

PluginsEnabled

ProxyOptions

The left margin of the pdf


document.
The right margin of the
pdf document.
The top margin of the pdf
document.
Maximum number of html
to pdf conversions that
can be performed
simultaneously.
The web page navigation
timeout in seconds.
An additional time in
seconds to wait for
asynchronous items to be
loaded before the web
page is rendered.
Gets a reference to the
object that controls the
bookmarks creation for
the generated pdf
document.
This property controls the
compression level of the
generated pdf document.
Gets a reference to the
object that specifies the
generated pdf document
properties.
This property can be used
to specify a custom pdf
document page size.
This property controls the
page orientation of the
generated pdf document
pages.
This property controls the
size of the generated
document pages.
Defines the pdf standard
used by the generated
pdf document.
A flag indicating if plugins
(like Flash players) are
enabled in the converter.
Gets a reference to an
object containing the
235

SelectPdf Pdf Library for .NET

SecurityOptions

StartupMode

StartupScript

ViewerPreferences

VisibleWebElementId

WebPageFixedSize

WebPageHeight

WebPageWidth

proxy settings used to


access the web page that
is being converted.
Gets a reference to the
object that specifies the
generated pdf document
security settings.
Use this property to
specify how the
conversion starts.
Use this property to
specify some JavaScript
code that will be injected
into the page that is
converted.
Controls how the pdf
document will appear in a
pdf viewer (like Adobe
Reader).
Use this property to
convert only a certain
section of the page,
specified by the html
element ID.
Controls whether the web
page is rendered with a
fixed size internal browser
or the size automatically
extends to make the
whole content visible.
Gets or sets the height of
the converted web page
as it would appear in the
internal browser used to
render the html.
Gets or sets the width of
the converted web page
as it would appear in the
internal browser used to
render the html.

Remarks
The HtmlToPdf class defines a reference to an object of this type.

See Also
SelectPdf Namespace

236

SelectPdf Pdf Library for .NET

HtmlToPdfOptions Constructor
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public HtmlToPdfOptions()
VB
Public Sub New

See Also
HtmlToPdfOptions Class
SelectPdf Namespace

237

SelectPdf Pdf Library for .NET

HtmlToPdfOptions.HtmlToPdfOptions Properties
The HtmlToPdfOptions type exposes the following members.

Properties
Name
Authentication

AutoFitHeight

AutoFitWidth

ColorSpace

CssMediaType

DisplayFooter

DisplayHeader

DrawBackground

EmbedFonts

ExternalLinksEnabled
HiddenWebElements

HttpCookies

HttpHeaders

Description
Handles authentication
options if the web page
being converted requires
authentication.
Specifies the html
content vertical auto fit
mode.
Specifies the html
content horizontal auto fit
mode.
Gets or sets the color
space of the generated
pdf document.
Indicates what css styles
are used when the web
page is rendered.
Controls if a custom
footer is displayed in the
generated pdf document.
Controls if a custom
header is displayed in the
generated pdf document.
Gets or sets a flag
indicating if the web page
background is rendered in
pdf.
Instructs the converter to
embed all the needed
fonts into the pdf
document or not.
Controls the rendering of
external hyperlinks in pdf.
Gets a reference to the
object that controls the
visibility of some web
elements in the
generated pdf document.
Gets the collection of
custom HTTP cookies
used for the conversion.
Get the collection of
238

SelectPdf Pdf Library for .NET

InternalLinksEnabled

JavaScriptEnabled

JpegCompressionEnabled

JpegCompressionLevel

KeepImagesTogether

KeepTextsTogether

MarginBottom
MarginLeft
MarginRight
MarginTop
MaximumConcurrentConv
ersions

MaxPageLoadTime
MinPageLoadTime

PdfBookmarkOptions

custom HTTP headers


used for the conversion.
Controls the conversion of
internal html links to
internal pdf links.
Enable scripts when
rendering the url or html
string.
Gets or sets a flag
indicating if the JPEG
compression is enabled or
not for the images in the
generated pdf document.
Gets or sets the
compression level of
images in the generated
pdf document.
This property instructs
the converter whether to
try to avoid cutting off
the images between pdf
pages or not.
This property instructs
the converter whether to
try to avoid cutting off
the text lines between pdf
pages or not.
The bottom margin of the
pdf document.
The left margin of the pdf
document.
The right margin of the
pdf document.
The top margin of the pdf
document.
Maximum number of html
to pdf conversions that
can be performed
simultaneously.
The web page navigation
timeout in seconds.
An additional time in
seconds to wait for
asynchronous items to be
loaded before the web
page is rendered.
Gets a reference to the
239

SelectPdf Pdf Library for .NET

PdfCompressionLevel

PdfDocumentInformation

PdfPageCustomSize

PdfPageOrientation

PdfPageSize

PdfStandard

PluginsEnabled

ProxyOptions

SecurityOptions

StartupMode

StartupScript

ViewerPreferences

object that controls the


bookmarks creation for
the generated pdf
document.
This property controls the
compression level of the
generated pdf document.
Gets a reference to the
object that specifies the
generated pdf document
properties.
This property can be used
to specify a custom pdf
document page size.
This property controls the
page orientation of the
generated pdf document
pages.
This property controls the
size of the generated
document pages.
Defines the pdf standard
used by the generated
pdf document.
A flag indicating if plugins
(like Flash players) are
enabled in the converter.
Gets a reference to an
object containing the
proxy settings used to
access the web page that
is being converted.
Gets a reference to the
object that specifies the
generated pdf document
security settings.
Use this property to
specify how the
conversion starts.
Use this property to
specify some JavaScript
code that will be injected
into the page that is
converted.
Controls how the pdf
document will appear in a
pdf viewer (like Adobe
240

SelectPdf Pdf Library for .NET

VisibleWebElementId

WebPageFixedSize

WebPageHeight

WebPageWidth

Reader).
Use this property to
convert only a certain
section of the page,
specified by the html
element ID.
Controls whether the web
page is rendered with a
fixed size internal browser
or the size automatically
extends to make the
whole content visible.
Gets or sets the height of
the converted web page
as it would appear in the
internal browser used to
render the html.
Gets or sets the width of
the converted web page
as it would appear in the
internal browser used to
render the html.

See Also
HtmlToPdfOptions Class
SelectPdf Namespace

241

SelectPdf Pdf Library for .NET

HtmlToPdfOptions.Authentication Property
Handles authentication options if the web page being converted requires
authentication.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public HtmlToPdfAuthenticationOptions Authentication { get; }
VB
Public ReadOnly Property Authentication As
HtmlToPdfAuthenticationOptions
Get
Property Value
Type: HtmlToPdfAuthenticationOptions

See Also
HtmlToPdfOptions Class
SelectPdf Namespace

242

SelectPdf Pdf Library for .NET

HtmlToPdfOptions.AutoFitHeight Property
Specifies the html content vertical auto fit mode.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public HtmlToPdfPageFitMode AutoFitHeight { get; set; }
VB
Public Property AutoFitHeight As HtmlToPdfPageFitMode
Get
Set
Property Value
Type: HtmlToPdfPageFitMode

Remarks
The converter considers both AutoFitWidth and AutoFitHeight when the html
content is rendered in the pdf page or specified rectangle.

If this property is set to NoAdjustment, the html content is not resized vertically in
any way to fit the available space. If the content is larger, it will be cut and not all of
it will be displayed in the generated pdf file.

If this property is set to ShrinkOnly, the html content is resized only if the content
height is larger than the destination space (pdf page or rectangle) height. In this
case, the content is shrunk to fit the destination space height and the elements that
it contains (texts, images) will appear smaller in the generated pdf document than
in the original web page. If the original content height is smaller than the
destination height, no adjustments will be done and the content will be rendered
exactly as it is, even though some additional white space might appear at the
bottom.

If this property is set to AutoFit, the converter will treat it like ShrinkOnly.
The default value of this property is NoAdjustment and for rendering, the converter
will only take AutoFitWidth into consideration.

See Also
HtmlToPdfOptions Class
SelectPdf Namespace

243

SelectPdf Pdf Library for .NET

244

SelectPdf Pdf Library for .NET

HtmlToPdfOptions.AutoFitWidth Property
Specifies the html content horizontal auto fit mode.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public HtmlToPdfPageFitMode AutoFitWidth { get; set; }
VB
Public Property AutoFitWidth As HtmlToPdfPageFitMode
Get
Set
Property Value
Type: HtmlToPdfPageFitMode

Remarks
The converter considers both AutoFitWidth and AutoFitHeight when the html
content is rendered in the pdf page or specified rectangle.

If this property is set to NoAdjustment, the html content is not resized horizontally
in any way to fit the available space. If the content is larger, it will be cut and not all
of it will be displayed in the generated pdf file.

If this property is set to ShrinkOnly, the html content is resized only if the content
width is larger than the destination space (pdf page or rectangle) width. In this case,
the content is shrunk to fit the destination space width and the elements that it
contains (texts, images) will appear smaller in the generated pdf document than in
the original web page. If the original content width is smaller than the destination
width, no adjustments will be done and the content will be rendered exactly as it is,
even though some additional white space might appear to its right.

If this property is set to AutoFit, the html content is resized to fit the available width
of the destination space. If the original content width is smaller than the destination
width, the elements rendered (texts, images) will appear larger in the generated pdf
document. If the original content width is larger than the destination width, the
elements rendered (texts, images) will appear smaller in the generated pdf
document.
The default value of this property is ShrinkOnly.

245

SelectPdf Pdf Library for .NET

See Also
HtmlToPdfOptions Class
SelectPdf Namespace

246

SelectPdf Pdf Library for .NET

HtmlToPdfOptions.ColorSpace Property
Gets or sets the color space of the generated pdf document.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public PdfColorSpace ColorSpace { get; set; }
VB
Public Property ColorSpace As PdfColorSpace
Get
Set
Property Value
Type: PdfColorSpace

Remarks
The possible values are RGB, CMYK or GrayScale. The default color space is RGB.

See Also
HtmlToPdfOptions Class
SelectPdf Namespace

247

SelectPdf Pdf Library for .NET

HtmlToPdfOptions.CssMediaType Property
Indicates what css styles are used when the web page is rendered.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public HtmlToPdfCssMediaType CssMediaType { get; set; }
VB
Public Property CssMediaType As HtmlToPdfCssMediaType
Get
Set
Property Value
Type: HtmlToPdfCssMediaType

Remarks
The default value is Screen and the page is rendered like in a regular web browser.
If the page contains printer specific styles, the property should be set to Print to
have the page rendered using those css styles.

See Also
HtmlToPdfOptions Class
SelectPdf Namespace

248

SelectPdf Pdf Library for .NET

HtmlToPdfOptions.DisplayFooter Property
Controls if a custom footer is displayed in the generated pdf document.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public bool DisplayFooter { get; set; }
VB
Public Property DisplayFooter As Boolean
Get
Set
Property Value
Type: Boolean

Remarks
The footer properties can be customized using the PdfFooter object exposed by
Footer property of the HtmlToPdf converter class.
Note: The default value of this property is false and the generated pdf document will
not have a custom footer.

See Also
HtmlToPdfOptions Class
SelectPdf Namespace

249

SelectPdf Pdf Library for .NET

HtmlToPdfOptions.DisplayHeader Property
Controls if a custom header is displayed in the generated pdf document.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public bool DisplayHeader { get; set; }
VB
Public Property DisplayHeader As Boolean
Get
Set
Property Value
Type: Boolean

Remarks
The header properties can be customized using the PdfHeader object exposed by
Header property of the HtmlToPdf converter class.
Note: The default value of this property is false and the generated pdf document will
not have a custom header.

See Also
HtmlToPdfOptions Class
SelectPdf Namespace

250

SelectPdf Pdf Library for .NET

HtmlToPdfOptions.DrawBackground Property
Gets or sets a flag indicating if the web page background is rendered in pdf.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public bool DrawBackground { get; set; }
VB
Public Property DrawBackground As Boolean
Get
Set
Property Value
Type: Boolean

Remarks
The default value for this property is true and the page background is rendered into
the generated pdf. Even though it might be white, it will still make invisible any pdf
element that was rendered behind it. Setting this property to false can make visible
the existing pdf elements behind this html element.

See Also
HtmlToPdfOptions Class
SelectPdf Namespace

251

SelectPdf Pdf Library for .NET

HtmlToPdfOptions.EmbedFonts Property
Instructs the converter to embed all the needed fonts into the pdf document or not.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public bool EmbedFonts { get; set; }
VB
Public Property EmbedFonts As Boolean
Get
Set
Property Value
Type: Boolean

Remarks
The default value for this property is false and the fonts are not automatically
embedded.
This property does not control the web fonts (fonts that are downloaded with the
web page). The web fonts are always embedded because they are not installed on
the machine.

See Also
HtmlToPdfOptions Class
SelectPdf Namespace

252

SelectPdf Pdf Library for .NET

HtmlToPdfOptions.ExternalLinksEnabled Property
Controls the rendering of external hyperlinks in pdf.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public bool ExternalLinksEnabled { get; set; }
VB
Public Property ExternalLinksEnabled As Boolean
Get
Set
Property Value
Type: Boolean

Remarks
The default value for this property is true and in this case all external hyperlinks
from the web page will be rendered in the generated pdf document.
When this property is set to false, external links are ignore and they do not appear
in the generated pdf document.

See Also
HtmlToPdfOptions Class
SelectPdf Namespace

253

SelectPdf Pdf Library for .NET

HtmlToPdfOptions.HiddenWebElements Property
Gets a reference to the object that controls the visibility of some web elements in
the generated pdf document.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public HiddenWebElements HiddenWebElements { get; }
VB
Public ReadOnly Property HiddenWebElements As HiddenWebElements
Get
Property Value
Type: HiddenWebElements

Remarks
This property needs to be set to instruct the html to pdf converter to hide some
elements from the web page and not render them in the pdf document. The
converter will not render the web elements specified by the CssSelectors of the
HiddenWebElements property.

See Also
HtmlToPdfOptions Class
SelectPdf Namespace

254

SelectPdf Pdf Library for .NET

HtmlToPdfOptions.HttpCookies Property
Gets the collection of custom HTTP cookies used for the conversion.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public NameValueCollection HttpCookies { get; }
VB
Public ReadOnly Property HttpCookies As NameValueCollection
Get
Property Value
Type: NameValueCollection

Remarks
This property returns a reference to the collection of custom HTTP cookies to be
sent by the converter to the web server when the web page is rendered. A cookie is
defined by a name/value pair that can be added to the collection using the
Add(String, String) method of the HttpCookies property.

See Also
HtmlToPdfOptions Class
SelectPdf Namespace

255

SelectPdf Pdf Library for .NET

HtmlToPdfOptions.HttpHeaders Property
Get the collection of custom HTTP headers used for the conversion.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public NameValueCollection HttpHeaders { get; }
VB
Public ReadOnly Property HttpHeaders As NameValueCollection
Get
Property Value
Type: NameValueCollection

Remarks
This property returns a reference to the collection of custom HTTP headers to be
sent by the converter to the web server when the web page is rendered. A custom
HTTP header is defined by a name/value pair that can be added to the collection
using the Add(String, String) method of the HttpHeaders property.

See Also
HtmlToPdfOptions Class
SelectPdf Namespace

256

SelectPdf Pdf Library for .NET

HtmlToPdfOptions.InternalLinksEnabled Property
Controls the conversion of internal html links to internal pdf links.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public bool InternalLinksEnabled { get; set; }
VB
Public Property InternalLinksEnabled As Boolean
Get
Set
Property Value
Type: Boolean

Remarks
The default value for this property is true and in this case all internal hyperlinks
from the web page (links that point within the web page) will be rendered in the
generated pdf document as internal pdf links (clicking one of them will jump within
the pdf document).

See Also
HtmlToPdfOptions Class
SelectPdf Namespace

257

SelectPdf Pdf Library for .NET

HtmlToPdfOptions.JavaScriptEnabled Property
Enable scripts when rendering the url or html string.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public bool JavaScriptEnabled { get; set; }
VB
Public Property JavaScriptEnabled As Boolean
Get
Set
Property Value
Type: Boolean

Remarks
The default value of this property is true and the converter will run any javascript
available when the page loads.

Note: If the javascript requires some time to load, MinPageLoadTime property should
be set to delay the conversion with the specified number of seconds and allow the
javascript to run.

See Also
HtmlToPdfOptions Class
SelectPdf Namespace

258

SelectPdf Pdf Library for .NET

HtmlToPdfOptions.JpegCompressionEnabled Property
Gets or sets a flag indicating if the JPEG compression is enabled or not for the
images in the generated pdf document.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public bool JpegCompressionEnabled { get; set; }
VB
Public Property JpegCompressionEnabled As Boolean
Get
Set
Property Value
Type: Boolean

Remarks
By default the JPEG compression is enabled to reduce the size of the generated pdf
document. When the JPEG compression is enabled the quality of the images in the
generated pdf is lower than the quality of the original images from the web page,
and this quality depends on the JpegCompressionLevel parameter. When the
JpegCompressionLevel is increased, the quality of the images in pdf decreases.

See Also
HtmlToPdfOptions Class
SelectPdf Namespace

259

SelectPdf Pdf Library for .NET

HtmlToPdfOptions.JpegCompressionLevel Property
Gets or sets the compression level of images in the generated pdf document.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public int JpegCompressionLevel { get; set; }
VB
Public Property JpegCompressionLevel As Integer
Get
Set
Property Value
Type: Int32

Remarks
This property can take values between 0 and 100. It has effect only when the
JpegCompressionEnabled is set to true. When the JpegCompressionLevel is 0, the
compression rate is the lowest and the quality of the images is the best. When the
JpegCompressionLevel is 100, the compression rate is the highest and quality of
the images in PDF is the worst.

The default JPEG compression level is 10, which should offer a good balance
between the compression rate and the quality of the images in pdf.

See Also
HtmlToPdfOptions Class
SelectPdf Namespace

260

SelectPdf Pdf Library for .NET

HtmlToPdfOptions.KeepImagesTogether Property
This property instructs the converter whether to try to avoid cutting off the images
between pdf pages or not.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public bool KeepImagesTogether { get; set; }
VB
Public Property KeepImagesTogether As Boolean
Get
Set
Property Value
Type: Boolean

Remarks
The default value is false and the converter does not try to avoid images cutting
between pdf pages.

See Also
HtmlToPdfOptions Class
SelectPdf Namespace

261

SelectPdf Pdf Library for .NET

HtmlToPdfOptions.KeepTextsTogether Property
This property instructs the converter whether to try to avoid cutting off the text
lines between pdf pages or not.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public bool KeepTextsTogether { get; set; }
VB
Public Property KeepTextsTogether As Boolean
Get
Set
Property Value
Type: Boolean

Remarks
The default value is true and the converter tries to avoid text cutting between pdf
pages.

See Also
HtmlToPdfOptions Class
SelectPdf Namespace

262

SelectPdf Pdf Library for .NET

HtmlToPdfOptions.MarginBottom Property
The bottom margin of the pdf document.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public int MarginBottom { get; set; }
VB
Public Property MarginBottom As Integer
Get
Set
Property Value
Type: Int32

Remarks
The margin is specified in points. 1 point is 1/72 inch.

See Also
HtmlToPdfOptions Class
SelectPdf Namespace

263

SelectPdf Pdf Library for .NET

HtmlToPdfOptions.MarginLeft Property
The left margin of the pdf document.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public int MarginLeft { get; set; }
VB
Public Property MarginLeft As Integer
Get
Set
Property Value
Type: Int32

Remarks
The margin is specified in points. 1 point is 1/72 inch.

See Also
HtmlToPdfOptions Class
SelectPdf Namespace

264

SelectPdf Pdf Library for .NET

HtmlToPdfOptions.MarginRight Property
The right margin of the pdf document.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public int MarginRight { get; set; }
VB
Public Property MarginRight As Integer
Get
Set
Property Value
Type: Int32

Remarks
The margin is specified in points. 1 point is 1/72 inch.

See Also
HtmlToPdfOptions Class
SelectPdf Namespace

265

SelectPdf Pdf Library for .NET

HtmlToPdfOptions.MarginTop Property
The top margin of the pdf document.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public int MarginTop { get; set; }
VB
Public Property MarginTop As Integer
Get
Set
Property Value
Type: Int32

Remarks
The margin is specified in points. 1 point is 1/72 inch.

See Also
HtmlToPdfOptions Class
SelectPdf Namespace

266

SelectPdf Pdf Library for .NET

HtmlToPdfOptions.MaximumConcurrentConversions
Property
Maximum number of html to pdf conversions that can be performed simultaneously.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public static int MaximumConcurrentConversions { get; set; }
VB
Public Shared Property MaximumConcurrentConversions As Integer
Get
Set
Property Value
Type: Int32

Remarks
This parameter must be set before the first conversion performed by the
application. When this property is set with a negative value or zero, the concurrency
level is maximum. The default value is 4.
If the maximum number is reached and more conversion requests arrive, they will
wait in a queue for an available spot.

See Also
HtmlToPdfOptions Class
SelectPdf Namespace

267

SelectPdf Pdf Library for .NET

HtmlToPdfOptions.MaxPageLoadTime Property
The web page navigation timeout in seconds.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public int MaxPageLoadTime { get; set; }
VB
Public Property MaxPageLoadTime As Integer
Get
Set
Property Value
Type: Int32

Remarks
Default value is 60 seconds. This value should be increased if large web pages are
loaded.

See Also
HtmlToPdfOptions Class
SelectPdf Namespace

268

SelectPdf Pdf Library for .NET

HtmlToPdfOptions.MinPageLoadTime Property
An additional time in seconds to wait for asynchronous items to be loaded before
the web page is rendered.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public int MinPageLoadTime { get; set; }
VB
Public Property MinPageLoadTime As Integer
Get
Set
Property Value
Type: Int32

Remarks
A delay of this type could be necessary if javascripts are loaded when the page is
rendered or if Flash movies are played.

See Also
HtmlToPdfOptions Class
SelectPdf Namespace

269

SelectPdf Pdf Library for .NET

HtmlToPdfOptions.PdfBookmarkOptions Property
Gets a reference to the object that controls the bookmarks creation for the
generated pdf document.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public PdfBookmarkOptions PdfBookmarkOptions { get; }
VB
Public ReadOnly Property PdfBookmarkOptions As PdfBookmarkOptions
Get
Property Value
Type: PdfBookmarkOptions

Remarks
This property needs to be set to instruct the html to pdf converter to automatically
generate some bookmarks in the pdf document. The converter will create
bookmarks for the web elements specified by the CssSelectors of the
PdfBookmarkOptions property.

See Also
HtmlToPdfOptions Class
SelectPdf Namespace

270

SelectPdf Pdf Library for .NET

HtmlToPdfOptions.PdfCompressionLevel Property
This property controls the compression level of the generated pdf document.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public PdfCompressionLevel PdfCompressionLevel { get; set; }
VB
Public Property PdfCompressionLevel As PdfCompressionLevel
Get
Set
Property Value
Type: PdfCompressionLevel

Remarks
The default value is Normal.

See Also
HtmlToPdfOptions Class
SelectPdf Namespace

271

SelectPdf Pdf Library for .NET

HtmlToPdfOptions.PdfDocumentInformation Property
Gets a reference to the object that specifies the generated pdf document properties.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public HtmlToPdfDocumentInformation PdfDocumentInformation { get; }
VB
Public ReadOnly Property PdfDocumentInformation As
HtmlToPdfDocumentInformation
Get
Property Value
Type: HtmlToPdfDocumentInformation

See Also
HtmlToPdfOptions Class
SelectPdf Namespace

272

SelectPdf Pdf Library for .NET

HtmlToPdfOptions.PdfPageCustomSize Property
This property can be used to specify a custom pdf document page size.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public SizeF PdfPageCustomSize { get; set; }
VB
Public Property PdfPageCustomSize As SizeF
Get
Set
Property Value
Type: SizeF

Remarks
The property is taken into account only when PdfPageSize property is set to Custom.
The custom width and height of the pdf page is specified in points. 1 point is 1/72
inch.

See Also
HtmlToPdfOptions Class
SelectPdf Namespace

273

SelectPdf Pdf Library for .NET

HtmlToPdfOptions.PdfPageOrientation Property
This property controls the page orientation of the generated pdf document pages.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public PdfPageOrientation PdfPageOrientation { get; set; }
VB
Public Property PdfPageOrientation As PdfPageOrientation
Get
Set
Property Value
Type: PdfPageOrientation

Remarks
The default pdf page orientation is Portrait.

See Also
HtmlToPdfOptions Class
SelectPdf Namespace

274

SelectPdf Pdf Library for .NET

HtmlToPdfOptions.PdfPageSize Property
This property controls the size of the generated document pages.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public PdfPageSize PdfPageSize { get; set; }
VB
Public Property PdfPageSize As PdfPageSize
Get
Set
Property Value
Type: PdfPageSize

Remarks
The default size of the pdf document pages is A4. When this property is set to
Custom, a custom size can be specified for the generated pdf document pages
using the PdfPageCustomSize property.

See Also
HtmlToPdfOptions Class
SelectPdf Namespace

275

SelectPdf Pdf Library for .NET

HtmlToPdfOptions.PdfStandard Property
Defines the pdf standard used by the generated pdf document.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public PdfStandard PdfStandard { get; set; }
VB
Public Property PdfStandard As PdfStandard
Get
Set
Property Value
Type: PdfStandard

Remarks
The default value is Full and in this case the full set of pdf features can be used in
the generated document. This property can be used to instruct the converter to
generate PDF/A, PDF/X or PDF/SiqQ compliant documents.

See Also
HtmlToPdfOptions Class
SelectPdf Namespace

276

SelectPdf Pdf Library for .NET

HtmlToPdfOptions.PluginsEnabled Property
A flag indicating if plugins (like Flash players) are enabled in the converter.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public bool PluginsEnabled { get; set; }
VB
Public Property PluginsEnabled As Boolean
Get
Set
Property Value
Type: Boolean

Remarks
The default value for this property is true.

See Also
HtmlToPdfOptions Class
SelectPdf Namespace

277

SelectPdf Pdf Library for .NET

HtmlToPdfOptions.ProxyOptions Property
Gets a reference to an object containing the proxy settings used to access the web
page that is being converted.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public HtmlToPdfProxyOptions ProxyOptions { get; }
VB
Public ReadOnly Property ProxyOptions As HtmlToPdfProxyOptions
Get
Property Value
Type: HtmlToPdfProxyOptions

See Also
HtmlToPdfOptions Class
SelectPdf Namespace

278

SelectPdf Pdf Library for .NET

HtmlToPdfOptions.SecurityOptions Property
Gets a reference to the object that specifies the generated pdf document security
settings.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public PdfSecurityOptions SecurityOptions { get; }
VB
Public ReadOnly Property SecurityOptions As PdfSecurityOptions
Get
Property Value
Type: PdfSecurityOptions

Remarks
This property returns a reference to a PdfSecurityOptions object that can be used to
control the generated pdf document security settings (like password, printing or
editing restrictions).

See Also
HtmlToPdfOptions Class
SelectPdf Namespace

279

SelectPdf Pdf Library for .NET

HtmlToPdfOptions.StartupMode Property
Use this property to specify how the conversion starts.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public HtmlToPdfStartupMode StartupMode { get; set; }
VB
Public Property StartupMode As HtmlToPdfStartupMode
Get
Set
Property Value
Type: HtmlToPdfStartupMode

Remarks
By default this is set to Automatic and the conversion is started as soon as the page
loads (and MinPageLoadTime elapses). If set to Manual, the conversion is started
only by a javascript call to SelectPdf.startConversion() from within the web page.

See Also
HtmlToPdfOptions Class
SelectPdf Namespace

280

SelectPdf Pdf Library for .NET

HtmlToPdfOptions.StartupScript Property
Use this property to specify some JavaScript code that will be injected into the page
that is converted.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public string StartupScript { get; set; }
VB
Public Property StartupScript As String
Get
Set
Property Value
Type: String

Remarks
The JavaScript code specified here will run before any other script on the page.

See Also
HtmlToPdfOptions Class
SelectPdf Namespace

281

SelectPdf Pdf Library for .NET

HtmlToPdfOptions.ViewerPreferences Property
Controls how the pdf document will appear in a pdf viewer (like Adobe Reader).
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public HtmlToPdfViewerPreferences ViewerPreferences { get; }
VB
Public ReadOnly Property ViewerPreferences As
HtmlToPdfViewerPreferences
Get
Property Value
Type: HtmlToPdfViewerPreferences

See Also
HtmlToPdfOptions Class
SelectPdf Namespace

282

SelectPdf Pdf Library for .NET

HtmlToPdfOptions.VisibleWebElementId Property
Use this property to convert only a certain section of the page, specified by the html
element ID.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public string VisibleWebElementId { get; set; }
VB
Public Property VisibleWebElementId As String
Get
Set
Property Value
Type: String

See Also
HtmlToPdfOptions Class
SelectPdf Namespace

283

SelectPdf Pdf Library for .NET

HtmlToPdfOptions.WebPageFixedSize Property
Controls whether the web page is rendered with a fixed size internal browser or the
size automatically extends to make the whole content visible.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public bool WebPageFixedSize { get; set; }
VB
Public Property WebPageFixedSize As Boolean
Get
Set
Property Value
Type: Boolean

Remarks
The default value of this property is false.

If the web page does not fit the dimensions specified by the WebPageWidth and
WebPageHeight properties and WebPageFixedSize is set to false, the converter
will try to automatically calculate a larger width and height to be able to display the
whole html content.
If WebPageFixedSize is set to true, this will indicate the converter not to calculate
another width and height, but use width and height specified by WebPageWidth and
WebPageHeight. These dimensions with be used even though the content will not fit
the available space and it will be truncated.
Note: If WebPageFixedSize is set to true, a page height needs to be set using
WebPageHeight, because the default value (0) will make the converter fail (cannot
render a web page with no height).

See Also
HtmlToPdfOptions Class
SelectPdf Namespace

284

SelectPdf Pdf Library for .NET

HtmlToPdfOptions.WebPageHeight Property
Gets or sets the height of the converted web page as it would appear in the internal
browser used to render the html.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public int WebPageHeight { get; set; }
VB
Public Property WebPageHeight As Integer
Get
Set
Property Value
Type: Int32

Remarks
The web page height is specified in pixels and the default value is 0px. This means
that the converter will automatically calculate the page height.
Generally this property does not need to be changed, but there are situations when
the converter cannot calculate correctly the web page height (for example for web
pages with frames) and in that case, WebPageHeight needs to be set, otherwise
no content might appear in the generated pdf.
Note: If the WebPageHeight is set, the content that exceeds this page height is
truncated and will not appear in the generated pdf document. Only using the
default 0 value will allow the whole page content to be rendered all the time in the
generated pdf document.
This property can also be set directly in the constructor of HtmlToPdf class.

See Also
HtmlToPdfOptions Class
SelectPdf Namespace

285

SelectPdf Pdf Library for .NET

HtmlToPdfOptions.WebPageWidth Property
Gets or sets the width of the converted web page as it would appear in the internal
browser used to render the html.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public int WebPageWidth { get; set; }
VB
Public Property WebPageWidth As Integer
Get
Set
Property Value
Type: Int32

Remarks
The web page width is specified in pixels and the default value is 1024px. The page
width is only an indication of the minimum page width recommended for
conversion. If the content does not fit this width, the converter will automatically
resize the internal browser to fit the whole html content. To avoid this, the
WebPageFixedSize property needs to be set to true. When WebPageFixedSize is true,
the web page will be rendered with the specified WebPageWidth and
WebPageHeight even though the content might be truncated.

If WebPageWidth is set to 0, the converter will automatically determine the page


width, finding the width that will fit the html content.
This property can also be set directly in the constructor of HtmlToPdf class.

See Also
HtmlToPdfOptions Class
SelectPdf Namespace

286

SelectPdf Pdf Library for .NET

HtmlToPdfPageFitMode Enumeration
Specifies how the html content is rendered in a pdf page.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public enum HtmlToPdfPageFitMode
VB
Public Enumeration HtmlToPdfPageFitMode

Members
Member name
NoAdjustment

Value
0

ShrinkOnly

AutoFit

Description
The html content
is rendered as it is.
No size
adjustments are
performed, even
though the
destination space
might be smaller
than needed.
The html content
is shrunk if
necessary to fit
the available
destination space.
This option does
not expand the
content if it's
smaller than the
available space.
The html content
is automatically
adjusted to fit the
entire available
space. Unlike
ShrinkOnly, the
content can be
either shrunk or
stretched.

See Also
SelectPdf Namespace

287

SelectPdf Pdf Library for .NET

HtmlToPdfProxyOptions Class
The proxy settings used to resolve the HTTP requests.

Inheritance Hierarchy
System.Object SelectPdf.HtmlToPdfProxyOptions
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public class HtmlToPdfProxyOptions
VB
Public Class HtmlToPdfProxyOptions
The HtmlToPdfProxyOptions type exposes the following members.

Constructors
Name
HtmlToPdfProxyOptions

Description

Name
HostName

Description
Gets or sets the host
name of the proxy host.
Gets or sets the password
used for authentication.
Gets or sets the port
number of the proxy host.
Gets or sets the proxy
type.
Gets or sets the user
name used for
authentication.

Properties

Password
PortNumber
Type
Username

See Also
SelectPdf Namespace

288

SelectPdf Pdf Library for .NET

HtmlToPdfProxyOptions Constructor
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public HtmlToPdfProxyOptions()
VB
Public Sub New

See Also
HtmlToPdfProxyOptions Class
SelectPdf Namespace

289

SelectPdf Pdf Library for .NET

HtmlToPdfProxyOptions.HtmlToPdfProxyOptions Properties
The HtmlToPdfProxyOptions type exposes the following members.

Properties
Name
HostName
Password
PortNumber
Type
Username

Description
Gets or sets the host
name of the proxy host.
Gets or sets the password
used for authentication.
Gets or sets the port
number of the proxy host.
Gets or sets the proxy
type.
Gets or sets the user
name used for
authentication.

See Also
HtmlToPdfProxyOptions Class
SelectPdf Namespace

290

SelectPdf Pdf Library for .NET

HtmlToPdfProxyOptions.HostName Property
Gets or sets the host name of the proxy host.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public string HostName { get; set; }
VB
Public Property HostName As String
Get
Set
Property Value
Type: String

See Also
HtmlToPdfProxyOptions Class
SelectPdf Namespace

291

SelectPdf Pdf Library for .NET

HtmlToPdfProxyOptions.Password Property
Gets or sets the password used for authentication.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public string Password { get; set; }
VB
Public Property Password As String
Get
Set
Property Value
Type: String

See Also
HtmlToPdfProxyOptions Class
SelectPdf Namespace

292

SelectPdf Pdf Library for .NET

HtmlToPdfProxyOptions.PortNumber Property
Gets or sets the port number of the proxy host.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public int PortNumber { get; set; }
VB
Public Property PortNumber As Integer
Get
Set
Property Value
Type: Int32

See Also
HtmlToPdfProxyOptions Class
SelectPdf Namespace

293

SelectPdf Pdf Library for .NET

HtmlToPdfProxyOptions.Type Property
Gets or sets the proxy type.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public NetworkProxyType Type { get; set; }
VB
Public Property Type As NetworkProxyType
Get
Set
Property Value
Type: NetworkProxyType

See Also
HtmlToPdfProxyOptions Class
SelectPdf Namespace

294

SelectPdf Pdf Library for .NET

HtmlToPdfProxyOptions.Username Property
Gets or sets the user name used for authentication.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public string Username { get; set; }
VB
Public Property Username As String
Get
Set
Property Value
Type: String

See Also
HtmlToPdfProxyOptions Class
SelectPdf Namespace

295

SelectPdf Pdf Library for .NET

HtmlToPdfResult Class
Offers information about the html to pdf conversion process.

Inheritance Hierarchy
System.Object SelectPdf.HtmlToPdfResult
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public class HtmlToPdfResult
VB
Public Class HtmlToPdfResult
The HtmlToPdfResult type exposes the following members.

Properties
Name
PdfPageCount

PdfPageLastIndex

PdfPageLastRectangle

PdfPageScaleFactor

PdfPageSize

PdfPagesRectangles

WebPageInformation

Description
The number of pages in
the generated pdf
document.
The index of the pdf page
where the rendering of
the html content ended in
the generated pdf
document.
The size and position of
the html content
rendered on the last page
in the generated pdf
document.
The factor used to scale
the html content to fit the
pdf page.
The size of the page in
the generated pdf
document.
The size and position of
the html content
rendered in all pages of
the pdf document.
Gets an object populated
after conversion with the
title, keywords and
description of the
converted web page.
296

SelectPdf Pdf Library for .NET


WebPageSize

The size of the web page


in pixels.

Remarks
After a successful conversion the ConversionResult property is initialized with an
instance of this class.

See Also
SelectPdf Namespace

297

SelectPdf Pdf Library for .NET

HtmlToPdfResult.HtmlToPdfResult Properties
The HtmlToPdfResult type exposes the following members.

Properties
Name
PdfPageCount

PdfPageLastIndex

PdfPageLastRectangle

PdfPageScaleFactor

PdfPageSize

PdfPagesRectangles

WebPageInformation

WebPageSize

Description
The number of pages in
the generated pdf
document.
The index of the pdf page
where the rendering of
the html content ended in
the generated pdf
document.
The size and position of
the html content
rendered on the last page
in the generated pdf
document.
The factor used to scale
the html content to fit the
pdf page.
The size of the page in
the generated pdf
document.
The size and position of
the html content
rendered in all pages of
the pdf document.
Gets an object populated
after conversion with the
title, keywords and
description of the
converted web page.
The size of the web page
in pixels.

See Also
HtmlToPdfResult Class
SelectPdf Namespace

298

SelectPdf Pdf Library for .NET

HtmlToPdfResult.PdfPageCount Property
The number of pages in the generated pdf document.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public int PdfPageCount { get; }
VB
Public ReadOnly Property PdfPageCount As Integer
Get
Property Value
Type: Int32

See Also
HtmlToPdfResult Class
SelectPdf Namespace

299

SelectPdf Pdf Library for .NET

HtmlToPdfResult.PdfPageLastIndex Property
The index of the pdf page where the rendering of the html content ended in the
generated pdf document.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public int PdfPageLastIndex { get; set; }
VB
Public Property PdfPageLastIndex As Integer
Get
Set
Property Value
Type: Int32

Remarks
This information is useful when other pdf elements are added after conversion using
the PdfDocument object.

See Also
HtmlToPdfResult Class
SelectPdf Namespace

300

SelectPdf Pdf Library for .NET

HtmlToPdfResult.PdfPageLastRectangle Property
The size and position of the html content rendered on the last page in the
generated pdf document.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public RectangleF PdfPageLastRectangle { get; set; }
VB
Public Property PdfPageLastRectangle As RectangleF
Get
Set
Property Value
Type: RectangleF

Remarks
This information is useful when other pdf elements are added after conversion using
the PdfDocument object.
Note: The last page is specified by the PdfPageLastIndex property.

See Also
HtmlToPdfResult Class
SelectPdf Namespace

301

SelectPdf Pdf Library for .NET

HtmlToPdfResult.PdfPageScaleFactor Property
The factor used to scale the html content to fit the pdf page.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public float PdfPageScaleFactor { get; }
VB
Public ReadOnly Property PdfPageScaleFactor As Single
Get
Property Value
Type: Single

Remarks
This property offers the factor used to scale the html content when rendered into
the pdf document. When AutoFitWidth is ShrinkOnly or AutoFit, the html content
might be resized to fit the pdf page width if necessary.

See Also
HtmlToPdfResult Class
SelectPdf Namespace

302

SelectPdf Pdf Library for .NET

HtmlToPdfResult.PdfPageSize Property
The size of the page in the generated pdf document.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public SizeF PdfPageSize { get; }
VB
Public ReadOnly Property PdfPageSize As SizeF
Get
Property Value
Type: SizeF

Remarks
This size is in points. 1 point is 1/72 inch.

See Also
HtmlToPdfResult Class
SelectPdf Namespace

303

SelectPdf Pdf Library for .NET

HtmlToPdfResult.PdfPagesRectangles Property
The size and position of the html content rendered in all pages of the pdf document.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public RectangleF[] PdfPagesRectangles { get; }
VB
Public ReadOnly Property PdfPagesRectangles As RectangleF()
Get
Property Value
Type: RectangleF[]

Remarks
This information is useful when other pdf elements are added after conversion using
the PdfDocument object.

See Also
HtmlToPdfResult Class
SelectPdf Namespace

304

SelectPdf Pdf Library for .NET

HtmlToPdfResult.WebPageInformation Property
Gets an object populated after conversion with the title, keywords and description of
the converted web page.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public WebPageInformation WebPageInformation { get; }
VB
Public ReadOnly Property WebPageInformation As WebPageInformation
Get
Property Value
Type: WebPageInformation

Remarks
This information can be used to set the properties of the pdf document after the
conversion.

See Also
HtmlToPdfResult Class
SelectPdf Namespace

305

SelectPdf Pdf Library for .NET

HtmlToPdfResult.WebPageSize Property
The size of the web page in pixels.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public SizeF WebPageSize { get; }
VB
Public ReadOnly Property WebPageSize As SizeF
Get
Property Value
Type: SizeF

Remarks
1px is 1/96 inch at 96 DPI.

See Also
HtmlToPdfResult Class
SelectPdf Namespace

306

SelectPdf Pdf Library for .NET

HtmlToPdfStartupMode Enumeration
Specifies the converter startup mode.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public enum HtmlToPdfStartupMode
VB
Public Enumeration HtmlToPdfStartupMode

Members
Member name
Automatic

Value
0

Manual

Description
The conversion
starts right after
the page loads.
The conversion
starts only when
called from
JavaScript.

See Also
SelectPdf Namespace

307

SelectPdf Pdf Library for .NET

HtmlToPdfViewerPreferences Class
The pdf viewer preferences. Controls how the pdf document appears in a pdf viewer
(like Adobe Reader).

Inheritance Hierarchy
System.Object SelectPdf.HtmlToPdfViewerPreferences
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public class HtmlToPdfViewerPreferences
VB
Public Class HtmlToPdfViewerPreferences
The HtmlToPdfViewerPreferences type exposes the following members.

Constructors
Name
HtmlToPdfViewerPreferen
ces

Description

Name
CenterWindow

Description
Gets or sets a flag
specifying whether to
position the document's
window in the center of
the screen.
Gets or sets a flag
specifying whether the
window's title bar should
display the document title
taken from
PdfDocumentInformation
property.
Gets or sets a flag
specifying whether to
resize the document's
window to fit the size of
the first displayed page.
Gets or sets a flag
specifying whether to
hide the pdf viewer
application's menu bar

Properties

DisplayDocTitle

FitWindow

HideMenuBar

308

SelectPdf Pdf Library for .NET

HideToolbar

HideWindowUI

NonFullScreenPageMode

PageLayout

PageMode

when the document is


active.
Gets or sets a flag
specifying whether to
hide the pdf viewer
application's tool bars
when the document is
active.
Gets or sets a flag
specifying whether to
hide user interface
elements in the
document's window (such
as scroll bars and
navigation controls),
leaving only the
document's contents
displayed.
Gets or sets the
document page mode
when the pdf viewer
application exits the full
screen mode.
Gets or sets the page
layout to be used when
the document is opened.
Gets or sets the
document page mode
when the pdf document is
opened in a pdf viewer.

See Also
SelectPdf Namespace

309

SelectPdf Pdf Library for .NET

HtmlToPdfViewerPreferences Constructor
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public HtmlToPdfViewerPreferences()
VB
Public Sub New

See Also
HtmlToPdfViewerPreferences Class
SelectPdf Namespace

310

SelectPdf Pdf Library for .NET

HtmlToPdfViewerPreferences.HtmlToPdfViewerPreferences
Properties
The HtmlToPdfViewerPreferences type exposes the following members.

Properties
Name
CenterWindow

DisplayDocTitle

FitWindow

HideMenuBar

HideToolbar

HideWindowUI

Description
Gets or sets a flag
specifying whether to
position the document's
window in the center of
the screen.
Gets or sets a flag
specifying whether the
window's title bar should
display the document title
taken from
PdfDocumentInformation
property.
Gets or sets a flag
specifying whether to
resize the document's
window to fit the size of
the first displayed page.
Gets or sets a flag
specifying whether to
hide the pdf viewer
application's menu bar
when the document is
active.
Gets or sets a flag
specifying whether to
hide the pdf viewer
application's tool bars
when the document is
active.
Gets or sets a flag
specifying whether to
hide user interface
elements in the
document's window (such
as scroll bars and
navigation controls),
leaving only the
document's contents
displayed.

311

SelectPdf Pdf Library for .NET


NonFullScreenPageMode

PageLayout

PageMode

Gets or sets the


document page mode
when the pdf viewer
application exits the full
screen mode.
Gets or sets the page
layout to be used when
the document is opened.
Gets or sets the
document page mode
when the pdf document is
opened in a pdf viewer.

See Also
HtmlToPdfViewerPreferences Class
SelectPdf Namespace

312

SelectPdf Pdf Library for .NET

HtmlToPdfViewerPreferences.CenterWindow Property
Gets or sets a flag specifying whether to position the document's window in the
center of the screen.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public bool CenterWindow { get; set; }
VB
Public Property CenterWindow As Boolean
Get
Set
Property Value
Type: Boolean

Remarks
The default value for this property is false.

See Also
HtmlToPdfViewerPreferences Class
SelectPdf Namespace

313

SelectPdf Pdf Library for .NET

HtmlToPdfViewerPreferences.DisplayDocTitle Property
Gets or sets a flag specifying whether the window's title bar should display the
document title taken from PdfDocumentInformation property.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public bool DisplayDocTitle { get; set; }
VB
Public Property DisplayDocTitle As Boolean
Get
Set
Property Value
Type: Boolean

Remarks
The default value for this property is false.

See Also
HtmlToPdfViewerPreferences Class
SelectPdf Namespace

314

SelectPdf Pdf Library for .NET

HtmlToPdfViewerPreferences.FitWindow Property
Gets or sets a flag specifying whether to resize the document's window to fit the
size of the first displayed page.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public bool FitWindow { get; set; }
VB
Public Property FitWindow As Boolean
Get
Set
Property Value
Type: Boolean

Remarks
The default value for this property is false.

See Also
HtmlToPdfViewerPreferences Class
SelectPdf Namespace

315

SelectPdf Pdf Library for .NET

HtmlToPdfViewerPreferences.HideMenuBar Property
Gets or sets a flag specifying whether to hide the pdf viewer application's menu bar
when the document is active.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public bool HideMenuBar { get; set; }
VB
Public Property HideMenuBar As Boolean
Get
Set
Property Value
Type: Boolean

Remarks
The default value for this property is false.

See Also
HtmlToPdfViewerPreferences Class
SelectPdf Namespace

316

SelectPdf Pdf Library for .NET

HtmlToPdfViewerPreferences.HideToolbar Property
Gets or sets a flag specifying whether to hide the pdf viewer application's tool bars
when the document is active.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public bool HideToolbar { get; set; }
VB
Public Property HideToolbar As Boolean
Get
Set
Property Value
Type: Boolean

Remarks
The default value for this property is false.

See Also
HtmlToPdfViewerPreferences Class
SelectPdf Namespace

317

SelectPdf Pdf Library for .NET

HtmlToPdfViewerPreferences.HideWindowUI Property
Gets or sets a flag specifying whether to hide user interface elements in the
document's window (such as scroll bars and navigation controls), leaving only the
document's contents displayed.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public bool HideWindowUI { get; set; }
VB
Public Property HideWindowUI As Boolean
Get
Set
Property Value
Type: Boolean

Remarks
The default value for this property is false.

See Also
HtmlToPdfViewerPreferences Class
SelectPdf Namespace

318

SelectPdf Pdf Library for .NET

HtmlToPdfViewerPreferences.NonFullScreenPageMode
Property
Gets or sets the document page mode when the pdf viewer application exits the full
screen mode.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public PdfViewerFullScreenExitMode NonFullScreenPageMode { get;
set; }
VB
Public Property NonFullScreenPageMode As PdfViewerFullScreenExitMode
Get
Set
Property Value
Type: PdfViewerFullScreenExitMode

Remarks
This property is taken into account only if PageMode is set to FullScreen. Otherwise
it is ignored.
The default value for this property is UseNone.

See Also
HtmlToPdfViewerPreferences Class
SelectPdf Namespace

319

SelectPdf Pdf Library for .NET

HtmlToPdfViewerPreferences.PageLayout Property
Gets or sets the page layout to be used when the document is opened.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public PdfViewerPageLayout PageLayout { get; set; }
VB
Public Property PageLayout As PdfViewerPageLayout
Get
Set
Property Value
Type: PdfViewerPageLayout

Remarks
The default value for this property is OneColumn.

See Also
HtmlToPdfViewerPreferences Class
SelectPdf Namespace

320

SelectPdf Pdf Library for .NET

HtmlToPdfViewerPreferences.PageMode Property
Gets or sets the document page mode when the pdf document is opened in a pdf
viewer.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public PdfViewerPageMode PageMode { get; set; }
VB
Public Property PageMode As PdfViewerPageMode
Get
Set
Property Value
Type: PdfViewerPageMode

Remarks
The default value for this property is UseNone.

See Also
HtmlToPdfViewerPreferences Class
SelectPdf Namespace

321

SelectPdf Pdf Library for .NET

NetworkProxyType Enumeration
The list of available proxy types used by the converter to resolve HTTP requests.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public enum NetworkProxyType
VB
Public Enumeration NetworkProxyType

Members
Member name
Socks5
None
Http
HttpCaching

Value
1
2
3
4

Description
Socks5
None
Http
HttpCaching

See Also
SelectPdf Namespace

322

SelectPdf Pdf Library for .NET

PdfAction Class
Base class for the pdf actions.

Inheritance Hierarchy
System.Object SelectPdf.PdfAction
avaScript

SelectPdf.PdfActionGoTo

SelectPdf.PdfActionJ

Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public abstract class PdfAction
VB
Public MustInherit Class PdfAction
The PdfAction type exposes the following members.

Constructors
Name
PdfAction

Description

Remarks
The pdf document can perform 2 types of actions when it is opened:

PdfActionGoTo
- The pdf document opens at a specific PdfDestination.

PdfActionJavaScript
- The pdf document will run a specific javascript.

See Also
SelectPdf Namespace

323

SelectPdf Pdf Library for .NET

PdfAction Constructor
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
protected PdfAction()
VB
Protected Sub New

See Also
PdfAction Class
SelectPdf Namespace

324

SelectPdf Pdf Library for .NET

PdfActionGoTo Class
Represents a Go To action in a pdf document.

Inheritance Hierarchy
System.Object SelectPdf.PdfAction

SelectPdf.PdfActionGoTo

Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public class PdfActionGoTo : PdfAction
VB
Public Class PdfActionGoTo
Inherits PdfAction
The PdfActionGoTo type exposes the following members.

Constructors
Name
PdfActionGoTo

Description
Creates a Go To action
based on the specified
pdf destination.

Name
Destination

Description
Gets or sets the pdf
destination of the Go To
action.

Properties

See Also
SelectPdf Namespace

325

SelectPdf Pdf Library for .NET

PdfActionGoTo Constructor
Creates a Go To action based on the specified pdf destination.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public PdfActionGoTo(
PdfDestination destination
)
VB
Public Sub New (
destination As PdfDestination
)
Parameters
destination
Type: SelectPdf.PdfDestination
The destination of the Go To action.

See Also
PdfActionGoTo Class
SelectPdf Namespace

326

SelectPdf Pdf Library for .NET

PdfActionGoTo.PdfActionGoTo Properties
The PdfActionGoTo type exposes the following members.

Properties
Name
Destination

Description
Gets or sets the pdf
destination of the Go To
action.

See Also
PdfActionGoTo Class
SelectPdf Namespace

327

SelectPdf Pdf Library for .NET

PdfActionGoTo.Destination Property
Gets or sets the pdf destination of the Go To action.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public PdfDestination Destination { get; set; }
VB
Public Property Destination As PdfDestination
Get
Set
Property Value
Type: PdfDestination

See Also
PdfActionGoTo Class
SelectPdf Namespace

328

SelectPdf Pdf Library for .NET

PdfActionJavaScript Class
Represents a JavaScript action in a pdf document.

Inheritance Hierarchy
System.Object SelectPdf.PdfAction

SelectPdf.PdfActionJavaScript

Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public class PdfActionJavaScript : PdfAction
VB
Public Class PdfActionJavaScript
Inherits PdfAction
The PdfActionJavaScript type exposes the following members.

Constructors
Name
PdfActionJavaScript

Description
Creates a JavaScript
action based on a
JavaScript code.

Name
JavaScript

Description
Gets or sets the
JavaScript code executed
by this action.

Properties

See Also
SelectPdf Namespace

329

SelectPdf Pdf Library for .NET

PdfActionJavaScript Constructor
Creates a JavaScript action based on a JavaScript code.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public PdfActionJavaScript(
string javaScript
)
VB
Public Sub New (
javaScript As String
)
Parameters
javaScript
Type: System.String
The JavaScript code.

See Also
PdfActionJavaScript Class
SelectPdf Namespace

330

SelectPdf Pdf Library for .NET

PdfActionJavaScript.PdfActionJavaScript Properties
The PdfActionJavaScript type exposes the following members.

Properties
Name
JavaScript

Description
Gets or sets the
JavaScript code executed
by this action.

See Also
PdfActionJavaScript Class
SelectPdf Namespace

331

SelectPdf Pdf Library for .NET

PdfActionJavaScript.JavaScript Property
Gets or sets the JavaScript code executed by this action.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public string JavaScript { get; set; }
VB
Public Property JavaScript As String
Get
Set
Property Value
Type: String

See Also
PdfActionJavaScript Class
SelectPdf Namespace

332

SelectPdf Pdf Library for .NET

PdfAnnotationElement Class
Represents a text annotation in a pdf document.

Inheritance Hierarchy
System.Object SelectPdf.PdfPageElement

SelectPdf.PdfAnnotationElement

Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public class PdfAnnotationElement : PdfPageElement
VB
Public Class PdfAnnotationElement
Inherits PdfPageElement
The PdfAnnotationElement type exposes the following members.

Constructors
Name
PdfAnnotationElement

Description
Constructs a text
annotation element.

Name
Icon

Description
Gets or sets the
annotation icon in the pdf
document.
Gets or sets annotation
status.
Gets or sets the
annotation rectangle in
the pdf page.
Gets or sets the
annotation text.

Properties

Open
Rectangle

Text

See Also
SelectPdf Namespace

333

SelectPdf Pdf Library for .NET

PdfAnnotationElement Constructor
Constructs a text annotation element.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public PdfAnnotationElement(
RectangleF rectangle,
string text
)
VB
Public Sub New (
rectangle As RectangleF,
text As String
)
Parameters
rectangle
Type: System.Drawing.RectangleF
The annotation rectangle in the pdf page.
text
Type: System.String
The annotation text.

See Also
PdfAnnotationElement Class
SelectPdf Namespace

334

SelectPdf Pdf Library for .NET

PdfAnnotationElement.PdfAnnotationElement Properties
The PdfAnnotationElement type exposes the following members.

Properties
Name
Icon

Open
Rectangle

Text

Description
Gets or sets the
annotation icon in the pdf
document.
Gets or sets annotation
status.
Gets or sets the
annotation rectangle in
the pdf page.
Gets or sets the
annotation text.

See Also
PdfAnnotationElement Class
SelectPdf Namespace

335

SelectPdf Pdf Library for .NET

PdfAnnotationElement.Icon Property
Gets or sets the annotation icon in the pdf document.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public PdfAnnotationIcon Icon { get; set; }
VB
Public Property Icon As PdfAnnotationIcon
Get
Set
Property Value
Type: PdfAnnotationIcon

See Also
PdfAnnotationElement Class
SelectPdf Namespace

336

SelectPdf Pdf Library for .NET

PdfAnnotationElement.Open Property
Gets or sets annotation status.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public bool Open { get; set; }
VB
Public Property Open As Boolean
Get
Set
Property Value
Type: Boolean

Remarks
Default value is of this property is false and the annotation is closed.

See Also
PdfAnnotationElement Class
SelectPdf Namespace

337

SelectPdf Pdf Library for .NET

PdfAnnotationElement.Rectangle Property
Gets or sets the annotation rectangle in the pdf page.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public RectangleF Rectangle { get; set; }
VB
Public Property Rectangle As RectangleF
Get
Set
Property Value
Type: RectangleF

See Also
PdfAnnotationElement Class
SelectPdf Namespace

338

SelectPdf Pdf Library for .NET

PdfAnnotationElement.Text Property
Gets or sets the annotation text.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public string Text { get; set; }
VB
Public Property Text As String
Get
Set
Property Value
Type: String

See Also
PdfAnnotationElement Class
SelectPdf Namespace

339

SelectPdf Pdf Library for .NET

PdfAnnotationIcon Enumeration
Defines a set of text annotation types.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public enum PdfAnnotationIcon
VB
Public Enumeration PdfAnnotationIcon

Members
Member name
Note
Comment
Help
Insert
Key
NewParagraph
Paragraph

Value
0
1
2
3
4
5
6

Description
Note.
Comment.
Help.
Insert.
Key.
NewParagraph.
Paragraph.

See Also
SelectPdf Namespace

340

SelectPdf Pdf Library for .NET

PdfBezierCurveElement Class
Represents a Bezier curve drawn in a pdf document.

Inheritance Hierarchy
System.Object SelectPdf.PdfPageElement
ezierCurveElement

SelectPdf.PdfElement

SelectPdf.PdfB

Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public class PdfBezierCurveElement : PdfElement
VB
Public Class PdfBezierCurveElement
Inherits PdfElement
The PdfBezierCurveElement type exposes the following members.

Constructors
Name
PdfBezierCurveElement

Description
Constructs a Bezier curve
element.

Name
Rotate

Description
Rotes the coordinate
system before rendering
the pdf element.
(Inherited from
PdfElement.)
Scales the coordinate
system before rendering
the pdf element.
(Inherited from
PdfElement.)
Skews the x and y axis by
an two different angles
before rendering the pdf
element. (Inherited from
PdfElement.)
Translates the coordinate
system before rendering
the pdf element.
(Inherited from
PdfElement.)

Methods

Scale

Skew

Translate

341

SelectPdf Pdf Library for .NET

Properties
Name
BackColor

Blending

ColorSpace

ForeColor

Gradient

LineStyle

Rotated

Scaled

Skewed

Translated

Transparency

Description
Gets or sets the pdf
element background
color. (Inherited from
PdfElement.)
Gets or sets the blending
mode for transparent
rendering of the pdf
element. (Inherited from
PdfElement.)
Gets or sets the color
space for the pdf element
rendering. (Inherited from
PdfElement.)
Gets or sets the pdf
element foreground color.
(Inherited from
PdfElement.)
Gets or sets the gradient
used to fill a shape.
(Inherited from
PdfElement.)
Gets or sets the line style
for pdf elements
rendering lines. (Inherited
from PdfElement.)
A flag to indicate if the
current pdf element was
rotated. (Inherited from
PdfElement.)
A flag to indicate if the
current pdf element was
scaled. (Inherited from
PdfElement.)
A flag to indicate if the
current pdf element was
skewed. (Inherited from
PdfElement.)
A flag to indicate if the
current pdf element was
translated. (Inherited
from PdfElement.)
Gets or sets the pdf
element transparency.

342

SelectPdf Pdf Library for .NET


(Inherited from
PdfElement.)

Remarks
A Bezier curve is specified by 4 points.

See Also
SelectPdf Namespace

343

SelectPdf Pdf Library for .NET

PdfBezierCurveElement Constructor
Constructs a Bezier curve element.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public PdfBezierCurveElement(
float x1,
float y1,
float x2,
float y2,
float x3,
float y3,
float x4,
float y4
)
VB
Public Sub
x1 As
y1 As
x2 As
y2 As
x3 As
y3 As
x4 As
y4 As
)

New (
Single,
Single,
Single,
Single,
Single,
Single,
Single,
Single

Parameters
x1
Type: System.Single
The first point X coordinate.
y1
Type: System.Single
The first point Y coordinate.
x2
Type: System.Single
The second point X coordinate.
y2
Type: System.Single
The second point Y coordinate.
x3

344

SelectPdf Pdf Library for .NET


Type: System.Single
The third point X coordinate.
y3
Type: System.Single
The third point Y coordinate.
x4
Type: System.Single
The fourth point X coordinate.
y4
Type: System.Single
The fourth point Y coordinate.

See Also
PdfBezierCurveElement Class
SelectPdf Namespace

345

SelectPdf Pdf Library for .NET

PdfBezierCurveElement.PdfBezierCurveElement Methods
The PdfBezierCurveElement type exposes the following members.

Methods
Name
Rotate

Scale

Skew

Translate

Description
Rotes the coordinate
system before rendering
the pdf element.
(Inherited from
PdfElement.)
Scales the coordinate
system before rendering
the pdf element.
(Inherited from
PdfElement.)
Skews the x and y axis by
an two different angles
before rendering the pdf
element. (Inherited from
PdfElement.)
Translates the coordinate
system before rendering
the pdf element.
(Inherited from
PdfElement.)

See Also
PdfBezierCurveElement Class
SelectPdf Namespace

346

SelectPdf Pdf Library for .NET

PdfBezierCurveElement.PdfBezierCurveElement
Properties
The PdfBezierCurveElement type exposes the following members.

Properties
Name
BackColor

Blending

ColorSpace

ForeColor

Gradient

LineStyle

Rotated

Scaled

Skewed

Translated

Description
Gets or sets the pdf
element background
color. (Inherited from
PdfElement.)
Gets or sets the blending
mode for transparent
rendering of the pdf
element. (Inherited from
PdfElement.)
Gets or sets the color
space for the pdf element
rendering. (Inherited from
PdfElement.)
Gets or sets the pdf
element foreground color.
(Inherited from
PdfElement.)
Gets or sets the gradient
used to fill a shape.
(Inherited from
PdfElement.)
Gets or sets the line style
for pdf elements
rendering lines. (Inherited
from PdfElement.)
A flag to indicate if the
current pdf element was
rotated. (Inherited from
PdfElement.)
A flag to indicate if the
current pdf element was
scaled. (Inherited from
PdfElement.)
A flag to indicate if the
current pdf element was
skewed. (Inherited from
PdfElement.)
A flag to indicate if the
current pdf element was

347

SelectPdf Pdf Library for .NET

Transparency

translated. (Inherited
from PdfElement.)
Gets or sets the pdf
element transparency.
(Inherited from
PdfElement.)

See Also
PdfBezierCurveElement Class
SelectPdf Namespace

348

SelectPdf Pdf Library for .NET

PdfBlending Enumeration
The blending settings for transparent renderings in a pdf document.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public enum PdfBlending
VB
Public Enumeration PdfBlending

Members
Member name
Normal

Value
0

Multiply

Screen

Overlay

Darken

Lighten

ColorDodge

ColorBurn

Description
Selects the source
color, ignoring the
backdrop.
Multiplies the
backdrop and
source color
values.
Multiplies the
complements of
the backdrop and
source color
values, then
complements the
result.
Multiplies or
screens the colors,
depending on the
backdrop color
value.
Selects the darker
of the backdrop
and source colors.
Selects the lighter
of the backdrop
and source colors.
Brightens the
backdrop color to
reflect the source
color. Painting with
black produces no
changes.
Darkens the

349

SelectPdf Pdf Library for .NET

HardLight

SoftLight

Difference

10

Exclusion

11

Hue

12

Saturation

13

Color

14

Luminosity

15

backdrop color to
reflect the source
color. Painting with
white produces no
change.
Multiplies or
screens the colors,
depending on the
source color value.
Darkens or
lightens the colors,
depending on the
source color value.
Subtracts the
darker of the two
constituent colors
from the lighter
color.
Produces an effect
similar to that of
the Difference
mode but lower in
contrast.
Creates a color
with the hue of the
source color and
the saturation and
luminosity of the
backdrop color.
Creates a color
with the saturation
of the source color
and the hue and
luminosity of the
backdrop color.
Creates a color
with the hue and
saturation of the
source color and
the luminosity of
the backdrop color.
Creates a color
with the luminosity
of the source color
and the hue and
saturation of the
backdrop color.
350

SelectPdf Pdf Library for .NET

See Also
SelectPdf Namespace

351

SelectPdf Pdf Library for .NET

PdfBookmark Class
Represents a bookmark in a pdf document.

Inheritance Hierarchy
System.Object SelectPdf.PdfBookmark
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public class PdfBookmark
VB
Public Class PdfBookmark
The PdfBookmark type exposes the following members.

Properties
Name
ChildNodes
Color
Destination
Parent

Style
Text

Description
Gets the child bookmark
collection.
Gets or sets the
bookmark text color.
Gets or sets the
bookmark destination.
Gets the parent of the
current bookmark or null
if the bookmark has no
parent.
Gets or sets the
bookmark text style.
Gets or sets the
bookmark text.

See Also
SelectPdf Namespace

352

SelectPdf Pdf Library for .NET

PdfBookmark.PdfBookmark Properties
The PdfBookmark type exposes the following members.

Properties
Name
ChildNodes
Color
Destination
Parent

Style
Text

Description
Gets the child bookmark
collection.
Gets or sets the
bookmark text color.
Gets or sets the
bookmark destination.
Gets the parent of the
current bookmark or null
if the bookmark has no
parent.
Gets or sets the
bookmark text style.
Gets or sets the
bookmark text.

See Also
PdfBookmark Class
SelectPdf Namespace

353

SelectPdf Pdf Library for .NET

PdfBookmark.ChildNodes Property
Gets the child bookmark collection.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public PdfBookmarksCollection ChildNodes { get; }
VB
Public ReadOnly Property ChildNodes As PdfBookmarksCollection
Get
Property Value
Type: PdfBookmarksCollection

See Also
PdfBookmark Class
SelectPdf Namespace

354

SelectPdf Pdf Library for .NET

PdfBookmark.Color Property
Gets or sets the bookmark text color.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public PdfColor Color { get; set; }
VB
Public Property Color As PdfColor
Get
Set
Property Value
Type: PdfColor

See Also
PdfBookmark Class
SelectPdf Namespace

355

SelectPdf Pdf Library for .NET

PdfBookmark.Destination Property
Gets or sets the bookmark destination.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public PdfDestination Destination { get; set; }
VB
Public Property Destination As PdfDestination
Get
Set
Property Value
Type: PdfDestination

See Also
PdfBookmark Class
SelectPdf Namespace

356

SelectPdf Pdf Library for .NET

PdfBookmark.Parent Property
Gets the parent of the current bookmark or null if the bookmark has no parent.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public PdfBookmark Parent { get; }
VB
Public ReadOnly Property Parent As PdfBookmark
Get
Property Value
Type: PdfBookmark

See Also
PdfBookmark Class
SelectPdf Namespace

357

SelectPdf Pdf Library for .NET

PdfBookmark.Style Property
Gets or sets the bookmark text style.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public PdfBookmarkStyle Style { get; set; }
VB
Public Property Style As PdfBookmarkStyle
Get
Set
Property Value
Type: PdfBookmarkStyle

See Also
PdfBookmark Class
SelectPdf Namespace

358

SelectPdf Pdf Library for .NET

PdfBookmark.Text Property
Gets or sets the bookmark text.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public string Text { get; set; }
VB
Public Property Text As String
Get
Set
Property Value
Type: String

See Also
PdfBookmark Class
SelectPdf Namespace

359

SelectPdf Pdf Library for .NET

PdfBookmarkOptions Class
Helps defining a set of html elements that will be associated with bookmarks in the
generated pdf document.

Inheritance Hierarchy
System.Object SelectPdf.PdfBookmarkOptions
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public class PdfBookmarkOptions
VB
Public Class PdfBookmarkOptions
The PdfBookmarkOptions type exposes the following members.

Constructors
Name
PdfBookmarkOptions

Description

Name
CssSelectors

Description
Gets or sets the selectors
of the html elements to
be bookmarked. For
example, the selector for
all the H1 elements is
"H1", the selector for all
the elements with the
CSS class name 'myclass'
is "*.myclass" and the
selector for the elements
with the id 'myid' is
"*#myid".

Properties

See Also
SelectPdf Namespace

360

SelectPdf Pdf Library for .NET

PdfBookmarkOptions Constructor
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public PdfBookmarkOptions()
VB
Public Sub New

See Also
PdfBookmarkOptions Class
SelectPdf Namespace

361

SelectPdf Pdf Library for .NET

PdfBookmarkOptions.PdfBookmarkOptions Properties
The PdfBookmarkOptions type exposes the following members.

Properties
Name
CssSelectors

Description
Gets or sets the selectors
of the html elements to
be bookmarked. For
example, the selector for
all the H1 elements is
"H1", the selector for all
the elements with the
CSS class name 'myclass'
is "*.myclass" and the
selector for the elements
with the id 'myid' is
"*#myid".

See Also
PdfBookmarkOptions Class
SelectPdf Namespace

362

SelectPdf Pdf Library for .NET

PdfBookmarkOptions.CssSelectors Property
Gets or sets the selectors of the html elements to be bookmarked. For example, the
selector for all the H1 elements is "H1", the selector for all the elements with the
CSS class name 'myclass' is "*.myclass" and the selector for the elements with the
id 'myid' is "*#myid".
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public string[] CssSelectors { get; set; }
VB
Public Property CssSelectors As String()
Get
Set
Property Value
Type: String[]

See Also
PdfBookmarkOptions Class
SelectPdf Namespace

363

SelectPdf Pdf Library for .NET

PdfBookmarksCollection Class
Represents the collection of bookmarks in a pdf document.

Inheritance Hierarchy
System.Object SelectPdf.PdfBookmarksCollection
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public class PdfBookmarksCollection : IEnumerable
VB
Public Class PdfBookmarksCollection
Implements IEnumerable
The PdfBookmarksCollection type exposes the following members.

Methods
Name
Add
GetEnumerator
Insert

Remove
RemoveAt

Description
Adds a new bookmark to
the bookmarks collection.
Gets the collection
enumerator.
Creates a new bookmark
and inserts it at the
specified zero based
index in the bookmarks
collection.
Removes the specified
pdf bookmark.
Removes the pdf
bookmark at the specified
index in the bookmarks
collection.

Properties
Name
Count

Document

Item

Description
The number of
bookmarks in the pdf
bookmarks collection.
The parent pdf document
of the bookmarks
collection.
Gets or sets the
bookmark at the specified

364

SelectPdf Pdf Library for .NET


zero based index in the
bookmarks collection.

See Also
SelectPdf Namespace

365

SelectPdf Pdf Library for .NET

PdfBookmarksCollection.PdfBookmarksCollection Methods
The PdfBookmarksCollection type exposes the following members.

Methods
Name
Add
GetEnumerator
Insert

Remove
RemoveAt

Description
Adds a new bookmark to
the bookmarks collection.
Gets the collection
enumerator.
Creates a new bookmark
and inserts it at the
specified zero based
index in the bookmarks
collection.
Removes the specified
pdf bookmark.
Removes the pdf
bookmark at the specified
index in the bookmarks
collection.

See Also
PdfBookmarksCollection Class
SelectPdf Namespace

366

SelectPdf Pdf Library for .NET

PdfBookmarksCollection.Add Method
Adds a new bookmark to the bookmarks collection.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public PdfBookmark Add(
string text,
PdfDestination destination
)
VB
Public Function Add (
text As String,
destination As PdfDestination
) As PdfBookmark
Parameters
text
Type: System.String
The bookmark text.
destination
Type: SelectPdf.PdfDestination
The bookmark destination.
Return Value
Type: PdfBookmarkThe newly created pdf bookmark.

See Also
PdfBookmarksCollection Class
SelectPdf Namespace

367

SelectPdf Pdf Library for .NET

PdfBookmarksCollection.GetEnumerator Method
Gets the collection enumerator.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public IEnumerator GetEnumerator()
VB
Public Function GetEnumerator As IEnumerator
Return Value
Type: IEnumeratorThe collection enumerator.
Implements
IEnumerable.GetEnumerator()

See Also
PdfBookmarksCollection Class
SelectPdf Namespace

368

SelectPdf Pdf Library for .NET

PdfBookmarksCollection.Insert Method
Creates a new bookmark and inserts it at the specified zero based index in the
bookmarks collection.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public PdfBookmark Insert(
int index,
string text,
PdfDestination destination
)
VB
Public Function Insert (
index As Integer,
text As String,
destination As PdfDestination
) As PdfBookmark
Parameters
index
Type: System.Int32
The zero based index where to insert the bookmark.
text
Type: System.String
The bookmark text.
destination
Type: SelectPdf.PdfDestination
The bookmark destination.
Return Value
Type: PdfBookmarkThe newly created pdf bookmark.

See Also
PdfBookmarksCollection Class
SelectPdf Namespace

369

SelectPdf Pdf Library for .NET

PdfBookmarksCollection.Remove Method
Removes the specified pdf bookmark.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public void Remove(
PdfBookmark bookmark
)
VB
Public Sub Remove (
bookmark As PdfBookmark
)
Parameters
bookmark
Type: SelectPdf.PdfBookmark
The pdf bookmark to be removed.

See Also
PdfBookmarksCollection Class
SelectPdf Namespace

370

SelectPdf Pdf Library for .NET

PdfBookmarksCollection.RemoveAt Method
Removes the pdf bookmark at the specified index in the bookmarks collection.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public void RemoveAt(
int index
)
VB
Public Sub RemoveAt (
index As Integer
)
Parameters
index
Type: System.Int32
The zero based index of the pdf bookmark to be removed.

See Also
PdfBookmarksCollection Class
SelectPdf Namespace

371

SelectPdf Pdf Library for .NET

PdfBookmarksCollection.PdfBookmarksCollection
Properties
The PdfBookmarksCollection type exposes the following members.

Properties
Name
Count

Document

Item

Description
The number of
bookmarks in the pdf
bookmarks collection.
The parent pdf document
of the bookmarks
collection.
Gets or sets the
bookmark at the specified
zero based index in the
bookmarks collection.

See Also
PdfBookmarksCollection Class
SelectPdf Namespace

372

SelectPdf Pdf Library for .NET

PdfBookmarksCollection.Count Property
The number of bookmarks in the pdf bookmarks collection.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public int Count { get; }
VB
Public ReadOnly Property Count As Integer
Get
Property Value
Type: Int32

See Also
PdfBookmarksCollection Class
SelectPdf Namespace

373

SelectPdf Pdf Library for .NET

PdfBookmarksCollection.Document Property
The parent pdf document of the bookmarks collection.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public PdfDocument Document { get; }
VB
Public ReadOnly Property Document As PdfDocument
Get
Property Value
Type: PdfDocument

See Also
PdfBookmarksCollection Class
SelectPdf Namespace

374

SelectPdf Pdf Library for .NET

PdfBookmarksCollection.Item Property
Gets or sets the bookmark at the specified zero based index in the bookmarks
collection.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public PdfBookmark this[
int index
] { get; }
VB
Public ReadOnly Default Property Item (
index As Integer
) As PdfBookmark
Get
Parameters
index
Type: System.Int32
The zero based bookmark index in the pdf bookmarks collection.
Return Value
Type: PdfBookmarkThe pdf bookmark at the specified index.

See Also
PdfBookmarksCollection Class
SelectPdf Namespace

375

SelectPdf Pdf Library for .NET

PdfBookmarkStyle Enumeration
The pdf bookmark text style.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
[FlagsAttribute]
public enum PdfBookmarkStyle
VB
<FlagsAttribute>
Public Enumeration PdfBookmarkStyle

Members
Member name
Normal
Italic
Bold

Value
0
1
2

Description
Normal text style.
The text is italic.
The text is bold.

See Also
SelectPdf Namespace

376

SelectPdf Pdf Library for .NET

PdfCanvas Class
Base class for classes that can render pdf page elements.

Inheritance Hierarchy
System.Object SelectPdf.PdfCanvas

SelectPdf.PdfPage

SelectPdf.PdfTemplate

Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public abstract class PdfCanvas
VB
Public MustInherit Class PdfCanvas
The PdfCanvas type exposes the following members.

Constructors
Name
PdfCanvas

Description

Name
Add

Description
Adds a pdf page element
to the canvas.
Measures the size of the
specified string when
rendered with the
specified font.

Methods

MeasureString

Properties
Name
ClientRectangle

Description
Gets the drawable area of
the canvas. The margins,
pdf document header and
footer are excluded.

Remarks
PdfCanvas
is the base class for PdfPage and PdfTemplate. PdfPage should be used to add
elements to the pdf document only in a certain page at a certain position.
PdfTemplate should be used to add elements to the pdf document that will appear in
more than one page.

377

SelectPdf Pdf Library for .NET

See Also
SelectPdf Namespace

378

SelectPdf Pdf Library for .NET

PdfCanvas Constructor
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
protected PdfCanvas()
VB
Protected Sub New

See Also
PdfCanvas Class
SelectPdf Namespace

379

SelectPdf Pdf Library for .NET

PdfCanvas.PdfCanvas Methods
The PdfCanvas type exposes the following members.

Methods
Name
Add
MeasureString

Description
Adds a pdf page element
to the canvas.
Measures the size of the
specified string when
rendered with the
specified font.

See Also
PdfCanvas Class
SelectPdf Namespace

380

SelectPdf Pdf Library for .NET

PdfCanvas.Add Method
Adds a pdf page element to the canvas.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public abstract PdfRenderingResult Add(
PdfPageElement element
)
VB
Public MustOverride Function Add (
element As PdfPageElement
) As PdfRenderingResult
Parameters
element
Type: SelectPdf.PdfPageElement
The page element to be rendered
Return Value
Type: PdfRenderingResultThe result of adding the element

See Also
PdfCanvas Class
SelectPdf Namespace

381

SelectPdf Pdf Library for .NET

PdfCanvas.MeasureString Method
Measures the size of the specified string when rendered with the specified font.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public SizeF MeasureString(
string text,
PdfFont font
)
VB
Public Function MeasureString (
text As String,
font As PdfFont
) As SizeF
Parameters
text
Type: System.String
String to measure.
font
Type: SelectPdf.PdfFont
The font used to render the string.
Return Value
Type: SizeFThe size of the string.

See Also
PdfCanvas Class
SelectPdf Namespace

382

SelectPdf Pdf Library for .NET

PdfCanvas.PdfCanvas Properties
The PdfCanvas type exposes the following members.

Properties
Name
ClientRectangle

Description
Gets the drawable area of
the canvas. The margins,
pdf document header and
footer are excluded.

See Also
PdfCanvas Class
SelectPdf Namespace

383

SelectPdf Pdf Library for .NET

PdfCanvas.ClientRectangle Property
Gets the drawable area of the canvas. The margins, pdf document header and
footer are excluded.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public RectangleF ClientRectangle { get; }
VB
Public ReadOnly Property ClientRectangle As RectangleF
Get
Property Value
Type: RectangleF

See Also
PdfCanvas Class
SelectPdf Namespace

384

SelectPdf Pdf Library for .NET

PdfCertificateSystem Enumeration
The types of system certificates stores.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public enum PdfCertificateSystem
VB
Public Enumeration PdfCertificateSystem

Members
Member name
PersonalCertific
ates

Value
0

RootCertification
Authorities

CertificationAuth
orities

SoftwarePublish
erCertificates

Description
A certificate store
that holds
certificates with
associated private
keys (Personal
Certificates store).
Root certificates
(Trusted Root
Certification
Authorities store).
Certification
authority
certificates
(Intermediate
Certification
Authorities store).
Software Publisher
Certificates store.

See Also
SelectPdf Namespace

385

SelectPdf Pdf Library for .NET

PdfCircleElement Class
Represents a circle shape drawn in a pdf document.

Inheritance Hierarchy
System.Object SelectPdf.PdfPageElement SelectPdf.PdfElement
ipseElement
SelectPdf.PdfCircleElement

SelectPdf.PdfEll

Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public class PdfCircleElement : PdfEllipseElement
VB
Public Class PdfCircleElement
Inherits PdfEllipseElement
The PdfCircleElement type exposes the following members.

Constructors
Name
PdfCircleElement

Description
Constructs a circle
element.

Name
Rotate

Description
Rotes the coordinate
system before rendering
the pdf element.
(Inherited from
PdfElement.)
Scales the coordinate
system before rendering
the pdf element.
(Inherited from
PdfElement.)
Skews the x and y axis by
an two different angles
before rendering the pdf
element. (Inherited from
PdfElement.)
Translates the coordinate
system before rendering
the pdf element.
(Inherited from
PdfElement.)

Methods

Scale

Skew

Translate

386

SelectPdf Pdf Library for .NET

Properties
Name
BackColor

Blending

ColorSpace

ForeColor

Gradient

LineStyle

Rotated

Scaled

Skewed

Translated

Transparency

Description
Gets or sets the pdf
element background
color. (Inherited from
PdfElement.)
Gets or sets the blending
mode for transparent
rendering of the pdf
element. (Inherited from
PdfElement.)
Gets or sets the color
space for the pdf element
rendering. (Inherited from
PdfElement.)
Gets or sets the pdf
element foreground color.
(Inherited from
PdfElement.)
Gets or sets the gradient
used to fill a shape.
(Inherited from
PdfElement.)
Gets or sets the line style
for pdf elements
rendering lines. (Inherited
from PdfElement.)
A flag to indicate if the
current pdf element was
rotated. (Inherited from
PdfElement.)
A flag to indicate if the
current pdf element was
scaled. (Inherited from
PdfElement.)
A flag to indicate if the
current pdf element was
skewed. (Inherited from
PdfElement.)
A flag to indicate if the
current pdf element was
translated. (Inherited
from PdfElement.)
Gets or sets the pdf
element transparency.

387

SelectPdf Pdf Library for .NET


(Inherited from
PdfElement.)

See Also
SelectPdf Namespace

388

SelectPdf Pdf Library for .NET

PdfCircleElement Constructor
Constructs a circle element.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public PdfCircleElement(
float x,
float y,
float radius
)
VB
Public Sub New (
x As Single,
y As Single,
radius As Single
)
Parameters
x
Type: System.Single
The X coordinate where the circle will be rendered.
y
Type: System.Single
The Y coordinate where the circle will be rendered.
radius
Type: System.Single
The circle radius.

See Also
PdfCircleElement Class
SelectPdf Namespace

389

SelectPdf Pdf Library for .NET

PdfCircleElement.PdfCircleElement Methods
The PdfCircleElement type exposes the following members.

Methods
Name
Rotate

Scale

Skew

Translate

Description
Rotes the coordinate
system before rendering
the pdf element.
(Inherited from
PdfElement.)
Scales the coordinate
system before rendering
the pdf element.
(Inherited from
PdfElement.)
Skews the x and y axis by
an two different angles
before rendering the pdf
element. (Inherited from
PdfElement.)
Translates the coordinate
system before rendering
the pdf element.
(Inherited from
PdfElement.)

See Also
PdfCircleElement Class
SelectPdf Namespace

390

SelectPdf Pdf Library for .NET

PdfCircleElement.PdfCircleElement Properties
The PdfCircleElement type exposes the following members.

Properties
Name
BackColor

Blending

ColorSpace

ForeColor

Gradient

LineStyle

Rotated

Scaled

Skewed

Translated

Description
Gets or sets the pdf
element background
color. (Inherited from
PdfElement.)
Gets or sets the blending
mode for transparent
rendering of the pdf
element. (Inherited from
PdfElement.)
Gets or sets the color
space for the pdf element
rendering. (Inherited from
PdfElement.)
Gets or sets the pdf
element foreground color.
(Inherited from
PdfElement.)
Gets or sets the gradient
used to fill a shape.
(Inherited from
PdfElement.)
Gets or sets the line style
for pdf elements
rendering lines. (Inherited
from PdfElement.)
A flag to indicate if the
current pdf element was
rotated. (Inherited from
PdfElement.)
A flag to indicate if the
current pdf element was
scaled. (Inherited from
PdfElement.)
A flag to indicate if the
current pdf element was
skewed. (Inherited from
PdfElement.)
A flag to indicate if the
current pdf element was
translated. (Inherited
from PdfElement.)
391

SelectPdf Pdf Library for .NET


Transparency

Gets or sets the pdf


element transparency.
(Inherited from
PdfElement.)

See Also
PdfCircleElement Class
SelectPdf Namespace

392

SelectPdf Pdf Library for .NET

PdfColor Class
Represents a pdf color.

Inheritance Hierarchy
System.Object SelectPdf.PdfColor
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public class PdfColor
VB
Public Class PdfColor
The PdfColor type exposes the following members.

Constructors
Name
PdfColor(Color)
PdfColor(Single)

PdfColor(Byte, Byte, Byte)


PdfColor(Single, Single,
Single, Single)

Description
Creates a pdf color based
on a .NET system color.
Creates a Gray-scale
color based on a gray
level.
Creates a pdf color based
on RGB values.
Creates a pdf color based
on GMYK values.

Operators
Name
Implicit(Color to PdfColor)

Implicit(PdfColor to Color)

Description
Implicit operator to
convert a .NET system
color to a pdf color.
Implicit operator to
convert a pdf color to a
.NET system color.

Properties
Name
Blue
Cyan
Empty
Gray

Description
Gets or sets the Blue
value of this pdf color.
Gets or sets the Cyan
value of this pdf color.
An empty color.
Gets or sets the Gray

393

SelectPdf Pdf Library for .NET

Green
Key
Magenta
Red
Yellow

level of this pdf color.


Gets or sets the Green
value of this pdf color.
Gets or sets the Key value
of this pdf color.
Gets or sets the Magenta
value of this pdf color.
Gets or sets the Red
value of this pdf color.
Gets or sets the Yellow
value of this pdf color.

See Also
SelectPdf Namespace

394

SelectPdf Pdf Library for .NET

PdfColor Constructor
Overload List
Name
PdfColor(Color)
PdfColor(Single)

PdfColor(Byte, Byte, Byte)


PdfColor(Single, Single,
Single, Single)

Description
Creates a pdf color based
on a .NET system color.
Creates a Gray-scale
color based on a gray
level.
Creates a pdf color based
on RGB values.
Creates a pdf color based
on GMYK values.

See Also
PdfColor Class
SelectPdf Namespace

395

SelectPdf Pdf Library for .NET

PdfColor Constructor (Color)


Creates a pdf color based on a .NET system color.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public PdfColor(
Color color
)
VB
Public Sub New (
color As Color
)
Parameters
color
Type: System.Drawing.Color
The .NET system color.

See Also
PdfColor Class
PdfColor Overload
SelectPdf Namespace

396

SelectPdf Pdf Library for .NET

PdfColor Constructor (Single)


Creates a Gray-scale color based on a gray level.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public PdfColor(
float gray
)
VB
Public Sub New (
gray As Single
)
Parameters
gray
Type: System.Single
A value between 0 and 1 to specify the gray level.

See Also
PdfColor Class
PdfColor Overload
SelectPdf Namespace

397

SelectPdf Pdf Library for .NET

PdfColor Constructor (Byte, Byte, Byte)


Creates a pdf color based on RGB values.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public PdfColor(
byte red,
byte green,
byte blue
)
VB
Public Sub New (
red As Byte,
green As Byte,
blue As Byte
)
Parameters
red
Type: System.Byte
Red value.
green
Type: System.Byte
Green value.
blue
Type: System.Byte
Blue value.

See Also
PdfColor Class
PdfColor Overload
SelectPdf Namespace

398

SelectPdf Pdf Library for .NET

PdfColor Constructor (Single, Single, Single, Single)


Creates a pdf color based on GMYK values.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public PdfColor(
float cyan,
float magenta,
float yellow,
float key
)
VB
Public Sub New (
cyan As Single,
magenta As Single,
yellow As Single,
key As Single
)
Parameters
cyan
Type: System.Single
Cyan value.
magenta
Type: System.Single
Magenta value.
yellow
Type: System.Single
Yellow value.
key
Type: System.Single
Key value.

See Also
PdfColor Class
PdfColor Overload
SelectPdf Namespace

399

SelectPdf Pdf Library for .NET

PdfColor.PdfColor Type Conversions


Operators
Name
Implicit(Color to PdfColor)

Implicit(PdfColor to Color)

Description
Implicit operator to
convert a .NET system
color to a pdf color.
Implicit operator to
convert a pdf color to a
.NET system color.

See Also
PdfColor Class
SelectPdf Namespace

400

SelectPdf Pdf Library for .NET

PdfColor Implicit Conversion Operators


Overload List
Name
Implicit(Color to PdfColor)

Implicit(PdfColor to Color)

Description
Implicit operator to
convert a .NET system
color to a pdf color.
Implicit operator to
convert a pdf color to a
.NET system color.

See Also
PdfColor Class
SelectPdf Namespace

401

SelectPdf Pdf Library for .NET

PdfColor Implicit Conversion (Color to PdfColor)


Implicit operator to convert a .NET system color to a pdf color.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public static implicit operator PdfColor (
Color color
)
VB
Public Shared Widening Operator CType (
color As Color
) As PdfColor
Parameters
color
Type: System.Drawing.Color
The .NET system color.
Return Value
Type: PdfColorThe pdf color.

See Also
PdfColor Class
Implicit Overload
SelectPdf Namespace

402

SelectPdf Pdf Library for .NET

PdfColor Implicit Conversion (PdfColor to Color)


Implicit operator to convert a pdf color to a .NET system color.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public static implicit operator Color (
PdfColor color
)
VB
Public Shared Widening Operator CType (
color As PdfColor
) As Color
Parameters
color
Type: SelectPdf.PdfColor
The pdf color.
Return Value
Type: ColorThe .NET system color.

See Also
PdfColor Class
Implicit Overload
SelectPdf Namespace

403

SelectPdf Pdf Library for .NET

PdfColor.PdfColor Properties
The PdfColor type exposes the following members.

Properties
Name
Blue
Cyan
Empty
Gray
Green
Key
Magenta
Red
Yellow

Description
Gets or sets the Blue
value of this pdf color.
Gets or sets the Cyan
value of this pdf color.
An empty color.
Gets or sets the Gray
level of this pdf color.
Gets or sets the Green
value of this pdf color.
Gets or sets the Key value
of this pdf color.
Gets or sets the Magenta
value of this pdf color.
Gets or sets the Red
value of this pdf color.
Gets or sets the Yellow
value of this pdf color.

See Also
PdfColor Class
SelectPdf Namespace

404

SelectPdf Pdf Library for .NET

PdfColor.Blue Property
Gets or sets the Blue value of this pdf color.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public byte Blue { get; set; }
VB
Public Property Blue As Byte
Get
Set
Property Value
Type: Byte

See Also
PdfColor Class
SelectPdf Namespace

405

SelectPdf Pdf Library for .NET

PdfColor.Cyan Property
Gets or sets the Cyan value of this pdf color.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public float Cyan { get; set; }
VB
Public Property Cyan As Single
Get
Set
Property Value
Type: Single

See Also
PdfColor Class
SelectPdf Namespace

406

SelectPdf Pdf Library for .NET

PdfColor.Empty Property
An empty color.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public static PdfColor Empty { get; }
VB
Public Shared ReadOnly Property Empty As PdfColor
Get
Property Value
Type: PdfColor

See Also
PdfColor Class
SelectPdf Namespace

407

SelectPdf Pdf Library for .NET

PdfColor.Gray Property
Gets or sets the Gray level of this pdf color.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public float Gray { get; set; }
VB
Public Property Gray As Single
Get
Set
Property Value
Type: Single

See Also
PdfColor Class
SelectPdf Namespace

408

SelectPdf Pdf Library for .NET

PdfColor.Green Property
Gets or sets the Green value of this pdf color.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public byte Green { get; set; }
VB
Public Property Green As Byte
Get
Set
Property Value
Type: Byte

See Also
PdfColor Class
SelectPdf Namespace

409

SelectPdf Pdf Library for .NET

PdfColor.Key Property
Gets or sets the Key value of this pdf color.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public float Key { get; set; }
VB
Public Property Key As Single
Get
Set
Property Value
Type: Single

See Also
PdfColor Class
SelectPdf Namespace

410

SelectPdf Pdf Library for .NET

PdfColor.Magenta Property
Gets or sets the Magenta value of this pdf color.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public float Magenta { get; set; }
VB
Public Property Magenta As Single
Get
Set
Property Value
Type: Single

See Also
PdfColor Class
SelectPdf Namespace

411

SelectPdf Pdf Library for .NET

PdfColor.Red Property
Gets or sets the Red value of this pdf color.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public byte Red { get; set; }
VB
Public Property Red As Byte
Get
Set
Property Value
Type: Byte

See Also
PdfColor Class
SelectPdf Namespace

412

SelectPdf Pdf Library for .NET

PdfColor.Yellow Property
Gets or sets the Yellow value of this pdf color.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public float Yellow { get; set; }
VB
Public Property Yellow As Single
Get
Set
Property Value
Type: Single

See Also
PdfColor Class
SelectPdf Namespace

413

SelectPdf Pdf Library for .NET

PdfColorSpace Enumeration
The list of possible color spaces for the pdf document.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public enum PdfColorSpace
VB
Public Enumeration PdfColorSpace

Members
Member name
RGB
CMYK
GrayScale

Value
0
1
2

Description
RGB color space.
CMYK color space.
Gray scale color
space.

See Also
SelectPdf Namespace

414

SelectPdf Pdf Library for .NET

PdfCompressionLevel Enumeration
The pdf document compression level.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public enum PdfCompressionLevel
VB
Public Enumeration PdfCompressionLevel

Members
Member name
NoCompression
Normal

Value
0
1

Best

Description
No compression.
Normal
compression level.
Best compression.
Produces the
smallest pdf
document but it
takes longer to
compress it.

See Also
SelectPdf Namespace

415

SelectPdf Pdf Library for .NET

PdfCustomPageSize Class
The pdf page size expressed in points.

Inheritance Hierarchy
System.Object SelectPdf.PdfCustomPageSize
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public sealed class PdfCustomPageSize
VB
Public NotInheritable Class PdfCustomPageSize
The PdfCustomPageSize type exposes the following members.

Constructors
Name
PdfCustomPageSize()
PdfCustomPageSize(Singl
e, Single)

Description
Default constructor
constructs a A4 page size
Constructs a custom page
size

Name
A0
A1
A10
A2
A3
A4
A5
A6
A7
A8
A9
ArchA
ArchB
ArchC
ArchD
ArchE
B0
B1
B2
B3
B4

Description
A0
A1
A10
A2
A3
A4
A5
A6
A7
A8
A9
ArchA
ArchB
ArchC
ArchD
ArchE
B0
B1
B2
B3
B4

Fields

416

SelectPdf Pdf Library for .NET


B5
Flsa
HalfLetter
Ledger
Legal
Letter
Letter11x17
Note

B5
Flsa
HalfLetter
Ledger
Legal
Letter
11x17
Note

Name
Height

Description
Gets or sets the page
height
Gets or sets the page
width

Properties

Width

Remarks
1 point is 1/72 inch.

See Also
SelectPdf Namespace

417

SelectPdf Pdf Library for .NET

PdfCustomPageSize Constructor
Overload List
Name
PdfCustomPageSize()
PdfCustomPageSize(Singl
e, Single)

Description
Default constructor
constructs a A4 page size
Constructs a custom page
size

See Also
PdfCustomPageSize Class
SelectPdf Namespace

418

SelectPdf Pdf Library for .NET

PdfCustomPageSize Constructor
Default constructor constructs a A4 page size
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public PdfCustomPageSize()
VB
Public Sub New

See Also
PdfCustomPageSize Class
PdfCustomPageSize Overload
SelectPdf Namespace

419

SelectPdf Pdf Library for .NET

PdfCustomPageSize Constructor (Single, Single)


Constructs a custom page size
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public PdfCustomPageSize(
float width,
float height
)
VB
Public Sub New (
width As Single,
height As Single
)
Parameters
width
Type: System.Single
The page width in points
height
Type: System.Single
The page height in points

See Also
PdfCustomPageSize Class
PdfCustomPageSize Overload
SelectPdf Namespace

420

SelectPdf Pdf Library for .NET

PdfCustomPageSize.PdfCustomPageSize Fields
The PdfCustomPageSize type exposes the following members.

Fields
Name
A0
A1
A10
A2
A3
A4
A5
A6
A7
A8
A9
ArchA
ArchB
ArchC
ArchD
ArchE
B0
B1
B2
B3
B4
B5
Flsa
HalfLetter
Ledger
Legal
Letter
Letter11x17
Note

Description
A0
A1
A10
A2
A3
A4
A5
A6
A7
A8
A9
ArchA
ArchB
ArchC
ArchD
ArchE
B0
B1
B2
B3
B4
B5
Flsa
HalfLetter
Ledger
Legal
Letter
11x17
Note

See Also
PdfCustomPageSize Class
SelectPdf Namespace

421

SelectPdf Pdf Library for .NET

PdfCustomPageSize.A0 Field
A0
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public static readonly PdfCustomPageSize A0
VB
Public Shared ReadOnly A0 As PdfCustomPageSize
Field Value
Type: PdfCustomPageSize

See Also
PdfCustomPageSize Class
SelectPdf Namespace

422

SelectPdf Pdf Library for .NET

PdfCustomPageSize.A1 Field
A1
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public static readonly PdfCustomPageSize A1
VB
Public Shared ReadOnly A1 As PdfCustomPageSize
Field Value
Type: PdfCustomPageSize

See Also
PdfCustomPageSize Class
SelectPdf Namespace

423

SelectPdf Pdf Library for .NET

PdfCustomPageSize.A10 Field
A10
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public static readonly PdfCustomPageSize A10
VB
Public Shared ReadOnly A10 As PdfCustomPageSize
Field Value
Type: PdfCustomPageSize

See Also
PdfCustomPageSize Class
SelectPdf Namespace

424

SelectPdf Pdf Library for .NET

PdfCustomPageSize.A2 Field
A2
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public static readonly PdfCustomPageSize A2
VB
Public Shared ReadOnly A2 As PdfCustomPageSize
Field Value
Type: PdfCustomPageSize

See Also
PdfCustomPageSize Class
SelectPdf Namespace

425

SelectPdf Pdf Library for .NET

PdfCustomPageSize.A3 Field
A3
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public static readonly PdfCustomPageSize A3
VB
Public Shared ReadOnly A3 As PdfCustomPageSize
Field Value
Type: PdfCustomPageSize

See Also
PdfCustomPageSize Class
SelectPdf Namespace

426

SelectPdf Pdf Library for .NET

PdfCustomPageSize.A4 Field
A4
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public static readonly PdfCustomPageSize A4
VB
Public Shared ReadOnly A4 As PdfCustomPageSize
Field Value
Type: PdfCustomPageSize

See Also
PdfCustomPageSize Class
SelectPdf Namespace

427

SelectPdf Pdf Library for .NET

PdfCustomPageSize.A5 Field
A5
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public static readonly PdfCustomPageSize A5
VB
Public Shared ReadOnly A5 As PdfCustomPageSize
Field Value
Type: PdfCustomPageSize

See Also
PdfCustomPageSize Class
SelectPdf Namespace

428

SelectPdf Pdf Library for .NET

PdfCustomPageSize.A6 Field
A6
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public static readonly PdfCustomPageSize A6
VB
Public Shared ReadOnly A6 As PdfCustomPageSize
Field Value
Type: PdfCustomPageSize

See Also
PdfCustomPageSize Class
SelectPdf Namespace

429

SelectPdf Pdf Library for .NET

PdfCustomPageSize.A7 Field
A7
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public static readonly PdfCustomPageSize A7
VB
Public Shared ReadOnly A7 As PdfCustomPageSize
Field Value
Type: PdfCustomPageSize

See Also
PdfCustomPageSize Class
SelectPdf Namespace

430

SelectPdf Pdf Library for .NET

PdfCustomPageSize.A8 Field
A8
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public static readonly PdfCustomPageSize A8
VB
Public Shared ReadOnly A8 As PdfCustomPageSize
Field Value
Type: PdfCustomPageSize

See Also
PdfCustomPageSize Class
SelectPdf Namespace

431

SelectPdf Pdf Library for .NET

PdfCustomPageSize.A9 Field
A9
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public static readonly PdfCustomPageSize A9
VB
Public Shared ReadOnly A9 As PdfCustomPageSize
Field Value
Type: PdfCustomPageSize

See Also
PdfCustomPageSize Class
SelectPdf Namespace

432

SelectPdf Pdf Library for .NET

PdfCustomPageSize.ArchA Field
ArchA
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public static readonly PdfCustomPageSize ArchA
VB
Public Shared ReadOnly ArchA As PdfCustomPageSize
Field Value
Type: PdfCustomPageSize

See Also
PdfCustomPageSize Class
SelectPdf Namespace

433

SelectPdf Pdf Library for .NET

PdfCustomPageSize.ArchB Field
ArchB
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public static readonly PdfCustomPageSize ArchB
VB
Public Shared ReadOnly ArchB As PdfCustomPageSize
Field Value
Type: PdfCustomPageSize

See Also
PdfCustomPageSize Class
SelectPdf Namespace

434

SelectPdf Pdf Library for .NET

PdfCustomPageSize.ArchC Field
ArchC
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public static readonly PdfCustomPageSize ArchC
VB
Public Shared ReadOnly ArchC As PdfCustomPageSize
Field Value
Type: PdfCustomPageSize

See Also
PdfCustomPageSize Class
SelectPdf Namespace

435

SelectPdf Pdf Library for .NET

PdfCustomPageSize.ArchD Field
ArchD
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public static readonly PdfCustomPageSize ArchD
VB
Public Shared ReadOnly ArchD As PdfCustomPageSize
Field Value
Type: PdfCustomPageSize

See Also
PdfCustomPageSize Class
SelectPdf Namespace

436

SelectPdf Pdf Library for .NET

PdfCustomPageSize.ArchE Field
ArchE
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public static readonly PdfCustomPageSize ArchE
VB
Public Shared ReadOnly ArchE As PdfCustomPageSize
Field Value
Type: PdfCustomPageSize

See Also
PdfCustomPageSize Class
SelectPdf Namespace

437

SelectPdf Pdf Library for .NET

PdfCustomPageSize.B0 Field
B0
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public static readonly PdfCustomPageSize B0
VB
Public Shared ReadOnly B0 As PdfCustomPageSize
Field Value
Type: PdfCustomPageSize

See Also
PdfCustomPageSize Class
SelectPdf Namespace

438

SelectPdf Pdf Library for .NET

PdfCustomPageSize.B1 Field
B1
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public static readonly PdfCustomPageSize B1
VB
Public Shared ReadOnly B1 As PdfCustomPageSize
Field Value
Type: PdfCustomPageSize

See Also
PdfCustomPageSize Class
SelectPdf Namespace

439

SelectPdf Pdf Library for .NET

PdfCustomPageSize.B2 Field
B2
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public static readonly PdfCustomPageSize B2
VB
Public Shared ReadOnly B2 As PdfCustomPageSize
Field Value
Type: PdfCustomPageSize

See Also
PdfCustomPageSize Class
SelectPdf Namespace

440

SelectPdf Pdf Library for .NET

PdfCustomPageSize.B3 Field
B3
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public static readonly PdfCustomPageSize B3
VB
Public Shared ReadOnly B3 As PdfCustomPageSize
Field Value
Type: PdfCustomPageSize

See Also
PdfCustomPageSize Class
SelectPdf Namespace

441

SelectPdf Pdf Library for .NET

PdfCustomPageSize.B4 Field
B4
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public static readonly PdfCustomPageSize B4
VB
Public Shared ReadOnly B4 As PdfCustomPageSize
Field Value
Type: PdfCustomPageSize

See Also
PdfCustomPageSize Class
SelectPdf Namespace

442

SelectPdf Pdf Library for .NET

PdfCustomPageSize.B5 Field
B5
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public static readonly PdfCustomPageSize B5
VB
Public Shared ReadOnly B5 As PdfCustomPageSize
Field Value
Type: PdfCustomPageSize

See Also
PdfCustomPageSize Class
SelectPdf Namespace

443

SelectPdf Pdf Library for .NET

PdfCustomPageSize.Flsa Field
Flsa
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public static readonly PdfCustomPageSize Flsa
VB
Public Shared ReadOnly Flsa As PdfCustomPageSize
Field Value
Type: PdfCustomPageSize

See Also
PdfCustomPageSize Class
SelectPdf Namespace

444

SelectPdf Pdf Library for .NET

PdfCustomPageSize.HalfLetter Field
HalfLetter
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public static readonly PdfCustomPageSize HalfLetter
VB
Public Shared ReadOnly HalfLetter As PdfCustomPageSize
Field Value
Type: PdfCustomPageSize

See Also
PdfCustomPageSize Class
SelectPdf Namespace

445

SelectPdf Pdf Library for .NET

PdfCustomPageSize.Ledger Field
Ledger
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public static readonly PdfCustomPageSize Ledger
VB
Public Shared ReadOnly Ledger As PdfCustomPageSize
Field Value
Type: PdfCustomPageSize

See Also
PdfCustomPageSize Class
SelectPdf Namespace

446

SelectPdf Pdf Library for .NET

PdfCustomPageSize.Legal Field
Legal
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public static readonly PdfCustomPageSize Legal
VB
Public Shared ReadOnly Legal As PdfCustomPageSize
Field Value
Type: PdfCustomPageSize

See Also
PdfCustomPageSize Class
SelectPdf Namespace

447

SelectPdf Pdf Library for .NET

PdfCustomPageSize.Letter Field
Letter
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public static readonly PdfCustomPageSize Letter
VB
Public Shared ReadOnly Letter As PdfCustomPageSize
Field Value
Type: PdfCustomPageSize

See Also
PdfCustomPageSize Class
SelectPdf Namespace

448

SelectPdf Pdf Library for .NET

PdfCustomPageSize.Letter11x17 Field
11x17
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public static readonly PdfCustomPageSize Letter11x17
VB
Public Shared ReadOnly Letter11x17 As PdfCustomPageSize
Field Value
Type: PdfCustomPageSize

See Also
PdfCustomPageSize Class
SelectPdf Namespace

449

SelectPdf Pdf Library for .NET

PdfCustomPageSize.Note Field
Note
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public static readonly PdfCustomPageSize Note
VB
Public Shared ReadOnly Note As PdfCustomPageSize
Field Value
Type: PdfCustomPageSize

See Also
PdfCustomPageSize Class
SelectPdf Namespace

450

SelectPdf Pdf Library for .NET

PdfCustomPageSize.PdfCustomPageSize Properties
The PdfCustomPageSize type exposes the following members.

Properties
Name
Height
Width

Description
Gets or sets the page
height
Gets or sets the page
width

See Also
PdfCustomPageSize Class
SelectPdf Namespace

451

SelectPdf Pdf Library for .NET

PdfCustomPageSize.Height Property
Gets or sets the page height
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public float Height { get; set; }
VB
Public Property Height As Single
Get
Set
Property Value
Type: Single

See Also
PdfCustomPageSize Class
SelectPdf Namespace

452

SelectPdf Pdf Library for .NET

PdfCustomPageSize.Width Property
Gets or sets the page width
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public float Width { get; set; }
VB
Public Property Width As Single
Get
Set
Property Value
Type: Single

See Also
PdfCustomPageSize Class
SelectPdf Namespace

453

SelectPdf Pdf Library for .NET

PdfDestination Class
Represents a destination in a pdf document.

Inheritance Hierarchy
System.Object SelectPdf.PdfDestination
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public class PdfDestination
VB
Public Class PdfDestination
The PdfDestination type exposes the following members.

Constructors
Name
PdfDestination(PdfPage)

PdfDestination(PdfPage,
PointF)

PdfDestination(PdfPage,
PointF,
PdfDestinationFitMode)

Description
Constructs a pdf
destination to the
specified pdf page.
Constructs a pdf
destination to the
specified location in the
specified page.
Constructs a destination
to the specified location
in the specified page and
with the specified fit
mode in the destination
page.

Properties
Name
FitMode

Location

Page
ZoomFactor

Description
Gets or sets the auto-fit
mode in the destination
page.
Gets or sets the location
point in the destination
page.
Gets or sets the
destination page.
Gets or sets the zoom
factor of the destination
page when viewed in a

454

SelectPdf Pdf Library for .NET


pdf viewer.

Remarks
The pdf destination is used by links, bookmarks or open actions to jump at a
specified position in the pdf document.

See Also
SelectPdf Namespace

455

SelectPdf Pdf Library for .NET

PdfDestination Constructor
Overload List
Name
PdfDestination(PdfPage)

PdfDestination(PdfPage,
PointF)

PdfDestination(PdfPage,
PointF,
PdfDestinationFitMode)

Description
Constructs a pdf
destination to the
specified pdf page.
Constructs a pdf
destination to the
specified location in the
specified page.
Constructs a destination
to the specified location
in the specified page and
with the specified fit
mode in the destination
page.

See Also
PdfDestination Class
SelectPdf Namespace

456

SelectPdf Pdf Library for .NET

PdfDestination Constructor (PdfPage)


Constructs a pdf destination to the specified pdf page.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public PdfDestination(
PdfPage page
)
VB
Public Sub New (
page As PdfPage
)
Parameters
page
Type: SelectPdf.PdfPage
The destination page.

See Also
PdfDestination Class
PdfDestination Overload
SelectPdf Namespace

457

SelectPdf Pdf Library for .NET

PdfDestination Constructor (PdfPage, PointF)


Constructs a pdf destination to the specified location in the specified page.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public PdfDestination(
PdfPage page,
PointF location
)
VB
Public Sub New (
page As PdfPage,
location As PointF
)
Parameters
page
Type: SelectPdf.PdfPage
The destination page.
location
Type: System.Drawing.PointF
The location in the destination pdf page.

See Also
PdfDestination Class
PdfDestination Overload
SelectPdf Namespace

458

SelectPdf Pdf Library for .NET

PdfDestination Constructor (PdfPage, PointF,


PdfDestinationFitMode)
Constructs a destination to the specified location in the specified page and with the
specified fit mode in the destination page.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public PdfDestination(
PdfPage page,
PointF location,
PdfDestinationFitMode fitMode
)
VB
Public Sub New (
page As PdfPage,
location As PointF,
fitMode As PdfDestinationFitMode
)
Parameters
page
Type: SelectPdf.PdfPage
The destination page.
location
Type: System.Drawing.PointF
The location in the destination page.
fitMode
Type: SelectPdf.PdfDestinationFitMode
The destination fit mode.

See Also
PdfDestination Class
PdfDestination Overload
SelectPdf Namespace

459

SelectPdf Pdf Library for .NET

PdfDestination.PdfDestination Properties
The PdfDestination type exposes the following members.

Properties
Name
FitMode

Location

Page
ZoomFactor

Description
Gets or sets the auto-fit
mode in the destination
page.
Gets or sets the location
point in the destination
page.
Gets or sets the
destination page.
Gets or sets the zoom
factor of the destination
page when viewed in a
pdf viewer.

See Also
PdfDestination Class
SelectPdf Namespace

460

SelectPdf Pdf Library for .NET

PdfDestination.FitMode Property
Gets or sets the auto-fit mode in the destination page.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public PdfDestinationFitMode FitMode { get; set; }
VB
Public Property FitMode As PdfDestinationFitMode
Get
Set
Property Value
Type: PdfDestinationFitMode

See Also
PdfDestination Class
SelectPdf Namespace

461

SelectPdf Pdf Library for .NET

PdfDestination.Location Property
Gets or sets the location point in the destination page.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public PointF Location { get; set; }
VB
Public Property Location As PointF
Get
Set
Property Value
Type: PointF

See Also
PdfDestination Class
SelectPdf Namespace

462

SelectPdf Pdf Library for .NET

PdfDestination.Page Property
Gets or sets the destination page.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public PdfPage Page { get; set; }
VB
Public Property Page As PdfPage
Get
Set
Property Value
Type: PdfPage

See Also
PdfDestination Class
SelectPdf Namespace

463

SelectPdf Pdf Library for .NET

PdfDestination.ZoomFactor Property
Gets or sets the zoom factor of the destination page when viewed in a pdf viewer.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public int ZoomFactor { get; set; }
VB
Public Property ZoomFactor As Integer
Get
Set
Property Value
Type: Int32

Remarks
This only works when FitMode is None.

This zoom factor is a percentage. A value of 100 will not zoom the page.

See Also
PdfDestination Class
SelectPdf Namespace

464

SelectPdf Pdf Library for .NET

PdfDestinationFitMode Enumeration
Specifies the auto-fit mode for a PdfDestination object.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public enum PdfDestinationFitMode
VB
Public Enumeration PdfDestinationFitMode

Members
Member name
None

Value
0

EntirePage

EntirePageWidth

EntirePageHeigh
t

BoundingBox

BoundingBoxWid
th

BoundingBoxHei
ght

Description
Does not try to
automatically fit
the page.
Automatically fits
the entire page.
Automatically fits
the entire width of
the page.
Automatically fits
the entire height
of the page.
Automatically fits
the bounding box.
Automatically fits
the entire
bounding box
width of the page.
Automatically fits
the entire
bounding box
height of the page.

See Also
SelectPdf Namespace

465

SelectPdf Pdf Library for .NET

PdfDigitalCertificate Class
This class represents a certificate used for digital signatures in a pdf document.

Inheritance Hierarchy
System.Object SelectPdf.PdfDigitalCertificate
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public class PdfDigitalCertificate
VB
Public Class PdfDigitalCertificate
The PdfDigitalCertificate type exposes the following members.

Properties
Name
EndDate
Issuer
SerialNumber
StartDate
Subject
Version

Description
Gets the end date of the
certificate.
Gets the certificate issuer
name.
Gets the certificate serial
number.
Gets the start date of the
certificate.
Gets the certificate
subject name.
Gets the certificate
version number.

See Also
SelectPdf Namespace

466

SelectPdf Pdf Library for .NET

PdfDigitalCertificate.PdfDigitalCertificate Properties
The PdfDigitalCertificate type exposes the following members.

Properties
Name
EndDate
Issuer
SerialNumber
StartDate
Subject
Version

Description
Gets the end date of the
certificate.
Gets the certificate issuer
name.
Gets the certificate serial
number.
Gets the start date of the
certificate.
Gets the certificate
subject name.
Gets the certificate
version number.

See Also
PdfDigitalCertificate Class
SelectPdf Namespace

467

SelectPdf Pdf Library for .NET

PdfDigitalCertificate.EndDate Property
Gets the end date of the certificate.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public DateTime EndDate { get; }
VB
Public ReadOnly Property EndDate As DateTime
Get
Property Value
Type: DateTime

See Also
PdfDigitalCertificate Class
SelectPdf Namespace

468

SelectPdf Pdf Library for .NET

PdfDigitalCertificate.Issuer Property
Gets the certificate issuer name.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public string Issuer { get; }
VB
Public ReadOnly Property Issuer As String
Get
Property Value
Type: String

See Also
PdfDigitalCertificate Class
SelectPdf Namespace

469

SelectPdf Pdf Library for .NET

PdfDigitalCertificate.SerialNumber Property
Gets the certificate serial number.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public byte[] SerialNumber { get; }
VB
Public ReadOnly Property SerialNumber As Byte()
Get
Property Value
Type: Byte[]

See Also
PdfDigitalCertificate Class
SelectPdf Namespace

470

SelectPdf Pdf Library for .NET

PdfDigitalCertificate.StartDate Property
Gets the start date of the certificate.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public DateTime StartDate { get; }
VB
Public ReadOnly Property StartDate As DateTime
Get
Property Value
Type: DateTime

See Also
PdfDigitalCertificate Class
SelectPdf Namespace

471

SelectPdf Pdf Library for .NET

PdfDigitalCertificate.Subject Property
Gets the certificate subject name.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public string Subject { get; }
VB
Public ReadOnly Property Subject As String
Get
Property Value
Type: String

See Also
PdfDigitalCertificate Class
SelectPdf Namespace

472

SelectPdf Pdf Library for .NET

PdfDigitalCertificate.Version Property
Gets the certificate version number.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public int Version { get; }
VB
Public ReadOnly Property Version As Integer
Get
Property Value
Type: Int32

See Also
PdfDigitalCertificate Class
SelectPdf Namespace

473

SelectPdf Pdf Library for .NET

PdfDigitalCertificatesCollection Class
Represents a collection of digital certificates that can be used to sign a pdf
document.

Inheritance Hierarchy
System.Object SelectPdf.PdfDigitalCertificatesCollection
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public class PdfDigitalCertificatesCollection : IEnumerable
VB
Public Class PdfDigitalCertificatesCollection
Implements IEnumerable
The PdfDigitalCertificatesCollection type exposes the following members.

Methods
Name
GetCertByIssuer

GetCertBySerialNumber

GetCertBySubject

GetEnumerator

Description
Searches for a certificate
with a specified issuer
name.
Searches for a certificate
with a specified serial
number.
Searches for a certificate
with a specified subject
name.
Gets the collection
enumerator.

Properties
Name
Count

Item

Description
Gets the number of
certificates in the
collection.
Gets the certificate at the
specified zero based
index from collection.

See Also
SelectPdf Namespace

474

SelectPdf Pdf Library for .NET

PdfDigitalCertificatesCollection.PdfDigitalCertificatesColle
ction Methods
The PdfDigitalCertificatesCollection type exposes the following members.

Methods
Name
GetCertByIssuer

GetCertBySerialNumber

GetCertBySubject

GetEnumerator

Description
Searches for a certificate
with a specified issuer
name.
Searches for a certificate
with a specified serial
number.
Searches for a certificate
with a specified subject
name.
Gets the collection
enumerator.

See Also
PdfDigitalCertificatesCollection Class
SelectPdf Namespace

475

SelectPdf Pdf Library for .NET

PdfDigitalCertificatesCollection.GetCertByIssuer Method
Searches for a certificate with a specified issuer name.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public PdfDigitalCertificate GetCertByIssuer(
string issuerName
)
VB
Public Function GetCertByIssuer (
issuerName As String
) As PdfDigitalCertificate
Parameters
issuerName
Type: System.String
Issuer name.
Return Value
Type: PdfDigitalCertificateThe certificate with the specified issuer name or null if no
certificate was found.

See Also
PdfDigitalCertificatesCollection Class
SelectPdf Namespace

476

SelectPdf Pdf Library for .NET

PdfDigitalCertificatesCollection.GetCertBySerialNumber
Method
Searches for a certificate with a specified serial number.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public PdfDigitalCertificate GetCertBySerialNumber(
byte[] serialNumber
)
VB
Public Function GetCertBySerialNumber (
serialNumber As Byte()
) As PdfDigitalCertificate
Parameters
serialNumber
Type: System.Byte[]
Serial number of the certificate.
Return Value
Type: PdfDigitalCertificateThe certificate with the specified serial number or null if
no certificate was found.

See Also
PdfDigitalCertificatesCollection Class
SelectPdf Namespace

477

SelectPdf Pdf Library for .NET

PdfDigitalCertificatesCollection.GetCertBySubject Method
Searches for a certificate with a specified subject name.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public PdfDigitalCertificate GetCertBySubject(
string subjectName
)
VB
Public Function GetCertBySubject (
subjectName As String
) As PdfDigitalCertificate
Parameters
subjectName
Type: System.String
Subject name.
Return Value
Type: PdfDigitalCertificateThe certificate with the specified subject name or null if no
certificate was found.

See Also
PdfDigitalCertificatesCollection Class
SelectPdf Namespace

478

SelectPdf Pdf Library for .NET

PdfDigitalCertificatesCollection.GetEnumerator Method
Gets the collection enumerator.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public IEnumerator GetEnumerator()
VB
Public Function GetEnumerator As IEnumerator
Return Value
Type: IEnumeratorThe collection enumerator.
Implements
IEnumerable.GetEnumerator()

See Also
PdfDigitalCertificatesCollection Class
SelectPdf Namespace

479

SelectPdf Pdf Library for .NET

PdfDigitalCertificatesCollection.PdfDigitalCertificatesColle
ction Properties
The PdfDigitalCertificatesCollection type exposes the following members.

Properties
Name
Count

Item

Description
Gets the number of
certificates in the
collection.
Gets the certificate at the
specified zero based
index from collection.

See Also
PdfDigitalCertificatesCollection Class
SelectPdf Namespace

480

SelectPdf Pdf Library for .NET

PdfDigitalCertificatesCollection.Count Property
Gets the number of certificates in the collection.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public int Count { get; }
VB
Public ReadOnly Property Count As Integer
Get
Property Value
Type: Int32

See Also
PdfDigitalCertificatesCollection Class
SelectPdf Namespace

481

SelectPdf Pdf Library for .NET

PdfDigitalCertificatesCollection.Item Property
Gets the certificate at the specified zero based index from collection.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public PdfDigitalCertificate this[
int index
] { get; }
VB
Public ReadOnly Default Property Item (
index As Integer
) As PdfDigitalCertificate
Get
Parameters
index
Type: System.Int32
The zero based index of the certificate.
Return Value
Type: PdfDigitalCertificateThe certificate at the specified index.

See Also
PdfDigitalCertificatesCollection Class
SelectPdf Namespace

482

SelectPdf Pdf Library for .NET

PdfDigitalCertificatesStore Class
Provides an interface for getting digital certificates from system certificates store or
from a password protected PKCS#12 file.

Inheritance Hierarchy
System.Object SelectPdf.PdfDigitalCertificatesStore
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public class PdfDigitalCertificatesStore
VB
Public Class PdfDigitalCertificatesStore
The PdfDigitalCertificatesStore type exposes the following members.

Constructors
Name
PdfDigitalCertificatesStor
e

Description

Name
GetCertificates()

Description
Gets the certificates
collection from the
Personal Certificates
store.
Gets the certificates
collection from the
specified PKCS#12 file.
Gets the certificates
collection from the
specified system
certificates store.
Gets the certificates
collection from the
specified password
protected PKCS#12 file.

Methods

GetCertificates(String)

GetCertificates(PdfCertific
ateSystem)

GetCertificates(String,
String)

Remarks
A PKCS#12 file stores both the private and the public keys and such a file can be for
example a file with extension .pfx generated by IIS from the SSL certificate installed
for a website.

483

SelectPdf Pdf Library for .NET

See Also
SelectPdf Namespace

484

SelectPdf Pdf Library for .NET

PdfDigitalCertificatesStore Constructor
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public PdfDigitalCertificatesStore()
VB
Public Sub New

See Also
PdfDigitalCertificatesStore Class
SelectPdf Namespace

485

SelectPdf Pdf Library for .NET

PdfDigitalCertificatesStore.PdfDigitalCertificatesStore
Methods
Methods
Name
GetCertificates()

GetCertificates(String)

GetCertificates(PdfCertific
ateSystem)

GetCertificates(String,
String)

Description
Gets the certificates
collection from the
Personal Certificates
store.
Gets the certificates
collection from the
specified PKCS#12 file.
Gets the certificates
collection from the
specified system
certificates store.
Gets the certificates
collection from the
specified password
protected PKCS#12 file.

See Also
PdfDigitalCertificatesStore Class
SelectPdf Namespace

486

SelectPdf Pdf Library for .NET

PdfDigitalCertificatesStore.GetCertificates Method
Overload List
Name
GetCertificates()

GetCertificates(String)

GetCertificates(PdfCertific
ateSystem)

GetCertificates(String,
String)

Description
Gets the certificates
collection from the
Personal Certificates
store.
Gets the certificates
collection from the
specified PKCS#12 file.
Gets the certificates
collection from the
specified system
certificates store.
Gets the certificates
collection from the
specified password
protected PKCS#12 file.

See Also
PdfDigitalCertificatesStore Class
SelectPdf Namespace

487

SelectPdf Pdf Library for .NET

PdfDigitalCertificatesStore.GetCertificates Method
Gets the certificates collection from the Personal Certificates store.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public static PdfDigitalCertificatesCollection GetCertificates()
VB
Public Shared Function GetCertificates As
PdfDigitalCertificatesCollection
Return Value
Type: PdfDigitalCertificatesCollectionThe Personal certificates collection.

Remarks
The Personal Certificates store can be accessed from Control Panel/Internet Options,
Content, Certificates.

See Also
PdfDigitalCertificatesStore Class
GetCertificates Overload
SelectPdf Namespace

488

SelectPdf Pdf Library for .NET

PdfDigitalCertificatesStore.GetCertificates Method (String)


Gets the certificates collection from the specified PKCS#12 file.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public static PdfDigitalCertificatesCollection GetCertificates(
string certFileName
)
VB
Public Shared Function GetCertificates (
certFileName As String
) As PdfDigitalCertificatesCollection
Parameters
certFileName
Type: System.String
The path of the .pfx or .p12 file storing the certificates.
Return Value
Type: PdfDigitalCertificatesCollectionThe certificates collection.

Remarks
This method uses a NULL password to get the certificates from packet.

A PKCS#12 file stores both the private and the public key and such a file can be for
example a file with extension .pfx generated by IIS from the SSL certificate installed
for a website.

See Also
PdfDigitalCertificatesStore Class
GetCertificates Overload
SelectPdf Namespace

489

SelectPdf Pdf Library for .NET

PdfDigitalCertificatesStore.GetCertificates Method
(PdfCertificateSystem)
Gets the certificates collection from the specified system certificates store.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public static PdfDigitalCertificatesCollection GetCertificates(
PdfCertificateSystem sysCertStore
)
VB
Public Shared Function GetCertificates (
sysCertStore As PdfCertificateSystem
) As PdfDigitalCertificatesCollection
Parameters
sysCertStore
Type: SelectPdf.PdfCertificateSystem
The system certificates store.
Return Value
Type: PdfDigitalCertificatesCollectionThe certificates collection.

See Also
PdfDigitalCertificatesStore Class
GetCertificates Overload
SelectPdf Namespace

490

SelectPdf Pdf Library for .NET

PdfDigitalCertificatesStore.GetCertificates Method (String,


String)
Gets the certificates collection from the specified password protected PKCS#12 file.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public static PdfDigitalCertificatesCollection GetCertificates(
string certFileName,
string password
)
VB
Public Shared Function GetCertificates (
certFileName As String,
password As String
) As PdfDigitalCertificatesCollection
Parameters
certFileName
Type: System.String
The path of the .pfx or .p12 file storing the certificates.
password
Type: System.String
The password used to decrypt and verify the PFX packet. This password must be
exactly the same as the password that was used to encrypt the packet. If the
password used to encrypt the packet was blank, pass NULL for the value of this
parameter.
Return Value
Type: PdfDigitalCertificatesCollectionThe certificates collection.

Remarks
A PKCS#12 file stores both the private and the public key and such a file can be for
example a file with extension .pfx generated by IIS from the SSL certificate installed
for a website.

See Also
PdfDigitalCertificatesStore Class
GetCertificates Overload
SelectPdf Namespace

491

SelectPdf Pdf Library for .NET

PdfDigitalSignatureElement Class
Represents a digital signature in a document.

Inheritance Hierarchy
System.Object SelectPdf.PdfPageElement

SelectPdf.PdfDigitalSignatureElement

Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public class PdfDigitalSignatureElement : PdfPageElement
VB
Public Class PdfDigitalSignatureElement
Inherits PdfPageElement
The PdfDigitalSignatureElement type exposes the following members.

Constructors
Name
PdfDigitalSignatureEleme
nt

Description
Constructs a digital
signature element that
can be added to a pdf
document page.

Name
Certificate

Description
Gets the certificate used
to create the signature.
Gets or sets the contact
information.
Gets or sets the location
of the signing.
Gets or sets the reason
for the signing.

Properties

ContactInfo
Location
Reason

See Also
SelectPdf Namespace

492

SelectPdf Pdf Library for .NET

PdfDigitalSignatureElement Constructor
Constructs a digital signature element that can be added to a pdf document page.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public PdfDigitalSignatureElement(
RectangleF bounds,
PdfDigitalCertificate certificate
)
VB
Public Sub New (
bounds As RectangleF,
certificate As PdfDigitalCertificate
)
Parameters
bounds
Type: System.Drawing.RectangleF
The digital signature rectangle inside the pdf page.
certificate
Type: SelectPdf.PdfDigitalCertificate
The digital certificate obtained from the digital certificates store.

See Also
PdfDigitalSignatureElement Class
SelectPdf Namespace

493

SelectPdf Pdf Library for .NET

PdfDigitalSignatureElement.PdfDigitalSignatureElement
Properties
The PdfDigitalSignatureElement type exposes the following members.

Properties
Name
Certificate
ContactInfo
Location
Reason

Description
Gets the certificate used
to create the signature.
Gets or sets the contact
information.
Gets or sets the location
of the signing.
Gets or sets the reason
for the signing.

See Also
PdfDigitalSignatureElement Class
SelectPdf Namespace

494

SelectPdf Pdf Library for .NET

PdfDigitalSignatureElement.Certificate Property
Gets the certificate used to create the signature.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public PdfDigitalCertificate Certificate { get; }
VB
Public ReadOnly Property Certificate As PdfDigitalCertificate
Get
Property Value
Type: PdfDigitalCertificate

See Also
PdfDigitalSignatureElement Class
SelectPdf Namespace

495

SelectPdf Pdf Library for .NET

PdfDigitalSignatureElement.ContactInfo Property
Gets or sets the contact information.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public string ContactInfo { get; set; }
VB
Public Property ContactInfo As String
Get
Set
Property Value
Type: String

Remarks
Information provided by the signer to enable a recipient to contact the signer to
verify the signature (for example: a phone number).

See Also
PdfDigitalSignatureElement Class
SelectPdf Namespace

496

SelectPdf Pdf Library for .NET

PdfDigitalSignatureElement.Location Property
Gets or sets the location of the signing.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public string Location { get; set; }
VB
Public Property Location As String
Get
Set
Property Value
Type: String

See Also
PdfDigitalSignatureElement Class
SelectPdf Namespace

497

SelectPdf Pdf Library for .NET

PdfDigitalSignatureElement.Reason Property
Gets or sets the reason for the signing.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public string Reason { get; set; }
VB
Public Property Reason As String
Get
Set
Property Value
Type: String

See Also
PdfDigitalSignatureElement Class
SelectPdf Namespace

498

SelectPdf Pdf Library for .NET

PdfDocument Class
Represents a pdf document.

Inheritance Hierarchy
System.Object SelectPdf.PdfDocument
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public class PdfDocument
VB
Public Class PdfDocument
The PdfDocument type exposes the following members.

Constructors
Name
PdfDocument()
PdfDocument(Stream)

PdfDocument(String)
PdfDocument(Stream,
String)

PdfDocument(String,
String)

Description
Creates an empty pdf
document object.
Loads a pdf document
from the specified
stream.
Loads a pdf document
from an existing pdf file.
Loads a pdf document
from a stream containing
a password protected pdf
document.
Loads a pdf document
from an existing
password protected pdf
file.

Methods
Name
AddBookmark(String,
PdfDestination)
AddBookmark(String,
PdfDestination,
PdfBookmark)

AddFont(Font)

Description
Creates a root bookmark
in the current pdf
document.
Creates a child bookmark
in the current pdf
document under the
specified parent
bookmark.
Adds a system font to the

499

SelectPdf Pdf Library for .NET

AddFont(String)

AddFont(PdfStandardCJKF
ont)
AddFont(PdfStandardFont
)
AddFont(Font, Boolean)
AddPage()

AddPage(PdfMargins)

AddPage(PdfPage)

AddPage(PdfCustomPage
Size, PdfMargins)

AddPage(PdfCustomPage
Size, PdfMargins,
PdfPageOrientation)

AddTemplate(RectangleF)

AddTemplate(Single,
Single)

Append

pdf fonts collection.


Adds a system font to the
pdf fonts collection. The
font is loaded from the
specified file.
Adds a standard CJK font
to the pdf fonts collection.
Adds a standard font to
the pdf fonts collection.
Adds a system font to the
pdf fonts collection.
Creates a new pdf page
and adds it to the pdf
document pages
collection.
Creates a new pdf page
with the specified
margins and adds it to
the pdf document pages
collection.
Adds the specified page
to the pdf document
pages collection.
Creates a new pdf page
with the specified size
and margins and adds it
to the pdf document
pages collection.
Creates a new pdf page
with the specified size,
margins and orientation
and adds it to the pdf
document pages
collection.
Adds a new template with
the specified bounds to
the pdf document
templates collection.
Adds a new template with
the specified width and
height to the pdf
document templates
collection.
Appends all pages from
another pdf document to
the current pdf
document.
500

SelectPdf Pdf Library for .NET


Close
DetachStream

GetPagesCount(Stream)

GetPagesCount(String)

InsertPage(Int32,
PdfPage)

InsertPage(Int32,
PdfCustomPageSize,
PdfMargins,
PdfPageOrientation)

RemovePage

RemovePageAt

Save()
Save(Stream)
Save(String)
Save(HttpResponse,
Boolean, String)

Closes the current pdf


document.
Detaches the stream that
was used to load the pdf
document, leaving it open
in case the current pdf
document is closed.
Returns the number of
pages in a specified pdf
document.
Returns the number of
pages in a specified pdf
document.
Inserts the specified page
into the pdf document
pages collection at the
specified index.
Creates a new pdf page
with the specified size,
margins and orientation
and inserts it into the pdf
document pages
collection at the specified
index.
Removes the specified
page from the pdf
document pages
collection.
Removes the pdf page at
the specified index in pdf
document pages
collection.
Saves the pdf document
as byte array.
Saves the pdf document
to the specified stream.
Saves the pdf document
to the specified file.
Saves the pdf document
to a HTTP stream.

Properties
Name
Bookmarks

Description
Gets the bookmarks
collection of the pdf
document.

501

SelectPdf Pdf Library for .NET


CompressionLevel

DocumentInformation

Fonts
Footer

Header

JpegCompressionEnabled

JpegCompressionLevel

Margins
OpenAction

Pages
Security

Templates
ViewerPreferences

Gets or sets the pdf


document compression
level.
Gets a reference to the
object that specifies the
pdf document properties.
Gets the pdf document
fonts collection.
Represents the default
pdf document footer
template.
Represents the default
pdf document header
template.
Gets or sets a flag
indicating if the JPEG
compression is enabled or
not for the images in the
generated pdf document.
Gets or sets the
compression level of
images in the generated
pdf document.
The default pdf document
margins.
The action to be
performed when the pdf
document is opened.
Gets the pdf document
pages collection.
Gets a reference to the
object that specifies the
pdf document security
settings.
Gets the pdf document
templates collection.
Controls how the pdf
document will appear in a
pdf viewer (like Adobe
Reader).

Remarks
This class provides the API to create, load, modify and save a pdf document.

See Also
SelectPdf Namespace

502

SelectPdf Pdf Library for .NET

PdfDocument Constructor
Overload List
Name
PdfDocument()
PdfDocument(Stream)

PdfDocument(String)
PdfDocument(Stream,
String)

PdfDocument(String,
String)

Description
Creates an empty pdf
document object.
Loads a pdf document
from the specified
stream.
Loads a pdf document
from an existing pdf file.
Loads a pdf document
from a stream containing
a password protected pdf
document.
Loads a pdf document
from an existing
password protected pdf
file.

See Also
PdfDocument Class
SelectPdf Namespace

503

SelectPdf Pdf Library for .NET

PdfDocument Constructor
Creates an empty pdf document object.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public PdfDocument()
VB
Public Sub New

Remarks
New pdf pages can be added to the document and new pdf elements can be added
to these new document pages.

See Also
PdfDocument Class
PdfDocument Overload
SelectPdf Namespace

504

SelectPdf Pdf Library for .NET

PdfDocument Constructor (Stream)


Loads a pdf document from the specified stream.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public PdfDocument(
Stream stream
)
VB
Public Sub New (
stream As Stream
)
Parameters
stream
Type: System.IO.Stream
The pdf document stream.

See Also
PdfDocument Class
PdfDocument Overload
SelectPdf Namespace

505

SelectPdf Pdf Library for .NET

PdfDocument Constructor (String)


Loads a pdf document from an existing pdf file.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public PdfDocument(
string fileName
)
VB
Public Sub New (
fileName As String
)
Parameters
fileName
Type: System.String
The full path to the existing pdf document file.

See Also
PdfDocument Class
PdfDocument Overload
SelectPdf Namespace

506

SelectPdf Pdf Library for .NET

PdfDocument Constructor (Stream, String)


Loads a pdf document from a stream containing a password protected pdf
document.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public PdfDocument(
Stream stream,
string password
)
VB
Public Sub New (
stream As Stream,
password As String
)
Parameters
stream
Type: System.IO.Stream
The stream containing the pdf document.
password
Type: System.String
The password to open the specified pdf document.

Remarks
The specified password can be a user or owner password.

See Also
PdfDocument Class
PdfDocument Overload
SelectPdf Namespace

507

SelectPdf Pdf Library for .NET

PdfDocument Constructor (String, String)


Loads a pdf document from an existing password protected pdf file.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public PdfDocument(
string fileName,
string password
)
VB
Public Sub New (
fileName As String,
password As String
)
Parameters
fileName
Type: System.String
The full path to the existing pdf file.
password
Type: System.String
The password to open the specified pdf document.

See Also
PdfDocument Class
PdfDocument Overload
SelectPdf Namespace

508

SelectPdf Pdf Library for .NET

PdfDocument.PdfDocument Methods
The PdfDocument type exposes the following members.

Methods
Name
AddBookmark(String,
PdfDestination)
AddBookmark(String,
PdfDestination,
PdfBookmark)

AddFont(Font)
AddFont(String)

AddFont(PdfStandardCJKF
ont)
AddFont(PdfStandardFont
)
AddFont(Font, Boolean)
AddPage()

AddPage(PdfMargins)

AddPage(PdfPage)

AddPage(PdfCustomPage
Size, PdfMargins)

AddPage(PdfCustomPage
Size, PdfMargins,
PdfPageOrientation)

Description
Creates a root bookmark
in the current pdf
document.
Creates a child bookmark
in the current pdf
document under the
specified parent
bookmark.
Adds a system font to the
pdf fonts collection.
Adds a system font to the
pdf fonts collection. The
font is loaded from the
specified file.
Adds a standard CJK font
to the pdf fonts collection.
Adds a standard font to
the pdf fonts collection.
Adds a system font to the
pdf fonts collection.
Creates a new pdf page
and adds it to the pdf
document pages
collection.
Creates a new pdf page
with the specified
margins and adds it to
the pdf document pages
collection.
Adds the specified page
to the pdf document
pages collection.
Creates a new pdf page
with the specified size
and margins and adds it
to the pdf document
pages collection.
Creates a new pdf page
with the specified size,
margins and orientation
and adds it to the pdf
509

SelectPdf Pdf Library for .NET

AddTemplate(RectangleF)

AddTemplate(Single,
Single)

Append

Close
DetachStream

GetPagesCount(Stream)

GetPagesCount(String)

InsertPage(Int32,
PdfPage)

InsertPage(Int32,
PdfCustomPageSize,
PdfMargins,
PdfPageOrientation)

RemovePage

RemovePageAt

document pages
collection.
Adds a new template with
the specified bounds to
the pdf document
templates collection.
Adds a new template with
the specified width and
height to the pdf
document templates
collection.
Appends all pages from
another pdf document to
the current pdf
document.
Closes the current pdf
document.
Detaches the stream that
was used to load the pdf
document, leaving it open
in case the current pdf
document is closed.
Returns the number of
pages in a specified pdf
document.
Returns the number of
pages in a specified pdf
document.
Inserts the specified page
into the pdf document
pages collection at the
specified index.
Creates a new pdf page
with the specified size,
margins and orientation
and inserts it into the pdf
document pages
collection at the specified
index.
Removes the specified
page from the pdf
document pages
collection.
Removes the pdf page at
the specified index in pdf
document pages
collection.
510

SelectPdf Pdf Library for .NET


Save()
Save(Stream)
Save(String)
Save(HttpResponse,
Boolean, String)

Saves the pdf document


as byte array.
Saves the pdf document
to the specified stream.
Saves the pdf document
to the specified file.
Saves the pdf document
to a HTTP stream.

See Also
PdfDocument Class
SelectPdf Namespace

511

SelectPdf Pdf Library for .NET

PdfDocument.AddBookmark Method
Overload List
Name
AddBookmark(String,
PdfDestination)
AddBookmark(String,
PdfDestination,
PdfBookmark)

Description
Creates a root bookmark
in the current pdf
document.
Creates a child bookmark
in the current pdf
document under the
specified parent
bookmark.

See Also
PdfDocument Class
SelectPdf Namespace

512

SelectPdf Pdf Library for .NET

PdfDocument.AddBookmark Method (String,


PdfDestination)
Creates a root bookmark in the current pdf document.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public PdfBookmark AddBookmark(
string text,
PdfDestination destination
)
VB
Public Function AddBookmark (
text As String,
destination As PdfDestination
) As PdfBookmark
Parameters
text
Type: System.String
The bookmark text.
destination
Type: SelectPdf.PdfDestination
The bookmark destination.
Return Value
Type: PdfBookmarkThe newly added bookmark.

See Also
PdfDocument Class
AddBookmark Overload
SelectPdf Namespace

513

SelectPdf Pdf Library for .NET

PdfDocument.AddBookmark Method (String,


PdfDestination, PdfBookmark)
Creates a child bookmark in the current pdf document under the specified parent
bookmark.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public PdfBookmark AddBookmark(
string text,
PdfDestination destination,
PdfBookmark parent
)
VB
Public Function AddBookmark (
text As String,
destination As PdfDestination,
parent As PdfBookmark
) As PdfBookmark
Parameters
text
Type: System.String
The bookmark text.
destination
Type: SelectPdf.PdfDestination
The bookmark destination.
parent
Type: SelectPdf.PdfBookmark
The parent bookmark.
Return Value
Type: PdfBookmarkThe newly added bookmark.

See Also
PdfDocument Class
AddBookmark Overload
SelectPdf Namespace

514

SelectPdf Pdf Library for .NET

PdfDocument.AddFont Method
Overload List
Name
AddFont(Font)
AddFont(String)

AddFont(PdfStandardCJKF
ont)
AddFont(PdfStandardFont
)
AddFont(Font, Boolean)

Description
Adds a system font to the
pdf fonts collection.
Adds a system font to the
pdf fonts collection. The
font is loaded from the
specified file.
Adds a standard CJK font
to the pdf fonts collection.
Adds a standard font to
the pdf fonts collection.
Adds a system font to the
pdf fonts collection.

See Also
PdfDocument Class
SelectPdf Namespace

515

SelectPdf Pdf Library for .NET

PdfDocument.AddFont Method (Font)


Adds a system font to the pdf fonts collection.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public PdfFont AddFont(
Font font
)
VB
Public Function AddFont (
font As Font
) As PdfFont
Parameters
font
Type: System.Drawing.Font
The system font to be added to the fonts collection.
Return Value
Type: PdfFontThe pdf font added to the fonts collection.

Remarks
If the font was already added, the method returns the existing font. By default the
font is embedded into the pdf document in order to support Unicode texts.

See Also
PdfDocument Class
AddFont Overload
SelectPdf Namespace

516

SelectPdf Pdf Library for .NET

PdfDocument.AddFont Method (String)


Adds a system font to the pdf fonts collection. The font is loaded from the specified
file.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public PdfFont AddFont(
string fontFileName
)
VB
Public Function AddFont (
fontFileName As String
) As PdfFont
Parameters
fontFileName
Type: System.String
The file name of the font to be added.
Return Value
Type: PdfFontThe pdf font added to the fonts collection.

Remarks
If the font was already added, the method returns the existing pdf font.

See Also
PdfDocument Class
AddFont Overload
SelectPdf Namespace

517

SelectPdf Pdf Library for .NET

PdfDocument.AddFont Method (PdfStandardCJKFont)


Adds a standard CJK font to the pdf fonts collection.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public PdfFont AddFont(
PdfStandardCJKFont stdCJKFont
)
VB
Public Function AddFont (
stdCJKFont As PdfStandardCJKFont
) As PdfFont
Parameters
stdCJKFont
Type: SelectPdf.PdfStandardCJKFont
The standard CJK font to add to the pdf document fonts collection.
Return Value
Type: PdfFontThe pdf font added to the fonts collection.

Remarks
If the font was already added, the method returns the existing pdf font.

See Also
PdfDocument Class
AddFont Overload
SelectPdf Namespace

518

SelectPdf Pdf Library for .NET

PdfDocument.AddFont Method (PdfStandardFont)


Adds a standard font to the pdf fonts collection.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public PdfFont AddFont(
PdfStandardFont stdFont
)
VB
Public Function AddFont (
stdFont As PdfStandardFont
) As PdfFont
Parameters
stdFont
Type: SelectPdf.PdfStandardFont
The standard font family.
Return Value
Type: PdfFontThe pdf font added to the fonts collection.

Remarks
If the font was already added, the method returns the existing pdf font.

See Also
PdfDocument Class
AddFont Overload
SelectPdf Namespace

519

SelectPdf Pdf Library for .NET

PdfDocument.AddFont Method (Font, Boolean)


Adds a system font to the pdf fonts collection.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public PdfFont AddFont(
Font font,
bool embedFont
)
VB
Public Function AddFont (
font As Font,
embedFont As Boolean
) As PdfFont
Parameters
font
Type: System.Drawing.Font
Font for adding.The system font to be added to the fonts collection.
embedFont
Type: System.Boolean
Specifies if the font will be embedded into the pdf document or not.
Return Value
Type: PdfFontThe pdf font added to the fonts collection.

Remarks
If the font was already added, the method returns the existing font. The embedFont
parameter indicates if the added font will be embedded into the pdf document or
not.

See Also
PdfDocument Class
AddFont Overload
SelectPdf Namespace

520

SelectPdf Pdf Library for .NET

PdfDocument.AddPage Method
Overload List
Name
AddPage()

AddPage(PdfMargins)

AddPage(PdfPage)

AddPage(PdfCustomPage
Size, PdfMargins)

AddPage(PdfCustomPage
Size, PdfMargins,
PdfPageOrientation)

Description
Creates a new pdf page
and adds it to the pdf
document pages
collection.
Creates a new pdf page
with the specified
margins and adds it to
the pdf document pages
collection.
Adds the specified page
to the pdf document
pages collection.
Creates a new pdf page
with the specified size
and margins and adds it
to the pdf document
pages collection.
Creates a new pdf page
with the specified size,
margins and orientation
and adds it to the pdf
document pages
collection.

See Also
PdfDocument Class
SelectPdf Namespace

521

SelectPdf Pdf Library for .NET

PdfDocument.AddPage Method
Creates a new pdf page and adds it to the pdf document pages collection.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public PdfPage AddPage()
VB
Public Function AddPage As PdfPage
Return Value
Type: PdfPageThe newly created pdf page.

Remarks
If there is a previous page in the pages collection, the orientation and size are
inherited from that page, otherwise a first page with the default A4 size and Portrait
orientation is created.

The page margins are inherited from the default pdf document margins specified in
Margins property.

See Also
PdfDocument Class
AddPage Overload
SelectPdf Namespace

522

SelectPdf Pdf Library for .NET

PdfDocument.AddPage Method (PdfMargins)


Creates a new pdf page with the specified margins and adds it to the pdf document
pages collection.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public PdfPage AddPage(
PdfMargins pageMargins
)
VB
Public Function AddPage (
pageMargins As PdfMargins
) As PdfPage
Parameters
pageMargins
Type: SelectPdf.PdfMargins
The pdf page margins.
Return Value
Type: PdfPageThe newly created pdf page.

Remarks
If there is a previous page in the pages collection, the orientation and size are
inherited from that page, otherwise a first page with the default A4 size and Portrait
orientation is created.

See Also
PdfDocument Class
AddPage Overload
SelectPdf Namespace

523

SelectPdf Pdf Library for .NET

PdfDocument.AddPage Method (PdfPage)


Adds the specified page to the pdf document pages collection.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public void AddPage(
PdfPage pdfPage
)
VB
Public Sub AddPage (
pdfPage As PdfPage
)
Parameters
pdfPage
Type: SelectPdf.PdfPage
The page to be added to the collection.

Remarks
The specified page can belong to another pdf document.

Important
The source pdf document must remain opened until the current document is
saved.

See Also
PdfDocument Class
AddPage Overload
SelectPdf Namespace

524

SelectPdf Pdf Library for .NET

PdfDocument.AddPage Method (PdfCustomPageSize,


PdfMargins)
Creates a new pdf page with the specified size and margins and adds it to the pdf
document pages collection.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public PdfPage AddPage(
PdfCustomPageSize pageSize,
PdfMargins pageMargins
)
VB
Public Function AddPage (
pageSize As PdfCustomPageSize,
pageMargins As PdfMargins
) As PdfPage
Parameters
pageSize
Type: SelectPdf.PdfCustomPageSize
The pdf page size.
pageMargins
Type: SelectPdf.PdfMargins
The pdf page margins.
Return Value
Type: PdfPageThe newly created pdf page.

Remarks
If there is a previous page in the pages collection, the orientation is inherited from
that page, otherwise a first page with the default Portrait orientation is created.

See Also
PdfDocument Class
AddPage Overload
SelectPdf Namespace

525

SelectPdf Pdf Library for .NET

PdfDocument.AddPage Method (PdfCustomPageSize,


PdfMargins, PdfPageOrientation)
Creates a new pdf page with the specified size, margins and orientation and adds it
to the pdf document pages collection.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public PdfPage AddPage(
PdfCustomPageSize pageSize,
PdfMargins pageMargins,
PdfPageOrientation pageOrientation
)
VB
Public Function AddPage (
pageSize As PdfCustomPageSize,
pageMargins As PdfMargins,
pageOrientation As PdfPageOrientation
) As PdfPage
Parameters
pageSize
Type: SelectPdf.PdfCustomPageSize
The pdf page size.
pageMargins
Type: SelectPdf.PdfMargins
The pdf page margins.
pageOrientation
Type: SelectPdf.PdfPageOrientation
The pdf page orientation.
Return Value
Type: PdfPageThe newly created pdf page.

See Also
PdfDocument Class
AddPage Overload
SelectPdf Namespace

526

SelectPdf Pdf Library for .NET

PdfDocument.AddTemplate Method
Overload List
Name
AddTemplate(RectangleF)

AddTemplate(Single,
Single)

Description
Adds a new template with
the specified bounds to
the pdf document
templates collection.
Adds a new template with
the specified width and
height to the pdf
document templates
collection.

See Also
PdfDocument Class
SelectPdf Namespace

527

SelectPdf Pdf Library for .NET

PdfDocument.AddTemplate Method (RectangleF)


Adds a new template with the specified bounds to the pdf document templates
collection.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public PdfTemplate AddTemplate(
RectangleF bounds
)
VB
Public Function AddTemplate (
bounds As RectangleF
) As PdfTemplate
Parameters
bounds
Type: System.Drawing.RectangleF
The template element bounds.
Return Value
Type: PdfTemplateThe newly added pdf template.

See Also
PdfDocument Class
AddTemplate Overload
SelectPdf Namespace

528

SelectPdf Pdf Library for .NET

PdfDocument.AddTemplate Method (Single, Single)


Adds a new template with the specified width and height to the pdf document
templates collection.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public PdfTemplate AddTemplate(
float width,
float height
)
VB
Public Function AddTemplate (
width As Single,
height As Single
) As PdfTemplate
Parameters
width
Type: System.Single
The pdf template width.
height
Type: System.Single
The pdf template height.
Return Value
Type: PdfTemplateThe newly added pdf template.

Remarks
The template location is top left corner of the pdf page. Use
AddTemplate(RectangleF) to specify another location for the template.

See Also
PdfDocument Class
AddTemplate Overload
SelectPdf Namespace

529

SelectPdf Pdf Library for .NET

PdfDocument.Append Method
Appends all pages from another pdf document to the current pdf document.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public void Append(
PdfDocument doc
)
VB
Public Sub Append (
doc As PdfDocument
)
Parameters
doc
Type: SelectPdf.PdfDocument
The document to be appended.

Remarks
A custom range of pages from another document can be appended to the current
document calling the Add(PdfPage) method on the Pages collection for each page to
be appended.

Important

The appended document must remain opened until the current document is saved.

See Also
PdfDocument Class
SelectPdf Namespace

530

SelectPdf Pdf Library for .NET

PdfDocument.Close Method
Closes the current pdf document.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public void Close()
VB
Public Sub Close

Remarks
Calling this method will release all the resources allocated by the pdf document.

Important
Always call this method after the document was saved.

Note
If the document was created from a stream, the stream will be closed if it was not
explicitly detached by calling the DetachStream() before the document is closed.

See Also
PdfDocument Class
SelectPdf Namespace

531

SelectPdf Pdf Library for .NET

PdfDocument.DetachStream Method
Detaches the stream that was used to load the pdf document, leaving it open in
case the current pdf document is closed.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public void DetachStream()
VB
Public Sub DetachStream

Remarks
Call this method to detach the stream from which the pdf document was created.
When this method is called before calling Close(), the Close() method will not close
the detached stream.

See Also
PdfDocument Class
SelectPdf Namespace

532

SelectPdf Pdf Library for .NET

PdfDocument.GetPagesCount Method
Overload List
Name
GetPagesCount(Stream)

GetPagesCount(String)

Description
Returns the number of
pages in a specified pdf
document.
Returns the number of
pages in a specified pdf
document.

See Also
PdfDocument Class
SelectPdf Namespace

533

SelectPdf Pdf Library for .NET

PdfDocument.GetPagesCount Method (Stream)


Returns the number of pages in a specified pdf document.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public static int GetPagesCount(
Stream stream
)
VB
Public Shared Function GetPagesCount (
stream As Stream
) As Integer
Parameters
stream
Type: System.IO.Stream
The stream containing the pdf document.
Return Value
Type: Int32The number of pages in the specified pdf document.

See Also
PdfDocument Class
GetPagesCount Overload
SelectPdf Namespace

534

SelectPdf Pdf Library for .NET

PdfDocument.GetPagesCount Method (String)


Returns the number of pages in a specified pdf document.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public static int GetPagesCount(
string fileName
)
VB
Public Shared Function GetPagesCount (
fileName As String
) As Integer
Parameters
fileName
Type: System.String
The pdf file.
Return Value
Type: Int32The number of pages in the specified pdf document.

See Also
PdfDocument Class
GetPagesCount Overload
SelectPdf Namespace

535

SelectPdf Pdf Library for .NET

PdfDocument.InsertPage Method
Overload List
Name
InsertPage(Int32,
PdfPage)

InsertPage(Int32,
PdfCustomPageSize,
PdfMargins,
PdfPageOrientation)

Description
Inserts the specified page
into the pdf document
pages collection at the
specified index.
Creates a new pdf page
with the specified size,
margins and orientation
and inserts it into the pdf
document pages
collection at the specified
index.

See Also
PdfDocument Class
SelectPdf Namespace

536

SelectPdf Pdf Library for .NET

PdfDocument.InsertPage Method (Int32, PdfPage)


Inserts the specified page into the pdf document pages collection at the specified
index.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public void InsertPage(
int pageIndex,
PdfPage pdfPage
)
VB
Public Sub InsertPage (
pageIndex As Integer,
pdfPage As PdfPage
)
Parameters
pageIndex
Type: System.Int32
The index where the pdf page will be inserted.
pdfPage
Type: SelectPdf.PdfPage
The pdf page to be inserted into the collection.

Remarks
The specified page can belong to another pdf document.

Note
The source pdf document must remain opened until the current document is
saved.

See Also
PdfDocument Class
InsertPage Overload
SelectPdf Namespace

537

SelectPdf Pdf Library for .NET

PdfDocument.InsertPage Method (Int32,


PdfCustomPageSize, PdfMargins, PdfPageOrientation)
Creates a new pdf page with the specified size, margins and orientation and inserts
it into the pdf document pages collection at the specified index.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public PdfPage InsertPage(
int index,
PdfCustomPageSize pageSize,
PdfMargins pageMargins,
PdfPageOrientation pageOrientation
)
VB
Public Function InsertPage (
index As Integer,
pageSize As PdfCustomPageSize,
pageMargins As PdfMargins,
pageOrientation As PdfPageOrientation
) As PdfPage
Parameters
index
Type: System.Int32
The index where the new pdf page will be inserted.
pageSize
Type: SelectPdf.PdfCustomPageSize
The pdf page size.
pageMargins
Type: SelectPdf.PdfMargins
The pdf page margins.
pageOrientation
Type: SelectPdf.PdfPageOrientation
The pdf page orientation.
Return Value
Type: PdfPageThe newly created pdf page.

See Also
PdfDocument Class
InsertPage Overload
SelectPdf Namespace
538

SelectPdf Pdf Library for .NET

539

SelectPdf Pdf Library for .NET

PdfDocument.RemovePage Method
Removes the specified page from the pdf document pages collection.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public void RemovePage(
PdfPage pdfPage
)
VB
Public Sub RemovePage (
pdfPage As PdfPage
)
Parameters
pdfPage
Type: SelectPdf.PdfPage
The pdf page to be removed.

See Also
PdfDocument Class
SelectPdf Namespace

540

SelectPdf Pdf Library for .NET

PdfDocument.RemovePageAt Method
Removes the pdf page at the specified index in pdf document pages collection.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public void RemovePageAt(
int index
)
VB
Public Sub RemovePageAt (
index As Integer
)
Parameters
index
Type: System.Int32
The zero based index of the pdf page to be removed.

See Also
PdfDocument Class
SelectPdf Namespace

541

SelectPdf Pdf Library for .NET

PdfDocument.Save Method
Overload List
Name
Save()
Save(Stream)
Save(String)
Save(HttpResponse,
Boolean, String)

Description
Saves the pdf document
as byte array.
Saves the pdf document
to the specified stream.
Saves the pdf document
to the specified file.
Saves the pdf document
to a HTTP stream.

See Also
PdfDocument Class
SelectPdf Namespace

542

SelectPdf Pdf Library for .NET

PdfDocument.Save Method
Saves the pdf document as byte array.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public byte[] Save()
VB
Public Function Save As Byte()
Return Value
Type: Byte[]The byte array representation of the document.

Remarks
The byte array can be further saved to a file or sent over HTTP as a response to the
browser.

See Also
PdfDocument Class
Save Overload
SelectPdf Namespace

543

SelectPdf Pdf Library for .NET

PdfDocument.Save Method (Stream)


Saves the pdf document to the specified stream.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public void Save(
Stream stream
)
VB
Public Sub Save (
stream As Stream
)
Parameters
stream
Type: System.IO.Stream
The stream where to save the pdf document.

See Also
PdfDocument Class
Save Overload
SelectPdf Namespace

544

SelectPdf Pdf Library for .NET

PdfDocument.Save Method (String)


Saves the pdf document to the specified file.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public void Save(
string fileName
)
VB
Public Sub Save (
fileName As String
)
Parameters
fileName
Type: System.String
The name of the file where to save the document. It can be a full path or a relative
path.

See Also
PdfDocument Class
Save Overload
SelectPdf Namespace

545

SelectPdf Pdf Library for .NET

PdfDocument.Save Method (HttpResponse, Boolean,


String)
Saves the pdf document to a HTTP stream.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public void Save(
HttpResponse httpResponse,
bool displayInline,
string fileName
)
VB
Public Sub Save (
httpResponse As HttpResponse,
displayInline As Boolean,
fileName As String
)
Parameters
httpResponse
Type: System.Web.HttpResponse
The HTTP response object.
displayInline
Type: System.Boolean
If this is true, the pdf document will be automatically opened in browser, otherwise
the user will be asked to save or open the downloaded pdf document.
fileName
Type: System.String
The name of the pdf document. This name is used by the browser when it opens the
pdf document inline or the name suggested for saving the document when the
document is sent as an attachment.

See Also
PdfDocument Class
Save Overload
SelectPdf Namespace

546

SelectPdf Pdf Library for .NET

PdfDocument.PdfDocument Properties
The PdfDocument type exposes the following members.

Properties
Name
Bookmarks

CompressionLevel

DocumentInformation

Fonts
Footer

Header

JpegCompressionEnabled

JpegCompressionLevel

Margins
OpenAction

Pages
Security

Templates
ViewerPreferences

Description
Gets the bookmarks
collection of the pdf
document.
Gets or sets the pdf
document compression
level.
Gets a reference to the
object that specifies the
pdf document properties.
Gets the pdf document
fonts collection.
Represents the default
pdf document footer
template.
Represents the default
pdf document header
template.
Gets or sets a flag
indicating if the JPEG
compression is enabled or
not for the images in the
generated pdf document.
Gets or sets the
compression level of
images in the generated
pdf document.
The default pdf document
margins.
The action to be
performed when the pdf
document is opened.
Gets the pdf document
pages collection.
Gets a reference to the
object that specifies the
pdf document security
settings.
Gets the pdf document
templates collection.
Controls how the pdf
document will appear in a
547

SelectPdf Pdf Library for .NET


pdf viewer (like Adobe
Reader).

See Also
PdfDocument Class
SelectPdf Namespace

548

SelectPdf Pdf Library for .NET

PdfDocument.Bookmarks Property
Gets the bookmarks collection of the pdf document.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public PdfBookmarksCollection Bookmarks { get; }
VB
Public ReadOnly Property Bookmarks As PdfBookmarksCollection
Get
Property Value
Type: PdfBookmarksCollection

See Also
PdfDocument Class
SelectPdf Namespace

549

SelectPdf Pdf Library for .NET

PdfDocument.CompressionLevel Property
Gets or sets the pdf document compression level.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public PdfCompressionLevel CompressionLevel { get; set; }
VB
Public Property CompressionLevel As PdfCompressionLevel
Get
Set
Property Value
Type: PdfCompressionLevel

See Also
PdfDocument Class
SelectPdf Namespace

550

SelectPdf Pdf Library for .NET

PdfDocument.DocumentInformation Property
Gets a reference to the object that specifies the pdf document properties.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public PdfDocumentInformation DocumentInformation { get; }
VB
Public ReadOnly Property DocumentInformation As
PdfDocumentInformation
Get
Property Value
Type: PdfDocumentInformation

See Also
PdfDocument Class
SelectPdf Namespace

551

SelectPdf Pdf Library for .NET

PdfDocument.Fonts Property
Gets the pdf document fonts collection.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public PdfFontCollection Fonts { get; }
VB
Public ReadOnly Property Fonts As PdfFontCollection
Get
Property Value
Type: PdfFontCollection

See Also
PdfDocument Class
SelectPdf Namespace

552

SelectPdf Pdf Library for .NET

PdfDocument.Footer Property
Represents the default pdf document footer template.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public PdfTemplate Footer { get; set; }
VB
Public Property Footer As PdfTemplate
Get
Set
Property Value
Type: PdfTemplate

Remarks
The footer space is automatically taken into account when calculating the available
space for rendering in a pdf page.

This template is automatically docked to the bottom of the pdf page.

See Also
PdfDocument Class
SelectPdf Namespace

553

SelectPdf Pdf Library for .NET

PdfDocument.Header Property
Represents the default pdf document header template.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public PdfTemplate Header { get; set; }
VB
Public Property Header As PdfTemplate
Get
Set
Property Value
Type: PdfTemplate

Remarks
The header space is automatically taken into account when calculating the available
space for rendering in a pdf page.

This template is automatically docked to the top of the pdf page.

See Also
PdfDocument Class
SelectPdf Namespace

554

SelectPdf Pdf Library for .NET

PdfDocument.JpegCompressionEnabled Property
Gets or sets a flag indicating if the JPEG compression is enabled or not for the
images in the generated pdf document.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public bool JpegCompressionEnabled { get; set; }
VB
Public Property JpegCompressionEnabled As Boolean
Get
Set
Property Value
Type: Boolean

Remarks
By default the JPEG compression is enabled to reduce the size of the generated pdf
document. When the JPEG compression is enabled the quality of the images in the
generated pdf is lower than the quality of the original images from the web page,
and this quality depends on the JpegCompressionLevel parameter. When the
JpegCompressionLevel is increased, the quality of the images in pdf decreases.

See Also
PdfDocument Class
SelectPdf Namespace

555

SelectPdf Pdf Library for .NET

PdfDocument.JpegCompressionLevel Property
Gets or sets the compression level of images in the generated pdf document.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public int JpegCompressionLevel { get; set; }
VB
Public Property JpegCompressionLevel As Integer
Get
Set
Property Value
Type: Int32

Remarks
This property can take values between 0 and 100. It has effect only when the
JpegCompressionEnabled is set to true. When the JpegCompressionLevel is 0, the
compression rate is the lowest and the quality of the images is the best. When the
JpegCompressionLevel is 100, the compression rate is the highest and quality of
the images in PDF is the worst.

The default JPEG compression level is 10, which should offer a good balance
between the compression rate and the quality of the images in pdf.

See Also
PdfDocument Class
SelectPdf Namespace

556

SelectPdf Pdf Library for .NET

PdfDocument.Margins Property
The default pdf document margins.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public PdfMargins Margins { get; set; }
VB
Public Property Margins As PdfMargins
Get
Set
Property Value
Type: PdfMargins

Remarks
A new pages will use the default margins if no margins are specified when the page
is added.

See Also
PdfDocument Class
SelectPdf Namespace

557

SelectPdf Pdf Library for .NET

PdfDocument.OpenAction Property
The action to be performed when the pdf document is opened.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public PdfDocumentOpenAction OpenAction { get; }
VB
Public ReadOnly Property OpenAction As PdfDocumentOpenAction
Get
Property Value
Type: PdfDocumentOpenAction

Remarks
The pdf document can perform 2 types of actions when it is opened:

PdfActionGoTo
- The pdf document opens at a specific PdfDestination.

PdfActionJavaScript
- The pdf document will run a specific javascript.

See Also
PdfDocument Class
SelectPdf Namespace

558

SelectPdf Pdf Library for .NET

PdfDocument.Pages Property
Gets the pdf document pages collection.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public PdfPageCollection Pages { get; }
VB
Public ReadOnly Property Pages As PdfPageCollection
Get
Property Value
Type: PdfPageCollection

See Also
PdfDocument Class
SelectPdf Namespace

559

SelectPdf Pdf Library for .NET

PdfDocument.Security Property
Gets a reference to the object that specifies the pdf document security settings.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public PdfDocumentSecurity Security { get; }
VB
Public ReadOnly Property Security As PdfDocumentSecurity
Get
Property Value
Type: PdfDocumentSecurity

See Also
PdfDocument Class
SelectPdf Namespace

560

SelectPdf Pdf Library for .NET

PdfDocument.Templates Property
Gets the pdf document templates collection.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public PdfTemplateCollection Templates { get; }
VB
Public ReadOnly Property Templates As PdfTemplateCollection
Get
Property Value
Type: PdfTemplateCollection

See Also
PdfDocument Class
SelectPdf Namespace

561

SelectPdf Pdf Library for .NET

PdfDocument.ViewerPreferences Property
Controls how the pdf document will appear in a pdf viewer (like Adobe Reader).
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public PdfViewerPreferences ViewerPreferences { get; }
VB
Public ReadOnly Property ViewerPreferences As PdfViewerPreferences
Get
Property Value
Type: PdfViewerPreferences

See Also
PdfDocument Class
SelectPdf Namespace

562

SelectPdf Pdf Library for .NET

PdfDocumentException Class
Exception thrown by the pdf document related objects.

Inheritance Hierarchy
System.Object System.Exception

SelectPdf.PdfDocumentException

Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public class PdfDocumentException : Exception
VB
Public Class PdfDocumentException
Inherits Exception

Constructors
Name
PdfDocumentException(St
ring)
PdfDocumentException(St
ring, Exception)

Description
Constructor.
Constructor.

See Also
SelectPdf Namespace

563

SelectPdf Pdf Library for .NET

PdfDocumentException Constructor
Overload List
Name
PdfDocumentException(St
ring)
PdfDocumentException(St
ring, Exception)

Description
Constructor.
Constructor.

See Also
PdfDocumentException Class
SelectPdf Namespace

564

SelectPdf Pdf Library for .NET

PdfDocumentException Constructor (String)


Constructor.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public PdfDocumentException(
string message
)
VB
Public Sub New (
message As String
)
Parameters
message
Type: System.String
The exception message.

See Also
PdfDocumentException Class
PdfDocumentException Overload
SelectPdf Namespace

565

SelectPdf Pdf Library for .NET

PdfDocumentException Constructor (String, Exception)


Constructor.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public PdfDocumentException(
string message,
Exception innerException
)
VB
Public Sub New (
message As String,
innerException As Exception
)
Parameters
message
Type: System.String
The exception message.
innerException
Type: System.Exception
The inner exception that triggered this exception.

See Also
PdfDocumentException Class
PdfDocumentException Overload
SelectPdf Namespace

566

SelectPdf Pdf Library for .NET

PdfDocumentInformation Class
This class provides the possibility to control the pdf document properties.

Inheritance Hierarchy
System.Object SelectPdf.PdfDocumentInformation
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public class PdfDocumentInformation
VB
Public Class PdfDocumentInformation
The PdfDocumentInformation type exposes the following members.

Properties
Name
Author
CreationDate

Keywords
Subject
Title

Description
Gets or sets the name of
the pdf document author.
Gets or sets the date and
time when the pdf
document was created.
Gets or sets the pdf
document keywords.
Gets or sets the subject
of the pdf document.
Gets or sets the pdf
document title.

Remarks
Using this class, the pdf document properties (author, title, keywords, etc) can be
controlled.

See Also
SelectPdf Namespace

567

SelectPdf Pdf Library for .NET

PdfDocumentInformation.PdfDocumentInformation
Properties
The PdfDocumentInformation type exposes the following members.

Properties
Name
Author
CreationDate

Keywords
Subject
Title

Description
Gets or sets the name of
the pdf document author.
Gets or sets the date and
time when the pdf
document was created.
Gets or sets the pdf
document keywords.
Gets or sets the subject
of the pdf document.
Gets or sets the pdf
document title.

See Also
PdfDocumentInformation Class
SelectPdf Namespace

568

SelectPdf Pdf Library for .NET

PdfDocumentInformation.Author Property
Gets or sets the name of the pdf document author.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public string Author { get; set; }
VB
Public Property Author As String
Get
Set
Property Value
Type: String

See Also
PdfDocumentInformation Class
SelectPdf Namespace

569

SelectPdf Pdf Library for .NET

PdfDocumentInformation.CreationDate Property
Gets or sets the date and time when the pdf document was created.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public DateTime CreationDate { get; set; }
VB
Public Property CreationDate As DateTime
Get
Set
Property Value
Type: DateTime

See Also
PdfDocumentInformation Class
SelectPdf Namespace

570

SelectPdf Pdf Library for .NET

PdfDocumentInformation.Keywords Property
Gets or sets the pdf document keywords.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public string Keywords { get; set; }
VB
Public Property Keywords As String
Get
Set
Property Value
Type: String

See Also
PdfDocumentInformation Class
SelectPdf Namespace

571

SelectPdf Pdf Library for .NET

PdfDocumentInformation.Subject Property
Gets or sets the subject of the pdf document.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public string Subject { get; set; }
VB
Public Property Subject As String
Get
Set
Property Value
Type: String

See Also
PdfDocumentInformation Class
SelectPdf Namespace

572

SelectPdf Pdf Library for .NET

PdfDocumentInformation.Title Property
Gets or sets the pdf document title.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public string Title { get; set; }
VB
Public Property Title As String
Get
Set
Property Value
Type: String

See Also
PdfDocumentInformation Class
SelectPdf Namespace

573

SelectPdf Pdf Library for .NET

PdfDocumentOpenAction Class
Encapsulates an action to be performed when the pdf document is opened.

Inheritance Hierarchy
System.Object SelectPdf.PdfDocumentOpenAction
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public class PdfDocumentOpenAction
VB
Public Class PdfDocumentOpenAction
The PdfDocumentOpenAction type exposes the following members.

Properties
Name
Action

Description
The pdf document open
action as an instance of
the PdfActionGoTo or
PdfActionJavaScript
classes.

Remarks
The pdf document can perform 2 types of actions when it is opened:

PdfActionGoTo
- The pdf document opens at a specific PdfDestination.

PdfActionJavaScript
- The pdf document will run a specific javascript.

See Also
SelectPdf Namespace

574

SelectPdf Pdf Library for .NET

PdfDocumentOpenAction.PdfDocumentOpenAction
Properties
The PdfDocumentOpenAction type exposes the following members.

Properties
Name
Action

Description
The pdf document open
action as an instance of
the PdfActionGoTo or
PdfActionJavaScript
classes.

See Also
PdfDocumentOpenAction Class
SelectPdf Namespace

575

SelectPdf Pdf Library for .NET

PdfDocumentOpenAction.Action Property
The pdf document open action as an instance of the PdfActionGoTo or
PdfActionJavaScript classes.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public PdfAction Action { get; set; }
VB
Public Property Action As PdfAction
Get
Set
Property Value
Type: PdfAction

See Also
PdfDocumentOpenAction Class
SelectPdf Namespace

576

SelectPdf Pdf Library for .NET

PdfDocumentSecurity Class
This class provides the options to control the pdf document security.

Inheritance Hierarchy
System.Object SelectPdf.PdfDocumentSecurity
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public class PdfDocumentSecurity
VB
Public Class PdfDocumentSecurity
The PdfDocumentSecurity type exposes the following members.

Properties
Name
CanAssembleDocument

CanCopyContent

CanEditAnnotations
CanEditContent
CanFillFormFields
CanPrint
OwnerPassword
UserPassword

Description
Allows inserting, rotating
or deleting pages or
bookmarks.
Allows copying page
contents such as text and
images.
Allows document
annotations editing.
Allows modifying
document content.
Allows filling in form
fields.
Allows printing.
Sets or gets the owner
password.
Gets or sets the user
password.

See Also
SelectPdf Namespace

577

SelectPdf Pdf Library for .NET

PdfDocumentSecurity.PdfDocumentSecurity Properties
The PdfDocumentSecurity type exposes the following members.

Properties
Name
CanAssembleDocument

CanCopyContent

CanEditAnnotations
CanEditContent
CanFillFormFields
CanPrint
OwnerPassword
UserPassword

Description
Allows inserting, rotating
or deleting pages or
bookmarks.
Allows copying page
contents such as text and
images.
Allows document
annotations editing.
Allows modifying
document content.
Allows filling in form
fields.
Allows printing.
Sets or gets the owner
password.
Gets or sets the user
password.

See Also
PdfDocumentSecurity Class
SelectPdf Namespace

578

SelectPdf Pdf Library for .NET

PdfDocumentSecurity.CanAssembleDocument Property
Allows inserting, rotating or deleting pages or bookmarks.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public bool CanAssembleDocument { get; set; }
VB
Public Property CanAssembleDocument As Boolean
Get
Set
Property Value
Type: Boolean

See Also
PdfDocumentSecurity Class
SelectPdf Namespace

579

SelectPdf Pdf Library for .NET

PdfDocumentSecurity.CanCopyContent Property
Allows copying page contents such as text and images.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public bool CanCopyContent { get; set; }
VB
Public Property CanCopyContent As Boolean
Get
Set
Property Value
Type: Boolean

See Also
PdfDocumentSecurity Class
SelectPdf Namespace

580

SelectPdf Pdf Library for .NET

PdfDocumentSecurity.CanEditAnnotations Property
Allows document annotations editing.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public bool CanEditAnnotations { get; set; }
VB
Public Property CanEditAnnotations As Boolean
Get
Set
Property Value
Type: Boolean

See Also
PdfDocumentSecurity Class
SelectPdf Namespace

581

SelectPdf Pdf Library for .NET

PdfDocumentSecurity.CanEditContent Property
Allows modifying document content.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public bool CanEditContent { get; set; }
VB
Public Property CanEditContent As Boolean
Get
Set
Property Value
Type: Boolean

See Also
PdfDocumentSecurity Class
SelectPdf Namespace

582

SelectPdf Pdf Library for .NET

PdfDocumentSecurity.CanFillFormFields Property
Allows filling in form fields.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public bool CanFillFormFields { get; set; }
VB
Public Property CanFillFormFields As Boolean
Get
Set
Property Value
Type: Boolean

See Also
PdfDocumentSecurity Class
SelectPdf Namespace

583

SelectPdf Pdf Library for .NET

PdfDocumentSecurity.CanPrint Property
Allows printing.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public bool CanPrint { get; set; }
VB
Public Property CanPrint As Boolean
Get
Set
Property Value
Type: Boolean

See Also
PdfDocumentSecurity Class
SelectPdf Namespace

584

SelectPdf Pdf Library for .NET

PdfDocumentSecurity.OwnerPassword Property
Sets or gets the owner password.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public string OwnerPassword { get; set; }
VB
Public Property OwnerPassword As String
Get
Set
Property Value
Type: String

Remarks
This password is required to change permissions of the pdf document (like printing
or editing).

See Also
PdfDocumentSecurity Class
SelectPdf Namespace

585

SelectPdf Pdf Library for .NET

PdfDocumentSecurity.UserPassword Property
Gets or sets the user password.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public string UserPassword { get; set; }
VB
Public Property UserPassword As String
Get
Set
Property Value
Type: String

Remarks
This password is required to open the pdf document.

See Also
PdfDocumentSecurity Class
SelectPdf Namespace

586

SelectPdf Pdf Library for .NET

PdfElement Class
The base class for some graphic elements from a pdf document.

Inheritance Hierarchy
System.Object SelectPdf.PdfPageElement SelectPdf.PdfElement
SelectPdf.PdfB
ezierCurveElement
SelectPdf.PdfEllipseArcElement
SelectPdf.PdfEllipseElemen
t
SelectPdf.PdfEllipseSliceElement
SelectPdf.PdfHtmlElement
SelectPdf.PdfI
mageElement
SelectPdf.PdfLineElement
SelectPdf.PdfPolygonElement
Sele
ctPdf.PdfRectangleElement
SelectPdf.PdfTextElement
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public abstract class PdfElement : PdfPageElement
VB
Public MustInherit Class PdfElement
Inherits PdfPageElement
The PdfElement type exposes the following members.

Constructors
Name
PdfElement

Description
Creates a new instance of
the PdfElement class.

Name
Rotate

Description
Rotes the coordinate
system before rendering
the pdf element.
Scales the coordinate
system before rendering
the pdf element.
Skews the x and y axis by
an two different angles
before rendering the pdf
element.
Translates the coordinate
system before rendering
the pdf element.

Methods

Scale

Skew

Translate

Properties
Name
BackColor

Description
Gets or sets the pdf

587

SelectPdf Pdf Library for .NET

Blending

ColorSpace

ForeColor
Gradient
LineStyle

Rotated

Scaled

Skewed

Translated

Transparency

element background
color.
Gets or sets the blending
mode for transparent
rendering of the pdf
element.
Gets or sets the color
space for the pdf element
rendering.
Gets or sets the pdf
element foreground color.
Gets or sets the gradient
used to fill a shape.
Gets or sets the line style
for pdf elements
rendering lines.
A flag to indicate if the
current pdf element was
rotated.
A flag to indicate if the
current pdf element was
scaled.
A flag to indicate if the
current pdf element was
skewed.
A flag to indicate if the
current pdf element was
translated.
Gets or sets the pdf
element transparency.

Remarks
Handles common properties that most of the pdf elements have.

See Also
SelectPdf Namespace

588

SelectPdf Pdf Library for .NET

PdfElement Constructor
Creates a new instance of the PdfElement class.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public PdfElement()
VB
Public Sub New

See Also
PdfElement Class
SelectPdf Namespace

589

SelectPdf Pdf Library for .NET

PdfElement.PdfElement Methods
The PdfElement type exposes the following members.

Methods
Name
Rotate

Scale

Skew

Translate

Description
Rotes the coordinate
system before rendering
the pdf element.
Scales the coordinate
system before rendering
the pdf element.
Skews the x and y axis by
an two different angles
before rendering the pdf
element.
Translates the coordinate
system before rendering
the pdf element.

See Also
PdfElement Class
SelectPdf Namespace

590

SelectPdf Pdf Library for .NET

PdfElement.Rotate Method
Rotes the coordinate system before rendering the pdf element.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public void Rotate(
float angle
)
VB
Public Sub Rotate (
angle As Single
)
Parameters
angle
Type: System.Single
The angle of rotation in degrees.

Remarks
The coordinate system axes are rotated clockwise by the specified angle before
rendering the element. The coordinates of the pdf element are relative to the
rotated coordinates system.
Note
For text rotations, the Direction property of the PdfTextElement object should be
used.

See Also
PdfElement Class
SelectPdf Namespace

591

SelectPdf Pdf Library for .NET

PdfElement.Scale Method
Scales the coordinate system before rendering the pdf element.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public void Scale(
float sx,
float sy
)
VB
Public Sub Scale (
sx As Single,
sy As Single
)
Parameters
sx
Type: System.Single
The value by which to scale the coordinate system on the x-axis direction.
sy
Type: System.Single
The value by which to scale the coordinate system on the y-axis direction.

Remarks
The coordinates are scaled so that 1 unit in the horizontal and vertical direction of
the new coordinate system is the same size as sx and sy units respectively, in the
previous coordinate system.

See Also
PdfElement Class
SelectPdf Namespace

592

SelectPdf Pdf Library for .NET

PdfElement.Skew Method
Skews the x and y axis by an two different angles before rendering the pdf element.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public void Skew(
float angleX,
float angleY
)
VB
Public Sub Skew (
angleX As Single,
angleY As Single
)
Parameters
angleX
Type: System.Single
Skew x angle.
angleY
Type: System.Single
Skew y angle.

See Also
PdfElement Class
SelectPdf Namespace

593

SelectPdf Pdf Library for .NET

PdfElement.Translate Method
Translates the coordinate system before rendering the pdf element.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public void Translate(
float tx,
float ty
)
VB
Public Sub Translate (
tx As Single,
ty As Single
)
Parameters
tx
Type: System.Single
The distance to translate the origin of the coordinate system on the x-axis direction.
ty
Type: System.Single
The distance to translate the origin of the coordinate system on the y-axis direction.

Remarks
The coordinates of the pdf element are relative to the translated coordinate system.

See Also
PdfElement Class
SelectPdf Namespace

594

SelectPdf Pdf Library for .NET

PdfElement.PdfElement Properties
The PdfElement type exposes the following members.

Properties
Name
BackColor

Blending

ColorSpace

ForeColor
Gradient
LineStyle

Rotated

Scaled

Skewed

Translated

Transparency

Description
Gets or sets the pdf
element background
color.
Gets or sets the blending
mode for transparent
rendering of the pdf
element.
Gets or sets the color
space for the pdf element
rendering.
Gets or sets the pdf
element foreground color.
Gets or sets the gradient
used to fill a shape.
Gets or sets the line style
for pdf elements
rendering lines.
A flag to indicate if the
current pdf element was
rotated.
A flag to indicate if the
current pdf element was
scaled.
A flag to indicate if the
current pdf element was
skewed.
A flag to indicate if the
current pdf element was
translated.
Gets or sets the pdf
element transparency.

See Also
PdfElement Class
SelectPdf Namespace

595

SelectPdf Pdf Library for .NET

PdfElement.BackColor Property
Gets or sets the pdf element background color.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public PdfColor BackColor { get; set; }
VB
Public Property BackColor As PdfColor
Get
Set
Property Value
Type: PdfColor

See Also
PdfElement Class
SelectPdf Namespace

596

SelectPdf Pdf Library for .NET

PdfElement.Blending Property
Gets or sets the blending mode for transparent rendering of the pdf element.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public PdfBlending Blending { get; set; }
VB
Public Property Blending As PdfBlending
Get
Set
Property Value
Type: PdfBlending

See Also
PdfElement Class
SelectPdf Namespace

597

SelectPdf Pdf Library for .NET

PdfElement.ColorSpace Property
Gets or sets the color space for the pdf element rendering.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public PdfColorSpace ColorSpace { get; set; }
VB
Public Property ColorSpace As PdfColorSpace
Get
Set
Property Value
Type: PdfColorSpace

See Also
PdfElement Class
SelectPdf Namespace

598

SelectPdf Pdf Library for .NET

PdfElement.ForeColor Property
Gets or sets the pdf element foreground color.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public PdfColor ForeColor { get; set; }
VB
Public Property ForeColor As PdfColor
Get
Set
Property Value
Type: PdfColor

See Also
PdfElement Class
SelectPdf Namespace

599

SelectPdf Pdf Library for .NET

PdfElement.Gradient Property
Gets or sets the gradient used to fill a shape.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public PdfGradient Gradient { get; set; }
VB
Public Property Gradient As PdfGradient
Get
Set
Property Value
Type: PdfGradient

See Also
PdfElement Class
SelectPdf Namespace

600

SelectPdf Pdf Library for .NET

PdfElement.LineStyle Property
Gets or sets the line style for pdf elements rendering lines.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public PdfLineStyle LineStyle { get; set; }
VB
Public Property LineStyle As PdfLineStyle
Get
Set
Property Value
Type: PdfLineStyle

See Also
PdfElement Class
SelectPdf Namespace

601

SelectPdf Pdf Library for .NET

PdfElement.Rotated Property
A flag to indicate if the current pdf element was rotated.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public bool Rotated { get; }
VB
Public ReadOnly Property Rotated As Boolean
Get
Property Value
Type: Boolean

See Also
PdfElement Class
SelectPdf Namespace

602

SelectPdf Pdf Library for .NET

PdfElement.Scaled Property
A flag to indicate if the current pdf element was scaled.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public bool Scaled { get; }
VB
Public ReadOnly Property Scaled As Boolean
Get
Property Value
Type: Boolean

See Also
PdfElement Class
SelectPdf Namespace

603

SelectPdf Pdf Library for .NET

PdfElement.Skewed Property
A flag to indicate if the current pdf element was skewed.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public bool Skewed { get; }
VB
Public ReadOnly Property Skewed As Boolean
Get
Property Value
Type: Boolean

See Also
PdfElement Class
SelectPdf Namespace

604

SelectPdf Pdf Library for .NET

PdfElement.Translated Property
A flag to indicate if the current pdf element was translated.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public bool Translated { get; }
VB
Public ReadOnly Property Translated As Boolean
Get
Property Value
Type: Boolean

See Also
PdfElement Class
SelectPdf Namespace

605

SelectPdf Pdf Library for .NET

PdfElement.Transparency Property
Gets or sets the pdf element transparency.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public int Transparency { get; set; }
VB
Public Property Transparency As Integer
Get
Set
Property Value
Type: Int32

Remarks
The transparency is expressed as a value between 0 and 100.

The value 0 means completely transparent and 100 means completely opaque.

See Also
PdfElement Class
SelectPdf Namespace

606

SelectPdf Pdf Library for .NET

PdfEllipseArcElement Class
Represents an ellipse arc element drawn in a pdf document.

Inheritance Hierarchy
System.Object SelectPdf.PdfPageElement
ipseArcElement

SelectPdf.PdfElement

SelectPdf.PdfEll

Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public class PdfEllipseArcElement : PdfElement
VB
Public Class PdfEllipseArcElement
Inherits PdfElement
The PdfEllipseArcElement type exposes the following members.

Constructors
Name
PdfEllipseArcElement

Description
Constructs an ellipse arc
element.

Name
Rotate

Description
Rotes the coordinate
system before rendering
the pdf element.
(Inherited from
PdfElement.)
Scales the coordinate
system before rendering
the pdf element.
(Inherited from
PdfElement.)
Skews the x and y axis by
an two different angles
before rendering the pdf
element. (Inherited from
PdfElement.)
Translates the coordinate
system before rendering
the pdf element.
(Inherited from
PdfElement.)

Methods

Scale

Skew

Translate

607

SelectPdf Pdf Library for .NET

Properties
Name
BackColor

Blending

ColorSpace

ForeColor

Gradient

LineStyle

Rotated

Scaled

Skewed

Translated

Transparency

Description
Gets or sets the pdf
element background
color. (Inherited from
PdfElement.)
Gets or sets the blending
mode for transparent
rendering of the pdf
element. (Inherited from
PdfElement.)
Gets or sets the color
space for the pdf element
rendering. (Inherited from
PdfElement.)
Gets or sets the pdf
element foreground color.
(Inherited from
PdfElement.)
Gets or sets the gradient
used to fill a shape.
(Inherited from
PdfElement.)
Gets or sets the line style
for pdf elements
rendering lines. (Inherited
from PdfElement.)
A flag to indicate if the
current pdf element was
rotated. (Inherited from
PdfElement.)
A flag to indicate if the
current pdf element was
scaled. (Inherited from
PdfElement.)
A flag to indicate if the
current pdf element was
skewed. (Inherited from
PdfElement.)
A flag to indicate if the
current pdf element was
translated. (Inherited
from PdfElement.)
Gets or sets the pdf
element transparency.

608

SelectPdf Pdf Library for .NET


(Inherited from
PdfElement.)

See Also
SelectPdf Namespace

609

SelectPdf Pdf Library for .NET

PdfEllipseArcElement Constructor
Constructs an ellipse arc element.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public PdfEllipseArcElement(
float x,
float y,
float width,
float height,
float startAngle,
float sweepAngle
)
VB
Public Sub New (
x As Single,
y As Single,
width As Single,
height As Single,
startAngle As Single,
sweepAngle As Single
)
Parameters
x
Type: System.Single
X coordinate of the rectangle enclosing the ellipse.
y
Type: System.Single
Y coordinate of the rectangle enclosing the ellipse.
width
Type: System.Single
Width of the rectangle enclosing the ellipse.
height
Type: System.Single
Height of the rectangle enclosing the ellipse.
startAngle
Type: System.Single
The start angle in degrees of the ellipse arc measured counter-clockwise from the X
axis centered in the enclosing rectangle.

610

SelectPdf Pdf Library for .NET


sweepAngle
Type: System.Single
The sweep angle in degrees of the ellipse arc measured counter-clockwise from the
start angle of the slice.

See Also
PdfEllipseArcElement Class
SelectPdf Namespace

611

SelectPdf Pdf Library for .NET

PdfEllipseArcElement.PdfEllipseArcElement Methods
The PdfEllipseArcElement type exposes the following members.

Methods
Name
Rotate

Scale

Skew

Translate

Description
Rotes the coordinate
system before rendering
the pdf element.
(Inherited from
PdfElement.)
Scales the coordinate
system before rendering
the pdf element.
(Inherited from
PdfElement.)
Skews the x and y axis by
an two different angles
before rendering the pdf
element. (Inherited from
PdfElement.)
Translates the coordinate
system before rendering
the pdf element.
(Inherited from
PdfElement.)

See Also
PdfEllipseArcElement Class
SelectPdf Namespace

612

SelectPdf Pdf Library for .NET

PdfEllipseArcElement.PdfEllipseArcElement Properties
The PdfEllipseArcElement type exposes the following members.

Properties
Name
BackColor

Blending

ColorSpace

ForeColor

Gradient

LineStyle

Rotated

Scaled

Skewed

Translated

Description
Gets or sets the pdf
element background
color. (Inherited from
PdfElement.)
Gets or sets the blending
mode for transparent
rendering of the pdf
element. (Inherited from
PdfElement.)
Gets or sets the color
space for the pdf element
rendering. (Inherited from
PdfElement.)
Gets or sets the pdf
element foreground color.
(Inherited from
PdfElement.)
Gets or sets the gradient
used to fill a shape.
(Inherited from
PdfElement.)
Gets or sets the line style
for pdf elements
rendering lines. (Inherited
from PdfElement.)
A flag to indicate if the
current pdf element was
rotated. (Inherited from
PdfElement.)
A flag to indicate if the
current pdf element was
scaled. (Inherited from
PdfElement.)
A flag to indicate if the
current pdf element was
skewed. (Inherited from
PdfElement.)
A flag to indicate if the
current pdf element was
translated. (Inherited
from PdfElement.)
613

SelectPdf Pdf Library for .NET


Transparency

Gets or sets the pdf


element transparency.
(Inherited from
PdfElement.)

See Also
PdfEllipseArcElement Class
SelectPdf Namespace

614

SelectPdf Pdf Library for .NET

PdfEllipseElement Class
Represents an ellipse shape drawn in a pdf document.

Inheritance Hierarchy
System.Object SelectPdf.PdfPageElement SelectPdf.PdfElement
ipseElement
SelectPdf.PdfCircleElement

SelectPdf.PdfEll

Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public class PdfEllipseElement : PdfElement
VB
Public Class PdfEllipseElement
Inherits PdfElement
The PdfEllipseElement type exposes the following members.

Constructors
Name
PdfEllipseElement

Description
Constructs an ellipse
element.

Name
Rotate

Description
Rotes the coordinate
system before rendering
the pdf element.
(Inherited from
PdfElement.)
Scales the coordinate
system before rendering
the pdf element.
(Inherited from
PdfElement.)
Skews the x and y axis by
an two different angles
before rendering the pdf
element. (Inherited from
PdfElement.)
Translates the coordinate
system before rendering
the pdf element.
(Inherited from
PdfElement.)

Methods

Scale

Skew

Translate

615

SelectPdf Pdf Library for .NET

Properties
Name
BackColor

Blending

ColorSpace

ForeColor

Gradient

LineStyle

Rotated

Scaled

Skewed

Translated

Transparency

Description
Gets or sets the pdf
element background
color. (Inherited from
PdfElement.)
Gets or sets the blending
mode for transparent
rendering of the pdf
element. (Inherited from
PdfElement.)
Gets or sets the color
space for the pdf element
rendering. (Inherited from
PdfElement.)
Gets or sets the pdf
element foreground color.
(Inherited from
PdfElement.)
Gets or sets the gradient
used to fill a shape.
(Inherited from
PdfElement.)
Gets or sets the line style
for pdf elements
rendering lines. (Inherited
from PdfElement.)
A flag to indicate if the
current pdf element was
rotated. (Inherited from
PdfElement.)
A flag to indicate if the
current pdf element was
scaled. (Inherited from
PdfElement.)
A flag to indicate if the
current pdf element was
skewed. (Inherited from
PdfElement.)
A flag to indicate if the
current pdf element was
translated. (Inherited
from PdfElement.)
Gets or sets the pdf
element transparency.

616

SelectPdf Pdf Library for .NET


(Inherited from
PdfElement.)

See Also
SelectPdf Namespace

617

SelectPdf Pdf Library for .NET

PdfEllipseElement Constructor
Constructs an ellipse element.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public PdfEllipseElement(
float x,
float y,
float xRadius,
float yRadius
)
VB
Public Sub New (
x As Single,
y As Single,
xRadius As Single,
yRadius As Single
)
Parameters
x
Type: System.Single
The X coordinate where the ellipse will be rendered.
y
Type: System.Single
The Y coordinate where the ellipse will be rendered.
xRadius
Type: System.Single
The X radius of the ellipse.
yRadius
Type: System.Single
The Y radius of the ellipse.

Remarks
The ellipse will be centered in the point specified by the (x, y) coordinates.

See Also
PdfEllipseElement Class
SelectPdf Namespace

618

SelectPdf Pdf Library for .NET

PdfEllipseElement.PdfEllipseElement Methods
The PdfEllipseElement type exposes the following members.

Methods
Name
Rotate

Scale

Skew

Translate

Description
Rotes the coordinate
system before rendering
the pdf element.
(Inherited from
PdfElement.)
Scales the coordinate
system before rendering
the pdf element.
(Inherited from
PdfElement.)
Skews the x and y axis by
an two different angles
before rendering the pdf
element. (Inherited from
PdfElement.)
Translates the coordinate
system before rendering
the pdf element.
(Inherited from
PdfElement.)

See Also
PdfEllipseElement Class
SelectPdf Namespace

619

SelectPdf Pdf Library for .NET

PdfEllipseElement.PdfEllipseElement Properties
The PdfEllipseElement type exposes the following members.

Properties
Name
BackColor

Blending

ColorSpace

ForeColor

Gradient

LineStyle

Rotated

Scaled

Skewed

Translated

Description
Gets or sets the pdf
element background
color. (Inherited from
PdfElement.)
Gets or sets the blending
mode for transparent
rendering of the pdf
element. (Inherited from
PdfElement.)
Gets or sets the color
space for the pdf element
rendering. (Inherited from
PdfElement.)
Gets or sets the pdf
element foreground color.
(Inherited from
PdfElement.)
Gets or sets the gradient
used to fill a shape.
(Inherited from
PdfElement.)
Gets or sets the line style
for pdf elements
rendering lines. (Inherited
from PdfElement.)
A flag to indicate if the
current pdf element was
rotated. (Inherited from
PdfElement.)
A flag to indicate if the
current pdf element was
scaled. (Inherited from
PdfElement.)
A flag to indicate if the
current pdf element was
skewed. (Inherited from
PdfElement.)
A flag to indicate if the
current pdf element was
translated. (Inherited
from PdfElement.)
620

SelectPdf Pdf Library for .NET


Transparency

Gets or sets the pdf


element transparency.
(Inherited from
PdfElement.)

See Also
PdfEllipseElement Class
SelectPdf Namespace

621

SelectPdf Pdf Library for .NET

PdfEllipseSliceElement Class
Represents a slice from an ellipse drawn in a pdf document.

Inheritance Hierarchy
System.Object SelectPdf.PdfPageElement
ipseSliceElement

SelectPdf.PdfElement

SelectPdf.PdfEll

Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public class PdfEllipseSliceElement : PdfElement
VB
Public Class PdfEllipseSliceElement
Inherits PdfElement
The PdfEllipseSliceElement type exposes the following members.

Constructors
Name
PdfEllipseSliceElement

Description
Constructs an ellipse slice
element.

Name
Rotate

Description
Rotes the coordinate
system before rendering
the pdf element.
(Inherited from
PdfElement.)
Scales the coordinate
system before rendering
the pdf element.
(Inherited from
PdfElement.)
Skews the x and y axis by
an two different angles
before rendering the pdf
element. (Inherited from
PdfElement.)
Translates the coordinate
system before rendering
the pdf element.
(Inherited from
PdfElement.)

Methods

Scale

Skew

Translate

622

SelectPdf Pdf Library for .NET

Properties
Name
BackColor

Blending

ColorSpace

ForeColor

Gradient

LineStyle

Rotated

Scaled

Skewed

Translated

Transparency

Description
Gets or sets the pdf
element background
color. (Inherited from
PdfElement.)
Gets or sets the blending
mode for transparent
rendering of the pdf
element. (Inherited from
PdfElement.)
Gets or sets the color
space for the pdf element
rendering. (Inherited from
PdfElement.)
Gets or sets the pdf
element foreground color.
(Inherited from
PdfElement.)
Gets or sets the gradient
used to fill a shape.
(Inherited from
PdfElement.)
Gets or sets the line style
for pdf elements
rendering lines. (Inherited
from PdfElement.)
A flag to indicate if the
current pdf element was
rotated. (Inherited from
PdfElement.)
A flag to indicate if the
current pdf element was
scaled. (Inherited from
PdfElement.)
A flag to indicate if the
current pdf element was
skewed. (Inherited from
PdfElement.)
A flag to indicate if the
current pdf element was
translated. (Inherited
from PdfElement.)
Gets or sets the pdf
element transparency.

623

SelectPdf Pdf Library for .NET


(Inherited from
PdfElement.)

See Also
SelectPdf Namespace

624

SelectPdf Pdf Library for .NET

PdfEllipseSliceElement Constructor
Constructs an ellipse slice element.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public PdfEllipseSliceElement(
float x,
float y,
float width,
float height,
float startAngle,
float sweepAngle
)
VB
Public Sub New (
x As Single,
y As Single,
width As Single,
height As Single,
startAngle As Single,
sweepAngle As Single
)
Parameters
x
Type: System.Single
X coordinate of the rectangle enclosing the ellipse.
y
Type: System.Single
Y coordinate of the rectangle enclosing the ellipse.
width
Type: System.Single
Width of the rectangle enclosing the ellipse.
height
Type: System.Single
Height of the rectangle enclosing the ellipse.
startAngle
Type: System.Single
The start angle in degrees of the ellipse slice measured counter-clockwise from the
X axis centered in the enclosing rectangle.

625

SelectPdf Pdf Library for .NET


sweepAngle
Type: System.Single
The sweep angle in degrees of the ellipse slice measured counter-clockwise from
the start angle of the slice.

See Also
PdfEllipseSliceElement Class
SelectPdf Namespace

626

SelectPdf Pdf Library for .NET

PdfEllipseSliceElement.PdfEllipseSliceElement Methods
The PdfEllipseSliceElement type exposes the following members.

Methods
Name
Rotate

Scale

Skew

Translate

Description
Rotes the coordinate
system before rendering
the pdf element.
(Inherited from
PdfElement.)
Scales the coordinate
system before rendering
the pdf element.
(Inherited from
PdfElement.)
Skews the x and y axis by
an two different angles
before rendering the pdf
element. (Inherited from
PdfElement.)
Translates the coordinate
system before rendering
the pdf element.
(Inherited from
PdfElement.)

See Also
PdfEllipseSliceElement Class
SelectPdf Namespace

627

SelectPdf Pdf Library for .NET

PdfEllipseSliceElement.PdfEllipseSliceElement Properties
The PdfEllipseSliceElement type exposes the following members.

Properties
Name
BackColor

Blending

ColorSpace

ForeColor

Gradient

LineStyle

Rotated

Scaled

Skewed

Translated

Description
Gets or sets the pdf
element background
color. (Inherited from
PdfElement.)
Gets or sets the blending
mode for transparent
rendering of the pdf
element. (Inherited from
PdfElement.)
Gets or sets the color
space for the pdf element
rendering. (Inherited from
PdfElement.)
Gets or sets the pdf
element foreground color.
(Inherited from
PdfElement.)
Gets or sets the gradient
used to fill a shape.
(Inherited from
PdfElement.)
Gets or sets the line style
for pdf elements
rendering lines. (Inherited
from PdfElement.)
A flag to indicate if the
current pdf element was
rotated. (Inherited from
PdfElement.)
A flag to indicate if the
current pdf element was
scaled. (Inherited from
PdfElement.)
A flag to indicate if the
current pdf element was
skewed. (Inherited from
PdfElement.)
A flag to indicate if the
current pdf element was
translated. (Inherited
from PdfElement.)
628

SelectPdf Pdf Library for .NET


Transparency

Gets or sets the pdf


element transparency.
(Inherited from
PdfElement.)

See Also
PdfEllipseSliceElement Class
SelectPdf Namespace

629

SelectPdf Pdf Library for .NET

PdfEncryptionKeySize Enumeration
The length of the pdf encryption key.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public enum PdfEncryptionKeySize
VB
Public Enumeration PdfEncryptionKeySize

Members
Member name
EncryptKey128Bi
t
EncryptKey40Bit

Value
2

Description
128 bit length.

40 bit length.

See Also
SelectPdf Namespace

630

SelectPdf Pdf Library for .NET

PdfExternalFileElement Class
Represents a link to an external file in a pdf document.

Inheritance Hierarchy
System.Object SelectPdf.PdfPageElement

SelectPdf.PdfExternalFileElement

Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public class PdfExternalFileElement : PdfPageElement
VB
Public Class PdfExternalFileElement
Inherits PdfPageElement
The PdfExternalFileElement type exposes the following members.

Constructors
Name
PdfExternalFileElement

Description
Constructs an external
file pdf element.

Name
FileName

Description
Gets or sets the external
file path.
Gets or sets the link
rectangle in the pdf page.

Properties

LinkRectangle

See Also
SelectPdf Namespace

631

SelectPdf Pdf Library for .NET

PdfExternalFileElement Constructor
Constructs an external file pdf element.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public PdfExternalFileElement(
RectangleF linkRectangle,
string fileName
)
VB
Public Sub New (
linkRectangle As RectangleF,
fileName As String
)
Parameters
linkRectangle
Type: System.Drawing.RectangleF
The link rectangle in the pdf page.
fileName
Type: System.String
The external file.

See Also
PdfExternalFileElement Class
SelectPdf Namespace

632

SelectPdf Pdf Library for .NET

PdfExternalFileElement.PdfExternalFileElement Properties
The PdfExternalFileElement type exposes the following members.

Properties
Name
FileName
LinkRectangle

Description
Gets or sets the external
file path.
Gets or sets the link
rectangle in the pdf page.

See Also
PdfExternalFileElement Class
SelectPdf Namespace

633

SelectPdf Pdf Library for .NET

PdfExternalFileElement.FileName Property
Gets or sets the external file path.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public string FileName { get; set; }
VB
Public Property FileName As String
Get
Set
Property Value
Type: String

See Also
PdfExternalFileElement Class
SelectPdf Namespace

634

SelectPdf Pdf Library for .NET

PdfExternalFileElement.LinkRectangle Property
Gets or sets the link rectangle in the pdf page.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public RectangleF LinkRectangle { get; set; }
VB
Public Property LinkRectangle As RectangleF
Get
Set
Property Value
Type: RectangleF

See Also
PdfExternalFileElement Class
SelectPdf Namespace

635

SelectPdf Pdf Library for .NET

PdfExternalLinkElement Class
Represents a link to an external url in a pdf document.

Inheritance Hierarchy
System.Object SelectPdf.PdfPageElement

SelectPdf.PdfExternalLinkElement

Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public class PdfExternalLinkElement : PdfPageElement
VB
Public Class PdfExternalLinkElement
Inherits PdfPageElement
The PdfExternalLinkElement type exposes the following members.

Constructors
Name
PdfExternalLinkElement

Description
Initializes an external link
pdf element.

Name
LinkRectangle

Description
Gets or sets the link
rectangle in the pdf page.
Gets or sets the link
destination url.

Properties

LinkURL

See Also
SelectPdf Namespace

636

SelectPdf Pdf Library for .NET

PdfExternalLinkElement Constructor
Initializes an external link pdf element.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public PdfExternalLinkElement(
RectangleF linkRectangle,
string linkURL
)
VB
Public Sub New (
linkRectangle As RectangleF,
linkURL As String
)
Parameters
linkRectangle
Type: System.Drawing.RectangleF
The link rectangle in the pdf page.
linkURL
Type: System.String
The link destination url.

See Also
PdfExternalLinkElement Class
SelectPdf Namespace

637

SelectPdf Pdf Library for .NET

PdfExternalLinkElement.PdfExternalLinkElement
Properties
The PdfExternalLinkElement type exposes the following members.

Properties
Name
LinkRectangle
LinkURL

Description
Gets or sets the link
rectangle in the pdf page.
Gets or sets the link
destination url.

See Also
PdfExternalLinkElement Class
SelectPdf Namespace

638

SelectPdf Pdf Library for .NET

PdfExternalLinkElement.LinkRectangle Property
Gets or sets the link rectangle in the pdf page.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public RectangleF LinkRectangle { get; set; }
VB
Public Property LinkRectangle As RectangleF
Get
Set
Property Value
Type: RectangleF

See Also
PdfExternalLinkElement Class
SelectPdf Namespace

639

SelectPdf Pdf Library for .NET

PdfExternalLinkElement.LinkURL Property
Gets or sets the link destination url.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public string LinkURL { get; set; }
VB
Public Property LinkURL As String
Get
Set
Property Value
Type: String

See Also
PdfExternalLinkElement Class
SelectPdf Namespace

640

SelectPdf Pdf Library for .NET

PdfFileAttachmentElement Class
Represents a file attachment in a pdf document.

Inheritance Hierarchy
System.Object SelectPdf.PdfPageElement

SelectPdf.PdfFileAttachmentElement

Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public class PdfFileAttachmentElement : PdfPageElement
VB
Public Class PdfFileAttachmentElement
Inherits PdfPageElement

Constructors
Name
PdfFileAttachmentElemen
t(String)
PdfFileAttachmentElemen
t(RectangleF, String)
PdfFileAttachmentElemen
t(Stream, String)

PdfFileAttachmentElemen
t(RectangleF, Stream,
String)

Description
Creates a file attachment
without a link in the pdf
page to the attachment.
Creates a file attachment
and a link in the pdf page
to the attachment.
Creates a file attachment
from a stream without a
link in the pdf page to the
attachment.
Creates a file attachment
from a stream and a link
in the pdf page to the
attachment.

Remarks
The file attachment can be linked from a pdf page or not.

See Also
SelectPdf Namespace

641

SelectPdf Pdf Library for .NET

PdfFileAttachmentElement Constructor
Overload List
Name
PdfFileAttachmentElemen
t(String)
PdfFileAttachmentElemen
t(RectangleF, String)
PdfFileAttachmentElemen
t(Stream, String)

PdfFileAttachmentElemen
t(RectangleF, Stream,
String)

Description
Creates a file attachment
without a link in the pdf
page to the attachment.
Creates a file attachment
and a link in the pdf page
to the attachment.
Creates a file attachment
from a stream without a
link in the pdf page to the
attachment.
Creates a file attachment
from a stream and a link
in the pdf page to the
attachment.

See Also
PdfFileAttachmentElement Class
SelectPdf Namespace

642

SelectPdf Pdf Library for .NET

PdfFileAttachmentElement Constructor (String)


Creates a file attachment without a link in the pdf page to the attachment.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public PdfFileAttachmentElement(
string fileName
)
VB
Public Sub New (
fileName As String
)
Parameters
fileName
Type: System.String
The path to file to be attached.

See Also
PdfFileAttachmentElement Class
PdfFileAttachmentElement Overload
SelectPdf Namespace

643

SelectPdf Pdf Library for .NET

PdfFileAttachmentElement Constructor (RectangleF,


String)
Creates a file attachment and a link in the pdf page to the attachment.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public PdfFileAttachmentElement(
RectangleF linkRectangle,
string fileName
)
VB
Public Sub New (
linkRectangle As RectangleF,
fileName As String
)
Parameters
linkRectangle
Type: System.Drawing.RectangleF
The attachment link rectangle in the pdf page.
fileName
Type: System.String
The path to file to be attached.

See Also
PdfFileAttachmentElement Class
PdfFileAttachmentElement Overload
SelectPdf Namespace

644

SelectPdf Pdf Library for .NET

PdfFileAttachmentElement Constructor (Stream, String)


Creates a file attachment from a stream without a link in the pdf page to the
attachment.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public PdfFileAttachmentElement(
Stream stream,
string attachmentName
)
VB
Public Sub New (
stream As Stream,
attachmentName As String
)
Parameters
stream
Type: System.IO.Stream
The file stream.
attachmentName
Type: System.String
The name of the attachment.

See Also
PdfFileAttachmentElement Class
PdfFileAttachmentElement Overload
SelectPdf Namespace

645

SelectPdf Pdf Library for .NET

PdfFileAttachmentElement Constructor (RectangleF,


Stream, String)
Creates a file attachment from a stream and a link in the pdf page to the
attachment.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public PdfFileAttachmentElement(
RectangleF linkRectangle,
Stream stream,
string attachmentName
)
VB
Public Sub New (
linkRectangle As RectangleF,
stream As Stream,
attachmentName As String
)
Parameters
linkRectangle
Type: System.Drawing.RectangleF
The attachment link rectangle in the pdf page.
stream
Type: System.IO.Stream
The file stream.
attachmentName
Type: System.String
The name of the attachment.

See Also
PdfFileAttachmentElement Class
PdfFileAttachmentElement Overload
SelectPdf Namespace

646

SelectPdf Pdf Library for .NET

PdfFont Class
Represents a font in a pdf document.

Inheritance Hierarchy
System.Object SelectPdf.PdfFont
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public class PdfFont
VB
Public Class PdfFont
The PdfFont type exposes the following members.

Methods
Name
Clone

GetCharWidth

GetSystemFont

GetTextSize
GetTextWidth

Description
Creates a clone of this
font in the specified pdf
document.
Gets the width of the
specified character in
points.
Converts the current pdf
font to a corresponding
system font.
Gets the size of the
specified string in points.
Get the width in points of
the specified string.

Properties
Name
FontBaseFamily
FontFamily
Height
IsStrikeout
IsUnderline
Size

Description
Gets the predefined
family name.
Gets the name of the font
family.
Gets the font height.
A flag to indicate if the
font is strikeout.
A flag to indicate if the
font is underline.
Gets or sets the font size
in points.

647

SelectPdf Pdf Library for .NET

See Also
SelectPdf Namespace

648

SelectPdf Pdf Library for .NET

PdfFont.PdfFont Methods
The PdfFont type exposes the following members.

Methods
Name
Clone

GetCharWidth

GetSystemFont

GetTextSize
GetTextWidth

Description
Creates a clone of this
font in the specified pdf
document.
Gets the width of the
specified character in
points.
Converts the current pdf
font to a corresponding
system font.
Gets the size of the
specified string in points.
Get the width in points of
the specified string.

See Also
PdfFont Class
SelectPdf Namespace

649

SelectPdf Pdf Library for .NET

PdfFont.Clone Method
Creates a clone of this font in the specified pdf document.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public PdfFont Clone(
PdfDocument document
)
VB
Public Function Clone (
document As PdfDocument
) As PdfFont
Parameters
document
Type: SelectPdf.PdfDocument
The pdf document where the font is cloned.
Return Value
Type: PdfFontThe font object clone.

See Also
PdfFont Class
SelectPdf Namespace

650

SelectPdf Pdf Library for .NET

PdfFont.GetCharWidth Method
Gets the width of the specified character in points.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public float GetCharWidth(
char c
)
VB
Public Function GetCharWidth (
c As Char
) As Single
Parameters
c
Type: System.Char
The character to be measured.
Return Value
Type: SingleThe character width in points.

See Also
PdfFont Class
SelectPdf Namespace

651

SelectPdf Pdf Library for .NET

PdfFont.GetSystemFont Method
Converts the current pdf font to a corresponding system font.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public Font GetSystemFont()
VB
Public Function GetSystemFont As Font
Return Value
Type: FontA system font corresponding to the current pdf font object.

See Also
PdfFont Class
SelectPdf Namespace

652

SelectPdf Pdf Library for .NET

PdfFont.GetTextSize Method
Gets the size of the specified string in points.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public SizeF GetTextSize(
string text
)
VB
Public Function GetTextSize (
text As String
) As SizeF
Parameters
text
Type: System.String
The string to be measured.
Return Value
Type: SizeFThe size of the string in points.

See Also
PdfFont Class
SelectPdf Namespace

653

SelectPdf Pdf Library for .NET

PdfFont.GetTextWidth Method
Get the width in points of the specified string.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public float GetTextWidth(
string text
)
VB
Public Function GetTextWidth (
text As String
) As Single
Parameters
text
Type: System.String
The string to be measured.
Return Value
Type: SingleThe width of the string in points.

See Also
PdfFont Class
SelectPdf Namespace

654

SelectPdf Pdf Library for .NET

PdfFont.PdfFont Properties
The PdfFont type exposes the following members.

Properties
Name
FontBaseFamily
FontFamily
Height
IsStrikeout
IsUnderline
Size

Description
Gets the predefined
family name.
Gets the name of the font
family.
Gets the font height.
A flag to indicate if the
font is strikeout.
A flag to indicate if the
font is underline.
Gets or sets the font size
in points.

See Also
PdfFont Class
SelectPdf Namespace

655

SelectPdf Pdf Library for .NET

PdfFont.FontBaseFamily Property
Gets the predefined family name.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public PdfStandardFont FontBaseFamily { get; }
VB
Public ReadOnly Property FontBaseFamily As PdfStandardFont
Get
Property Value
Type: PdfStandardFont

See Also
PdfFont Class
SelectPdf Namespace

656

SelectPdf Pdf Library for .NET

PdfFont.FontFamily Property
Gets the name of the font family.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public string FontFamily { get; }
VB
Public ReadOnly Property FontFamily As String
Get
Property Value
Type: String

See Also
PdfFont Class
SelectPdf Namespace

657

SelectPdf Pdf Library for .NET

PdfFont.Height Property
Gets the font height.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public float Height { get; }
VB
Public ReadOnly Property Height As Single
Get
Property Value
Type: Single

See Also
PdfFont Class
SelectPdf Namespace

658

SelectPdf Pdf Library for .NET

PdfFont.IsStrikeout Property
A flag to indicate if the font is strikeout.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public bool IsStrikeout { get; set; }
VB
Public Property IsStrikeout As Boolean
Get
Set
Property Value
Type: Boolean

See Also
PdfFont Class
SelectPdf Namespace

659

SelectPdf Pdf Library for .NET

PdfFont.IsUnderline Property
A flag to indicate if the font is underline.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public bool IsUnderline { get; set; }
VB
Public Property IsUnderline As Boolean
Get
Set
Property Value
Type: Boolean

See Also
PdfFont Class
SelectPdf Namespace

660

SelectPdf Pdf Library for .NET

PdfFont.Size Property
Gets or sets the font size in points.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public float Size { get; set; }
VB
Public Property Size As Single
Get
Set
Property Value
Type: Single

See Also
PdfFont Class
SelectPdf Namespace

661

SelectPdf Pdf Library for .NET

PdfFontCollection Class
Represents a collection of fonts in a pdf document.

Inheritance Hierarchy
System.Object SelectPdf.PdfFontCollection
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public class PdfFontCollection : IEnumerable
VB
Public Class PdfFontCollection
Implements IEnumerable
The PdfFontCollection type exposes the following members.

Constructors
Name
PdfFontCollection

Description
Creates a font collection
for the specified PDF
document

Name
Add(Font)

Description
Adds a system font to the
pdf fonts collection.
Adds a system font to the
pdf fonts collection. The
font is loaded from the
specified file.
Adds a pdf font to the pdf
fonts collection.
Adds the specified array
of pdf fonts to the pdf
document fonts
collection.
Adds a standard CJK font
to the pdf fonts collection.
Adds a standard font to
the pdf fonts collection.
Adds a system font to the
pdf fonts collection.
Checks if the specified
font belongs to the fonts

Methods

Add(String)

Add(PdfFont)
Add(PdfFont[])

Add(PdfStandardCJKFont)
Add(PdfStandardFont)
Add(Font, Boolean)
Contains

662

SelectPdf Pdf Library for .NET

GetEnumerator
IndexOf

Insert

Remove

collection.
Gets the collection
enumerator.
Returns the index of the
specified font in the fonts
collection.
Inserts a font to the
specified index in the pdf
fonts collection.
Removes the specified
pdf font from the fonts
collection.

Properties
Name
Item

Description
Gets or sets the font at
the specified zero based
index in the fonts
collection.

See Also
SelectPdf Namespace

663

SelectPdf Pdf Library for .NET

PdfFontCollection Constructor
Creates a font collection for the specified PDF document
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public PdfFontCollection(
PdfDocument document
)
VB
Public Sub New (
document As PdfDocument
)
Parameters
document
Type: SelectPdf.PdfDocument

See Also
PdfFontCollection Class
SelectPdf Namespace

664

SelectPdf Pdf Library for .NET

PdfFontCollection.PdfFontCollection Methods
The PdfFontCollection type exposes the following members.

Methods
Name
Add(Font)
Add(String)

Add(PdfFont)
Add(PdfFont[])

Add(PdfStandardCJKFont)
Add(PdfStandardFont)
Add(Font, Boolean)
Contains

GetEnumerator
IndexOf

Insert

Remove

Description
Adds a system font to the
pdf fonts collection.
Adds a system font to the
pdf fonts collection. The
font is loaded from the
specified file.
Adds a pdf font to the pdf
fonts collection.
Adds the specified array
of pdf fonts to the pdf
document fonts
collection.
Adds a standard CJK font
to the pdf fonts collection.
Adds a standard font to
the pdf fonts collection.
Adds a system font to the
pdf fonts collection.
Checks if the specified
font belongs to the fonts
collection.
Gets the collection
enumerator.
Returns the index of the
specified font in the fonts
collection.
Inserts a font to the
specified index in the pdf
fonts collection.
Removes the specified
pdf font from the fonts
collection.

See Also
PdfFontCollection Class
SelectPdf Namespace

665

SelectPdf Pdf Library for .NET

PdfFontCollection.Add Method
Overload List
Name
Add(Font)
Add(String)

Add(PdfFont)
Add(PdfFont[])

Add(PdfStandardCJKFont)
Add(PdfStandardFont)
Add(Font, Boolean)

Description
Adds a system font to the
pdf fonts collection.
Adds a system font to the
pdf fonts collection. The
font is loaded from the
specified file.
Adds a pdf font to the pdf
fonts collection.
Adds the specified array
of pdf fonts to the pdf
document fonts
collection.
Adds a standard CJK font
to the pdf fonts collection.
Adds a standard font to
the pdf fonts collection.
Adds a system font to the
pdf fonts collection.

See Also
PdfFontCollection Class
SelectPdf Namespace

666

SelectPdf Pdf Library for .NET

PdfFontCollection.Add Method (Font)


Adds a system font to the pdf fonts collection.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public PdfFont Add(
Font font
)
VB
Public Function Add (
font As Font
) As PdfFont
Parameters
font
Type: System.Drawing.Font
The system font to be added to the fonts collection.
Return Value
Type: PdfFontThe pdf font added to the fonts collection.

Remarks
If the font was already added, the method returns the existing font. By default the
font is embedded into the pdf document in order to support Unicode texts.

See Also
PdfFontCollection Class
Add Overload
SelectPdf Namespace

667

SelectPdf Pdf Library for .NET

PdfFontCollection.Add Method (String)


Adds a system font to the pdf fonts collection. The font is loaded from the specified
file.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public PdfFont Add(
string fontFilename
)
VB
Public Function Add (
fontFilename As String
) As PdfFont
Parameters
fontFilename
Type: System.String
Return Value
Type: PdfFontThe pdf font added to the fonts collection.

Remarks
If the font was already added, the method returns the existing pdf font.

See Also
PdfFontCollection Class
Add Overload
SelectPdf Namespace

668

SelectPdf Pdf Library for .NET

PdfFontCollection.Add Method (PdfFont)


Adds a pdf font to the pdf fonts collection.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public PdfFont Add(
PdfFont font
)
VB
Public Function Add (
font As PdfFont
) As PdfFont
Parameters
font
Type: SelectPdf.PdfFont
The pdf font object to be add to the collection.
Return Value
Type: PdfFontThe pdf font added to the fonts collection.

Remarks
If the font was already added, the method returns the existing pdf font.

See Also
PdfFontCollection Class
Add Overload
SelectPdf Namespace

669

SelectPdf Pdf Library for .NET

PdfFontCollection.Add Method (PdfFont[])


Adds the specified array of pdf fonts to the pdf document fonts collection.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public void Add(
PdfFont[] fonts
)
VB
Public Sub Add (
fonts As PdfFont()
)
Parameters
fonts
Type: SelectPdf.PdfFont[]
The pdf fonts to be added to the collection.

See Also
PdfFontCollection Class
Add Overload
SelectPdf Namespace

670

SelectPdf Pdf Library for .NET

PdfFontCollection.Add Method (PdfStandardCJKFont)


Adds a standard CJK font to the pdf fonts collection.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public PdfFont Add(
PdfStandardCJKFont stdCJKFont
)
VB
Public Function Add (
stdCJKFont As PdfStandardCJKFont
) As PdfFont
Parameters
stdCJKFont
Type: SelectPdf.PdfStandardCJKFont
The standard CJK font to add to the pdf document fonts collection.
Return Value
Type: PdfFontThe pdf font added to the fonts collection.

Remarks
If the font was already added, the method returns the existing pdf font.

See Also
PdfFontCollection Class
Add Overload
SelectPdf Namespace

671

SelectPdf Pdf Library for .NET

PdfFontCollection.Add Method (PdfStandardFont)


Adds a standard font to the pdf fonts collection.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public PdfFont Add(
PdfStandardFont stdFont
)
VB
Public Function Add (
stdFont As PdfStandardFont
) As PdfFont
Parameters
stdFont
Type: SelectPdf.PdfStandardFont
The standard font family.
Return Value
Type: PdfFontThe pdf font added to the fonts collection.

Remarks
If the font was already added, the method returns the existing pdf font.

See Also
PdfFontCollection Class
Add Overload
SelectPdf Namespace

672

SelectPdf Pdf Library for .NET

PdfFontCollection.Add Method (Font, Boolean)


Adds a system font to the pdf fonts collection.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public PdfFont Add(
Font font,
bool embedFont
)
VB
Public Function Add (
font As Font,
embedFont As Boolean
) As PdfFont
Parameters
font
Type: System.Drawing.Font
Font for adding.The system font to be added to the fonts collection.
embedFont
Type: System.Boolean
Specifies if the font will be embedded into the pdf document or not.
Return Value
Type: PdfFontThe pdf font added to the fonts collection.

Remarks
If the font was already added, the method returns the existing font. The embedFont
parameter indicates if the added font will be embedded into the pdf document or
not.

See Also
PdfFontCollection Class
Add Overload
SelectPdf Namespace

673

SelectPdf Pdf Library for .NET

PdfFontCollection.Contains Method
Checks if the specified font belongs to the fonts collection.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public bool Contains(
PdfFont font
)
VB
Public Function Contains (
font As PdfFont
) As Boolean
Parameters
font
Type: SelectPdf.PdfFont
The specified pdf font.
Return Value
Type: BooleanTrue if the font is found in the collection, otherwise returns false.

See Also
PdfFontCollection Class
SelectPdf Namespace

674

SelectPdf Pdf Library for .NET

PdfFontCollection.GetEnumerator Method
Gets the collection enumerator.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public IEnumerator GetEnumerator()
VB
Public Function GetEnumerator As IEnumerator
Return Value
Type: IEnumeratorThe collection enumerator.
Implements
IEnumerable.GetEnumerator()

See Also
PdfFontCollection Class
SelectPdf Namespace

675

SelectPdf Pdf Library for .NET

PdfFontCollection.IndexOf Method
Returns the index of the specified font in the fonts collection.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public int IndexOf(
PdfFont font
)
VB
Public Function IndexOf (
font As PdfFont
) As Integer
Parameters
font
Type: SelectPdf.PdfFont
The font to search in collection.
Return Value
Type: Int32The index of font or -1 if the font does not exist.

See Also
PdfFontCollection Class
SelectPdf Namespace

676

SelectPdf Pdf Library for .NET

PdfFontCollection.Insert Method
Inserts a font to the specified index in the pdf fonts collection.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public void Insert(
int index,
PdfFont font
)
VB
Public Sub Insert (
index As Integer,
font As PdfFont
)
Parameters
index
Type: System.Int32
Index in collection where to insert the font.
font
Type: SelectPdf.PdfFont
The font to be inserted in the collection.

See Also
PdfFontCollection Class
SelectPdf Namespace

677

SelectPdf Pdf Library for .NET

PdfFontCollection.Remove Method
Removes the specified pdf font from the fonts collection.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public void Remove(
PdfFont font
)
VB
Public Sub Remove (
font As PdfFont
)
Parameters
font
Type: SelectPdf.PdfFont
The font to be removed from the pdf fonts collection.

See Also
PdfFontCollection Class
SelectPdf Namespace

678

SelectPdf Pdf Library for .NET

PdfFontCollection.PdfFontCollection Properties
The PdfFontCollection type exposes the following members.

Properties
Name
Item

Description
Gets or sets the font at
the specified zero based
index in the fonts
collection.

See Also
PdfFontCollection Class
SelectPdf Namespace

679

SelectPdf Pdf Library for .NET

PdfFontCollection.Item Property
Gets or sets the font at the specified zero based index in the fonts collection.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public PdfFont this[
int index
] { get; }
VB
Public ReadOnly Default Property Item (
index As Integer
) As PdfFont
Get
Parameters
index
Type: System.Int32
The zero based font index in the fonts pages collection.
Return Value
Type: PdfFontThe pdf font at the specified index.

See Also
PdfFontCollection Class
SelectPdf Namespace

680

SelectPdf Pdf Library for .NET

PdfFontType Enumeration
The list of supported fonts for the header and footer
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public enum PdfFontType
VB
Public Enumeration PdfFontType

Members
Member name
None
Helvetica
HelveticaBold
HelveticaOblique
HelvetivaBoldOb
lique
Courier
CourierBold
CourierOblique
CourierBoldObliq
ue
TimesRoman
TimesBold
TimesBoldItalic
TimesItalic
Symbol
ZapfDingbats

Value
0
1
2
3
4
5
6
7
8
9
10
11
12
13
14

Description
None
Helvetica
HelveticaBold
HelveticaOblique
HelvetivaBoldObliq
ue
Courier
CourierBold
CourierOblique
CourierBoldObliqu
e
TimesRoman
TimesBold
TimesBoldItalic
TimesItalic
Symbol
ZapfDingbats

See Also
SelectPdf Namespace

681

SelectPdf Pdf Library for .NET

PdfFooter Class
Handles the properties of the footer of the generated pdf document.

Inheritance Hierarchy
System.Object SelectPdf.PdfFooter
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public class PdfFooter
VB
Public Class PdfFooter
The PdfFooter type exposes the following members.

Constructors
Name
PdfFooter

Description

Name
Add

Description
Adds an additional
element to the footer of
the pdf document.

Name
DisplayOnEvenPages

Description
Controls the visibility of
the footer on the even
numbered pages of the
generated pdf document.
Controls the visibility of
the footer on the first
page of the generated pdf
document.
Controls the visibility of
the footer on the odd
numbered pages of the
generated pdf document.
Controls the page number
for the first page being
rendered.
The height of the pdf
document footer.

Methods

Properties

DisplayOnFirstPage

DisplayOnOddPages

FirstPageNumber

Height

682

SelectPdf Pdf Library for .NET


TotalPagesOffset

Controls the total number


of pages offset in the
generated pdf document.

Remarks
This class encapsulates the options to control the footer in the rendered pdf
document. The HtmlToPdf class contains a reference to an object of this type.

The footer is displayed only if DisplayFooter property of the Options object is true. If
the DisplayFooter property of the Options object is false, the footer will not be
displayed and all the options set here will have no effect.

See Also
SelectPdf Namespace

683

SelectPdf Pdf Library for .NET

PdfFooter Constructor
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public PdfFooter()
VB
Public Sub New

See Also
PdfFooter Class
SelectPdf Namespace

684

SelectPdf Pdf Library for .NET

PdfFooter.PdfFooter Methods
The PdfFooter type exposes the following members.

Methods
Name
Add

Description
Adds an additional
element to the footer of
the pdf document.

See Also
PdfFooter Class
SelectPdf Namespace

685

SelectPdf Pdf Library for .NET

PdfFooter.Add Method
Adds an additional element to the footer of the pdf document.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public void Add(
PdfSectionElement element
)
VB
Public Sub Add (
element As PdfSectionElement
)
Parameters
element
Type: SelectPdf.PdfSectionElement
The element that will be rendered in the pdf footer.

Remarks
There are 3 section elements that can be added to the footer of the pdf document:
PdfHtmlSection, PdfTextSection and PdfImageSection.

See Also
PdfFooter Class
SelectPdf Namespace

686

SelectPdf Pdf Library for .NET

PdfFooter.PdfFooter Properties
The PdfFooter type exposes the following members.

Properties
Name
DisplayOnEvenPages

DisplayOnFirstPage

DisplayOnOddPages

FirstPageNumber

Height
TotalPagesOffset

Description
Controls the visibility of
the footer on the even
numbered pages of the
generated pdf document.
Controls the visibility of
the footer on the first
page of the generated pdf
document.
Controls the visibility of
the footer on the odd
numbered pages of the
generated pdf document.
Controls the page number
for the first page being
rendered.
The height of the pdf
document footer.
Controls the total number
of pages offset in the
generated pdf document.

See Also
PdfFooter Class
SelectPdf Namespace

687

SelectPdf Pdf Library for .NET

PdfFooter.DisplayOnEvenPages Property
Controls the visibility of the footer on the even numbered pages of the generated
pdf document.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public bool DisplayOnEvenPages { get; set; }
VB
Public Property DisplayOnEvenPages As Boolean
Get
Set
Property Value
Type: Boolean

Remarks
By default the footer is displayed on both odd and even numbered pages.

See Also
PdfFooter Class
SelectPdf Namespace

688

SelectPdf Pdf Library for .NET

PdfFooter.DisplayOnFirstPage Property
Controls the visibility of the footer on the first page of the generated pdf document.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public bool DisplayOnFirstPage { get; set; }
VB
Public Property DisplayOnFirstPage As Boolean
Get
Set
Property Value
Type: Boolean

Remarks
When this property is true the footer will be displayed on the first page of the pdf
document, otherwise it will not be visible. This property has priority over
DisplayOnOddPages. The default value is true.

See Also
PdfFooter Class
SelectPdf Namespace

689

SelectPdf Pdf Library for .NET

PdfFooter.DisplayOnOddPages Property
Controls the visibility of the footer on the odd numbered pages of the generated pdf
document.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public bool DisplayOnOddPages { get; set; }
VB
Public Property DisplayOnOddPages As Boolean
Get
Set
Property Value
Type: Boolean

Remarks
By default the footer is displayed on both odd and even numbered pages. The
DisplayOnFirstPage property has priority over DisplayOnOddPages.

See Also
PdfFooter Class
SelectPdf Namespace

690

SelectPdf Pdf Library for .NET

PdfFooter.FirstPageNumber Property
Controls the page number for the first page being rendered.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public int FirstPageNumber { get; set; }
VB
Public Property FirstPageNumber As Integer
Get
Set
Property Value
Type: Int32

Remarks
The page number is displayed setting a {page_number} placeholder in the Text
property. By default the page numbers start with 1. This can be changed using the
FirstPageNumber property.

See Also
PdfFooter Class
SelectPdf Namespace

691

SelectPdf Pdf Library for .NET

PdfFooter.Height Property
The height of the pdf document footer.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public float Height { get; set; }
VB
Public Property Height As Single
Get
Set
Property Value
Type: Single

Remarks
This height is specified in points. 1 point is 1/72 inch. The default value is 35pt.

See Also
PdfFooter Class
SelectPdf Namespace

692

SelectPdf Pdf Library for .NET

PdfFooter.TotalPagesOffset Property
Controls the total number of pages offset in the generated pdf document.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public int TotalPagesOffset { get; set; }
VB
Public Property TotalPagesOffset As Integer
Get
Set
Property Value
Type: Int32

Remarks
The total number of pages is displayed setting a {total_pages} placeholder in the
Text property. The total number of pages can be incremented with a value specified
by the TotalPagesOffset property. This could be useful when the generated pdf will
be merged with other documents.

See Also
PdfFooter Class
SelectPdf Namespace

693

SelectPdf Pdf Library for .NET

PdfGradient Class
Defines a brush used to fill a space.

Inheritance Hierarchy
System.Object SelectPdf.PdfGradient
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public class PdfGradient
VB
Public Class PdfGradient
The PdfGradient type exposes the following members.

Constructors
Name
PdfGradient

Description
Initializes the pdf gradient
object.

Name
EndColor

Description
Gets or sets the gradient
end color.
Gets or sets the gradient
direction.
Gets or sets the gradient
start color.

Properties

GradientDirection
StartColor

See Also
SelectPdf Namespace

694

SelectPdf Pdf Library for .NET

PdfGradient Constructor
Initializes the pdf gradient object.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public PdfGradient(
PdfGradientDirection direction,
PdfColor start,
PdfColor end
)
VB
Public Sub New (
direction As PdfGradientDirection,
start As PdfColor,
end As PdfColor
)
Parameters
direction
Type: SelectPdf.PdfGradientDirection
The gradient direction.
start
Type: SelectPdf.PdfColor
The start color of the gradient.
end
Type: SelectPdf.PdfColor
The end color of the gradient.

See Also
PdfGradient Class
SelectPdf Namespace

695

SelectPdf Pdf Library for .NET

PdfGradient.PdfGradient Properties
The PdfGradient type exposes the following members.

Properties
Name
EndColor
GradientDirection
StartColor

Description
Gets or sets the gradient
end color.
Gets or sets the gradient
direction.
Gets or sets the gradient
start color.

See Also
PdfGradient Class
SelectPdf Namespace

696

SelectPdf Pdf Library for .NET

PdfGradient.EndColor Property
Gets or sets the gradient end color.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public PdfColor EndColor { get; set; }
VB
Public Property EndColor As PdfColor
Get
Set
Property Value
Type: PdfColor

See Also
PdfGradient Class
SelectPdf Namespace

697

SelectPdf Pdf Library for .NET

PdfGradient.GradientDirection Property
Gets or sets the gradient direction.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public PdfGradientDirection GradientDirection { get; set; }
VB
Public Property GradientDirection As PdfGradientDirection
Get
Set
Property Value
Type: PdfGradientDirection

See Also
PdfGradient Class
SelectPdf Namespace

698

SelectPdf Pdf Library for .NET

PdfGradient.StartColor Property
Gets or sets the gradient start color.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public PdfColor StartColor { get; set; }
VB
Public Property StartColor As PdfColor
Get
Set
Property Value
Type: PdfColor

See Also
PdfGradient Class
SelectPdf Namespace

699

SelectPdf Pdf Library for .NET

PdfGradientDirection Enumeration
The direction of the pdf gradient brush.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public enum PdfGradientDirection
VB
Public Enumeration PdfGradientDirection

Members
Member name
Horizontal

Value
0

Vertical

ForwardDiagonal

BackwardDiagon
al

Description
Horizontal
gradient from left
to right.
Vertical gradient
from top to
bottom.
Diagonal gradient
from top left to
bottom right.
Diagonal gradient
from top right to
bottom left.

See Also
SelectPdf Namespace

700

SelectPdf Pdf Library for .NET

PdfHeader Class
Handles the properties of the header of the generated pdf document.

Inheritance Hierarchy
System.Object SelectPdf.PdfHeader
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public class PdfHeader
VB
Public Class PdfHeader
The PdfHeader type exposes the following members.

Constructors
Name
PdfHeader

Description

Name
Add

Description
Adds an additional
element to the header of
the pdf document.

Name
DisplayOnEvenPages

Description
Controls the visibility of
the header on the even
numbered pages of the
generated pdf document.
Controls the visibility of
the header on the first
page of the generated pdf
document.
Controls the visibility of
the header on the odd
numbered pages of the
generated pdf document.
Controls the page number
for the first page being
rendered.
The height of the pdf
document header.

Methods

Properties

DisplayOnFirstPage

DisplayOnOddPages

FirstPageNumber

Height

701

SelectPdf Pdf Library for .NET


TotalPagesOffset

Controls the total number


of pages offset in the
generated pdf document.

Remarks
This class encapsulates the options to control the header in the rendered pdf
document. The HtmlToPdf class contains a reference to an object of this type.

The header is displayed only if DisplayHeader property of the Options object is true.
If the DisplayHeader property of the Options object is false, the header will not be
displayed and all the options set here will have no effect.

See Also
SelectPdf Namespace

702

SelectPdf Pdf Library for .NET

PdfHeader Constructor
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public PdfHeader()
VB
Public Sub New

See Also
PdfHeader Class
SelectPdf Namespace

703

SelectPdf Pdf Library for .NET

PdfHeader.PdfHeader Methods
The PdfHeader type exposes the following members.

Methods
Name
Add

Description
Adds an additional
element to the header of
the pdf document.

See Also
PdfHeader Class
SelectPdf Namespace

704

SelectPdf Pdf Library for .NET

PdfHeader.Add Method
Adds an additional element to the header of the pdf document.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public void Add(
PdfSectionElement element
)
VB
Public Sub Add (
element As PdfSectionElement
)
Parameters
element
Type: SelectPdf.PdfSectionElement
The element that will be rendered in the pdf header.

Remarks
There are 3 section elements that can be added to the header of the pdf document:
PdfHtmlSection, PdfTextSection and PdfImageSection.

See Also
PdfHeader Class
SelectPdf Namespace

705

SelectPdf Pdf Library for .NET

PdfHeader.PdfHeader Properties
The PdfHeader type exposes the following members.

Properties
Name
DisplayOnEvenPages

DisplayOnFirstPage

DisplayOnOddPages

FirstPageNumber

Height
TotalPagesOffset

Description
Controls the visibility of
the header on the even
numbered pages of the
generated pdf document.
Controls the visibility of
the header on the first
page of the generated pdf
document.
Controls the visibility of
the header on the odd
numbered pages of the
generated pdf document.
Controls the page number
for the first page being
rendered.
The height of the pdf
document header.
Controls the total number
of pages offset in the
generated pdf document.

See Also
PdfHeader Class
SelectPdf Namespace

706

SelectPdf Pdf Library for .NET

PdfHeader.DisplayOnEvenPages Property
Controls the visibility of the header on the even numbered pages of the generated
pdf document.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public bool DisplayOnEvenPages { get; set; }
VB
Public Property DisplayOnEvenPages As Boolean
Get
Set
Property Value
Type: Boolean

Remarks
By default the header is displayed on both odd and even numbered pages.

See Also
PdfHeader Class
SelectPdf Namespace

707

SelectPdf Pdf Library for .NET

PdfHeader.DisplayOnFirstPage Property
Controls the visibility of the header on the first page of the generated pdf
document.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public bool DisplayOnFirstPage { get; set; }
VB
Public Property DisplayOnFirstPage As Boolean
Get
Set
Property Value
Type: Boolean

Remarks
When this property is true the header will be displayed on the first page of the pdf
document, otherwise it will not be visible. This property has priority over
DisplayOnOddPages. The default value is true.

See Also
PdfHeader Class
SelectPdf Namespace

708

SelectPdf Pdf Library for .NET

PdfHeader.DisplayOnOddPages Property
Controls the visibility of the header on the odd numbered pages of the generated
pdf document.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public bool DisplayOnOddPages { get; set; }
VB
Public Property DisplayOnOddPages As Boolean
Get
Set
Property Value
Type: Boolean

Remarks
By default the header is displayed on both odd and even numbered pages. The
DisplayOnFirstPage property has priority over DisplayOnOddPages.

See Also
PdfHeader Class
SelectPdf Namespace

709

SelectPdf Pdf Library for .NET

PdfHeader.FirstPageNumber Property
Controls the page number for the first page being rendered.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public int FirstPageNumber { get; set; }
VB
Public Property FirstPageNumber As Integer
Get
Set
Property Value
Type: Int32

Remarks
The page number is displayed setting a {page_number} placeholder in the Text
property. By default the page numbers start with 1. This can be changed using the
FirstPageNumber property.

See Also
PdfHeader Class
SelectPdf Namespace

710

SelectPdf Pdf Library for .NET

PdfHeader.Height Property
The height of the pdf document header.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public float Height { get; set; }
VB
Public Property Height As Single
Get
Set
Property Value
Type: Single

Remarks
This height is specified in points. 1 point is 1/72 inch. The default value is 45pt.

See Also
PdfHeader Class
SelectPdf Namespace

711

SelectPdf Pdf Library for .NET

PdfHeader.TotalPagesOffset Property
Controls the total number of pages offset in the generated pdf document.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public int TotalPagesOffset { get; set; }
VB
Public Property TotalPagesOffset As Integer
Get
Set
Property Value
Type: Int32

Remarks
The total number of pages is displayed setting a {total_pages} placeholder in the
Text property. The total number of pages can be incremented with a value specified
by the TotalPagesOffset property. This could be useful when the generated pdf will
be merged with other documents.

See Also
PdfHeader Class
SelectPdf Namespace

712

SelectPdf Pdf Library for .NET

PdfHtmlElement Class
Represents a html element that can be added to a pdf document.

Inheritance Hierarchy
System.Object SelectPdf.PdfPageElement
mlElement

SelectPdf.PdfElement

SelectPdf.PdfHt

Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public sealed class PdfHtmlElement : PdfElement
VB
Public NotInheritable Class PdfHtmlElement
Inherits PdfElement
The PdfHtmlElement type exposes the following members.

Constructors
Name
PdfHtmlElement(String)

PdfHtmlElement(String,
String)
PdfHtmlElement(Single,
Single, String)
PdfHtmlElement(Single,
Single, Single, String)
PdfHtmlElement(Single,
Single, String, String)
PdfHtmlElement(Single,
Single, Single, Single,
String)
PdfHtmlElement(Single,
Single, Single, String,
String)
PdfHtmlElement(Single,
Single, Single, Single,
String, String)

Description
Creates a html object that
can be added to a pdf
document.
Creates a html object that
can be added to a pdf
document.
Creates a html object that
can be added to a pdf
document.
Creates a html object that
can be added to a pdf
document.
Creates a html object that
can be added to a pdf
document.
Creates a html object that
can be added to a pdf
document.
Creates a html object that
can be added to a pdf
document.
Creates a html object that
can be added to a pdf
document.

713

SelectPdf Pdf Library for .NET

Methods
Name
Rotate

Scale

Skew

Translate

Description
Rotes the coordinate
system before rendering
the pdf element.
(Inherited from
PdfElement.)
Scales the coordinate
system before rendering
the pdf element.
(Inherited from
PdfElement.)
Skews the x and y axis by
an two different angles
before rendering the pdf
element. (Inherited from
PdfElement.)
Translates the coordinate
system before rendering
the pdf element.
(Inherited from
PdfElement.)

Properties
Name
Authentication

AutoFitHeight
AutoFitWidth
BackColor

Blending

ColorSpace

Description
Handles authentication
options if the web page
being converted requires
authentication.
Specifies the vertical auto
fit mode.
Specifies the horizontal
auto fit mode.
Gets or sets the pdf
element background
color. (Inherited from
PdfElement.)
Gets or sets the blending
mode for transparent
rendering of the pdf
element. (Inherited from
PdfElement.)
Gets or sets the color
space for the pdf element
rendering. (Inherited from
PdfElement.)

714

SelectPdf Pdf Library for .NET


CssMediaType

DisplayFooterOnEvenPag
es

DisplayFooterOnOddPage
s

DisplayHeaderOnEvenPag
es

DisplayHeaderOnOddPag
es

DrawBackground

EmbedFonts

ExternalLinksEnabled
ForeColor

Gradient

HiddenWebElements

HttpCookies

Indicates what css styles


are used when the web
page is rendered.
Controls the visibility of
the document footer on
the even numbered
pages generated by this
pdf element.
Controls the visibility of
the document footer on
the odd numbered pages
generated by this pdf
element.
Controls the visibility of
the document header on
the even numbered
pages generated by this
pdf element.
Controls the visibility of
the document header on
the odd numbered pages
generated by this pdf
element.
Gets or sets a flag
indicating if the web page
background is rendered in
pdf.
Instructs the converter to
embed all the needed
fonts into the pdf
document or not.
Controls the rendering of
external hyperlinks in pdf.
Gets or sets the pdf
element foreground color.
(Inherited from
PdfElement.)
Gets or sets the gradient
used to fill a shape.
(Inherited from
PdfElement.)
Gets a reference to the
object that controls the
visibility of some web
elements in the
generated pdf document.
Gets the collection of
715

SelectPdf Pdf Library for .NET

HttpHeaders

InternalLinksEnabled

JavaScriptEnabled

KeepImagesTogether

KeepTextsTogether

LineStyle

MaxPageLoadTime
MinPageLoadTime

PdfBookmarkOptions

PdfPagesRectangles

PluginsEnabled

ProxyOptions

custom HTTP cookies


used for the conversion.
Get the collection of
custom HTTP headers
used for the conversion.
Controls the conversion of
internal html links to
internal pdf links.
Enable scripts when
rendering the url or html
string.
This property instructs
the converter whether to
try to avoid cutting off
the images between pdf
pages or not.
This property instructs
the converter whether to
try to avoid cutting off
the text lines between pdf
pages or not.
Gets or sets the line style
for pdf elements
rendering lines. (Inherited
from PdfElement.)
The web page navigation
timeout in seconds.
An additional time in
seconds to wait for
asynchronous items to be
loaded before the web
page is rendered.
Gets a reference to the
object that controls the
bookmarks creation for
the generated pdf
document.
The size and position of
the html content
rendered in all pages of
the pdf document.
A flag indicating if plugins
(like Flash players) are
enabled in the converter.
Gets a reference to an
object containing the
proxy settings used to
716

SelectPdf Pdf Library for .NET

Rotated

Scaled

Skewed

StartupMode

StartupScript

Translated

Transparency

VisibleWebElementId

WebPageFixedSize

WebPageHeight

WebPageInformation

access the web page that


is being converted.
A flag to indicate if the
current pdf element was
rotated. (Inherited from
PdfElement.)
A flag to indicate if the
current pdf element was
scaled. (Inherited from
PdfElement.)
A flag to indicate if the
current pdf element was
skewed. (Inherited from
PdfElement.)
Use this property to
specify how the
conversion starts.
Use this property to
specify some JavaScript
code that will be injected
into the page that is
converted.
A flag to indicate if the
current pdf element was
translated. (Inherited
from PdfElement.)
Gets or sets the pdf
element transparency.
(Inherited from
PdfElement.)
Use this property to
convert only a certain
section of the page,
specified by the html
element ID.
Controls whether the web
page is rendered with a
fixed size internal browser
or the size automatically
extends to make the
whole content visible.
Gets or sets the height of
the converted web page
as it would appear in the
internal browser used to
render the html.
Gets an object populated
717

SelectPdf Pdf Library for .NET

WebPageWidth

after conversion with the


title, keywords and
description of the
converted web page.
Gets or sets the width of
the converted web page
as it would appear in the
internal browser used to
render the html.

Remarks
The html can be specified by either an url or a html string.

The html to pdf conversion is performed when the element is added to the drawing
canvas (pdf page or template).

See Also
SelectPdf Namespace

718

SelectPdf Pdf Library for .NET

PdfHtmlElement Constructor
Overload List
Name
PdfHtmlElement(String)

PdfHtmlElement(String,
String)
PdfHtmlElement(Single,
Single, String)
PdfHtmlElement(Single,
Single, Single, String)
PdfHtmlElement(Single,
Single, String, String)
PdfHtmlElement(Single,
Single, Single, Single,
String)
PdfHtmlElement(Single,
Single, Single, String,
String)
PdfHtmlElement(Single,
Single, Single, Single,
String, String)

Description
Creates a html object that
can be added to a pdf
document.
Creates a html object that
can be added to a pdf
document.
Creates a html object that
can be added to a pdf
document.
Creates a html object that
can be added to a pdf
document.
Creates a html object that
can be added to a pdf
document.
Creates a html object that
can be added to a pdf
document.
Creates a html object that
can be added to a pdf
document.
Creates a html object that
can be added to a pdf
document.

See Also
PdfHtmlElement Class
SelectPdf Namespace

719

SelectPdf Pdf Library for .NET

PdfHtmlElement Constructor (String)


Creates a html object that can be added to a pdf document.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public PdfHtmlElement(
string url
)
VB
Public Sub New (
url As String
)
Parameters
url
Type: System.String
The full url of the web page to be converted to pdf. The url can be also the full path
of a html file from the local file system.

Remarks
The html element is specified in this case by an url. The html will be converted and
rendered at the (0,0) location in the pdf canvas. The width of the element in pdf is
the available width in pdf page and the height is auto determined.
The web page is rendered in an internal browser with the default width of 1024px
and height auto determined. This can be changed using the WebPageWidth and
WebPageHeight properties.

See Also
PdfHtmlElement Class
PdfHtmlElement Overload
SelectPdf Namespace

720

SelectPdf Pdf Library for .NET

PdfHtmlElement Constructor (String, String)


Creates a html object that can be added to a pdf document.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public PdfHtmlElement(
string htmlString,
string baseUrl
)
VB
Public Sub New (
htmlString As String,
baseUrl As String
)
Parameters
htmlString
Type: System.String
The html string to be converted to pdf.
baseUrl
Type: System.String
This parameter allows the converter to resolve relative urls. Basically, baseUrl +
relative image/css url = full absolute url.

Remarks
The html element is specified in this case by a html string. The html will be
converted and rendered at the (0,0) location in the pdf canvas. The width of the
element in pdf is the available width in pdf page and the height is auto determined.
The web page is rendered in an internal browser with the default width of 1024px
and height auto determined. This can be changed using the WebPageWidth and
WebPageHeight properties.

See Also
PdfHtmlElement Class
PdfHtmlElement Overload
SelectPdf Namespace

721

SelectPdf Pdf Library for .NET

PdfHtmlElement Constructor (Single, Single, String)


Creates a html object that can be added to a pdf document.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public PdfHtmlElement(
float x,
float y,
string url
)
VB
Public Sub New (
x As Single,
y As Single,
url As String
)
Parameters
x
Type: System.Single
The position in points on the X axis where the element will be rendered.
y
Type: System.Single
The position in points on the Y axis where the element will be rendered.
url
Type: System.String
The full url of the web page to be converted to pdf. The url can be also the full path
of a html file from the local file system.

Remarks
The html element is specified in this case by an url. The html will be converted and
rendered at the (x,y) location in the pdf canvas. The width of the element in pdf is
the available width in pdf page and the height is auto determined.
The web page is rendered in an internal browser with the default width of 1024px
and height auto determined. This can be changed using the WebPageWidth and
WebPageHeight properties.

See Also
PdfHtmlElement Class
PdfHtmlElement Overload
SelectPdf Namespace

722

SelectPdf Pdf Library for .NET

PdfHtmlElement Constructor (Single, Single, Single,


String)
Creates a html object that can be added to a pdf document.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public PdfHtmlElement(
float x,
float y,
float width,
string url
)
VB
Public Sub New (
x As Single,
y As Single,
width As Single,
url As String
)
Parameters
x
Type: System.Single
The position in points on the X axis where the element will be rendered.
y
Type: System.Single
The position in points on the Y axis where the element will be rendered.
width
Type: System.Single
The destination width in points for the rendered content.
url
Type: System.String
The full url of the web page to be converted to pdf. The url can be also the full path
of a html file from the local file system.

Remarks
The html element is specified in this case by an url. The html will be converted and
rendered at the (x,y) location in the pdf canvas. The width of the element in pdf is
specified as parameter and the height is auto determined.

723

SelectPdf Pdf Library for .NET


The web page is rendered in an internal browser with the default width of 1024px
and height auto determined. This can be changed using the WebPageWidth and
WebPageHeight properties.

See Also
PdfHtmlElement Class
PdfHtmlElement Overload
SelectPdf Namespace

724

SelectPdf Pdf Library for .NET

PdfHtmlElement Constructor (Single, Single, String,


String)
Creates a html object that can be added to a pdf document.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public PdfHtmlElement(
float x,
float y,
string htmlString,
string baseUrl
)
VB
Public Sub New (
x As Single,
y As Single,
htmlString As String,
baseUrl As String
)
Parameters
x
Type: System.Single
The position in points on the X axis where the element will be rendered.
y
Type: System.Single
The position in points on the Y axis where the element will be rendered.
htmlString
Type: System.String
The html string to be converted to pdf.
baseUrl
Type: System.String
This parameter allows the converter to resolve relative urls. Basically, baseUrl +
relative image/css url = full absolute url.

Remarks
The html element is specified in this case by a html string. The html will be
converted and rendered at the (x,y) location in the pdf canvas. The width of the
element in pdf is the available width in pdf page and the height is auto determined.

725

SelectPdf Pdf Library for .NET


The web page is rendered in an internal browser with the default width of 1024px
and height auto determined. This can be changed using the WebPageWidth and
WebPageHeight properties.

See Also
PdfHtmlElement Class
PdfHtmlElement Overload
SelectPdf Namespace

726

SelectPdf Pdf Library for .NET

PdfHtmlElement Constructor (Single, Single, Single,


Single, String)
Creates a html object that can be added to a pdf document.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public PdfHtmlElement(
float x,
float y,
float width,
float height,
string url
)
VB
Public Sub New (
x As Single,
y As Single,
width As Single,
height As Single,
url As String
)
Parameters
x
Type: System.Single
The position in points on the X axis where the element will be rendered.
y
Type: System.Single
The position in points on the Y axis where the element will be rendered.
width
Type: System.Single
The destination width in points for the rendered content.
height
Type: System.Single
The destination height in points for the rendered content.
url
Type: System.String
The full url of the web page to be converted to pdf. The url can be also the full path
of a html file from the local file system.

727

SelectPdf Pdf Library for .NET

Remarks
The html element is specified in this case by an url. The html will be converted and
rendered at the (x,y) location in the pdf canvas. The width and height of the
element in pdf are also specified as parameters.
The web page is rendered in an internal browser with the default width of 1024px
and height auto determined. This can be changed using the WebPageWidth and
WebPageHeight properties.

See Also
PdfHtmlElement Class
PdfHtmlElement Overload
SelectPdf Namespace

728

SelectPdf Pdf Library for .NET

PdfHtmlElement Constructor (Single, Single, Single,


String, String)
Creates a html object that can be added to a pdf document.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public PdfHtmlElement(
float x,
float y,
float width,
string htmlString,
string baseUrl
)
VB
Public Sub New (
x As Single,
y As Single,
width As Single,
htmlString As String,
baseUrl As String
)
Parameters
x
Type: System.Single
The position in points on the X axis where the element will be rendered.
y
Type: System.Single
The position in points on the Y axis where the element will be rendered.
width
Type: System.Single
The destination width in points for the rendered content.
htmlString
Type: System.String
The html string to be converted to pdf.
baseUrl
Type: System.String
This parameter allows the converter to resolve relative urls. Basically, baseUrl +
relative image/css url = full absolute url.

729

SelectPdf Pdf Library for .NET

Remarks
The html element is specified in this case by a html string. The html will be
converted and rendered at the (x,y) location in the pdf canvas. The width of the
element in pdf is specified as parameter and the height is auto determined.
The web page is rendered in an internal browser with the default width of 1024px
and height auto determined. This can be changed using the WebPageWidth and
WebPageHeight properties.

See Also
PdfHtmlElement Class
PdfHtmlElement Overload
SelectPdf Namespace

730

SelectPdf Pdf Library for .NET

PdfHtmlElement Constructor (Single, Single, Single,


Single, String, String)
Creates a html object that can be added to a pdf document.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public PdfHtmlElement(
float x,
float y,
float width,
float height,
string htmlString,
string baseUrl
)
VB
Public Sub New (
x As Single,
y As Single,
width As Single,
height As Single,
htmlString As String,
baseUrl As String
)
Parameters
x
Type: System.Single
The position in points on the X axis where the element will be rendered.
y
Type: System.Single
The position in points on the Y axis where the element will be rendered.
width
Type: System.Single
The destination width in points for the rendered content.
height
Type: System.Single
The destination height in points for the rendered content.
htmlString
Type: System.String
The html string to be converted to pdf.

731

SelectPdf Pdf Library for .NET


baseUrl
Type: System.String
This parameter allows the converter to resolve relative urls. Basically, baseUrl +
relative image/css url = full absolute url.

Remarks
The html element is specified in this case by a html string. The html will be
converted and rendered at the (x,y) location in the pdf canvas. The width and height
of the element in pdf are also specified as parameters.
The web page is rendered in an internal browser with the default width of 1024px
and height auto determined. This can be changed using the WebPageWidth and
WebPageHeight properties.

See Also
PdfHtmlElement Class
PdfHtmlElement Overload
SelectPdf Namespace

732

SelectPdf Pdf Library for .NET

PdfHtmlElement.PdfHtmlElement Methods
The PdfHtmlElement type exposes the following members.

Methods
Name
Rotate

Scale

Skew

Translate

Description
Rotes the coordinate
system before rendering
the pdf element.
(Inherited from
PdfElement.)
Scales the coordinate
system before rendering
the pdf element.
(Inherited from
PdfElement.)
Skews the x and y axis by
an two different angles
before rendering the pdf
element. (Inherited from
PdfElement.)
Translates the coordinate
system before rendering
the pdf element.
(Inherited from
PdfElement.)

See Also
PdfHtmlElement Class
SelectPdf Namespace

733

SelectPdf Pdf Library for .NET

PdfHtmlElement.PdfHtmlElement Properties
The PdfHtmlElement type exposes the following members.

Properties
Name
Authentication

AutoFitHeight
AutoFitWidth
BackColor

Blending

ColorSpace

CssMediaType

DisplayFooterOnEvenPag
es

DisplayFooterOnOddPage
s

DisplayHeaderOnEvenPag
es

DisplayHeaderOnOddPag
es

Description
Handles authentication
options if the web page
being converted requires
authentication.
Specifies the vertical auto
fit mode.
Specifies the horizontal
auto fit mode.
Gets or sets the pdf
element background
color. (Inherited from
PdfElement.)
Gets or sets the blending
mode for transparent
rendering of the pdf
element. (Inherited from
PdfElement.)
Gets or sets the color
space for the pdf element
rendering. (Inherited from
PdfElement.)
Indicates what css styles
are used when the web
page is rendered.
Controls the visibility of
the document footer on
the even numbered
pages generated by this
pdf element.
Controls the visibility of
the document footer on
the odd numbered pages
generated by this pdf
element.
Controls the visibility of
the document header on
the even numbered
pages generated by this
pdf element.
Controls the visibility of
the document header on
734

SelectPdf Pdf Library for .NET

DrawBackground

EmbedFonts

ExternalLinksEnabled
ForeColor

Gradient

HiddenWebElements

HttpCookies

HttpHeaders

InternalLinksEnabled

JavaScriptEnabled

KeepImagesTogether

KeepTextsTogether

the odd numbered pages


generated by this pdf
element.
Gets or sets a flag
indicating if the web page
background is rendered in
pdf.
Instructs the converter to
embed all the needed
fonts into the pdf
document or not.
Controls the rendering of
external hyperlinks in pdf.
Gets or sets the pdf
element foreground color.
(Inherited from
PdfElement.)
Gets or sets the gradient
used to fill a shape.
(Inherited from
PdfElement.)
Gets a reference to the
object that controls the
visibility of some web
elements in the
generated pdf document.
Gets the collection of
custom HTTP cookies
used for the conversion.
Get the collection of
custom HTTP headers
used for the conversion.
Controls the conversion of
internal html links to
internal pdf links.
Enable scripts when
rendering the url or html
string.
This property instructs
the converter whether to
try to avoid cutting off
the images between pdf
pages or not.
This property instructs
the converter whether to
try to avoid cutting off
the text lines between pdf
735

SelectPdf Pdf Library for .NET

LineStyle

MaxPageLoadTime
MinPageLoadTime

PdfBookmarkOptions

PdfPagesRectangles

PluginsEnabled

ProxyOptions

Rotated

Scaled

Skewed

StartupMode

StartupScript

pages or not.
Gets or sets the line style
for pdf elements
rendering lines. (Inherited
from PdfElement.)
The web page navigation
timeout in seconds.
An additional time in
seconds to wait for
asynchronous items to be
loaded before the web
page is rendered.
Gets a reference to the
object that controls the
bookmarks creation for
the generated pdf
document.
The size and position of
the html content
rendered in all pages of
the pdf document.
A flag indicating if plugins
(like Flash players) are
enabled in the converter.
Gets a reference to an
object containing the
proxy settings used to
access the web page that
is being converted.
A flag to indicate if the
current pdf element was
rotated. (Inherited from
PdfElement.)
A flag to indicate if the
current pdf element was
scaled. (Inherited from
PdfElement.)
A flag to indicate if the
current pdf element was
skewed. (Inherited from
PdfElement.)
Use this property to
specify how the
conversion starts.
Use this property to
specify some JavaScript
code that will be injected
736

SelectPdf Pdf Library for .NET

Translated

Transparency

VisibleWebElementId

WebPageFixedSize

WebPageHeight

WebPageInformation

WebPageWidth

into the page that is


converted.
A flag to indicate if the
current pdf element was
translated. (Inherited
from PdfElement.)
Gets or sets the pdf
element transparency.
(Inherited from
PdfElement.)
Use this property to
convert only a certain
section of the page,
specified by the html
element ID.
Controls whether the web
page is rendered with a
fixed size internal browser
or the size automatically
extends to make the
whole content visible.
Gets or sets the height of
the converted web page
as it would appear in the
internal browser used to
render the html.
Gets an object populated
after conversion with the
title, keywords and
description of the
converted web page.
Gets or sets the width of
the converted web page
as it would appear in the
internal browser used to
render the html.

See Also
PdfHtmlElement Class
SelectPdf Namespace

737

SelectPdf Pdf Library for .NET

PdfHtmlElement.Authentication Property
Handles authentication options if the web page being converted requires
authentication.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public HtmlToPdfAuthenticationOptions Authentication { get; }
VB
Public ReadOnly Property Authentication As
HtmlToPdfAuthenticationOptions
Get
Property Value
Type: HtmlToPdfAuthenticationOptions

See Also
PdfHtmlElement Class
SelectPdf Namespace

738

SelectPdf Pdf Library for .NET

PdfHtmlElement.AutoFitHeight Property
Specifies the vertical auto fit mode.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public HtmlToPdfPageFitMode AutoFitHeight { get; set; }
VB
Public Property AutoFitHeight As HtmlToPdfPageFitMode
Get
Set
Property Value
Type: HtmlToPdfPageFitMode

Remarks
The converter considers both AutoFitWidth and AutoFitHeight when the html
content is rendered in the pdf page or specified rectangle.

If this property is set to NoAdjustment, the html content is not resized vertically in
any way to fit the available space. If the content is larger, it will be cut and not all of
it will be displayed in the generated pdf file.

If this property is set to ShrinkOnly, the html content is resized only if the content
height is larger than the destination space (pdf page or rectangle) height. In this
case, the content is shrunk to fit the destination space height and the elements that
it contains (texts, images) will appear smaller in the generated pdf document than
in the original web page. If the original content height is smaller than the
destination height, no adjustments will be done and the content will be rendered
exactly as it is, even though some additional white space might appear at the
bottom.

If this property is set to AutoFit, the converter will treat it like ShrinkOnly.
The default value of this property is NoAdjustment and for rendering, the converter
will only take AutoFitWidth into consideration.

See Also
PdfHtmlElement Class
SelectPdf Namespace

739

SelectPdf Pdf Library for .NET

740

SelectPdf Pdf Library for .NET

PdfHtmlElement.AutoFitWidth Property
Specifies the horizontal auto fit mode.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public HtmlToPdfPageFitMode AutoFitWidth { get; set; }
VB
Public Property AutoFitWidth As HtmlToPdfPageFitMode
Get
Set
Property Value
Type: HtmlToPdfPageFitMode

Remarks
The converter considers both AutoFitWidth and AutoFitHeight when the html
content is rendered in the pdf page or specified rectangle.

If this property is set to NoAdjustment, the html content is not resized horizontally
in any way to fit the available space. If the content is larger, it will be cut and not all
of it will be displayed in the generated pdf file.

If this property is set to ShrinkOnly, the html content is resized only if the content
width is larger than the destination space (pdf page or rectangle) width. In this case,
the content is shrunk to fit the destination space width and the elements that it
contains (texts, images) will appear smaller in the generated pdf document than in
the original web page. If the original content width is smaller than the destination
width, no adjustments will be done and the content will be rendered exactly as it is,
even though some additional white space might appear to its right.

If this property is set to AutoFit, the html content is resized to fit the available width
of the destination space. If the original content width is smaller than the destination
width, the elements rendered (texts, images) will appear larger in the generated pdf
document. If the original content width is larger than the destination width, the
elements rendered (texts, images) will appear smaller in the generated pdf
document.
The default value of this property is ShrinkOnly.

741

SelectPdf Pdf Library for .NET

See Also
PdfHtmlElement Class
SelectPdf Namespace

742

SelectPdf Pdf Library for .NET

PdfHtmlElement.CssMediaType Property
Indicates what css styles are used when the web page is rendered.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public HtmlToPdfCssMediaType CssMediaType { get; set; }
VB
Public Property CssMediaType As HtmlToPdfCssMediaType
Get
Set
Property Value
Type: HtmlToPdfCssMediaType

Remarks
The default value is Screen and the page is rendered like in a regular web browser.
If the page contains printer specific styles, the property should be set to Print to
have the page rendered using those css styles.

See Also
PdfHtmlElement Class
SelectPdf Namespace

743

SelectPdf Pdf Library for .NET

PdfHtmlElement.DisplayFooterOnEvenPages Property
Controls the visibility of the document footer on the even numbered pages
generated by this pdf element.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public bool DisplayFooterOnEvenPages { get; set; }
VB
Public Property DisplayFooterOnEvenPages As Boolean
Get
Set
Property Value
Type: Boolean

Remarks
By default the footer is displayed on both odd and even numbered pages. The
DisplayFooter property of the PdfPage has priority over
DisplayFooterOnEvenPages.

See Also
PdfHtmlElement Class
SelectPdf Namespace

744

SelectPdf Pdf Library for .NET

PdfHtmlElement.DisplayFooterOnOddPages Property
Controls the visibility of the document footer on the odd numbered pages generated
by this pdf element.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public bool DisplayFooterOnOddPages { get; set; }
VB
Public Property DisplayFooterOnOddPages As Boolean
Get
Set
Property Value
Type: Boolean

Remarks
By default the footer is displayed on both odd and even numbered pages. The
DisplayFooter property of the PdfPage has priority over
DisplayFooterOnOddPages.

See Also
PdfHtmlElement Class
SelectPdf Namespace

745

SelectPdf Pdf Library for .NET

PdfHtmlElement.DisplayHeaderOnEvenPages Property
Controls the visibility of the document header on the even numbered pages
generated by this pdf element.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public bool DisplayHeaderOnEvenPages { get; set; }
VB
Public Property DisplayHeaderOnEvenPages As Boolean
Get
Set
Property Value
Type: Boolean

Remarks
By default the header is displayed on both odd and even numbered pages. The
DisplayHeader property of the PdfPage has priority over
DisplayHeaderOnEvenPages.

See Also
PdfHtmlElement Class
SelectPdf Namespace

746

SelectPdf Pdf Library for .NET

PdfHtmlElement.DisplayHeaderOnOddPages Property
Controls the visibility of the document header on the odd numbered pages
generated by this pdf element.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public bool DisplayHeaderOnOddPages { get; set; }
VB
Public Property DisplayHeaderOnOddPages As Boolean
Get
Set
Property Value
Type: Boolean

Remarks
By default the header is displayed on both odd and even numbered pages. The
DisplayHeader property of the PdfPage has priority over
DisplayHeaderOnOddPages.

See Also
PdfHtmlElement Class
SelectPdf Namespace

747

SelectPdf Pdf Library for .NET

PdfHtmlElement.DrawBackground Property
Gets or sets a flag indicating if the web page background is rendered in pdf.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public bool DrawBackground { get; set; }
VB
Public Property DrawBackground As Boolean
Get
Set
Property Value
Type: Boolean

Remarks
The default value for this property is true and the page background is rendered into
the generated pdf. Even though it might be white, it will still make invisible any pdf
element that was rendered behind it. Setting this property to false can make visible
the existing pdf elements behind this html element.

See Also
PdfHtmlElement Class
SelectPdf Namespace

748

SelectPdf Pdf Library for .NET

PdfHtmlElement.EmbedFonts Property
Instructs the converter to embed all the needed fonts into the pdf document or not.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public bool EmbedFonts { get; set; }
VB
Public Property EmbedFonts As Boolean
Get
Set
Property Value
Type: Boolean

Remarks
The default value for this property is false and the fonts are not automatically
embedded.
This property does not control the web fonts (fonts that are downloaded with the
web page). The web fonts are always embedded because they are not installed on
the machine.

See Also
PdfHtmlElement Class
SelectPdf Namespace

749

SelectPdf Pdf Library for .NET

PdfHtmlElement.ExternalLinksEnabled Property
Controls the rendering of external hyperlinks in pdf.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public bool ExternalLinksEnabled { get; set; }
VB
Public Property ExternalLinksEnabled As Boolean
Get
Set
Property Value
Type: Boolean

Remarks
The default value for this property is true and in this case all external hyperlinks
from the web page will be rendered in the generated pdf document.
When this property is set to false, external links are ignore and they do not appear
in the generated pdf document.

See Also
PdfHtmlElement Class
SelectPdf Namespace

750

SelectPdf Pdf Library for .NET

PdfHtmlElement.HiddenWebElements Property
Gets a reference to the object that controls the visibility of some web elements in
the generated pdf document.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public HiddenWebElements HiddenWebElements { get; }
VB
Public ReadOnly Property HiddenWebElements As HiddenWebElements
Get
Property Value
Type: HiddenWebElements

Remarks
This property needs to be set to instruct the html to pdf converter to hide some
elements from the web page and not render them in the pdf document. The
converter will not render the web elements specified by the CssSelectors of the
HiddenWebElements property.

See Also
PdfHtmlElement Class
SelectPdf Namespace

751

SelectPdf Pdf Library for .NET

PdfHtmlElement.HttpCookies Property
Gets the collection of custom HTTP cookies used for the conversion.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public NameValueCollection HttpCookies { get; }
VB
Public ReadOnly Property HttpCookies As NameValueCollection
Get
Property Value
Type: NameValueCollection

Remarks
This property returns a reference to the collection of custom HTTP cookies to be
sent by the converter to the web server when the web page is rendered. A cookie is
defined by a name/value pair that can be added to the collection using the
Add(String, String) method of the HttpCookies property.

See Also
PdfHtmlElement Class
SelectPdf Namespace

752

SelectPdf Pdf Library for .NET

PdfHtmlElement.HttpHeaders Property
Get the collection of custom HTTP headers used for the conversion.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public NameValueCollection HttpHeaders { get; }
VB
Public ReadOnly Property HttpHeaders As NameValueCollection
Get
Property Value
Type: NameValueCollection

Remarks
This property returns a reference to the collection of custom HTTP headers to be
sent by the converter to the web server when the web page is rendered. A custom
HTTP header is defined by a name/value pair that can be added to the collection
using the Add(String, String) method of the HttpHeaders property.

See Also
PdfHtmlElement Class
SelectPdf Namespace

753

SelectPdf Pdf Library for .NET

PdfHtmlElement.InternalLinksEnabled Property
Controls the conversion of internal html links to internal pdf links.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public bool InternalLinksEnabled { get; set; }
VB
Public Property InternalLinksEnabled As Boolean
Get
Set
Property Value
Type: Boolean

Remarks
The default value for this property is true and in this case all internal hyperlinks
from the web page (links that point within the web page) will be rendered in the
generated pdf document as internal pdf links (clicking one of them will jump within
the pdf document).

See Also
PdfHtmlElement Class
SelectPdf Namespace

754

SelectPdf Pdf Library for .NET

PdfHtmlElement.JavaScriptEnabled Property
Enable scripts when rendering the url or html string.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public bool JavaScriptEnabled { get; set; }
VB
Public Property JavaScriptEnabled As Boolean
Get
Set
Property Value
Type: Boolean

Remarks
The default value of this property is true and the converter will run any javascript
available when the page loads.

Note: If the javascript requires some time to load, MinPageLoadTime property should
be set to delay the conversion with the specified number of seconds and allow the
javascript to run.

See Also
PdfHtmlElement Class
SelectPdf Namespace

755

SelectPdf Pdf Library for .NET

PdfHtmlElement.KeepImagesTogether Property
This property instructs the converter whether to try to avoid cutting off the images
between pdf pages or not.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public bool KeepImagesTogether { get; set; }
VB
Public Property KeepImagesTogether As Boolean
Get
Set
Property Value
Type: Boolean

Remarks
The default value is false and the converter does not try to avoid images cutting
between pdf pages.

See Also
PdfHtmlElement Class
SelectPdf Namespace

756

SelectPdf Pdf Library for .NET

PdfHtmlElement.KeepTextsTogether Property
This property instructs the converter whether to try to avoid cutting off the text
lines between pdf pages or not.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public bool KeepTextsTogether { get; set; }
VB
Public Property KeepTextsTogether As Boolean
Get
Set
Property Value
Type: Boolean

Remarks
The default value is true and the converter tries to avoid text cutting between pdf
pages.

See Also
PdfHtmlElement Class
SelectPdf Namespace

757

SelectPdf Pdf Library for .NET

PdfHtmlElement.MaxPageLoadTime Property
The web page navigation timeout in seconds.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public int MaxPageLoadTime { get; set; }
VB
Public Property MaxPageLoadTime As Integer
Get
Set
Property Value
Type: Int32

Remarks
Default value is 60 seconds. This value should be increased if large web pages are
loaded.

See Also
PdfHtmlElement Class
SelectPdf Namespace

758

SelectPdf Pdf Library for .NET

PdfHtmlElement.MinPageLoadTime Property
An additional time in seconds to wait for asynchronous items to be loaded before
the web page is rendered.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public int MinPageLoadTime { get; set; }
VB
Public Property MinPageLoadTime As Integer
Get
Set
Property Value
Type: Int32

Remarks
A delay of this type could be necessary if javascripts are loaded when the page is
rendered or if Flash movies are played.

See Also
PdfHtmlElement Class
SelectPdf Namespace

759

SelectPdf Pdf Library for .NET

PdfHtmlElement.PdfBookmarkOptions Property
Gets a reference to the object that controls the bookmarks creation for the
generated pdf document.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public PdfBookmarkOptions PdfBookmarkOptions { get; }
VB
Public ReadOnly Property PdfBookmarkOptions As PdfBookmarkOptions
Get
Property Value
Type: PdfBookmarkOptions

Remarks
This property needs to be set to instruct the html to pdf converter to automatically
generate some bookmarks in the pdf document. The converter will create
bookmarks for the web elements specified by the CssSelectors of the
PdfBookmarkOptions property.

See Also
PdfHtmlElement Class
SelectPdf Namespace

760

SelectPdf Pdf Library for .NET

PdfHtmlElement.PdfPagesRectangles Property
The size and position of the html content rendered in all pages of the pdf document.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public RectangleF[] PdfPagesRectangles { get; }
VB
Public ReadOnly Property PdfPagesRectangles As RectangleF()
Get
Property Value
Type: RectangleF[]

Remarks
This information is useful when other pdf elements are added after conversion using
the PdfDocument object.

See Also
PdfHtmlElement Class
SelectPdf Namespace

761

SelectPdf Pdf Library for .NET

PdfHtmlElement.PluginsEnabled Property
A flag indicating if plugins (like Flash players) are enabled in the converter.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public bool PluginsEnabled { get; set; }
VB
Public Property PluginsEnabled As Boolean
Get
Set
Property Value
Type: Boolean

Remarks
The default value for this property is true.

See Also
PdfHtmlElement Class
SelectPdf Namespace

762

SelectPdf Pdf Library for .NET

PdfHtmlElement.ProxyOptions Property
Gets a reference to an object containing the proxy settings used to access the web
page that is being converted.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public HtmlToPdfProxyOptions ProxyOptions { get; }
VB
Public ReadOnly Property ProxyOptions As HtmlToPdfProxyOptions
Get
Property Value
Type: HtmlToPdfProxyOptions

See Also
PdfHtmlElement Class
SelectPdf Namespace

763

SelectPdf Pdf Library for .NET

PdfHtmlElement.StartupMode Property
Use this property to specify how the conversion starts.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public HtmlToPdfStartupMode StartupMode { get; set; }
VB
Public Property StartupMode As HtmlToPdfStartupMode
Get
Set
Property Value
Type: HtmlToPdfStartupMode

Remarks
By default this is set to Automatic and the conversion is started as soon as the page
loads (and MinPageLoadTime elapses). If set to Manual, the conversion is started
only by a javascript call to SelectPdf.startConversion() from within the web page.

See Also
PdfHtmlElement Class
SelectPdf Namespace

764

SelectPdf Pdf Library for .NET

PdfHtmlElement.StartupScript Property
Use this property to specify some JavaScript code that will be injected into the page
that is converted.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public string StartupScript { get; set; }
VB
Public Property StartupScript As String
Get
Set
Property Value
Type: String

Remarks
The JavaScript code specified here will run before any other script on the page.

See Also
PdfHtmlElement Class
SelectPdf Namespace

765

SelectPdf Pdf Library for .NET

PdfHtmlElement.VisibleWebElementId Property
Use this property to convert only a certain section of the page, specified by the html
element ID.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public string VisibleWebElementId { set; }
VB
Public WriteOnly Property VisibleWebElementId As String
Set
Property Value
Type: String

See Also
PdfHtmlElement Class
SelectPdf Namespace

766

SelectPdf Pdf Library for .NET

PdfHtmlElement.WebPageFixedSize Property
Controls whether the web page is rendered with a fixed size internal browser or the
size automatically extends to make the whole content visible.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public bool WebPageFixedSize { get; set; }
VB
Public Property WebPageFixedSize As Boolean
Get
Set
Property Value
Type: Boolean

Remarks
The default value of this property is false.

If the web page does not fit the dimensions specified by the WebPageWidth and
WebPageHeight properties and WebPageFixedSize is set to false, the converter
will try to automatically calculate a larger width and height to be able to display the
whole html content.
If WebPageFixedSize is set to true, this will indicate the converter not to calculate
another width and height, but use width and height specified by WebPageWidth and
WebPageHeight. These dimensions with be used even though the content will not fit
the available space and it will be truncated.
Note: If WebPageFixedSize is set to true, a page height needs to be set using
WebPageHeight, because the default value (0) will make the converter fail (cannot
render a web page with no height).

See Also
PdfHtmlElement Class
SelectPdf Namespace

767

SelectPdf Pdf Library for .NET

PdfHtmlElement.WebPageHeight Property
Gets or sets the height of the converted web page as it would appear in the internal
browser used to render the html.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public int WebPageHeight { get; set; }
VB
Public Property WebPageHeight As Integer
Get
Set
Property Value
Type: Int32

Remarks
The web page height is specified in pixels and the default value is 0px. This means
that the converter will automatically calculate the page height.
Generally this property does not need to be changed, but there are situations when
the converter cannot calculate correctly the web page height (for example for web
pages with frames) and in that case, WebPageHeight needs to be set, otherwise
no content might appear in the generated pdf.
Note: If the WebPageHeight is set, the content that exceeds this page height is
truncated and will not appear in the generated pdf document. Only using the
default 0 value will allow the whole page content to be rendered all the time in the
generated pdf document.
This property can also be set directly in the constructor of PdfHtmlElement class.

See Also
PdfHtmlElement Class
SelectPdf Namespace

768

SelectPdf Pdf Library for .NET

PdfHtmlElement.WebPageInformation Property
Gets an object populated after conversion with the title, keywords and description of
the converted web page.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public WebPageInformation WebPageInformation { get; }
VB
Public ReadOnly Property WebPageInformation As WebPageInformation
Get
Property Value
Type: WebPageInformation

Remarks
This information can be used to set the properties of the pdf document after the
conversion.

See Also
PdfHtmlElement Class
SelectPdf Namespace

769

SelectPdf Pdf Library for .NET

PdfHtmlElement.WebPageWidth Property
Gets or sets the width of the converted web page as it would appear in the internal
browser used to render the html.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public int WebPageWidth { get; set; }
VB
Public Property WebPageWidth As Integer
Get
Set
Property Value
Type: Int32

Remarks
The web page width is specified in pixels and the default value is 1024px. The page
width is only an indication of the minimum page width recommended for
conversion. If the content does not fit this width, the converter will automatically
resize the internal browser to fit the whole html content. To avoid this, the
WebPageFixedSize property needs to be set to true. When WebPageFixedSize is true,
the web page will be rendered with the specified WebPageWidth and
WebPageHeight even though the content might be truncated.

If WebPageWidth is set to 0, the converter will automatically determine the page


width, finding the width that will fit the html content.
This property can also be set directly in the constructor of PdfHtmlElement class.

See Also
PdfHtmlElement Class
SelectPdf Namespace

770

SelectPdf Pdf Library for .NET

PdfHtmlSection Class
Represents a html element that can be added to the header or footer templates of a
pdf document.

Inheritance Hierarchy
System.Object SelectPdf.PdfSectionElement

SelectPdf.PdfHtmlSection

Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public class PdfHtmlSection : PdfSectionElement
VB
Public Class PdfHtmlSection
Inherits PdfSectionElement
The PdfHtmlSection type exposes the following members.

Constructors
Name
PdfHtmlSection(String)

PdfHtmlSection(String,
String)

PdfHtmlSection(Single,
Single, String)

PdfHtmlSection(Single,
Single, Single, String)

PdfHtmlSection(Single,
Single, String, String)

PdfHtmlSection(Single,

Description
Creates a html object
can be added to the
header or footer
templates of a pdf
document.
Creates a html object
can be added to the
header or footer
templates of a pdf
document.
Creates a html object
can be added to the
header or footer
templates of a pdf
document.
Creates a html object
can be added to the
header or footer
templates of a pdf
document.
Creates a html object
can be added to the
header or footer
templates of a pdf
document.
Creates a html object

that

that

that

that

that

that
771

SelectPdf Pdf Library for .NET


Single, Single, String,
String)

can be added to the


header or footer
templates of a pdf
document.

Name
Authentication

Description
Handles authentication
options if the web page
being converted requires
authentication.
Specifies the vertical auto
fit mode.
Specifies the horizontal
auto fit mode.
Indicates what css styles
are used when the web
page is rendered.
Gets or sets a flag
indicating if the web page
background is rendered in
pdf.
Instructs the converter to
embed all the needed
fonts into the pdf
document or not.
Controls the rendering of
external hyperlinks in pdf.
Gets the collection of
custom HTTP cookies
used for the conversion.
Get the collection of
custom HTTP headers
used for the conversion.
Controls the conversion of
internal html links to
internal pdf links.
Enable scripts when
rendering the url or html
string.
This property instructs
the converter whether to
try to avoid cutting off
the images between pdf
pages or not.
This property instructs

Properties

AutoFitHeight
AutoFitWidth
CssMediaType

DrawBackground

EmbedFonts

ExternalLinksEnabled
HttpCookies

HttpHeaders

InternalLinksEnabled

JavaScriptEnabled

KeepImagesTogether

KeepTextsTogether

772

SelectPdf Pdf Library for .NET

MaxPageLoadTime
MinPageLoadTime

PluginsEnabled

ProxyOptions

StartupMode

StartupScript

VisibleWebElementId

WebPageFixedSize

WebPageHeight

WebPageWidth

the converter whether to


try to avoid cutting off
the text lines between pdf
pages or not.
The web page navigation
timeout in seconds.
An additional time in
seconds to wait for
asynchronous items to be
loaded before the web
page is rendered.
A flag indicating if plugins
(like Flash players) are
enabled in the converter.
Gets a reference to an
object containing the
proxy settings used to
access the web page that
is being converted.
Use this property to
specify how the
conversion starts.
Use this property to
specify some JavaScript
code that will be injected
into the page that is
converted.
Use this property to
convert only a certain
section of the page,
specified by the html
element ID.
Controls whether the web
page is rendered with a
fixed size internal browser
or the size automatically
extends to make the
whole content visible.
Gets or sets the height of
the converted web page
as it would appear in the
internal browser used to
render the html.
Gets or sets the width of
the converted web page
as it would appear in the
internal browser used to
773

SelectPdf Pdf Library for .NET


render the html.

Remarks
The html can be specified by either an url or a html string.

See Also
SelectPdf Namespace

774

SelectPdf Pdf Library for .NET

PdfHtmlSection Constructor
Overload List
Name
PdfHtmlSection(String)

PdfHtmlSection(String,
String)

PdfHtmlSection(Single,
Single, String)

PdfHtmlSection(Single,
Single, Single, String)

PdfHtmlSection(Single,
Single, String, String)

PdfHtmlSection(Single,
Single, Single, String,
String)

Description
Creates a html object
can be added to the
header or footer
templates of a pdf
document.
Creates a html object
can be added to the
header or footer
templates of a pdf
document.
Creates a html object
can be added to the
header or footer
templates of a pdf
document.
Creates a html object
can be added to the
header or footer
templates of a pdf
document.
Creates a html object
can be added to the
header or footer
templates of a pdf
document.
Creates a html object
can be added to the
header or footer
templates of a pdf
document.

that

that

that

that

that

that

See Also
PdfHtmlSection Class
SelectPdf Namespace

775

SelectPdf Pdf Library for .NET

PdfHtmlSection Constructor (String)


Creates a html object that can be added to the header or footer templates of a pdf
document.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public PdfHtmlSection(
string url
)
VB
Public Sub New (
url As String
)
Parameters
url
Type: System.String
The full url of the web page to be converted to pdf. The url can be also the full path
of a html file from the local file system.

Remarks
The html element is specified in this case by an url. The html will be converted and
rendered at the (0,0) location in the pdf header or footer. The width of the element
in pdf is the available width in pdf page and the height is auto determined.
The web page is rendered in an internal browser with the default width of 1024px
and height auto determined. This can be changed using the WebPageWidth and
WebPageHeight properties.

See Also
PdfHtmlSection Class
PdfHtmlSection Overload
SelectPdf Namespace

776

SelectPdf Pdf Library for .NET

PdfHtmlSection Constructor (String, String)


Creates a html object that can be added to the header or footer templates of a pdf
document.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public PdfHtmlSection(
string htmlString,
string baseUrl
)
VB
Public Sub New (
htmlString As String,
baseUrl As String
)
Parameters
htmlString
Type: System.String
The html string to be converted to pdf.
baseUrl
Type: System.String
This parameter allows the converter to resolve relative urls. Basically, baseUrl +
relative image/css url = full absolute url.

Remarks
The html element is specified in this case by a html string. The html will be
converted and rendered at the (0,0) location in the pdf header or footer. The width
of the element in pdf is the available width in pdf page and the height is auto
determined.
The web page is rendered in an internal browser with the default width of 1024px
and height auto determined. This can be changed using the WebPageWidth and
WebPageHeight properties.

See Also
PdfHtmlSection Class
PdfHtmlSection Overload
SelectPdf Namespace

777

SelectPdf Pdf Library for .NET

PdfHtmlSection Constructor (Single, Single, String)


Creates a html object that can be added to the header or footer templates of a pdf
document.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public PdfHtmlSection(
float x,
float y,
string url
)
VB
Public Sub New (
x As Single,
y As Single,
url As String
)
Parameters
x
Type: System.Single
The position in points on the X axis where the element will be rendered.
y
Type: System.Single
The position in points on the Y axis where the element will be rendered.
url
Type: System.String
The full url of the web page to be converted to pdf. The url can be also the full path
of a html file from the local file system.

Remarks
The html element is specified in this case by an url. The html will be converted and
rendered at the (x,y) location in the pdf header or footer. The width of the element
in pdf is the available width in pdf page and the height is auto determined.
The web page is rendered in an internal browser with the default width of 1024px
and height auto determined. This can be changed using the WebPageWidth and
WebPageHeight properties.

See Also
PdfHtmlSection Class
PdfHtmlSection Overload
SelectPdf Namespace

778

SelectPdf Pdf Library for .NET

779

SelectPdf Pdf Library for .NET

PdfHtmlSection Constructor (Single, Single, Single, String)


Creates a html object that can be added to the header or footer templates of a pdf
document.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public PdfHtmlSection(
float x,
float y,
float width,
string url
)
VB
Public Sub New (
x As Single,
y As Single,
width As Single,
url As String
)
Parameters
x
Type: System.Single
The position in points on the X axis where the element will be rendered.
y
Type: System.Single
The position in points on the Y axis where the element will be rendered.
width
Type: System.Single
The destination width in points for the rendered content.
url
Type: System.String
The full url of the web page to be converted to pdf. The url can be also the full path
of a html file from the local file system.

Remarks
The html element is specified in this case by an url. The html will be converted and
rendered at the (x,y) location in the pdf header or footer. The width of the element
in pdf is specified as parameter and the height is auto determined.

780

SelectPdf Pdf Library for .NET


The web page is rendered in an internal browser with the default width of 1024px
and height auto determined. This can be changed using the WebPageWidth and
WebPageHeight properties.

See Also
PdfHtmlSection Class
PdfHtmlSection Overload
SelectPdf Namespace

781

SelectPdf Pdf Library for .NET

PdfHtmlSection Constructor (Single, Single, String, String)


Creates a html object that can be added to the header or footer templates of a pdf
document.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public PdfHtmlSection(
float x,
float y,
string htmlString,
string baseUrl
)
VB
Public Sub New (
x As Single,
y As Single,
htmlString As String,
baseUrl As String
)
Parameters
x
Type: System.Single
The position in points on the X axis where the element will be rendered.
y
Type: System.Single
The position in points on the Y axis where the element will be rendered.
htmlString
Type: System.String
The html string to be converted to pdf.
baseUrl
Type: System.String
This parameter allows the converter to resolve relative urls. Basically, baseUrl +
relative image/css url = full absolute url.

Remarks
The html element is specified in this case by a html string. The html will be
converted and rendered at the (x,y) location in the pdf header or footer. The width
of the element in pdf is the available width in pdf page and the height is auto
determined.

782

SelectPdf Pdf Library for .NET


The web page is rendered in an internal browser with the default width of 1024px
and height auto determined. This can be changed using the WebPageWidth and
WebPageHeight properties.

See Also
PdfHtmlSection Class
PdfHtmlSection Overload
SelectPdf Namespace

783

SelectPdf Pdf Library for .NET

PdfHtmlSection Constructor (Single, Single, Single, String,


String)
Creates a html object that can be added to the header or footer templates of a pdf
document.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public PdfHtmlSection(
float x,
float y,
float width,
string htmlString,
string baseUrl
)
VB
Public Sub New (
x As Single,
y As Single,
width As Single,
htmlString As String,
baseUrl As String
)
Parameters
x
Type: System.Single
The position in points on the X axis where the element will be rendered.
y
Type: System.Single
The position in points on the Y axis where the element will be rendered.
width
Type: System.Single
The destination width in points for the rendered content.
htmlString
Type: System.String
The html string to be converted to pdf.
baseUrl
Type: System.String
This parameter allows the converter to resolve relative urls. Basically, baseUrl +
relative image/css url = full absolute url.

784

SelectPdf Pdf Library for .NET

Remarks
The html element is specified in this case by a html string. The html will be
converted and rendered at the (x,y) location in the pdf header or footer. The width
of the element in pdf is specified as parameter and the height is auto determined.
The web page is rendered in an internal browser with the default width of 1024px
and height auto determined. This can be changed using the WebPageWidth and
WebPageHeight properties.

See Also
PdfHtmlSection Class
PdfHtmlSection Overload
SelectPdf Namespace

785

SelectPdf Pdf Library for .NET

PdfHtmlSection.PdfHtmlSection Properties
The PdfHtmlSection type exposes the following members.

Properties
Name
Authentication

AutoFitHeight
AutoFitWidth
CssMediaType

DrawBackground

EmbedFonts

ExternalLinksEnabled
HttpCookies

HttpHeaders

InternalLinksEnabled

JavaScriptEnabled

KeepImagesTogether

KeepTextsTogether

Description
Handles authentication
options if the web page
being converted requires
authentication.
Specifies the vertical auto
fit mode.
Specifies the horizontal
auto fit mode.
Indicates what css styles
are used when the web
page is rendered.
Gets or sets a flag
indicating if the web page
background is rendered in
pdf.
Instructs the converter to
embed all the needed
fonts into the pdf
document or not.
Controls the rendering of
external hyperlinks in pdf.
Gets the collection of
custom HTTP cookies
used for the conversion.
Get the collection of
custom HTTP headers
used for the conversion.
Controls the conversion of
internal html links to
internal pdf links.
Enable scripts when
rendering the url or html
string.
This property instructs
the converter whether to
try to avoid cutting off
the images between pdf
pages or not.
This property instructs
the converter whether to
try to avoid cutting off
786

SelectPdf Pdf Library for .NET

MaxPageLoadTime
MinPageLoadTime

PluginsEnabled

ProxyOptions

StartupMode

StartupScript

VisibleWebElementId

WebPageFixedSize

WebPageHeight

WebPageWidth

the text lines between pdf


pages or not.
The web page navigation
timeout in seconds.
An additional time in
seconds to wait for
asynchronous items to be
loaded before the web
page is rendered.
A flag indicating if plugins
(like Flash players) are
enabled in the converter.
Gets a reference to an
object containing the
proxy settings used to
access the web page that
is being converted.
Use this property to
specify how the
conversion starts.
Use this property to
specify some JavaScript
code that will be injected
into the page that is
converted.
Use this property to
convert only a certain
section of the page,
specified by the html
element ID.
Controls whether the web
page is rendered with a
fixed size internal browser
or the size automatically
extends to make the
whole content visible.
Gets or sets the height of
the converted web page
as it would appear in the
internal browser used to
render the html.
Gets or sets the width of
the converted web page
as it would appear in the
internal browser used to
render the html.

787

SelectPdf Pdf Library for .NET

See Also
PdfHtmlSection Class
SelectPdf Namespace

788

SelectPdf Pdf Library for .NET

PdfHtmlSection.Authentication Property
Handles authentication options if the web page being converted requires
authentication.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public HtmlToPdfAuthenticationOptions Authentication { get; }
VB
Public ReadOnly Property Authentication As
HtmlToPdfAuthenticationOptions
Get
Property Value
Type: HtmlToPdfAuthenticationOptions

See Also
PdfHtmlSection Class
SelectPdf Namespace

789

SelectPdf Pdf Library for .NET

PdfHtmlSection.AutoFitHeight Property
Specifies the vertical auto fit mode.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public HtmlToPdfPageFitMode AutoFitHeight { get; set; }
VB
Public Property AutoFitHeight As HtmlToPdfPageFitMode
Get
Set
Property Value
Type: HtmlToPdfPageFitMode

Remarks
The converter considers both AutoFitWidth and AutoFitHeight when the html
content is rendered in the pdf page or specified rectangle.

If this property is set to NoAdjustment, the html content is not resized vertically in
any way to fit the available space. If the content is larger, it will be cut and not all of
it will be displayed in the generated pdf file.

If this property is set to ShrinkOnly, the html content is resized only if the content
height is larger than the destination space (pdf page or rectangle) height. In this
case, the content is shrunk to fit the destination space height and the elements that
it contains (texts, images) will appear smaller in the generated pdf document than
in the original web page. If the original content height is smaller than the
destination height, no adjustments will be done and the content will be rendered
exactly as it is, even though some additional white space might appear at the
bottom.

If this property is set to AutoFit, the converter will treat it like ShrinkOnly.
The default value of this property is NoAdjustment and for rendering, the converter
will only take AutoFitWidth into consideration.

See Also
PdfHtmlSection Class
SelectPdf Namespace

790

SelectPdf Pdf Library for .NET

791

SelectPdf Pdf Library for .NET

PdfHtmlSection.AutoFitWidth Property
Specifies the horizontal auto fit mode.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public HtmlToPdfPageFitMode AutoFitWidth { get; set; }
VB
Public Property AutoFitWidth As HtmlToPdfPageFitMode
Get
Set
Property Value
Type: HtmlToPdfPageFitMode

Remarks
The converter considers both AutoFitWidth and AutoFitHeight when the html
content is rendered in the pdf page or specified rectangle.

If this property is set to NoAdjustment, the html content is not resized horizontally
in any way to fit the available space. If the content is larger, it will be cut and not all
of it will be displayed in the generated pdf file.

If this property is set to ShrinkOnly, the html content is resized only if the content
width is larger than the destination space (pdf page or rectangle) width. In this case,
the content is shrunk to fit the destination space width and the elements that it
contains (texts, images) will appear smaller in the generated pdf document than in
the original web page. If the original content width is smaller than the destination
width, no adjustments will be done and the content will be rendered exactly as it is,
even though some additional white space might appear to its right.

If this property is set to AutoFit, the html content is resized to fit the available width
of the destination space. If the original content width is smaller than the destination
width, the elements rendered (texts, images) will appear larger in the generated pdf
document. If the original content width is larger than the destination width, the
elements rendered (texts, images) will appear smaller in the generated pdf
document.
The default value of this property is ShrinkOnly.

792

SelectPdf Pdf Library for .NET

See Also
PdfHtmlSection Class
SelectPdf Namespace

793

SelectPdf Pdf Library for .NET

PdfHtmlSection.CssMediaType Property
Indicates what css styles are used when the web page is rendered.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public HtmlToPdfCssMediaType CssMediaType { get; set; }
VB
Public Property CssMediaType As HtmlToPdfCssMediaType
Get
Set
Property Value
Type: HtmlToPdfCssMediaType

Remarks
The default value is Screen and the page is rendered like in a regular web browser.
If the page contains printer specific styles, the property should be set to Print to
have the page rendered using those css styles.

See Also
PdfHtmlSection Class
SelectPdf Namespace

794

SelectPdf Pdf Library for .NET

PdfHtmlSection.DrawBackground Property
Gets or sets a flag indicating if the web page background is rendered in pdf.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public bool DrawBackground { get; set; }
VB
Public Property DrawBackground As Boolean
Get
Set
Property Value
Type: Boolean

Remarks
The default value for this property is true and the page background is rendered into
the generated pdf. Even though it might be white, it will still make invisible any pdf
element that was rendered behind it. Setting this property to false can make visible
the existing pdf elements behind this html element.

See Also
PdfHtmlSection Class
SelectPdf Namespace

795

SelectPdf Pdf Library for .NET

PdfHtmlSection.EmbedFonts Property
Instructs the converter to embed all the needed fonts into the pdf document or not.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public bool EmbedFonts { get; set; }
VB
Public Property EmbedFonts As Boolean
Get
Set
Property Value
Type: Boolean

Remarks
The default value for this property is false and the fonts are not automatically
embedded.
This property does not control the web fonts (fonts that are downloaded with the
web page). The web fonts are always embedded because they are not installed on
the machine.

See Also
PdfHtmlSection Class
SelectPdf Namespace

796

SelectPdf Pdf Library for .NET

PdfHtmlSection.ExternalLinksEnabled Property
Controls the rendering of external hyperlinks in pdf.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public bool ExternalLinksEnabled { get; set; }
VB
Public Property ExternalLinksEnabled As Boolean
Get
Set
Property Value
Type: Boolean

Remarks
The default value for this property is true and in this case all external hyperlinks
from the web page will be rendered in the generated pdf document.
When this property is set to false, external links are ignore and they do not appear
in the generated pdf document.

See Also
PdfHtmlSection Class
SelectPdf Namespace

797

SelectPdf Pdf Library for .NET

PdfHtmlSection.HttpCookies Property
Gets the collection of custom HTTP cookies used for the conversion.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public NameValueCollection HttpCookies { get; }
VB
Public ReadOnly Property HttpCookies As NameValueCollection
Get
Property Value
Type: NameValueCollection

Remarks
This property returns a reference to the collection of custom HTTP cookies to be
sent by the converter to the web server when the web page is rendered. A cookie is
defined by a name/value pair that can be added to the collection using the
Add(String, String) method of the HttpCookies property.

See Also
PdfHtmlSection Class
SelectPdf Namespace

798

SelectPdf Pdf Library for .NET

PdfHtmlSection.HttpHeaders Property
Get the collection of custom HTTP headers used for the conversion.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public NameValueCollection HttpHeaders { get; }
VB
Public ReadOnly Property HttpHeaders As NameValueCollection
Get
Property Value
Type: NameValueCollection

Remarks
This property returns a reference to the collection of custom HTTP headers to be
sent by the converter to the web server when the web page is rendered. A custom
HTTP header is defined by a name/value pair that can be added to the collection
using the Add(String, String) method of the HttpHeaders property.

See Also
PdfHtmlSection Class
SelectPdf Namespace

799

SelectPdf Pdf Library for .NET

PdfHtmlSection.InternalLinksEnabled Property
Controls the conversion of internal html links to internal pdf links.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public bool InternalLinksEnabled { get; set; }
VB
Public Property InternalLinksEnabled As Boolean
Get
Set
Property Value
Type: Boolean

Remarks
The default value for this property is true and in this case all internal hyperlinks
from the web page (links that point within the web page) will be rendered in the
generated pdf document as internal pdf links (clicking one of them will jump within
the pdf document).

See Also
PdfHtmlSection Class
SelectPdf Namespace

800

SelectPdf Pdf Library for .NET

PdfHtmlSection.JavaScriptEnabled Property
Enable scripts when rendering the url or html string.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public bool JavaScriptEnabled { get; set; }
VB
Public Property JavaScriptEnabled As Boolean
Get
Set
Property Value
Type: Boolean

Remarks
The default value of this property is true and the converter will run any javascript
available when the page loads.

Note: If the javascript requires some time to load, MinPageLoadTime property should
be set to delay the conversion with the specified number of seconds and allow the
javascript to run.

See Also
PdfHtmlSection Class
SelectPdf Namespace

801

SelectPdf Pdf Library for .NET

PdfHtmlSection.KeepImagesTogether Property
This property instructs the converter whether to try to avoid cutting off the images
between pdf pages or not.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public bool KeepImagesTogether { get; set; }
VB
Public Property KeepImagesTogether As Boolean
Get
Set
Property Value
Type: Boolean

Remarks
The default value is false and the converter does not try to avoid images cutting
between pdf pages.

See Also
PdfHtmlSection Class
SelectPdf Namespace

802

SelectPdf Pdf Library for .NET

PdfHtmlSection.KeepTextsTogether Property
This property instructs the converter whether to try to avoid cutting off the text
lines between pdf pages or not.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public bool KeepTextsTogether { get; set; }
VB
Public Property KeepTextsTogether As Boolean
Get
Set
Property Value
Type: Boolean

Remarks
The default value is true and the converter tries to avoid text cutting between pdf
pages.

See Also
PdfHtmlSection Class
SelectPdf Namespace

803

SelectPdf Pdf Library for .NET

PdfHtmlSection.MaxPageLoadTime Property
The web page navigation timeout in seconds.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public int MaxPageLoadTime { get; set; }
VB
Public Property MaxPageLoadTime As Integer
Get
Set
Property Value
Type: Int32

Remarks
Default value is 60 seconds. This value should be increased if large web pages are
loaded.

See Also
PdfHtmlSection Class
SelectPdf Namespace

804

SelectPdf Pdf Library for .NET

PdfHtmlSection.MinPageLoadTime Property
An additional time in seconds to wait for asynchronous items to be loaded before
the web page is rendered.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public int MinPageLoadTime { get; set; }
VB
Public Property MinPageLoadTime As Integer
Get
Set
Property Value
Type: Int32

Remarks
A delay of this type could be necessary if javascripts are loaded when the page is
rendered or if Flash movies are played.

See Also
PdfHtmlSection Class
SelectPdf Namespace

805

SelectPdf Pdf Library for .NET

PdfHtmlSection.PluginsEnabled Property
A flag indicating if plugins (like Flash players) are enabled in the converter.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public bool PluginsEnabled { get; set; }
VB
Public Property PluginsEnabled As Boolean
Get
Set
Property Value
Type: Boolean

Remarks
The default value for this property is true.

See Also
PdfHtmlSection Class
SelectPdf Namespace

806

SelectPdf Pdf Library for .NET

PdfHtmlSection.ProxyOptions Property
Gets a reference to an object containing the proxy settings used to access the web
page that is being converted.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public HtmlToPdfProxyOptions ProxyOptions { get; }
VB
Public ReadOnly Property ProxyOptions As HtmlToPdfProxyOptions
Get
Property Value
Type: HtmlToPdfProxyOptions

See Also
PdfHtmlSection Class
SelectPdf Namespace

807

SelectPdf Pdf Library for .NET

PdfHtmlSection.StartupMode Property
Use this property to specify how the conversion starts.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public HtmlToPdfStartupMode StartupMode { get; set; }
VB
Public Property StartupMode As HtmlToPdfStartupMode
Get
Set
Property Value
Type: HtmlToPdfStartupMode

Remarks
By default this is set to Automatic and the conversion is started as soon as the page
loads (and MinPageLoadTime elapses). If set to Manual, the conversion is started
only by a javascript call to SelectPdf.startConversion() from within the web page.

See Also
PdfHtmlSection Class
SelectPdf Namespace

808

SelectPdf Pdf Library for .NET

PdfHtmlSection.StartupScript Property
Use this property to specify some JavaScript code that will be injected into the page
that is converted.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public string StartupScript { get; set; }
VB
Public Property StartupScript As String
Get
Set
Property Value
Type: String

Remarks
The JavaScript code specified here will run before any other script on the page.

See Also
PdfHtmlSection Class
SelectPdf Namespace

809

SelectPdf Pdf Library for .NET

PdfHtmlSection.VisibleWebElementId Property
Use this property to convert only a certain section of the page, specified by the html
element ID.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public string VisibleWebElementId { set; }
VB
Public WriteOnly Property VisibleWebElementId As String
Set
Property Value
Type: String

See Also
PdfHtmlSection Class
SelectPdf Namespace

810

SelectPdf Pdf Library for .NET

PdfHtmlSection.WebPageFixedSize Property
Controls whether the web page is rendered with a fixed size internal browser or the
size automatically extends to make the whole content visible.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public bool WebPageFixedSize { get; set; }
VB
Public Property WebPageFixedSize As Boolean
Get
Set
Property Value
Type: Boolean

Remarks
The default value of this property is false.

If the web page does not fit the dimensions specified by the WebPageWidth and
WebPageHeight properties and WebPageFixedSize is set to false, the converter
will try to automatically calculate a larger width and height to be able to display the
whole html content.
If WebPageFixedSize is set to true, this will indicate the converter not to calculate
another width and height, but use width and height specified by WebPageWidth and
WebPageHeight. These dimensions with be used even though the content will not fit
the available space and it will be truncated.
Note: If WebPageFixedSize is set to true, a page height needs to be set using
WebPageHeight, because the default value (0) will make the converter fail (cannot
render a web page with no height).

See Also
PdfHtmlSection Class
SelectPdf Namespace

811

SelectPdf Pdf Library for .NET

PdfHtmlSection.WebPageHeight Property
Gets or sets the height of the converted web page as it would appear in the internal
browser used to render the html.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public int WebPageHeight { get; set; }
VB
Public Property WebPageHeight As Integer
Get
Set
Property Value
Type: Int32

Remarks
The web page height is specified in pixels and the default value is 0px. This means
that the converter will automatically calculate the page height.
Generally this property does not need to be changed, but there are situations when
the converter cannot calculate correctly the web page height (for example for web
pages with frames) and in that case, WebPageHeight needs to be set, otherwise
no content might appear in the generated pdf.
Note: If the WebPageHeight is set, the content that exceeds this page height is
truncated and will not appear in the generated pdf document. Only using the
default 0 value will allow the whole page content to be rendered all the time in the
generated pdf document.
This property can also be set directly in the constructor of PdfHtmlSection class.

See Also
PdfHtmlSection Class
SelectPdf Namespace

812

SelectPdf Pdf Library for .NET

PdfHtmlSection.WebPageWidth Property
Gets or sets the width of the converted web page as it would appear in the internal
browser used to render the html.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public int WebPageWidth { get; set; }
VB
Public Property WebPageWidth As Integer
Get
Set
Property Value
Type: Int32

Remarks
The web page width is specified in pixels and the default value is 1024px. The page
width is only an indication of the minimum page width recommended for
conversion. If the content does not fit this width, the converter will automatically
resize the internal browser to fit the whole html content. To avoid this, the
WebPageFixedSize property needs to be set to true. When WebPageFixedSize is true,
the web page will be rendered with the specified WebPageWidth and
WebPageHeight even though the content might be truncated.

If WebPageWidth is set to 0, the converter will automatically determine the page


width, finding the width that will fit the html content.
This property can also be set directly in the constructor of PdfHtmlSection class.

See Also
PdfHtmlSection Class
SelectPdf Namespace

813

SelectPdf Pdf Library for .NET

PdfImageElement Class
Represents an image that can be added to a pdf document.

Inheritance Hierarchy
System.Object SelectPdf.PdfPageElement
mageElement

SelectPdf.PdfElement

SelectPdf.PdfI

Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public class PdfImageElement : PdfElement
VB
Public Class PdfImageElement
Inherits PdfElement
The PdfImageElement type exposes the following members.

Constructors
Name
PdfImageElement(Single,
Single, Image)
PdfImageElement(Single,
Single, String)
PdfImageElement(Single,
Single, Single, Image)
PdfImageElement(Single,
Single, Single, String)
PdfImageElement(Single,
Single, Single, Single,
Image)
PdfImageElement(Single,
Single, Single, Single,
String)

Description
Creates an image object
that can be added to a
pdf document.
Creates an image object
that can be added to a
pdf document.
Creates an image object
that can be added to a
pdf document.
Creates an image object
that can be added to a
pdf document.
Creates an image object
that can be added to a
pdf document.
Creates an image object
that can be added to a
pdf document.

Methods
Name
Rotate

Description
Rotes the coordinate
system before rendering
the pdf element.
(Inherited from

814

SelectPdf Pdf Library for .NET

Scale

Skew

Translate

PdfElement.)
Scales the coordinate
system before rendering
the pdf element.
(Inherited from
PdfElement.)
Skews the x and y axis by
an two different angles
before rendering the pdf
element. (Inherited from
PdfElement.)
Translates the coordinate
system before rendering
the pdf element.
(Inherited from
PdfElement.)

Properties
Name
BackColor

Blending

ColorSpace

ForeColor

Gradient

Height

Image
LineStyle

Description
Gets or sets the pdf
element background
color. (Inherited from
PdfElement.)
Gets or sets the blending
mode for transparent
rendering of the pdf
element. (Inherited from
PdfElement.)
Gets or sets the color
space for the pdf element
rendering. (Inherited from
PdfElement.)
Gets or sets the pdf
element foreground color.
(Inherited from
PdfElement.)
Gets or sets the gradient
used to fill a shape.
(Inherited from
PdfElement.)
Gets or sets the image
height in the destination
pdf page.
Gets the underlying
system image object.
Gets or sets the line style

815

SelectPdf Pdf Library for .NET

MultiFrameRendering

Rotated

Scaled

Skewed

Translated

Transparency

TransparentRendering

Width

X
Y

for pdf elements


rendering lines. (Inherited
from PdfElement.)
A property that can be
used to enable or disable
multi-frame images
rendering.
A flag to indicate if the
current pdf element was
rotated. (Inherited from
PdfElement.)
A flag to indicate if the
current pdf element was
scaled. (Inherited from
PdfElement.)
A flag to indicate if the
current pdf element was
skewed. (Inherited from
PdfElement.)
A flag to indicate if the
current pdf element was
translated. (Inherited
from PdfElement.)
Gets or sets the pdf
element transparency.
(Inherited from
PdfElement.)
A flag indicating if the
image transparency
information is used when
the image is rendered in
the pdf document.
Gets or sets the image
width in the destination
pdf page.
Gets or sets the image
position on the X axis.
Gets or sets the image
position on the Y axis.

See Also
SelectPdf Namespace

816

SelectPdf Pdf Library for .NET

PdfImageElement Constructor
Overload List
Name
PdfImageElement(Single,
Single, Image)
PdfImageElement(Single,
Single, String)
PdfImageElement(Single,
Single, Single, Image)
PdfImageElement(Single,
Single, Single, String)
PdfImageElement(Single,
Single, Single, Single,
Image)
PdfImageElement(Single,
Single, Single, Single,
String)

Description
Creates an image object
that can be added to a
pdf document.
Creates an image object
that can be added to a
pdf document.
Creates an image object
that can be added to a
pdf document.
Creates an image object
that can be added to a
pdf document.
Creates an image object
that can be added to a
pdf document.
Creates an image object
that can be added to a
pdf document.

See Also
PdfImageElement Class
SelectPdf Namespace

817

SelectPdf Pdf Library for .NET

PdfImageElement Constructor (Single, Single, Image)


Creates an image object that can be added to a pdf document.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public PdfImageElement(
float x,
float y,
Image imageObj
)
VB
Public Sub New (
x As Single,
y As Single,
imageObj As Image
)
Parameters
x
Type: System.Single
The X position where this element will be rendered.
y
Type: System.Single
The Y position where this element will be rendered.
imageObj
Type: System.Drawing.Image
The system image object.

Remarks
The image object is created from the specified Image object that will be rendered
at the position (x,y) with a width equal to the available space in page and the height
auto determined to keep the aspect ratio.

See Also
PdfImageElement Class
PdfImageElement Overload
SelectPdf Namespace

818

SelectPdf Pdf Library for .NET

PdfImageElement Constructor (Single, Single, String)


Creates an image object that can be added to a pdf document.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public PdfImageElement(
float x,
float y,
string fileName
)
VB
Public Sub New (
x As Single,
y As Single,
fileName As String
)
Parameters
x
Type: System.Single
The X position where this element will be rendered.
y
Type: System.Single
The Y position where this element will be rendered.
fileName
Type: System.String
The image file path.

Remarks
The image object is created from the specified file and will be rendered at the
position (x,y) with the width equal to available width in page and the height auto
determined to keep the initial aspect ratio.

See Also
PdfImageElement Class
PdfImageElement Overload
SelectPdf Namespace

819

SelectPdf Pdf Library for .NET

PdfImageElement Constructor (Single, Single, Single,


Image)
Creates an image object that can be added to a pdf document.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public PdfImageElement(
float x,
float y,
float width,
Image imageObj
)
VB
Public Sub New (
x As Single,
y As Single,
width As Single,
imageObj As Image
)
Parameters
x
Type: System.Single
The X position where this element will be rendered.
y
Type: System.Single
The Y position where this element will be rendered.
width
Type: System.Single
The destination rectangle width.
imageObj
Type: System.Drawing.Image
The system image object.

Remarks
The image object is created from the specified Image object that will be rendered
at the position (x,y) with the specified destination width and the height auto
determined to keep the aspect ratio.

See Also
PdfImageElement Class
PdfImageElement Overload
820

SelectPdf Pdf Library for .NET


SelectPdf Namespace

821

SelectPdf Pdf Library for .NET

PdfImageElement Constructor (Single, Single, Single,


String)
Creates an image object that can be added to a pdf document.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public PdfImageElement(
float x,
float y,
float width,
string fileName
)
VB
Public Sub New (
x As Single,
y As Single,
width As Single,
fileName As String
)
Parameters
x
Type: System.Single
The X position where this element will be rendered.
y
Type: System.Single
The Y position where this element will be rendered.
width
Type: System.Single
The destination rectangle width.
fileName
Type: System.String
The image file path.

Remarks
The image object is created from the specified file that will be rendered at the
position (x,y) with the specified destination width and the height auto determined to
keep the initial aspect ratio.

See Also
PdfImageElement Class
PdfImageElement Overload
822

SelectPdf Pdf Library for .NET


SelectPdf Namespace

823

SelectPdf Pdf Library for .NET

PdfImageElement Constructor (Single, Single, Single,


Single, Image)
Creates an image object that can be added to a pdf document.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public PdfImageElement(
float x,
float y,
float width,
float height,
Image imageObj
)
VB
Public Sub New (
x As Single,
y As Single,
width As Single,
height As Single,
imageObj As Image
)
Parameters
x
Type: System.Single
The X position where this element will be rendered.
y
Type: System.Single
The Y position where this element will be rendered.
width
Type: System.Single
The destination rectangle width.
height
Type: System.Single
The destination rectangle height.
imageObj
Type: System.Drawing.Image
The system image object.

824

SelectPdf Pdf Library for .NET

Remarks
The image object is created from the specified Image object that will be rendered
at the position (x,y) with the specified destination width and height size.

See Also
PdfImageElement Class
PdfImageElement Overload
SelectPdf Namespace

825

SelectPdf Pdf Library for .NET

PdfImageElement Constructor (Single, Single, Single,


Single, String)
Creates an image object that can be added to a pdf document.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public PdfImageElement(
float x,
float y,
float width,
float height,
string fileName
)
VB
Public Sub New (
x As Single,
y As Single,
width As Single,
height As Single,
fileName As String
)
Parameters
x
Type: System.Single
The X position where this element will be rendered.
y
Type: System.Single
The Y position where this element will be rendered.
width
Type: System.Single
The destination rectangle width.
height
Type: System.Single
The destination rectangle height.
fileName
Type: System.String
The image file path.

826

SelectPdf Pdf Library for .NET

Remarks
The image object is created from the specified file that will be rendered at the
position (x,y) with the specified destination width and height size.

See Also
PdfImageElement Class
PdfImageElement Overload
SelectPdf Namespace

827

SelectPdf Pdf Library for .NET

PdfImageElement.PdfImageElement Methods
The PdfImageElement type exposes the following members.

Methods
Name
Rotate

Scale

Skew

Translate

Description
Rotes the coordinate
system before rendering
the pdf element.
(Inherited from
PdfElement.)
Scales the coordinate
system before rendering
the pdf element.
(Inherited from
PdfElement.)
Skews the x and y axis by
an two different angles
before rendering the pdf
element. (Inherited from
PdfElement.)
Translates the coordinate
system before rendering
the pdf element.
(Inherited from
PdfElement.)

See Also
PdfImageElement Class
SelectPdf Namespace

828

SelectPdf Pdf Library for .NET

PdfImageElement.PdfImageElement Properties
The PdfImageElement type exposes the following members.

Properties
Name
BackColor

Blending

ColorSpace

ForeColor

Gradient

Height

Image
LineStyle

MultiFrameRendering

Rotated

Scaled

Description
Gets or sets the pdf
element background
color. (Inherited from
PdfElement.)
Gets or sets the blending
mode for transparent
rendering of the pdf
element. (Inherited from
PdfElement.)
Gets or sets the color
space for the pdf element
rendering. (Inherited from
PdfElement.)
Gets or sets the pdf
element foreground color.
(Inherited from
PdfElement.)
Gets or sets the gradient
used to fill a shape.
(Inherited from
PdfElement.)
Gets or sets the image
height in the destination
pdf page.
Gets the underlying
system image object.
Gets or sets the line style
for pdf elements
rendering lines. (Inherited
from PdfElement.)
A property that can be
used to enable or disable
multi-frame images
rendering.
A flag to indicate if the
current pdf element was
rotated. (Inherited from
PdfElement.)
A flag to indicate if the
current pdf element was
scaled. (Inherited from
829

SelectPdf Pdf Library for .NET

Skewed

Translated

Transparency

TransparentRendering

Width

X
Y

PdfElement.)
A flag to indicate if the
current pdf element was
skewed. (Inherited from
PdfElement.)
A flag to indicate if the
current pdf element was
translated. (Inherited
from PdfElement.)
Gets or sets the pdf
element transparency.
(Inherited from
PdfElement.)
A flag indicating if the
image transparency
information is used when
the image is rendered in
the pdf document.
Gets or sets the image
width in the destination
pdf page.
Gets or sets the image
position on the X axis.
Gets or sets the image
position on the Y axis.

See Also
PdfImageElement Class
SelectPdf Namespace

830

SelectPdf Pdf Library for .NET

PdfImageElement.Height Property
Gets or sets the image height in the destination pdf page.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public float Height { get; set; }
VB
Public Property Height As Single
Get
Set
Property Value
Type: Single

See Also
PdfImageElement Class
SelectPdf Namespace

831

SelectPdf Pdf Library for .NET

PdfImageElement.Image Property
Gets the underlying system image object.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public Image Image { get; }
VB
Public ReadOnly Property Image As Image
Get
Property Value
Type: Image

See Also
PdfImageElement Class
SelectPdf Namespace

832

SelectPdf Pdf Library for .NET

PdfImageElement.MultiFrameRendering Property
A property that can be used to enable or disable multi-frame images rendering.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public bool MultiFrameRendering { get; set; }
VB
Public Property MultiFrameRendering As Boolean
Get
Set
Property Value
Type: Boolean

See Also
PdfImageElement Class
SelectPdf Namespace

833

SelectPdf Pdf Library for .NET

PdfImageElement.TransparentRendering Property
A flag indicating if the image transparency information is used when the image is
rendered in the pdf document.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public bool TransparentRendering { get; set; }
VB
Public Property TransparentRendering As Boolean
Get
Set
Property Value
Type: Boolean

Remarks
The default value of this property is false. Set this property to true to use
transparency information from the transparent PNG images and bitmap images with
alpha channel when the image is rendered in the pdf document.

See Also
PdfImageElement Class
SelectPdf Namespace

834

SelectPdf Pdf Library for .NET

PdfImageElement.Width Property
Gets or sets the image width in the destination pdf page.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public float Width { get; set; }
VB
Public Property Width As Single
Get
Set
Property Value
Type: Single

See Also
PdfImageElement Class
SelectPdf Namespace

835

SelectPdf Pdf Library for .NET

PdfImageElement.X Property
Gets or sets the image position on the X axis.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public float X { get; set; }
VB
Public Property X As Single
Get
Set
Property Value
Type: Single

See Also
PdfImageElement Class
SelectPdf Namespace

836

SelectPdf Pdf Library for .NET

PdfImageElement.Y Property
Gets or sets the image position on the Y axis.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public float Y { get; set; }
VB
Public Property Y As Single
Get
Set
Property Value
Type: Single

See Also
PdfImageElement Class
SelectPdf Namespace

837

SelectPdf Pdf Library for .NET

PdfImageSection Class
Represents an image that can be added to the header or footer templates of a pdf
document.

Inheritance Hierarchy
System.Object SelectPdf.PdfSectionElement

SelectPdf.PdfImageSection

Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public class PdfImageSection : PdfSectionElement
VB
Public Class PdfImageSection
Inherits PdfSectionElement
The PdfImageSection type exposes the following members.

Constructors
Name
PdfImageSection(Single,
Single, Single, Image)

PdfImageSection(Single,
Single, Single, String)

PdfImageSection(Single,
Single, Single, Single,
Image)

PdfImageSection(Single,
Single, Single, Single,
String)

Description
Creates an image object
that can be added to the
header or footer
templates of a pdf
document.
Creates an image object
that can be added to the
header or footer
templates of a pdf
document.
Creates an image object
that can be added to the
header or footer
templates of a pdf
document.
Creates an image object
that can be added to the
header or footer
templates of a pdf
document.

Properties
Name
Height

Description
Gets or sets the image
height in the destination

838

SelectPdf Pdf Library for .NET

Image
Transparency
Width

X
Y

pdf page.
Gets the underlying
system image object.
Gets or sets the pdf
element transparency.
Gets or sets the image
width in the destination
pdf page.
Gets or sets the image
position on the X axis.
Gets or sets the image
position on the Y axis.

See Also
SelectPdf Namespace

839

SelectPdf Pdf Library for .NET

PdfImageSection Constructor
Overload List
Name
PdfImageSection(Single,
Single, Single, Image)

PdfImageSection(Single,
Single, Single, String)

PdfImageSection(Single,
Single, Single, Single,
Image)

PdfImageSection(Single,
Single, Single, Single,
String)

Description
Creates an image object
that can be added to the
header or footer
templates of a pdf
document.
Creates an image object
that can be added to the
header or footer
templates of a pdf
document.
Creates an image object
that can be added to the
header or footer
templates of a pdf
document.
Creates an image object
that can be added to the
header or footer
templates of a pdf
document.

See Also
PdfImageSection Class
SelectPdf Namespace

840

SelectPdf Pdf Library for .NET

PdfImageSection Constructor (Single, Single, Single,


Image)
Creates an image object that can be added to the header or footer templates of a
pdf document.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public PdfImageSection(
float x,
float y,
float width,
Image imageObj
)
VB
Public Sub New (
x As Single,
y As Single,
width As Single,
imageObj As Image
)
Parameters
x
Type: System.Single
The X position where this element will be rendered.
y
Type: System.Single
The Y position where this element will be rendered.
width
Type: System.Single
The destination rectangle width.
imageObj
Type: System.Drawing.Image
The system image object.

Remarks
The image object is created from the specified Image object that will be rendered
at the position (x,y) in the pdf header or footer with the specified destination width
and the height auto determined to keep the aspect ratio.

See Also
PdfImageSection Class
841

SelectPdf Pdf Library for .NET


PdfImageSection Overload
SelectPdf Namespace

842

SelectPdf Pdf Library for .NET

PdfImageSection Constructor (Single, Single, Single,


String)
Creates an image object that can be added to the header or footer templates of a
pdf document.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public PdfImageSection(
float x,
float y,
float width,
string fileName
)
VB
Public Sub New (
x As Single,
y As Single,
width As Single,
fileName As String
)
Parameters
x
Type: System.Single
The X position where this element will be rendered.
y
Type: System.Single
The Y position where this element will be rendered.
width
Type: System.Single
The destination rectangle width.
fileName
Type: System.String
The image file path.

Remarks
The image object is created from the specified file that will be rendered at the
position (x,y) in the pdf header or footer with the specified destination width and
the height auto determined to keep the initial aspect ratio.

See Also
PdfImageSection Class
843

SelectPdf Pdf Library for .NET


PdfImageSection Overload
SelectPdf Namespace

844

SelectPdf Pdf Library for .NET

PdfImageSection Constructor (Single, Single, Single,


Single, Image)
Creates an image object that can be added to the header or footer templates of a
pdf document.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public PdfImageSection(
float x,
float y,
float width,
float height,
Image imageObj
)
VB
Public Sub New (
x As Single,
y As Single,
width As Single,
height As Single,
imageObj As Image
)
Parameters
x
Type: System.Single
The X position where this element will be rendered.
y
Type: System.Single
The Y position where this element will be rendered.
width
Type: System.Single
The destination rectangle width.
height
Type: System.Single
The destination rectangle height.
imageObj
Type: System.Drawing.Image
The system image object.

845

SelectPdf Pdf Library for .NET

Remarks
The image object is created from the specified Image object that will be rendered
at the position (x,y) in the pdf header or footer with the specified destination width
and height size.

See Also
PdfImageSection Class
PdfImageSection Overload
SelectPdf Namespace

846

SelectPdf Pdf Library for .NET

PdfImageSection Constructor (Single, Single, Single,


Single, String)
Creates an image object that can be added to the header or footer templates of a
pdf document.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public PdfImageSection(
float x,
float y,
float width,
float height,
string fileName
)
VB
Public Sub New (
x As Single,
y As Single,
width As Single,
height As Single,
fileName As String
)
Parameters
x
Type: System.Single
The X position where this element will be rendered.
y
Type: System.Single
The Y position where this element will be rendered.
width
Type: System.Single
The destination rectangle width.
height
Type: System.Single
The destination rectangle height.
fileName
Type: System.String
The image file path.

847

SelectPdf Pdf Library for .NET

Remarks
The image object is created from the specified file that will be rendered at the
position (x,y) in the pdf header or footer with the specified destination width and
height size.

See Also
PdfImageSection Class
PdfImageSection Overload
SelectPdf Namespace

848

SelectPdf Pdf Library for .NET

PdfImageSection.PdfImageSection Properties
The PdfImageSection type exposes the following members.

Properties
Name
Height

Image
Transparency
Width

X
Y

Description
Gets or sets the image
height in the destination
pdf page.
Gets the underlying
system image object.
Gets or sets the pdf
element transparency.
Gets or sets the image
width in the destination
pdf page.
Gets or sets the image
position on the X axis.
Gets or sets the image
position on the Y axis.

See Also
PdfImageSection Class
SelectPdf Namespace

849

SelectPdf Pdf Library for .NET

PdfImageSection.Height Property
Gets or sets the image height in the destination pdf page.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public float Height { get; set; }
VB
Public Property Height As Single
Get
Set
Property Value
Type: Single

See Also
PdfImageSection Class
SelectPdf Namespace

850

SelectPdf Pdf Library for .NET

PdfImageSection.Image Property
Gets the underlying system image object.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public Image Image { get; }
VB
Public ReadOnly Property Image As Image
Get
Property Value
Type: Image

See Also
PdfImageSection Class
SelectPdf Namespace

851

SelectPdf Pdf Library for .NET

PdfImageSection.Transparency Property
Gets or sets the pdf element transparency.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public int Transparency { get; set; }
VB
Public Property Transparency As Integer
Get
Set
Property Value
Type: Int32

Remarks
The transparency is expressed as a value between 0 and 100.

The value 0 means completely transparent and 100 means completely opaque.

See Also
PdfImageSection Class
SelectPdf Namespace

852

SelectPdf Pdf Library for .NET

PdfImageSection.Width Property
Gets or sets the image width in the destination pdf page.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public float Width { get; set; }
VB
Public Property Width As Single
Get
Set
Property Value
Type: Single

See Also
PdfImageSection Class
SelectPdf Namespace

853

SelectPdf Pdf Library for .NET

PdfImageSection.X Property
Gets or sets the image position on the X axis.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public float X { get; set; }
VB
Public Property X As Single
Get
Set
Property Value
Type: Single

See Also
PdfImageSection Class
SelectPdf Namespace

854

SelectPdf Pdf Library for .NET

PdfImageSection.Y Property
Gets or sets the image position on the Y axis.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public float Y { get; set; }
VB
Public Property Y As Single
Get
Set
Property Value
Type: Single

See Also
PdfImageSection Class
SelectPdf Namespace

855

SelectPdf Pdf Library for .NET

PdfInternalLinkElement Class
Represents an internal link in a pdf document.

Inheritance Hierarchy
System.Object SelectPdf.PdfPageElement

SelectPdf.PdfInternalLinkElement

Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public class PdfInternalLinkElement : PdfPageElement
VB
Public Class PdfInternalLinkElement
Inherits PdfPageElement
The PdfInternalLinkElement type exposes the following members.

Constructors
Name
PdfInternalLinkElement

Description
Initializes an internal link
pdf element.

Name
LinkDestination

Description
Gets or sets the link
destination in the pdf
document.
Gets or sets the link
rectangle in the pdf page.

Properties

LinkRectangle

See Also
SelectPdf Namespace

856

SelectPdf Pdf Library for .NET

PdfInternalLinkElement Constructor
Initializes an internal link pdf element.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public PdfInternalLinkElement(
RectangleF linkRectangle,
PdfDestination linkDestination
)
VB
Public Sub New (
linkRectangle As RectangleF,
linkDestination As PdfDestination
)
Parameters
linkRectangle
Type: System.Drawing.RectangleF
The link rectangle in the page.
linkDestination
Type: SelectPdf.PdfDestination
The link destination in the pdf document.

See Also
PdfInternalLinkElement Class
SelectPdf Namespace

857

SelectPdf Pdf Library for .NET

PdfInternalLinkElement.PdfInternalLinkElement Properties
The PdfInternalLinkElement type exposes the following members.

Properties
Name
LinkDestination

LinkRectangle

Description
Gets or sets the link
destination in the pdf
document.
Gets or sets the link
rectangle in the pdf page.

See Also
PdfInternalLinkElement Class
SelectPdf Namespace

858

SelectPdf Pdf Library for .NET

PdfInternalLinkElement.LinkDestination Property
Gets or sets the link destination in the pdf document.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public PdfDestination LinkDestination { get; set; }
VB
Public Property LinkDestination As PdfDestination
Get
Set
Property Value
Type: PdfDestination

See Also
PdfInternalLinkElement Class
SelectPdf Namespace

859

SelectPdf Pdf Library for .NET

PdfInternalLinkElement.LinkRectangle Property
Gets or sets the link rectangle in the pdf page.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public RectangleF LinkRectangle { get; set; }
VB
Public Property LinkRectangle As RectangleF
Get
Set
Property Value
Type: RectangleF

See Also
PdfInternalLinkElement Class
SelectPdf Namespace

860

SelectPdf Pdf Library for .NET

PdfLineCapStyle Enumeration
The line cap styles in a pdf document.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public enum PdfLineCapStyle
VB
Public Enumeration PdfLineCapStyle

Members
Member name
Default

Value
-1

ButtCap
RoundCap

0
1

ProjectingSquar
eCap

Description
Default line cap
style.
Butt line cap style.
Round line cap
style.
Projecting square
line cap style.

See Also
SelectPdf Namespace

861

SelectPdf Pdf Library for .NET

PdfLineDashStyle Enumeration
Specifies the style of a dashed line in a pdf document.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public enum PdfLineDashStyle
VB
Public Enumeration PdfLineDashStyle

Members
Member name
Default
Solid

Value
-1
0

Dash

Dot

DashDot

DashDotDot

Description
Default dash style.
Specifies a solid
line.
Specifies a line
consisting of
dashes.
Specifies a line
consisting of dots.
Specifies a line
consisting of a
repeating pattern
of dash-dot.
Specifies a line
consisting of a
repeating pattern
of dash-dot-dot.

See Also
SelectPdf Namespace

862

SelectPdf Pdf Library for .NET

PdfLineElement Class
Represents a line drawn in a pdf document.

Inheritance Hierarchy
System.Object SelectPdf.PdfPageElement
neElement

SelectPdf.PdfElement

SelectPdf.PdfLi

Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public class PdfLineElement : PdfElement
VB
Public Class PdfLineElement
Inherits PdfElement
The PdfLineElement type exposes the following members.

Constructors
Name
PdfLineElement(PointF,
PointF)
PdfLineElement(Single,
Single, Single, Single)

Description
Constructs a pdf line
element.
Constructs a pdf line
element.

Name
Rotate

Description
Rotes the coordinate
system before rendering
the pdf element.
(Inherited from
PdfElement.)
Scales the coordinate
system before rendering
the pdf element.
(Inherited from
PdfElement.)
Skews the x and y axis by
an two different angles
before rendering the pdf
element. (Inherited from
PdfElement.)
Translates the coordinate
system before rendering
the pdf element.

Methods

Scale

Skew

Translate

863

SelectPdf Pdf Library for .NET


(Inherited from
PdfElement.)

Properties
Name
BackColor

Blending

ColorSpace

ForeColor

Gradient

LineStyle

Rotated

Scaled

Skewed

Translated

Description
Gets or sets the pdf
element background
color. (Inherited from
PdfElement.)
Gets or sets the blending
mode for transparent
rendering of the pdf
element. (Inherited from
PdfElement.)
Gets or sets the color
space for the pdf element
rendering. (Inherited from
PdfElement.)
Gets or sets the pdf
element foreground color.
(Inherited from
PdfElement.)
Gets or sets the gradient
used to fill a shape.
(Inherited from
PdfElement.)
Gets or sets the line style
for pdf elements
rendering lines. (Inherited
from PdfElement.)
A flag to indicate if the
current pdf element was
rotated. (Inherited from
PdfElement.)
A flag to indicate if the
current pdf element was
scaled. (Inherited from
PdfElement.)
A flag to indicate if the
current pdf element was
skewed. (Inherited from
PdfElement.)
A flag to indicate if the
current pdf element was
translated. (Inherited
from PdfElement.)

864

SelectPdf Pdf Library for .NET


Transparency

Gets or sets the pdf


element transparency.
(Inherited from
PdfElement.)

See Also
SelectPdf Namespace

865

SelectPdf Pdf Library for .NET

PdfLineElement Constructor
Overload List
Name
PdfLineElement(PointF,
PointF)
PdfLineElement(Single,
Single, Single, Single)

Description
Constructs a pdf line
element.
Constructs a pdf line
element.

See Also
PdfLineElement Class
SelectPdf Namespace

866

SelectPdf Pdf Library for .NET

PdfLineElement Constructor (PointF, PointF)


Constructs a pdf line element.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public PdfLineElement(
PointF start,
PointF end
)
VB
Public Sub New (
start As PointF,
end As PointF
)
Parameters
start
Type: System.Drawing.PointF
The starting point of the line.
end
Type: System.Drawing.PointF
The ending point of the line.

See Also
PdfLineElement Class
PdfLineElement Overload
SelectPdf Namespace

867

SelectPdf Pdf Library for .NET

PdfLineElement Constructor (Single, Single, Single,


Single)
Constructs a pdf line element.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public PdfLineElement(
float startX,
float startY,
float endX,
float endY
)
VB
Public Sub New (
startX As Single,
startY As Single,
endX As Single,
endY As Single
)
Parameters
startX
Type: System.Single
The start position X coordinate.
startY
Type: System.Single
The start position Y coordinate.
endX
Type: System.Single
The end position X coordinate.
endY
Type: System.Single
The end position Y coordinate.

See Also
PdfLineElement Class
PdfLineElement Overload
SelectPdf Namespace

868

SelectPdf Pdf Library for .NET

PdfLineElement.PdfLineElement Methods
The PdfLineElement type exposes the following members.

Methods
Name
Rotate

Scale

Skew

Translate

Description
Rotes the coordinate
system before rendering
the pdf element.
(Inherited from
PdfElement.)
Scales the coordinate
system before rendering
the pdf element.
(Inherited from
PdfElement.)
Skews the x and y axis by
an two different angles
before rendering the pdf
element. (Inherited from
PdfElement.)
Translates the coordinate
system before rendering
the pdf element.
(Inherited from
PdfElement.)

See Also
PdfLineElement Class
SelectPdf Namespace

869

SelectPdf Pdf Library for .NET

PdfLineElement.PdfLineElement Properties
The PdfLineElement type exposes the following members.

Properties
Name
BackColor

Blending

ColorSpace

ForeColor

Gradient

LineStyle

Rotated

Scaled

Skewed

Translated

Description
Gets or sets the pdf
element background
color. (Inherited from
PdfElement.)
Gets or sets the blending
mode for transparent
rendering of the pdf
element. (Inherited from
PdfElement.)
Gets or sets the color
space for the pdf element
rendering. (Inherited from
PdfElement.)
Gets or sets the pdf
element foreground color.
(Inherited from
PdfElement.)
Gets or sets the gradient
used to fill a shape.
(Inherited from
PdfElement.)
Gets or sets the line style
for pdf elements
rendering lines. (Inherited
from PdfElement.)
A flag to indicate if the
current pdf element was
rotated. (Inherited from
PdfElement.)
A flag to indicate if the
current pdf element was
scaled. (Inherited from
PdfElement.)
A flag to indicate if the
current pdf element was
skewed. (Inherited from
PdfElement.)
A flag to indicate if the
current pdf element was
translated. (Inherited
from PdfElement.)
870

SelectPdf Pdf Library for .NET


Transparency

Gets or sets the pdf


element transparency.
(Inherited from
PdfElement.)

See Also
PdfLineElement Class
SelectPdf Namespace

871

SelectPdf Pdf Library for .NET

PdfLineJoinStyle Enumeration
Line join styles in a pdf document.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public enum PdfLineJoinStyle
VB
Public Enumeration PdfLineJoinStyle

Members
Member name
Default

Value
-1

MitterJoin

RoundJoin

BevelJoin

Description
Default line join
style.
Mitter line join
style.
Round line join
style.
Bevel line join
style.

See Also
SelectPdf Namespace

872

SelectPdf Pdf Library for .NET

PdfLineStyle Class
The line style for pdf graphic elements that draw lines.

Inheritance Hierarchy
System.Object SelectPdf.PdfLineStyle
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public class PdfLineStyle
VB
Public Class PdfLineStyle
The PdfLineStyle type exposes the following members.

Constructors
Name
PdfLineStyle()
PdfLineStyle(Single)

PdfLineStyle(PdfLineDash
Style)
PdfLineStyle(Single,
PdfLineDashStyle)
PdfLineStyle(Single,
PdfLineCapStyle,
PdfLineJoinStyle)

Description
Constructs a default line
style.
Constructs a line style
with the specified line
width.
Constructs a line style for
a dashed line.
Constructs a line style for
a dashed line with the
specified line width.
Constructs a style for a
line with the specified
width, cap and join styles.

Properties
Name
LineCapStyle
LineDashStyle
LineJoinStyle
LineWidth

Description
Gets or sets
style.
Gets or sets
style.
Gets or sets
style.
Gets or sets
width.

the line cap


the line dash
the line join
the line

See Also
SelectPdf Namespace

873

SelectPdf Pdf Library for .NET

874

SelectPdf Pdf Library for .NET

PdfLineStyle Constructor
Overload List
Name
PdfLineStyle()
PdfLineStyle(Single)

PdfLineStyle(PdfLineDash
Style)
PdfLineStyle(Single,
PdfLineDashStyle)
PdfLineStyle(Single,
PdfLineCapStyle,
PdfLineJoinStyle)

Description
Constructs a default line
style.
Constructs a line style
with the specified line
width.
Constructs a line style for
a dashed line.
Constructs a line style for
a dashed line with the
specified line width.
Constructs a style for a
line with the specified
width, cap and join styles.

See Also
PdfLineStyle Class
SelectPdf Namespace

875

SelectPdf Pdf Library for .NET

PdfLineStyle Constructor
Constructs a default line style.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public PdfLineStyle()
VB
Public Sub New

See Also
PdfLineStyle Class
PdfLineStyle Overload
SelectPdf Namespace

876

SelectPdf Pdf Library for .NET

PdfLineStyle Constructor (Single)


Constructs a line style with the specified line width.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public PdfLineStyle(
float lineWidth
)
VB
Public Sub New (
lineWidth As Single
)
Parameters
lineWidth
Type: System.Single
The line width.

See Also
PdfLineStyle Class
PdfLineStyle Overload
SelectPdf Namespace

877

SelectPdf Pdf Library for .NET

PdfLineStyle Constructor (PdfLineDashStyle)


Constructs a line style for a dashed line.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public PdfLineStyle(
PdfLineDashStyle lineDashStyle
)
VB
Public Sub New (
lineDashStyle As PdfLineDashStyle
)
Parameters
lineDashStyle
Type: SelectPdf.PdfLineDashStyle
The dash style.

See Also
PdfLineStyle Class
PdfLineStyle Overload
SelectPdf Namespace

878

SelectPdf Pdf Library for .NET

PdfLineStyle Constructor (Single, PdfLineDashStyle)


Constructs a line style for a dashed line with the specified line width.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public PdfLineStyle(
float lineWidth,
PdfLineDashStyle lineDashStyle
)
VB
Public Sub New (
lineWidth As Single,
lineDashStyle As PdfLineDashStyle
)
Parameters
lineWidth
Type: System.Single
The line width.
lineDashStyle
Type: SelectPdf.PdfLineDashStyle
The dash style.

See Also
PdfLineStyle Class
PdfLineStyle Overload
SelectPdf Namespace

879

SelectPdf Pdf Library for .NET

PdfLineStyle Constructor (Single, PdfLineCapStyle,


PdfLineJoinStyle)
Constructs a style for a line with the specified width, cap and join styles.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public PdfLineStyle(
float lineWidth,
PdfLineCapStyle lineCapStyle,
PdfLineJoinStyle lineJoinStyle
)
VB
Public Sub New (
lineWidth As Single,
lineCapStyle As PdfLineCapStyle,
lineJoinStyle As PdfLineJoinStyle
)
Parameters
lineWidth
Type: System.Single
The line width.
lineCapStyle
Type: SelectPdf.PdfLineCapStyle
The line cap style.
lineJoinStyle
Type: SelectPdf.PdfLineJoinStyle
The line join style.

See Also
PdfLineStyle Class
PdfLineStyle Overload
SelectPdf Namespace

880

SelectPdf Pdf Library for .NET

PdfLineStyle.PdfLineStyle Properties
The PdfLineStyle type exposes the following members.

Properties
Name
LineCapStyle
LineDashStyle
LineJoinStyle
LineWidth

Description
Gets or sets
style.
Gets or sets
style.
Gets or sets
style.
Gets or sets
width.

the line cap


the line dash
the line join
the line

See Also
PdfLineStyle Class
SelectPdf Namespace

881

SelectPdf Pdf Library for .NET

PdfLineStyle.LineCapStyle Property
Gets or sets the line cap style.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public PdfLineCapStyle LineCapStyle { get; set; }
VB
Public Property LineCapStyle As PdfLineCapStyle
Get
Set
Property Value
Type: PdfLineCapStyle

See Also
PdfLineStyle Class
SelectPdf Namespace

882

SelectPdf Pdf Library for .NET

PdfLineStyle.LineDashStyle Property
Gets or sets the line dash style.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public PdfLineDashStyle LineDashStyle { get; set; }
VB
Public Property LineDashStyle As PdfLineDashStyle
Get
Set
Property Value
Type: PdfLineDashStyle

See Also
PdfLineStyle Class
SelectPdf Namespace

883

SelectPdf Pdf Library for .NET

PdfLineStyle.LineJoinStyle Property
Gets or sets the line join style.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public PdfLineJoinStyle LineJoinStyle { get; set; }
VB
Public Property LineJoinStyle As PdfLineJoinStyle
Get
Set
Property Value
Type: PdfLineJoinStyle

See Also
PdfLineStyle Class
SelectPdf Namespace

884

SelectPdf Pdf Library for .NET

PdfLineStyle.LineWidth Property
Gets or sets the line width.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public float LineWidth { get; set; }
VB
Public Property LineWidth As Single
Get
Set
Property Value
Type: Single

See Also
PdfLineStyle Class
SelectPdf Namespace

885

SelectPdf Pdf Library for .NET

PdfMargins Class
Represents the settings for a pdf page margins.

Inheritance Hierarchy
System.Object SelectPdf.PdfMargins
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public class PdfMargins
VB
Public Class PdfMargins
The PdfMargins type exposes the following members.

Constructors
Name
PdfMargins()
PdfMargins(Single)
PdfMargins(Single, Single,
Single, Single)

Description
Initializes all margins with
0
Initializes all margins with
the same value
Default constructor
initializes with 0 all the
margins

Properties
Name
Empty

Description
Empty margins object

See Also
SelectPdf Namespace

886

SelectPdf Pdf Library for .NET

PdfMargins Constructor
Overload List
Name
PdfMargins()
PdfMargins(Single)
PdfMargins(Single, Single,
Single, Single)

Description
Initializes all margins with
0
Initializes all margins with
the same value
Default constructor
initializes with 0 all the
margins

See Also
PdfMargins Class
SelectPdf Namespace

887

SelectPdf Pdf Library for .NET

PdfMargins Constructor
Initializes all margins with 0
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public PdfMargins()
VB
Public Sub New

See Also
PdfMargins Class
PdfMargins Overload
SelectPdf Namespace

888

SelectPdf Pdf Library for .NET

PdfMargins Constructor (Single)


Initializes all margins with the same value
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public PdfMargins(
float all
)
VB
Public Sub New (
all As Single
)
Parameters
all
Type: System.Single
The value for all document margins.

See Also
PdfMargins Class
PdfMargins Overload
SelectPdf Namespace

889

SelectPdf Pdf Library for .NET

PdfMargins Constructor (Single, Single, Single, Single)


Default constructor initializes with 0 all the margins
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public PdfMargins(
float left,
float right,
float top,
float bottom
)
VB
Public Sub New (
left As Single,
right As Single,
top As Single,
bottom As Single
)
Parameters
left
Type: System.Single
The left margin
right
Type: System.Single
The right margin
top
Type: System.Single
The top margin
bottom
Type: System.Single
The bottom margin

See Also
PdfMargins Class
PdfMargins Overload
SelectPdf Namespace

890

SelectPdf Pdf Library for .NET

PdfMargins.PdfMargins Properties
The PdfMargins type exposes the following members.

Properties
Name
Empty

Description
Empty margins object

See Also
PdfMargins Class
SelectPdf Namespace

891

SelectPdf Pdf Library for .NET

PdfMargins.Empty Property
Empty margins object
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public static PdfMargins Empty { get; }
VB
Public Shared ReadOnly Property Empty As PdfMargins
Get
Property Value
Type: PdfMargins

See Also
PdfMargins Class
SelectPdf Namespace

892

SelectPdf Pdf Library for .NET

PdfPage Class
Represents a page in a pdf document.

Inheritance Hierarchy
System.Object SelectPdf.PdfCanvas

SelectPdf.PdfPage

Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public class PdfPage : PdfCanvas
VB
Public Class PdfPage
Inherits PdfCanvas
The PdfPage type exposes the following members.

Methods
Name
Add

MeasureString

Description
Adds the specified pdf
element to the current
page. (Overrides
PdfCanvas.Add(PdfPageEl
ement).)
Measures the size of the
specified string when
rendered with the
specified font. (Inherited
from PdfCanvas.)

Properties
Name
ClientRectangle

CustomFooter

CustomHeader

DisplayFooter

Description
Gets the drawable area of
the canvas. The margins,
pdf document header and
footer are excluded.
(Inherited from
PdfCanvas.)
Represents the custom
footer template for the
pdf page.
Represents the custom
header template for the
pdf page.
Controls if a custom

893

SelectPdf Pdf Library for .NET

DisplayHeader

Document
Margins
Orientation
PageIndex

PageSize
Rotation

footer is displayed in the


current pdf page.
Controls if a custom
header is displayed in the
current pdf page.
The parent pdf document
of the current page.
Gets the pdf page
margins.
Pdf page orientation.
The index of the current
page in the pdf pages
collection.
Gets the pdf page size in
points.
Pdf page rotation.

See Also
SelectPdf Namespace

894

SelectPdf Pdf Library for .NET

PdfPage.PdfPage Methods
The PdfPage type exposes the following members.

Methods
Name
Add

MeasureString

Description
Adds the specified pdf
element to the current
page. (Overrides
PdfCanvas.Add(PdfPageEl
ement).)
Measures the size of the
specified string when
rendered with the
specified font. (Inherited
from PdfCanvas.)

See Also
PdfPage Class
SelectPdf Namespace

895

SelectPdf Pdf Library for .NET

PdfPage.Add Method
Adds the specified pdf element to the current page.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public override PdfRenderingResult Add(
PdfPageElement element
)
VB
Public Overrides Function Add (
element As PdfPageElement
) As PdfRenderingResult
Parameters
element
Type: SelectPdf.PdfPageElement
The element to be added to the current pdf page.
Return Value
Type: PdfRenderingResultThe result of adding the element to the page.

See Also
PdfPage Class
SelectPdf Namespace

896

SelectPdf Pdf Library for .NET

PdfPage.PdfPage Properties
The PdfPage type exposes the following members.

Properties
Name
ClientRectangle

CustomFooter

CustomHeader

DisplayFooter

DisplayHeader

Document
Margins
Orientation
PageIndex

PageSize
Rotation

Description
Gets the drawable area of
the canvas. The margins,
pdf document header and
footer are excluded.
(Inherited from
PdfCanvas.)
Represents the custom
footer template for the
pdf page.
Represents the custom
header template for the
pdf page.
Controls if a custom
footer is displayed in the
current pdf page.
Controls if a custom
header is displayed in the
current pdf page.
The parent pdf document
of the current page.
Gets the pdf page
margins.
Pdf page orientation.
The index of the current
page in the pdf pages
collection.
Gets the pdf page size in
points.
Pdf page rotation.

See Also
PdfPage Class
SelectPdf Namespace

897

SelectPdf Pdf Library for .NET

PdfPage.CustomFooter Property
Represents the custom footer template for the pdf page.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public PdfTemplate CustomFooter { get; set; }
VB
Public Property CustomFooter As PdfTemplate
Get
Set
Property Value
Type: PdfTemplate

Remarks
It will replace the default pdf document footer template specified by Footer.

See Also
PdfPage Class
SelectPdf Namespace

898

SelectPdf Pdf Library for .NET

PdfPage.CustomHeader Property
Represents the custom header template for the pdf page.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public PdfTemplate CustomHeader { get; set; }
VB
Public Property CustomHeader As PdfTemplate
Get
Set
Property Value
Type: PdfTemplate

Remarks
It will replace the default pdf document header template specified by Header.

See Also
PdfPage Class
SelectPdf Namespace

899

SelectPdf Pdf Library for .NET

PdfPage.DisplayFooter Property
Controls if a custom footer is displayed in the current pdf page.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public bool DisplayFooter { get; set; }
VB
Public Property DisplayFooter As Boolean
Get
Set
Property Value
Type: Boolean

See Also
PdfPage Class
SelectPdf Namespace

900

SelectPdf Pdf Library for .NET

PdfPage.DisplayHeader Property
Controls if a custom header is displayed in the current pdf page.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public bool DisplayHeader { get; set; }
VB
Public Property DisplayHeader As Boolean
Get
Set
Property Value
Type: Boolean

See Also
PdfPage Class
SelectPdf Namespace

901

SelectPdf Pdf Library for .NET

PdfPage.Document Property
The parent pdf document of the current page.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public PdfDocument Document { get; }
VB
Public ReadOnly Property Document As PdfDocument
Get
Property Value
Type: PdfDocument

See Also
PdfPage Class
SelectPdf Namespace

902

SelectPdf Pdf Library for .NET

PdfPage.Margins Property
Gets the pdf page margins.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public PdfMargins Margins { get; }
VB
Public ReadOnly Property Margins As PdfMargins
Get
Property Value
Type: PdfMargins

See Also
PdfPage Class
SelectPdf Namespace

903

SelectPdf Pdf Library for .NET

PdfPage.Orientation Property
Pdf page orientation.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public PdfPageOrientation Orientation { get; set; }
VB
Public Property Orientation As PdfPageOrientation
Get
Set
Property Value
Type: PdfPageOrientation

Remarks
The default page orientation is Portrait.

See Also
PdfPage Class
SelectPdf Namespace

904

SelectPdf Pdf Library for .NET

PdfPage.PageIndex Property
The index of the current page in the pdf pages collection.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public int PageIndex { get; }
VB
Public ReadOnly Property PageIndex As Integer
Get
Property Value
Type: Int32

See Also
PdfPage Class
SelectPdf Namespace

905

SelectPdf Pdf Library for .NET

PdfPage.PageSize Property
Gets the pdf page size in points.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public PdfCustomPageSize PageSize { get; }
VB
Public ReadOnly Property PageSize As PdfCustomPageSize
Get
Property Value
Type: PdfCustomPageSize

See Also
PdfPage Class
SelectPdf Namespace

906

SelectPdf Pdf Library for .NET

PdfPage.Rotation Property
Pdf page rotation.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public PdfPageRotation Rotation { get; set; }
VB
Public Property Rotation As PdfPageRotation
Get
Set
Property Value
Type: PdfPageRotation

Remarks
The pdf page can be rotated with 90, 180 or 270 degrees from the original position.

See Also
PdfPage Class
SelectPdf Namespace

907

SelectPdf Pdf Library for .NET

PdfPageCollection Class
Represents the collection of pages in a pdf document.

Inheritance Hierarchy
System.Object SelectPdf.PdfPageCollection
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public class PdfPageCollection : IEnumerable
VB
Public Class PdfPageCollection
Implements IEnumerable
The PdfPageCollection type exposes the following members.

Methods
Name
Add()

Add(PdfMargins)

Add(PdfPage)

Add(PdfPage[])

Add(PdfCustomPageSize,
PdfMargins)

Add(PdfCustomPageSize,
PdfMargins,
PdfPageOrientation)

Description
Creates a new pdf page
and adds it to the pdf
document pages
collection.
Creates a new pdf page
with the specified
margins and adds it to
the pdf document pages
collection.
Adds the specified page
to the pdf document
pages collection.
Adds the specified array
of pages to the pdf
document pages
collection.
Creates a new pdf page
with the specified size
and margins and adds it
to the pdf document
pages collection.
Creates a new pdf page
with the specified size,
margins and orientation
and adds it to the pdf
document pages
collection.
908

SelectPdf Pdf Library for .NET


Contains

GetEnumerator
IndexOf

Insert(Int32, PdfPage)

Insert(Int32,
PdfCustomPageSize,
PdfMargins,
PdfPageOrientation)

Remove

RemoveAt

Indicates if the collection


contains the specified
page.
Gets the collection
enumerator.
Returns the index of
specified page in
collection.
Inserts the specified page
into the pdf document
pages collection at the
specified index.
Creates a new pdf page
with the specified size,
margins and orientation
and inserts it into the pdf
document pages
collection at the specified
index.
Removes the specified
page from the pdf
document pages
collection.
Removes the pdf page at
the specified index in pdf
document pages
collection.

Properties
Name
Count
Document
Item

Description
The number of pages in
the pdf pages collection.
The parent pdf document
of the pages collection.
Gets or sets the page at
the specified zero based
index in the pages
collection.

Remarks
PdfPageCollection
is a collection of PdfPage objects.

See Also
SelectPdf Namespace

909

SelectPdf Pdf Library for .NET

PdfPageCollection.PdfPageCollection Methods
The PdfPageCollection type exposes the following members.

Methods
Name
Add()

Add(PdfMargins)

Add(PdfPage)

Add(PdfPage[])

Add(PdfCustomPageSize,
PdfMargins)

Add(PdfCustomPageSize,
PdfMargins,
PdfPageOrientation)

Contains

GetEnumerator
IndexOf

Insert(Int32, PdfPage)

Insert(Int32,
PdfCustomPageSize,

Description
Creates a new pdf page
and adds it to the pdf
document pages
collection.
Creates a new pdf page
with the specified
margins and adds it to
the pdf document pages
collection.
Adds the specified page
to the pdf document
pages collection.
Adds the specified array
of pages to the pdf
document pages
collection.
Creates a new pdf page
with the specified size
and margins and adds it
to the pdf document
pages collection.
Creates a new pdf page
with the specified size,
margins and orientation
and adds it to the pdf
document pages
collection.
Indicates if the collection
contains the specified
page.
Gets the collection
enumerator.
Returns the index of
specified page in
collection.
Inserts the specified page
into the pdf document
pages collection at the
specified index.
Creates a new pdf page
with the specified size,
910

SelectPdf Pdf Library for .NET


PdfMargins,
PdfPageOrientation)

Remove

RemoveAt

margins and orientation


and inserts it into the pdf
document pages
collection at the specified
index.
Removes the specified
page from the pdf
document pages
collection.
Removes the pdf page at
the specified index in pdf
document pages
collection.

See Also
PdfPageCollection Class
SelectPdf Namespace

911

SelectPdf Pdf Library for .NET

PdfPageCollection.Add Method
Overload List
Name
Add()

Add(PdfMargins)

Add(PdfPage)

Add(PdfPage[])

Add(PdfCustomPageSize,
PdfMargins)

Add(PdfCustomPageSize,
PdfMargins,
PdfPageOrientation)

Description
Creates a new pdf page
and adds it to the pdf
document pages
collection.
Creates a new pdf page
with the specified
margins and adds it to
the pdf document pages
collection.
Adds the specified page
to the pdf document
pages collection.
Adds the specified array
of pages to the pdf
document pages
collection.
Creates a new pdf page
with the specified size
and margins and adds it
to the pdf document
pages collection.
Creates a new pdf page
with the specified size,
margins and orientation
and adds it to the pdf
document pages
collection.

See Also
PdfPageCollection Class
SelectPdf Namespace

912

SelectPdf Pdf Library for .NET

PdfPageCollection.Add Method
Creates a new pdf page and adds it to the pdf document pages collection.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public PdfPage Add()
VB
Public Function Add As PdfPage
Return Value
Type: PdfPageThe newly created pdf page.

Remarks
If there is a previous page in the pages collection, the orientation and size are
inherited from that page, otherwise a first page with the default A4 size and Portrait
orientation is created.

The page margins are inherited from the default pdf document margins specified in
Margins property.

See Also
PdfPageCollection Class
Add Overload
SelectPdf Namespace

913

SelectPdf Pdf Library for .NET

PdfPageCollection.Add Method (PdfMargins)


Creates a new pdf page with the specified margins and adds it to the pdf document
pages collection.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public PdfPage Add(
PdfMargins pageMargins
)
VB
Public Function Add (
pageMargins As PdfMargins
) As PdfPage
Parameters
pageMargins
Type: SelectPdf.PdfMargins
The pdf page margins.
Return Value
Type: PdfPageThe newly created pdf page.

Remarks
If there is a previous page in the pages collection, the orientation and size are
inherited from that page, otherwise a first page with the default A4 size and Portrait
orientation is created.

See Also
PdfPageCollection Class
Add Overload
SelectPdf Namespace

914

SelectPdf Pdf Library for .NET

PdfPageCollection.Add Method (PdfPage)


Adds the specified page to the pdf document pages collection.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public int Add(
PdfPage pdfPage
)
VB
Public Function Add (
pdfPage As PdfPage
) As Integer
Parameters
pdfPage
Type: SelectPdf.PdfPage
The page to be added to the collection.
Return Value
Type: Int32The index of the page in collection. If the page already exists, this
method returns the index of the existing page.

Remarks
The specified page can belong to another pdf document.

Important
The source pdf document must remain opened until the current document is
saved.

See Also
PdfPageCollection Class
Add Overload
SelectPdf Namespace

915

SelectPdf Pdf Library for .NET

PdfPageCollection.Add Method (PdfPage[])


Adds the specified array of pages to the pdf document pages collection.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public void Add(
PdfPage[] pages
)
VB
Public Sub Add (
pages As PdfPage()
)
Parameters
pages
Type: SelectPdf.PdfPage[]
The pdf pages to be added to the collection.

Remarks
The specified pages can belong to another pdf document.

Important
The source pdf document must remain opened until the current document is
saved.

See Also
PdfPageCollection Class
Add Overload
SelectPdf Namespace

916

SelectPdf Pdf Library for .NET

PdfPageCollection.Add Method (PdfCustomPageSize,


PdfMargins)
Creates a new pdf page with the specified size and margins and adds it to the pdf
document pages collection.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public PdfPage Add(
PdfCustomPageSize pageSize,
PdfMargins pageMargins
)
VB
Public Function Add (
pageSize As PdfCustomPageSize,
pageMargins As PdfMargins
) As PdfPage
Parameters
pageSize
Type: SelectPdf.PdfCustomPageSize
The pdf page size.
pageMargins
Type: SelectPdf.PdfMargins
The pdf page margins.
Return Value
Type: PdfPageThe newly created pdf page.

Remarks
If there is a previous page in the pages collection, the orientation is inherited from
that page, otherwise a first page with the default Portrait orientation is created.

See Also
PdfPageCollection Class
Add Overload
SelectPdf Namespace

917

SelectPdf Pdf Library for .NET

PdfPageCollection.Add Method (PdfCustomPageSize,


PdfMargins, PdfPageOrientation)
Creates a new pdf page with the specified size, margins and orientation and adds it
to the pdf document pages collection.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public PdfPage Add(
PdfCustomPageSize pageSize,
PdfMargins pageMargins,
PdfPageOrientation pageOrientation
)
VB
Public Function Add (
pageSize As PdfCustomPageSize,
pageMargins As PdfMargins,
pageOrientation As PdfPageOrientation
) As PdfPage
Parameters
pageSize
Type: SelectPdf.PdfCustomPageSize
The pdf page size.
pageMargins
Type: SelectPdf.PdfMargins
The pdf page margins.
pageOrientation
Type: SelectPdf.PdfPageOrientation
The pdf page orientation.
Return Value
Type: PdfPageThe newly created pdf page.

See Also
PdfPageCollection Class
Add Overload
SelectPdf Namespace

918

SelectPdf Pdf Library for .NET

PdfPageCollection.Contains Method
Indicates if the collection contains the specified page.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public bool Contains(
PdfPage pdfPage
)
VB
Public Function Contains (
pdfPage As PdfPage
) As Boolean
Parameters
pdfPage
Type: SelectPdf.PdfPage
The specified pdf page.
Return Value
Type: BooleanTrue if the collection contains the specified page.

See Also
PdfPageCollection Class
SelectPdf Namespace

919

SelectPdf Pdf Library for .NET

PdfPageCollection.GetEnumerator Method
Gets the collection enumerator.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public IEnumerator GetEnumerator()
VB
Public Function GetEnumerator As IEnumerator
Return Value
Type: IEnumeratorThe collection enumerator.
Implements
IEnumerable.GetEnumerator()

See Also
PdfPageCollection Class
SelectPdf Namespace

920

SelectPdf Pdf Library for .NET

PdfPageCollection.IndexOf Method
Returns the index of specified page in collection.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public int IndexOf(
PdfPage pdfPage
)
VB
Public Function IndexOf (
pdfPage As PdfPage
) As Integer
Parameters
pdfPage
Type: SelectPdf.PdfPage
The specified pdf page.
Return Value
Type: Int32The index of the specified page in collection.

See Also
PdfPageCollection Class
SelectPdf Namespace

921

SelectPdf Pdf Library for .NET

PdfPageCollection.Insert Method
Overload List
Name
Insert(Int32, PdfPage)

Insert(Int32,
PdfCustomPageSize,
PdfMargins,
PdfPageOrientation)

Description
Inserts the specified page
into the pdf document
pages collection at the
specified index.
Creates a new pdf page
with the specified size,
margins and orientation
and inserts it into the pdf
document pages
collection at the specified
index.

See Also
PdfPageCollection Class
SelectPdf Namespace

922

SelectPdf Pdf Library for .NET

PdfPageCollection.Insert Method (Int32, PdfPage)


Inserts the specified page into the pdf document pages collection at the specified
index.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public void Insert(
int pageIndex,
PdfPage pdfPage
)
VB
Public Sub Insert (
pageIndex As Integer,
pdfPage As PdfPage
)
Parameters
pageIndex
Type: System.Int32
The index where the pdf page will be inserted.
pdfPage
Type: SelectPdf.PdfPage
The pdf page to be inserted into the collection.

Remarks
The specified page can belong to another pdf document.

Note
The source pdf document must remain opened until the current document is
saved.

See Also
PdfPageCollection Class
Insert Overload
SelectPdf Namespace

923

SelectPdf Pdf Library for .NET

PdfPageCollection.Insert Method (Int32,


PdfCustomPageSize, PdfMargins, PdfPageOrientation)
Creates a new pdf page with the specified size, margins and orientation and inserts
it into the pdf document pages collection at the specified index.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public PdfPage Insert(
int index,
PdfCustomPageSize pageSize,
PdfMargins pageMargins,
PdfPageOrientation pageOrientation
)
VB
Public Function Insert (
index As Integer,
pageSize As PdfCustomPageSize,
pageMargins As PdfMargins,
pageOrientation As PdfPageOrientation
) As PdfPage
Parameters
index
Type: System.Int32
The index where the new pdf page will be inserted.
pageSize
Type: SelectPdf.PdfCustomPageSize
The pdf page size.
pageMargins
Type: SelectPdf.PdfMargins
The pdf page margins.
pageOrientation
Type: SelectPdf.PdfPageOrientation
The pdf page orientation.
Return Value
Type: PdfPageThe newly created pdf page.

See Also
PdfPageCollection Class
Insert Overload
SelectPdf Namespace
924

SelectPdf Pdf Library for .NET

925

SelectPdf Pdf Library for .NET

PdfPageCollection.Remove Method
Removes the specified page from the pdf document pages collection.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public void Remove(
PdfPage pdfPage
)
VB
Public Sub Remove (
pdfPage As PdfPage
)
Parameters
pdfPage
Type: SelectPdf.PdfPage
The pdf page to be removed.

See Also
PdfPageCollection Class
SelectPdf Namespace

926

SelectPdf Pdf Library for .NET

PdfPageCollection.RemoveAt Method
Removes the pdf page at the specified index in pdf document pages collection.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public void RemoveAt(
int index
)
VB
Public Sub RemoveAt (
index As Integer
)
Parameters
index
Type: System.Int32
The zero based index of the pdf page to be removed.

See Also
PdfPageCollection Class
SelectPdf Namespace

927

SelectPdf Pdf Library for .NET

PdfPageCollection.PdfPageCollection Properties
The PdfPageCollection type exposes the following members.

Properties
Name
Count
Document
Item

Description
The number of pages in
the pdf pages collection.
The parent pdf document
of the pages collection.
Gets or sets the page at
the specified zero based
index in the pages
collection.

See Also
PdfPageCollection Class
SelectPdf Namespace

928

SelectPdf Pdf Library for .NET

PdfPageCollection.Count Property
The number of pages in the pdf pages collection.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public int Count { get; }
VB
Public ReadOnly Property Count As Integer
Get
Property Value
Type: Int32

See Also
PdfPageCollection Class
SelectPdf Namespace

929

SelectPdf Pdf Library for .NET

PdfPageCollection.Document Property
The parent pdf document of the pages collection.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public PdfDocument Document { get; }
VB
Public ReadOnly Property Document As PdfDocument
Get
Property Value
Type: PdfDocument

See Also
PdfPageCollection Class
SelectPdf Namespace

930

SelectPdf Pdf Library for .NET

PdfPageCollection.Item Property
Gets or sets the page at the specified zero based index in the pages collection.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public PdfPage this[
int index
] { get; set; }
VB
Public Default Property Item (
index As Integer
) As PdfPage
Get
Set
Parameters
index
Type: System.Int32
The zero based page index in the pdf pages collection.
Return Value
Type: PdfPageThe pdf page at the specified index.

See Also
PdfPageCollection Class
SelectPdf Namespace

931

SelectPdf Pdf Library for .NET

PdfPageElement Class
The base class for all graphic elements from a pdf document.

Inheritance Hierarchy
System.Object SelectPdf.PdfPageElement SelectPdf.PdfAnnotationElement Selec
tPdf.PdfDigitalSignatureElement SelectPdf.PdfElement SelectPdf.PdfExternalFileEl
ement SelectPdf.PdfExternalLinkElement SelectPdf.PdfFileAttachmentElement
SelectPdf.PdfInternalLinkElement SelectPdf.PdfSoundLinkElement
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public abstract class PdfPageElement
VB
Public MustInherit Class PdfPageElement
The PdfPageElement type exposes the following members.

Constructors
Name
PdfPageElement

Description

See Also
SelectPdf Namespace

932

SelectPdf Pdf Library for .NET

PdfPageElement Constructor
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
protected PdfPageElement()
VB
Protected Sub New

See Also
PdfPageElement Class
SelectPdf Namespace

933

SelectPdf Pdf Library for .NET

PdfPageOrientation Enumeration
The list of pdf pages available orientations.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public enum PdfPageOrientation
VB
Public Enumeration PdfPageOrientation

Members
Member name
Portrait
Landscape

Value
0
1

Description
Portrait
Landscape

See Also
SelectPdf Namespace

934

SelectPdf Pdf Library for .NET

PdfPageRotation Enumeration
Standard rotation angles for pdf pages.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public enum PdfPageRotation
VB
Public Enumeration PdfPageRotation

Members
Member name
Rotate_0
Rotate_90

Value
0
90

Rotate_180

180

Rotate_270

270

Description
0 degrees rotation.
90 degrees
rotation.
180 degrees
rotation.
270 degrees
rotation.

See Also
SelectPdf Namespace

935

SelectPdf Pdf Library for .NET

PdfPageSize Enumeration
The list of pdf standard page sizes.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public enum PdfPageSize
VB
Public Enumeration PdfPageSize

Members
Member name
Custom

Value
0

Letter
Note
Legal
A0
A1
A2
A3
A4
A5
A6
A7
A8
A9
A10
B0
B1
B2
B3
B4
B5
ArchE
ArchD
ArchC
ArchB
ArchA
Flsa
HalfLetter
Letter11x17
Ledger

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29

Description
Use specified page
size
Letter format
Note format
Legal format
A0 format
A1 format
A2 format
A3 format
A4 format
A5 format
A6 format
A7 format
A8 format
A9 format
A0 format
B0 format
B1 format
B2 format
B3 format
B4 format
B5 format
ArchE format
ArchD format
ArchC format
ArchB format
ArchA format
Flsa format
HalfLetter format
11x17 format
Ledger format

936

SelectPdf Pdf Library for .NET

See Also
SelectPdf Namespace

937

SelectPdf Pdf Library for .NET

PdfPolygonElement Class
Represents a polygon drawn in a pdf document.

Inheritance Hierarchy
System.Object SelectPdf.PdfPageElement
lygonElement

SelectPdf.PdfElement

SelectPdf.PdfPo

Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public class PdfPolygonElement : PdfElement
VB
Public Class PdfPolygonElement
Inherits PdfElement
The PdfPolygonElement type exposes the following members.

Constructors
Name
PdfPolygonElement

Description
Constructs a polygon
element.

Name
Rotate

Description
Rotes the coordinate
system before rendering
the pdf element.
(Inherited from
PdfElement.)
Scales the coordinate
system before rendering
the pdf element.
(Inherited from
PdfElement.)
Skews the x and y axis by
an two different angles
before rendering the pdf
element. (Inherited from
PdfElement.)
Translates the coordinate
system before rendering
the pdf element.
(Inherited from
PdfElement.)

Methods

Scale

Skew

Translate

938

SelectPdf Pdf Library for .NET

Properties
Name
BackColor

Blending

ColorSpace

ForeColor

Gradient

LineStyle

Rotated

Scaled

Skewed

Translated

Transparency

Description
Gets or sets the pdf
element background
color. (Inherited from
PdfElement.)
Gets or sets the blending
mode for transparent
rendering of the pdf
element. (Inherited from
PdfElement.)
Gets or sets the color
space for the pdf element
rendering. (Inherited from
PdfElement.)
Gets or sets the pdf
element foreground color.
(Inherited from
PdfElement.)
Gets or sets the gradient
used to fill a shape.
(Inherited from
PdfElement.)
Gets or sets the line style
for pdf elements
rendering lines. (Inherited
from PdfElement.)
A flag to indicate if the
current pdf element was
rotated. (Inherited from
PdfElement.)
A flag to indicate if the
current pdf element was
scaled. (Inherited from
PdfElement.)
A flag to indicate if the
current pdf element was
skewed. (Inherited from
PdfElement.)
A flag to indicate if the
current pdf element was
translated. (Inherited
from PdfElement.)
Gets or sets the pdf
element transparency.

939

SelectPdf Pdf Library for .NET


(Inherited from
PdfElement.)

See Also
SelectPdf Namespace

940

SelectPdf Pdf Library for .NET

PdfPolygonElement Constructor
Constructs a polygon element.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public PdfPolygonElement(
PointF[] points
)
VB
Public Sub New (
points As PointF()
)
Parameters
points
Type: System.Drawing.PointF[]
The points to be connected to form the polygon.

See Also
PdfPolygonElement Class
SelectPdf Namespace

941

SelectPdf Pdf Library for .NET

PdfPolygonElement.PdfPolygonElement Methods
The PdfPolygonElement type exposes the following members.

Methods
Name
Rotate

Scale

Skew

Translate

Description
Rotes the coordinate
system before rendering
the pdf element.
(Inherited from
PdfElement.)
Scales the coordinate
system before rendering
the pdf element.
(Inherited from
PdfElement.)
Skews the x and y axis by
an two different angles
before rendering the pdf
element. (Inherited from
PdfElement.)
Translates the coordinate
system before rendering
the pdf element.
(Inherited from
PdfElement.)

See Also
PdfPolygonElement Class
SelectPdf Namespace

942

SelectPdf Pdf Library for .NET

PdfPolygonElement.PdfPolygonElement Properties
The PdfPolygonElement type exposes the following members.

Properties
Name
BackColor

Blending

ColorSpace

ForeColor

Gradient

LineStyle

Rotated

Scaled

Skewed

Translated

Description
Gets or sets the pdf
element background
color. (Inherited from
PdfElement.)
Gets or sets the blending
mode for transparent
rendering of the pdf
element. (Inherited from
PdfElement.)
Gets or sets the color
space for the pdf element
rendering. (Inherited from
PdfElement.)
Gets or sets the pdf
element foreground color.
(Inherited from
PdfElement.)
Gets or sets the gradient
used to fill a shape.
(Inherited from
PdfElement.)
Gets or sets the line style
for pdf elements
rendering lines. (Inherited
from PdfElement.)
A flag to indicate if the
current pdf element was
rotated. (Inherited from
PdfElement.)
A flag to indicate if the
current pdf element was
scaled. (Inherited from
PdfElement.)
A flag to indicate if the
current pdf element was
skewed. (Inherited from
PdfElement.)
A flag to indicate if the
current pdf element was
translated. (Inherited
from PdfElement.)
943

SelectPdf Pdf Library for .NET


Transparency

Gets or sets the pdf


element transparency.
(Inherited from
PdfElement.)

See Also
PdfPolygonElement Class
SelectPdf Namespace

944

SelectPdf Pdf Library for .NET

PdfRectangleElement Class
Represents a rectangle drawn in a pdf document.

Inheritance Hierarchy
System.Object SelectPdf.PdfPageElement
ectangleElement

SelectPdf.PdfElement

SelectPdf.PdfR

Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public class PdfRectangleElement : PdfElement
VB
Public Class PdfRectangleElement
Inherits PdfElement
The PdfRectangleElement type exposes the following members.

Constructors
Name
PdfRectangleElement(Rec
tangleF)
PdfRectangleElement(Sin
gle, Single, Single, Single)

Description
Constructs a pdf
rectangle element.
Constructs a pdf
rectangle element.

Name
Rotate

Description
Rotes the coordinate
system before rendering
the pdf element.
(Inherited from
PdfElement.)
Scales the coordinate
system before rendering
the pdf element.
(Inherited from
PdfElement.)
Skews the x and y axis by
an two different angles
before rendering the pdf
element. (Inherited from
PdfElement.)
Translates the coordinate
system before rendering
the pdf element.

Methods

Scale

Skew

Translate

945

SelectPdf Pdf Library for .NET


(Inherited from
PdfElement.)

Properties
Name
BackColor

Blending

ColorSpace

ForeColor

Gradient

LineStyle

Rotated

Scaled

Skewed

Translated

Description
Gets or sets the pdf
element background
color. (Inherited from
PdfElement.)
Gets or sets the blending
mode for transparent
rendering of the pdf
element. (Inherited from
PdfElement.)
Gets or sets the color
space for the pdf element
rendering. (Inherited from
PdfElement.)
Gets or sets the pdf
element foreground color.
(Inherited from
PdfElement.)
Gets or sets the gradient
used to fill a shape.
(Inherited from
PdfElement.)
Gets or sets the line style
for pdf elements
rendering lines. (Inherited
from PdfElement.)
A flag to indicate if the
current pdf element was
rotated. (Inherited from
PdfElement.)
A flag to indicate if the
current pdf element was
scaled. (Inherited from
PdfElement.)
A flag to indicate if the
current pdf element was
skewed. (Inherited from
PdfElement.)
A flag to indicate if the
current pdf element was
translated. (Inherited
from PdfElement.)

946

SelectPdf Pdf Library for .NET


Transparency

Gets or sets the pdf


element transparency.
(Inherited from
PdfElement.)

See Also
SelectPdf Namespace

947

SelectPdf Pdf Library for .NET

PdfRectangleElement Constructor
Overload List
Name
PdfRectangleElement(Rec
tangleF)
PdfRectangleElement(Sin
gle, Single, Single, Single)

Description
Constructs a pdf
rectangle element.
Constructs a pdf
rectangle element.

See Also
PdfRectangleElement Class
SelectPdf Namespace

948

SelectPdf Pdf Library for .NET

PdfRectangleElement Constructor (RectangleF)


Constructs a pdf rectangle element.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public PdfRectangleElement(
RectangleF rectangle
)
VB
Public Sub New (
rectangle As RectangleF
)
Parameters
rectangle
Type: System.Drawing.RectangleF
The rectangle specifications in system format.

See Also
PdfRectangleElement Class
PdfRectangleElement Overload
SelectPdf Namespace

949

SelectPdf Pdf Library for .NET

PdfRectangleElement Constructor (Single, Single, Single,


Single)
Constructs a pdf rectangle element.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public PdfRectangleElement(
float x,
float y,
float width,
float height
)
VB
Public Sub New (
x As Single,
y As Single,
width As Single,
height As Single
)
Parameters
x
Type: System.Single
The X coordinate of the top left corner of the rectangle.
y
Type: System.Single
The Y coordinate of the top left corner of the rectangle.
width
Type: System.Single
The rectangle width.
height
Type: System.Single
The rectangle height.

See Also
PdfRectangleElement Class
PdfRectangleElement Overload
SelectPdf Namespace

950

SelectPdf Pdf Library for .NET

PdfRectangleElement.PdfRectangleElement Methods
The PdfRectangleElement type exposes the following members.

Methods
Name
Rotate

Scale

Skew

Translate

Description
Rotes the coordinate
system before rendering
the pdf element.
(Inherited from
PdfElement.)
Scales the coordinate
system before rendering
the pdf element.
(Inherited from
PdfElement.)
Skews the x and y axis by
an two different angles
before rendering the pdf
element. (Inherited from
PdfElement.)
Translates the coordinate
system before rendering
the pdf element.
(Inherited from
PdfElement.)

See Also
PdfRectangleElement Class
SelectPdf Namespace

951

SelectPdf Pdf Library for .NET

PdfRectangleElement.PdfRectangleElement Properties
The PdfRectangleElement type exposes the following members.

Properties
Name
BackColor

Blending

ColorSpace

ForeColor

Gradient

LineStyle

Rotated

Scaled

Skewed

Translated

Description
Gets or sets the pdf
element background
color. (Inherited from
PdfElement.)
Gets or sets the blending
mode for transparent
rendering of the pdf
element. (Inherited from
PdfElement.)
Gets or sets the color
space for the pdf element
rendering. (Inherited from
PdfElement.)
Gets or sets the pdf
element foreground color.
(Inherited from
PdfElement.)
Gets or sets the gradient
used to fill a shape.
(Inherited from
PdfElement.)
Gets or sets the line style
for pdf elements
rendering lines. (Inherited
from PdfElement.)
A flag to indicate if the
current pdf element was
rotated. (Inherited from
PdfElement.)
A flag to indicate if the
current pdf element was
scaled. (Inherited from
PdfElement.)
A flag to indicate if the
current pdf element was
skewed. (Inherited from
PdfElement.)
A flag to indicate if the
current pdf element was
translated. (Inherited
from PdfElement.)
952

SelectPdf Pdf Library for .NET


Transparency

Gets or sets the pdf


element transparency.
(Inherited from
PdfElement.)

See Also
PdfRectangleElement Class
SelectPdf Namespace

953

SelectPdf Pdf Library for .NET

PdfRenderingResult Class
The result of adding a pdf element to a pdf page or template.

Inheritance Hierarchy
System.Object SelectPdf.PdfRenderingResult
esult

SelectPdf.PdfTextElementRenderingR

Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public class PdfRenderingResult
VB
Public Class PdfRenderingResult
The PdfRenderingResult type exposes the following members.

Properties
Name
PdfPageLastIndex

PdfPageLastRectangle

Description
The index of the pdf page
where the rendering of
the page element ended.
The bounds inside the pdf
page where the rendering
of the page element
ended.

See Also
SelectPdf Namespace

954

SelectPdf Pdf Library for .NET

PdfRenderingResult.PdfRenderingResult Properties
The PdfRenderingResult type exposes the following members.

Properties
Name
PdfPageLastIndex

PdfPageLastRectangle

Description
The index of the pdf page
where the rendering of
the page element ended.
The bounds inside the pdf
page where the rendering
of the page element
ended.

See Also
PdfRenderingResult Class
SelectPdf Namespace

955

SelectPdf Pdf Library for .NET

PdfRenderingResult.PdfPageLastIndex Property
The index of the pdf page where the rendering of the page element ended.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public int PdfPageLastIndex { get; set; }
VB
Public Property PdfPageLastIndex As Integer
Get
Set
Property Value
Type: Int32

Remarks
This information is useful when other pdf elements are added to the PdfDocument
object.

See Also
PdfRenderingResult Class
SelectPdf Namespace

956

SelectPdf Pdf Library for .NET

PdfRenderingResult.PdfPageLastRectangle Property
The bounds inside the pdf page where the rendering of the page element ended.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public RectangleF PdfPageLastRectangle { get; set; }
VB
Public Property PdfPageLastRectangle As RectangleF
Get
Set
Property Value
Type: RectangleF

Remarks
This information is useful when other pdf elements are added to the PdfDocument
object.
Note: The last page is specified by the PdfPageLastIndex property.

See Also
PdfRenderingResult Class
SelectPdf Namespace

957

SelectPdf Pdf Library for .NET

PdfSectionElement Class
The base class for pdf elements that can be added to header and footer of a pdf
document.

Inheritance Hierarchy
System.Object SelectPdf.PdfSectionElement
PdfImageSection SelectPdf.PdfTextSection

SelectPdf.PdfHtmlSection

SelectPdf.

Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public abstract class PdfSectionElement
VB
Public MustInherit Class PdfSectionElement
The PdfSectionElement type exposes the following members.

Constructors
Name
PdfSectionElement

Description

See Also
SelectPdf Namespace

958

SelectPdf Pdf Library for .NET

PdfSectionElement Constructor
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
protected PdfSectionElement()
VB
Protected Sub New

See Also
PdfSectionElement Class
SelectPdf Namespace

959

SelectPdf Pdf Library for .NET

PdfSecurityOptions Class
This class provides the options to control the pdf document security.

Inheritance Hierarchy
System.Object SelectPdf.PdfSecurityOptions
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public class PdfSecurityOptions
VB
Public Class PdfSecurityOptions
The PdfSecurityOptions type exposes the following members.

Constructors
Name
PdfSecurityOptions

Description

Name
CanAssembleDocument

Description
Allows inserting, rotating
or deleting pages or
bookmarks.
Allows copying page
contents such as text and
images.
Allows document
annotations editing.
Allows modifying
document content.
Allows filling in form
fields.
Allows printing.
Sets or gets the owner
password.
Gets or sets the user
password.

Properties

CanCopyContent

CanEditAnnotations
CanEditContent
CanFillFormFields
CanPrint
OwnerPassword
UserPassword

Remarks
The HtmlToPdfOptions class defines a reference to an object of this type.

See Also
SelectPdf Namespace

960

SelectPdf Pdf Library for .NET

961

SelectPdf Pdf Library for .NET

PdfSecurityOptions Constructor
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public PdfSecurityOptions()
VB
Public Sub New

See Also
PdfSecurityOptions Class
SelectPdf Namespace

962

SelectPdf Pdf Library for .NET

PdfSecurityOptions.PdfSecurityOptions Properties
The PdfSecurityOptions type exposes the following members.

Properties
Name
CanAssembleDocument

CanCopyContent

CanEditAnnotations
CanEditContent
CanFillFormFields
CanPrint
OwnerPassword
UserPassword

Description
Allows inserting, rotating
or deleting pages or
bookmarks.
Allows copying page
contents such as text and
images.
Allows document
annotations editing.
Allows modifying
document content.
Allows filling in form
fields.
Allows printing.
Sets or gets the owner
password.
Gets or sets the user
password.

See Also
PdfSecurityOptions Class
SelectPdf Namespace

963

SelectPdf Pdf Library for .NET

PdfSecurityOptions.CanAssembleDocument Property
Allows inserting, rotating or deleting pages or bookmarks.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public bool CanAssembleDocument { get; set; }
VB
Public Property CanAssembleDocument As Boolean
Get
Set
Property Value
Type: Boolean

See Also
PdfSecurityOptions Class
SelectPdf Namespace

964

SelectPdf Pdf Library for .NET

PdfSecurityOptions.CanCopyContent Property
Allows copying page contents such as text and images.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public bool CanCopyContent { get; set; }
VB
Public Property CanCopyContent As Boolean
Get
Set
Property Value
Type: Boolean

See Also
PdfSecurityOptions Class
SelectPdf Namespace

965

SelectPdf Pdf Library for .NET

PdfSecurityOptions.CanEditAnnotations Property
Allows document annotations editing.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public bool CanEditAnnotations { get; set; }
VB
Public Property CanEditAnnotations As Boolean
Get
Set
Property Value
Type: Boolean

See Also
PdfSecurityOptions Class
SelectPdf Namespace

966

SelectPdf Pdf Library for .NET

PdfSecurityOptions.CanEditContent Property
Allows modifying document content.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public bool CanEditContent { get; set; }
VB
Public Property CanEditContent As Boolean
Get
Set
Property Value
Type: Boolean

See Also
PdfSecurityOptions Class
SelectPdf Namespace

967

SelectPdf Pdf Library for .NET

PdfSecurityOptions.CanFillFormFields Property
Allows filling in form fields.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public bool CanFillFormFields { get; set; }
VB
Public Property CanFillFormFields As Boolean
Get
Set
Property Value
Type: Boolean

See Also
PdfSecurityOptions Class
SelectPdf Namespace

968

SelectPdf Pdf Library for .NET

PdfSecurityOptions.CanPrint Property
Allows printing.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public bool CanPrint { get; set; }
VB
Public Property CanPrint As Boolean
Get
Set
Property Value
Type: Boolean

See Also
PdfSecurityOptions Class
SelectPdf Namespace

969

SelectPdf Pdf Library for .NET

PdfSecurityOptions.OwnerPassword Property
Sets or gets the owner password.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public string OwnerPassword { get; set; }
VB
Public Property OwnerPassword As String
Get
Set
Property Value
Type: String

Remarks
This password is required to change permissions of the pdf document (like printing
or editing).

See Also
PdfSecurityOptions Class
SelectPdf Namespace

970

SelectPdf Pdf Library for .NET

PdfSecurityOptions.UserPassword Property
Gets or sets the user password.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public string UserPassword { get; set; }
VB
Public Property UserPassword As String
Get
Set
Property Value
Type: String

Remarks
This password is required to open the pdf document.

See Also
PdfSecurityOptions Class
SelectPdf Namespace

971

SelectPdf Pdf Library for .NET

PdfSoundLinkElement Class
Represents a link to an external sound file in a pdf document.

Inheritance Hierarchy
System.Object SelectPdf.PdfPageElement

SelectPdf.PdfSoundLinkElement

Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public class PdfSoundLinkElement : PdfPageElement
VB
Public Class PdfSoundLinkElement
Inherits PdfPageElement
The PdfSoundLinkElement type exposes the following members.

Constructors
Name
PdfSoundLinkElement

Description
Constructs an external
sound link pdf element.

Name
FileName

Description
Gets or sets the external
sound file path.
Gets or sets the link
rectangle in the pdf page.

Properties

LinkRectangle

See Also
SelectPdf Namespace

972

SelectPdf Pdf Library for .NET

PdfSoundLinkElement Constructor
Constructs an external sound link pdf element.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public PdfSoundLinkElement(
RectangleF linkRectangle,
string fileName
)
VB
Public Sub New (
linkRectangle As RectangleF,
fileName As String
)
Parameters
linkRectangle
Type: System.Drawing.RectangleF
The link rectangle in the pdf page.
fileName
Type: System.String
The external sound file.

See Also
PdfSoundLinkElement Class
SelectPdf Namespace

973

SelectPdf Pdf Library for .NET

PdfSoundLinkElement.PdfSoundLinkElement Properties
The PdfSoundLinkElement type exposes the following members.

Properties
Name
FileName
LinkRectangle

Description
Gets or sets the external
sound file path.
Gets or sets the link
rectangle in the pdf page.

See Also
PdfSoundLinkElement Class
SelectPdf Namespace

974

SelectPdf Pdf Library for .NET

PdfSoundLinkElement.FileName Property
Gets or sets the external sound file path.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public string FileName { get; set; }
VB
Public Property FileName As String
Get
Set
Property Value
Type: String

See Also
PdfSoundLinkElement Class
SelectPdf Namespace

975

SelectPdf Pdf Library for .NET

PdfSoundLinkElement.LinkRectangle Property
Gets or sets the link rectangle in the pdf page.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public RectangleF LinkRectangle { get; set; }
VB
Public Property LinkRectangle As RectangleF
Get
Set
Property Value
Type: RectangleF

See Also
PdfSoundLinkElement Class
SelectPdf Namespace

976

SelectPdf Pdf Library for .NET

PdfStandard Enumeration
The list of pdf standards available.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public enum PdfStandard
VB
Public Enumeration PdfStandard

Members
Member name
Full

Value
0

PdfA

PdfX

PdfSiqQLevelA

PdfSiqQLevelB

Description
The full pdf
features can be
used in the
generated pdf
document.
The generated pdf
is in conformance
with PDF/A
standard which
makes the
document suitable
for long term
archiving.
The generated PDF
is in conformance
with PDF/X
standard which
makes the
document suitable
for graphics
exchange.
The generated PDF
is in conformance
with PDF/SiqQ
Level A standard
which makes the
document suitable
for being digitally
signed.
The generated PDF
is in conformance
with PDF/SiqQ

977

SelectPdf Pdf Library for .NET


Level B standard
which makes the
document suitable
for being digitally
signed.

See Also
SelectPdf Namespace

978

SelectPdf Pdf Library for .NET

PdfStandardCJKFont Enumeration
The Korean-Japanesse-Chinese (CJK) predefined fonts.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public enum PdfStandardCJKFont
VB
Public Enumeration PdfStandardCJKFont

Members
Member name
HeiseiKakuGothi
cW5
HeiseiMinchoW3

Value
0

HanyangSystem
sGothicMedium

HanyangSystem
sShinMyeongJoM
edium

MonotypeHeiMe
dium

MonotypeSungLi
ght

SinoTypeSongLig
ht

Description
Heisei Kaku Gothic
W5 Japanese font.
Heisei Mincho W3
Japanese font.
Hanyang Systems
Gothic Medium
Korean font.
Hanyang Systems
Shin MyeongJo
Medium Korean
font.
Monotype Hei
Medium Chinese
traditional font.
Monotype Sung
Light Chinese
traditional font.
SinoType Song
Light Chinese
simplified font.

See Also
SelectPdf Namespace

979

SelectPdf Pdf Library for .NET

PdfStandardFont Enumeration
Standard PDF font families.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public enum PdfStandardFont
VB
Public Enumeration PdfStandardFont

Members
Member name
Custom
Helvetica
HelveticaBold
HelveticaOblique
HelveticaBoldOb
lique
Courier
CourierBold
CourierOblique
CourierBoldObliq
ue
TimesRoman
TimesBold
TimesBoldItalic
TimesItalic
Symbol
ZapfDingbats

Value
0
1
2
3
4
5
6
7
8
9
10
11
12
13
14

Description
Custom font.
Helvetica
Helvetica Bold
Helvetica Oblique
Helvetica Bold
Oblique
Courier
Courier Bold
Courier Oblique
Courier Bold
Oblique
Times Roman
Times Bold
Times Bold Italic
Times Italic
Symbol
ZapfDingbats

See Also
SelectPdf Namespace

980

SelectPdf Pdf Library for .NET

PdfTemplate Class
Represents a template in a pdf document. A template contains elements that are
repeated on each page of the pdf document.

Inheritance Hierarchy
System.Object SelectPdf.PdfCanvas

SelectPdf.PdfTemplate

Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public class PdfTemplate : PdfCanvas
VB
Public Class PdfTemplate
Inherits PdfCanvas
The PdfTemplate type exposes the following members.

Methods
Name
Add

MeasureString

Description
Adds a pdf element to the
template. (Overrides
PdfCanvas.Add(PdfPageEl
ement).)
Measures the size of the
specified string when
rendered with the
specified font. (Inherited
from PdfCanvas.)

Properties
Name
Anchoring

Background

Bounds
ClientRectangle

Description
Gets or sets the template
anchoring settings inside
the pdf page.
Controls whether the
template is rendered
behind the page main
content or not.
Gets or sets the template
bounds rectangle.
Gets the drawable area of
the canvas. The margins,
pdf document header and
footer are excluded.

981

SelectPdf Pdf Library for .NET

DisplayOnEvenPages

DisplayOnFirstPage

DisplayOnOddPages

Docking

FirstPageNumber
Foreground

Height
TotalPagesOffset
Width

(Inherited from
PdfCanvas.)
Controls the visibility of
the template on the even
numbered pages of the
pdf document.
Controls the visibility of
the template on the first
page of the generated pdf
document.
Controls the visibility of
the template on the odd
numbered pages of the
pdf document.
Gets or sets the template
docking style inside the
pdf page.
Controls whether the
template is rendered in
front of the page main
content or not.
Gets or sets the height for
a custom template.
Gets or sets the width for
a custom template.

See Also
SelectPdf Namespace

982

SelectPdf Pdf Library for .NET

PdfTemplate.PdfTemplate Methods
The PdfTemplate type exposes the following members.

Methods
Name
Add

MeasureString

Description
Adds a pdf element to the
template. (Overrides
PdfCanvas.Add(PdfPageEl
ement).)
Measures the size of the
specified string when
rendered with the
specified font. (Inherited
from PdfCanvas.)

See Also
PdfTemplate Class
SelectPdf Namespace

983

SelectPdf Pdf Library for .NET

PdfTemplate.Add Method
Adds a pdf element to the template.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public override PdfRenderingResult Add(
PdfPageElement element
)
VB
Public Overrides Function Add (
element As PdfPageElement
) As PdfRenderingResult
Parameters
element
Type: SelectPdf.PdfPageElement
The page element to be added.
Return Value
Type: PdfRenderingResultThe result of element rendering.

See Also
PdfTemplate Class
SelectPdf Namespace

984

SelectPdf Pdf Library for .NET

PdfTemplate.PdfTemplate Properties
The PdfTemplate type exposes the following members.

Properties
Name
Anchoring

Background

Bounds
ClientRectangle

DisplayOnEvenPages

DisplayOnFirstPage

DisplayOnOddPages

Docking

FirstPageNumber
Foreground

Height
TotalPagesOffset
Width

Description
Gets or sets the template
anchoring settings inside
the pdf page.
Controls whether the
template is rendered
behind the page main
content or not.
Gets or sets the template
bounds rectangle.
Gets the drawable area of
the canvas. The margins,
pdf document header and
footer are excluded.
(Inherited from
PdfCanvas.)
Controls the visibility of
the template on the even
numbered pages of the
pdf document.
Controls the visibility of
the template on the first
page of the generated pdf
document.
Controls the visibility of
the template on the odd
numbered pages of the
pdf document.
Gets or sets the template
docking style inside the
pdf page.
Controls whether the
template is rendered in
front of the page main
content or not.
Gets or sets the height for
a custom template.
Gets or sets the width for
a custom template.

985

SelectPdf Pdf Library for .NET

See Also
PdfTemplate Class
SelectPdf Namespace

986

SelectPdf Pdf Library for .NET

PdfTemplate.Anchoring Property
Gets or sets the template anchoring settings inside the pdf page.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public PdfTemplateAnchoring Anchoring { get; set; }
VB
Public Property Anchoring As PdfTemplateAnchoring
Get
Set
Property Value
Type: PdfTemplateAnchoring

See Also
PdfTemplate Class
SelectPdf Namespace

987

SelectPdf Pdf Library for .NET

PdfTemplate.Background Property
Controls whether the template is rendered behind the page main content or not.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public bool Background { get; set; }
VB
Public Property Background As Boolean
Get
Set
Property Value
Type: Boolean

Remarks
The default value is false. Elements from the template will not be displayed behind
the other elements from the page.

See Also
PdfTemplate Class
SelectPdf Namespace

988

SelectPdf Pdf Library for .NET

PdfTemplate.Bounds Property
Gets or sets the template bounds rectangle.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public RectangleF Bounds { get; set; }
VB
Public Property Bounds As RectangleF
Get
Set
Property Value
Type: RectangleF

Remarks
This property has no effect for a default document template.

See Also
PdfTemplate Class
SelectPdf Namespace

989

SelectPdf Pdf Library for .NET

PdfTemplate.DisplayOnEvenPages Property
Controls the visibility of the template on the even numbered pages of the pdf
document.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public bool DisplayOnEvenPages { get; set; }
VB
Public Property DisplayOnEvenPages As Boolean
Get
Set
Property Value
Type: Boolean

Remarks
By default the template is displayed on both odd and even numbered pages.

See Also
PdfTemplate Class
SelectPdf Namespace

990

SelectPdf Pdf Library for .NET

PdfTemplate.DisplayOnFirstPage Property
Controls the visibility of the template on the first page of the generated pdf
document.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public bool DisplayOnFirstPage { get; set; }
VB
Public Property DisplayOnFirstPage As Boolean
Get
Set
Property Value
Type: Boolean

Remarks
When this property is true the template will be displayed on the first page of the pdf
document, otherwise it will not be visible. This property has priority over
DisplayOnOddPages. The default value is true.

See Also
PdfTemplate Class
SelectPdf Namespace

991

SelectPdf Pdf Library for .NET

PdfTemplate.DisplayOnOddPages Property
Controls the visibility of the template on the odd numbered pages of the pdf
document.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public bool DisplayOnOddPages { get; set; }
VB
Public Property DisplayOnOddPages As Boolean
Get
Set
Property Value
Type: Boolean

Remarks
By default the template is displayed on both odd and even numbered pages. The
DisplayOnFirstPage property has priority over DisplayOnOddPages.

See Also
PdfTemplate Class
SelectPdf Namespace

992

SelectPdf Pdf Library for .NET

PdfTemplate.Docking Property
Gets or sets the template docking style inside the pdf page.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public PdfTemplateDocking Docking { get; set; }
VB
Public Property Docking As PdfTemplateDocking
Get
Set
Property Value
Type: PdfTemplateDocking

See Also
PdfTemplate Class
SelectPdf Namespace

993

SelectPdf Pdf Library for .NET

PdfTemplate.FirstPageNumber Property
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public int FirstPageNumber { get; set; }
VB
Public Property FirstPageNumber As Integer
Get
Set
Property Value
Type: Int32

Remarks
The page number is displayed setting a {page_number} placeholder in a Text
property of a PdfTextElement object that can be added to the template. By default
the page numbers start with 1. This can be changed using the FirstPageNumber
property.

See Also
PdfTemplate Class
SelectPdf Namespace

994

SelectPdf Pdf Library for .NET

PdfTemplate.Foreground Property
Controls whether the template is rendered in front of the page main content or not.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public bool Foreground { get; set; }
VB
Public Property Foreground As Boolean
Get
Set
Property Value
Type: Boolean

Remarks
The default value is true. Elements from the template will be displayed in front of
the other elements from the page.

See Also
PdfTemplate Class
SelectPdf Namespace

995

SelectPdf Pdf Library for .NET

PdfTemplate.Height Property
Gets or sets the height for a custom template.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public float Height { get; set; }
VB
Public Property Height As Single
Get
Set
Property Value
Type: Single

Remarks
This property has no effect for a default document template.

See Also
PdfTemplate Class
SelectPdf Namespace

996

SelectPdf Pdf Library for .NET

PdfTemplate.TotalPagesOffset Property
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public int TotalPagesOffset { get; set; }
VB
Public Property TotalPagesOffset As Integer
Get
Set
Property Value
Type: Int32

Remarks
The total number of pages is displayed setting a {total_pages} placeholder in the
Text property of a PdfTextElement object that can be added to the template. The
total number of pages can be incremented with a value specified by the
TotalPagesOffset property. This could be useful when the generated pdf will be
merged with other documents.

See Also
PdfTemplate Class
SelectPdf Namespace

997

SelectPdf Pdf Library for .NET

PdfTemplate.Width Property
Gets or sets the width for a custom template.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public float Width { get; set; }
VB
Public Property Width As Single
Get
Set
Property Value
Type: Single

Remarks
This property has no effect for a default document template.

See Also
PdfTemplate Class
SelectPdf Namespace

998

SelectPdf Pdf Library for .NET

PdfTemplateAnchoring Enumeration
The anchoring position of a pdf template.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public enum PdfTemplateAnchoring
VB
Public Enumeration PdfTemplateAnchoring

Members
Member name
NotAnchored

Value
0

Center

TopLeft

TopRight

BottomLeft

BottomRight

Description
The template is
not anchored.
The template will
be anchored in the
center of the pdf
page.
The template will
be anchored in the
top left corner of
the pdf page.
The template will
be anchored in the
top right corner of
the pdf page.
The template will
be anchored in the
bottom left corner
of the pdf page.
The template will
be anchored in the
bottom left corner
of the pdf page.

See Also
SelectPdf Namespace

999

SelectPdf Pdf Library for .NET

PdfTemplateCollection Class
Represents the collection of pages in a pdf document. A pdf template is repeated on
each page of the pdf document.

Inheritance Hierarchy
System.Object SelectPdf.PdfTemplateCollection
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public class PdfTemplateCollection
VB
Public Class PdfTemplateCollection
The PdfTemplateCollection type exposes the following members.

Methods
Name
Add(RectangleF)

Add(Single, Single)

GetEnumerator

Description
Adds a new template with
the specified bounds to
the pdf document
templates collection.
Adds a new template with
the specified width and
height to the pdf
document templates
collection.
Gets the collection
enumerator.

Properties
Name
Count

Footer

Header

Item

Description
The number of templates
in pdf templates
collection.
Represents the default
pdf document footer
template.
Represents the default
pdf document header
template.
Gets or sets the template
at the specified zero
based index in the

1000

SelectPdf Pdf Library for .NET


templates collection.

See Also
SelectPdf Namespace

1001

SelectPdf Pdf Library for .NET

PdfTemplateCollection.PdfTemplateCollection Methods
The PdfTemplateCollection type exposes the following members.

Methods
Name
Add(RectangleF)

Add(Single, Single)

GetEnumerator

Description
Adds a new template with
the specified bounds to
the pdf document
templates collection.
Adds a new template with
the specified width and
height to the pdf
document templates
collection.
Gets the collection
enumerator.

See Also
PdfTemplateCollection Class
SelectPdf Namespace

1002

SelectPdf Pdf Library for .NET

PdfTemplateCollection.Add Method
Overload List
Name
Add(RectangleF)

Add(Single, Single)

Description
Adds a new template with
the specified bounds to
the pdf document
templates collection.
Adds a new template with
the specified width and
height to the pdf
document templates
collection.

See Also
PdfTemplateCollection Class
SelectPdf Namespace

1003

SelectPdf Pdf Library for .NET

PdfTemplateCollection.Add Method (RectangleF)


Adds a new template with the specified bounds to the pdf document templates
collection.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public PdfTemplate Add(
RectangleF bounds
)
VB
Public Function Add (
bounds As RectangleF
) As PdfTemplate
Parameters
bounds
Type: System.Drawing.RectangleF
The template element bounds.
Return Value
Type: PdfTemplateThe newly added pdf template.

See Also
PdfTemplateCollection Class
Add Overload
SelectPdf Namespace

1004

SelectPdf Pdf Library for .NET

PdfTemplateCollection.Add Method (Single, Single)


Adds a new template with the specified width and height to the pdf document
templates collection.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public PdfTemplate Add(
float width,
float height
)
VB
Public Function Add (
width As Single,
height As Single
) As PdfTemplate
Parameters
width
Type: System.Single
The pdf template width.
height
Type: System.Single
The pdf template height.
Return Value
Type: PdfTemplateThe newly added pdf template.

Remarks
The template location is top left corner of the pdf page. Use Add(RectangleF) to
specify another location for the template.

See Also
PdfTemplateCollection Class
Add Overload
SelectPdf Namespace

1005

SelectPdf Pdf Library for .NET

PdfTemplateCollection.GetEnumerator Method
Gets the collection enumerator.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public IEnumerator GetEnumerator()
VB
Public Function GetEnumerator As IEnumerator
Return Value
Type: IEnumeratorThe collection enumerator.

See Also
PdfTemplateCollection Class
SelectPdf Namespace

1006

SelectPdf Pdf Library for .NET

PdfTemplateCollection.PdfTemplateCollection Properties
The PdfTemplateCollection type exposes the following members.

Properties
Name
Count

Footer

Header

Item

Description
The number of templates
in pdf templates
collection.
Represents the default
pdf document footer
template.
Represents the default
pdf document header
template.
Gets or sets the template
at the specified zero
based index in the
templates collection.

See Also
PdfTemplateCollection Class
SelectPdf Namespace

1007

SelectPdf Pdf Library for .NET

PdfTemplateCollection.Count Property
The number of templates in pdf templates collection.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public int Count { get; }
VB
Public ReadOnly Property Count As Integer
Get
Property Value
Type: Int32

See Also
PdfTemplateCollection Class
SelectPdf Namespace

1008

SelectPdf Pdf Library for .NET

PdfTemplateCollection.Footer Property
Represents the default pdf document footer template.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public PdfTemplate Footer { get; set; }
VB
Public Property Footer As PdfTemplate
Get
Set
Property Value
Type: PdfTemplate

Remarks
The footer space is automatically taken into account when calculating the available
space for rendering in a pdf page.

This template is automatically docked to the bottom of the pdf page.

See Also
PdfTemplateCollection Class
SelectPdf Namespace

1009

SelectPdf Pdf Library for .NET

PdfTemplateCollection.Header Property
Represents the default pdf document header template.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public PdfTemplate Header { get; set; }
VB
Public Property Header As PdfTemplate
Get
Set
Property Value
Type: PdfTemplate

Remarks
The header space is automatically taken into account when calculating the available
space for rendering in a pdf page.

This template is automatically docked to the top of the pdf page.

See Also
PdfTemplateCollection Class
SelectPdf Namespace

1010

SelectPdf Pdf Library for .NET

PdfTemplateCollection.Item Property
Gets or sets the template at the specified zero based index in the templates
collection.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public PdfTemplate this[
int index
] { get; }
VB
Public ReadOnly Default Property Item (
index As Integer
) As PdfTemplate
Get
Parameters
index
Type: System.Int32
The zero based template index in the pdf templates collection.
Return Value
Type: PdfTemplateThe pdf template at the specified index.

See Also
PdfTemplateCollection Class
SelectPdf Namespace

1011

SelectPdf Pdf Library for .NET

PdfTemplateDocking Enumeration
The docking style of a pdf template.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public enum PdfTemplateDocking
VB
Public Enumeration PdfTemplateDocking

Members
Member name
NotDocked

Value
0

Top

Bottom

Left

Right

Fill

Description
The template is
not docked in the
pdf page.
The template is
docked to the top
of the pdf page.
The template is
docked to the
bottom of the pdf
page.
The template is
docked to the left
of the pdf page.
The template is
docked to the right
of the pdf page.
The template fills
the pdf page.

See Also
SelectPdf Namespace

1012

SelectPdf Pdf Library for .NET

PdfTextElement Class
Represents a text that can be added to a pdf document.

Inheritance Hierarchy
System.Object SelectPdf.PdfPageElement
xtElement

SelectPdf.PdfElement

SelectPdf.PdfTe

Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public class PdfTextElement : PdfElement
VB
Public Class PdfTextElement
Inherits PdfElement
The PdfTextElement type exposes the following members.

Constructors
Name
PdfTextElement(Single,
Single, String, PdfFont)
PdfTextElement(Single,
Single, Single, String,
PdfFont)
PdfTextElement(Single,
Single, String, PdfFont,
PdfColor)
PdfTextElement(Single,
Single, Single, Single,
String, PdfFont)
PdfTextElement(Single,
Single, Single, String,
PdfFont, PdfColor)
PdfTextElement(Single,
Single, Single, Single,
String, PdfFont, PdfColor)

Description
Creates a text object that
can be added to a pdf
document.
Creates a text object that
can be added to a pdf
document.
Creates a text object that
can be added to a pdf
document.
Creates a text object that
can be added to a pdf
document.
Creates a text object that
can be added to a pdf
document.
Creates a text object that
can be added to a pdf
document.

Methods
Name
Rotate

Description
Rotes the coordinate
system before rendering
the pdf element.
(Inherited from

1013

SelectPdf Pdf Library for .NET

Scale

Skew

Translate

PdfElement.)
Scales the coordinate
system before rendering
the pdf element.
(Inherited from
PdfElement.)
Skews the x and y axis by
an two different angles
before rendering the pdf
element. (Inherited from
PdfElement.)
Translates the coordinate
system before rendering
the pdf element.
(Inherited from
PdfElement.)

Properties
Name
BackColor

Blending

CharacterSpacing

ClipRectangle

ColorSpace

Direction
Font
ForeColor

Gradient

Description
Gets or sets the pdf
element background
color. (Inherited from
PdfElement.)
Gets or sets the blending
mode for transparent
rendering of the pdf
element. (Inherited from
PdfElement.)
Gets or sets an additional
space between
characters.
A rectangle to be added
to the current clipping
path.
Gets or sets the color
space for the pdf element
rendering. (Inherited from
PdfElement.)
Gets or sets an angle to
control the text direction.
The text font.
Gets or sets the pdf
element foreground color.
(Inherited from
PdfElement.)
Gets or sets the gradient

1014

SelectPdf Pdf Library for .NET

Height

HorizontalAlign
Leading

LineStyle

RightToLeft
Rotated

Scaled

Skewed

Text

TextRise

Translated

Transparency

used to fill a shape.


(Inherited from
PdfElement.)
The height of the
destination rectangle
where the text will be
rendered.
Gets or sets the
horizontal text alignment.
Gets or sets a value that
indicates the vertical
distance between the
baselines of adjacent
lines of text.
Gets or sets the line style
for pdf elements
rendering lines. (Inherited
from PdfElement.)
Indicates if the text is in a
right-to-left language.
A flag to indicate if the
current pdf element was
rotated. (Inherited from
PdfElement.)
A flag to indicate if the
current pdf element was
scaled. (Inherited from
PdfElement.)
A flag to indicate if the
current pdf element was
skewed. (Inherited from
PdfElement.)
The text string that will
be added to the pdf
document.
Gets or sets the distance
to move the text baseline
up or down from its
default location.
A flag to indicate if the
current pdf element was
translated. (Inherited
from PdfElement.)
Gets or sets the pdf
element transparency.
(Inherited from
PdfElement.)
1015

SelectPdf Pdf Library for .NET


VerticalAlign
Width

WordSpacing
X
Y

Gets or sets the vertical


text alignment.
The width of destination
rectangle where the text
will be rendered.
Gets or sets an additional
space between words.
Gets or sets the text start
position on the X axis.
Gets or sets the text start
position on the Y axis.

See Also
SelectPdf Namespace

1016

SelectPdf Pdf Library for .NET

PdfTextElement Constructor
Overload List
Name
PdfTextElement(Single,
Single, String, PdfFont)
PdfTextElement(Single,
Single, Single, String,
PdfFont)
PdfTextElement(Single,
Single, String, PdfFont,
PdfColor)
PdfTextElement(Single,
Single, Single, Single,
String, PdfFont)
PdfTextElement(Single,
Single, Single, String,
PdfFont, PdfColor)
PdfTextElement(Single,
Single, Single, Single,
String, PdfFont, PdfColor)

Description
Creates a text object that
can be added to a pdf
document.
Creates a text object that
can be added to a pdf
document.
Creates a text object that
can be added to a pdf
document.
Creates a text object that
can be added to a pdf
document.
Creates a text object that
can be added to a pdf
document.
Creates a text object that
can be added to a pdf
document.

See Also
PdfTextElement Class
SelectPdf Namespace

1017

SelectPdf Pdf Library for .NET

PdfTextElement Constructor (Single, Single, String,


PdfFont)
Creates a text object that can be added to a pdf document.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public PdfTextElement(
float x,
float y,
string text,
PdfFont font
)
VB
Public Sub New (
x As Single,
y As Single,
text As String,
font As PdfFont
)
Parameters
x
Type: System.Single
The start X coordinate where the text will be rendered.
y
Type: System.Single
The start Y coordinate where the text will be rendered.
text
Type: System.String
The text to be rendered.
font
Type: SelectPdf.PdfFont
The text font. To support Unicode texts, the true type fonts must be embedded in
the pdf document when they are added.

Remarks
The text element that will be rendered at the specified (x,y) position using the
specified font. The height of the rendered text will be auto-determined. The width is
the available width in page.

See Also
PdfTextElement Class
1018

SelectPdf Pdf Library for .NET


PdfTextElement Overload
SelectPdf Namespace

1019

SelectPdf Pdf Library for .NET

PdfTextElement Constructor (Single, Single, Single, String,


PdfFont)
Creates a text object that can be added to a pdf document.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public PdfTextElement(
float x,
float y,
float width,
string text,
PdfFont font
)
VB
Public Sub New (
x As Single,
y As Single,
width As Single,
text As String,
font As PdfFont
)
Parameters
x
Type: System.Single
The start X coordinate where the text will be rendered.
y
Type: System.Single
The start Y coordinate where the text will be rendered.
width
Type: System.Single
The width of the destination rectangle.
text
Type: System.String
The text to be rendered.
font
Type: SelectPdf.PdfFont
The text font. To support Unicode texts, the true type fonts must be embedded in
the pdf document when they are added.

1020

SelectPdf Pdf Library for .NET

Remarks
The text element that will be rendered at the specified (x,y) position using the
specified font. The width of the text is specified as parameter. The height of the
rendered text will be auto-determined.

See Also
PdfTextElement Class
PdfTextElement Overload
SelectPdf Namespace

1021

SelectPdf Pdf Library for .NET

PdfTextElement Constructor (Single, Single, String,


PdfFont, PdfColor)
Creates a text object that can be added to a pdf document.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public PdfTextElement(
float x,
float y,
string text,
PdfFont font,
PdfColor color
)
VB
Public Sub New (
x As Single,
y As Single,
text As String,
font As PdfFont,
color As PdfColor
)
Parameters
x
Type: System.Single
The start X coordinate where the text will be rendered.
y
Type: System.Single
The start Y coordinate where the text will be rendered.
text
Type: System.String
The text to be rendered.
font
Type: SelectPdf.PdfFont
The text font. To support Unicode texts, the true type fonts must be embedded in
the pdf document when they are added.
color
Type: SelectPdf.PdfColor
The text color.

1022

SelectPdf Pdf Library for .NET

Remarks
The text element that will be rendered at the specified (x,y) position using the
specified font and color. The height of the rendered text will be auto-determined.
The width is the available width in page.

See Also
PdfTextElement Class
PdfTextElement Overload
SelectPdf Namespace

1023

SelectPdf Pdf Library for .NET

PdfTextElement Constructor (Single, Single, Single, Single,


String, PdfFont)
Creates a text object that can be added to a pdf document.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public PdfTextElement(
float x,
float y,
float width,
float height,
string text,
PdfFont font
)
VB
Public Sub New (
x As Single,
y As Single,
width As Single,
height As Single,
text As String,
font As PdfFont
)
Parameters
x
Type: System.Single
The start X coordinate where the text will be rendered.
y
Type: System.Single
The start Y coordinate where the text will be rendered.
width
Type: System.Single
The width of the destination rectangle.
height
Type: System.Single
The height of the destination rectangle.
text
Type: System.String
The text to be rendered.

1024

SelectPdf Pdf Library for .NET


font
Type: SelectPdf.PdfFont
The text font. To support Unicode texts, the true type fonts must be embedded in
the pdf document when they are added.

Remarks
The text element that will be rendered at the specified (x,y) position using the
specified font. The width and height of the text on the destination page are also
specified.

See Also
PdfTextElement Class
PdfTextElement Overload
SelectPdf Namespace

1025

SelectPdf Pdf Library for .NET

PdfTextElement Constructor (Single, Single, Single, String,


PdfFont, PdfColor)
Creates a text object that can be added to a pdf document.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public PdfTextElement(
float x,
float y,
float width,
string text,
PdfFont font,
PdfColor color
)
VB
Public Sub New (
x As Single,
y As Single,
width As Single,
text As String,
font As PdfFont,
color As PdfColor
)
Parameters
x
Type: System.Single
The start X coordinate where the text will be rendered.
y
Type: System.Single
The start Y coordinate where the text will be rendered.
width
Type: System.Single
The width of the destination rectangle.
text
Type: System.String
The text to be rendered.
font
Type: SelectPdf.PdfFont
The text font. To support Unicode texts, the true type fonts must be embedded in
the pdf document when they are added.
1026

SelectPdf Pdf Library for .NET


color
Type: SelectPdf.PdfColor
The text color.

Remarks
The text element that will be rendered at the specified (x,y) position using the
specified font and color. The width of the text is specified as parameter. The height
of the rendered text will be auto-determined.

See Also
PdfTextElement Class
PdfTextElement Overload
SelectPdf Namespace

1027

SelectPdf Pdf Library for .NET

PdfTextElement Constructor (Single, Single, Single, Single,


String, PdfFont, PdfColor)
Creates a text object that can be added to a pdf document.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public PdfTextElement(
float x,
float y,
float width,
float height,
string text,
PdfFont font,
PdfColor color
)
VB
Public Sub New (
x As Single,
y As Single,
width As Single,
height As Single,
text As String,
font As PdfFont,
color As PdfColor
)
Parameters
x
Type: System.Single
The start X coordinate where the text will be rendered.
y
Type: System.Single
The start Y coordinate where the text will be rendered.
width
Type: System.Single
The width of the destination rectangle.
height
Type: System.Single
The height of the destination rectangle.
text
Type: System.String
1028

SelectPdf Pdf Library for .NET


The text to be rendered.
font
Type: SelectPdf.PdfFont
The text font. To support Unicode texts, the true type fonts must be embedded in
the pdf document when they are added.
color
Type: SelectPdf.PdfColor
The text color.

Remarks
The text element that will be rendered at the specified (x,y) position using the
specified font. The width and height of the text on the destination page are also
specified.

See Also
PdfTextElement Class
PdfTextElement Overload
SelectPdf Namespace

1029

SelectPdf Pdf Library for .NET

PdfTextElement.PdfTextElement Methods
The PdfTextElement type exposes the following members.

Methods
Name
Rotate

Scale

Skew

Translate

Description
Rotes the coordinate
system before rendering
the pdf element.
(Inherited from
PdfElement.)
Scales the coordinate
system before rendering
the pdf element.
(Inherited from
PdfElement.)
Skews the x and y axis by
an two different angles
before rendering the pdf
element. (Inherited from
PdfElement.)
Translates the coordinate
system before rendering
the pdf element.
(Inherited from
PdfElement.)

See Also
PdfTextElement Class
SelectPdf Namespace

1030

SelectPdf Pdf Library for .NET

PdfTextElement.PdfTextElement Properties
The PdfTextElement type exposes the following members.

Properties
Name
BackColor

Blending

CharacterSpacing

ClipRectangle

ColorSpace

Direction
Font
ForeColor

Gradient

Height

HorizontalAlign
Leading

Description
Gets or sets the pdf
element background
color. (Inherited from
PdfElement.)
Gets or sets the blending
mode for transparent
rendering of the pdf
element. (Inherited from
PdfElement.)
Gets or sets an additional
space between
characters.
A rectangle to be added
to the current clipping
path.
Gets or sets the color
space for the pdf element
rendering. (Inherited from
PdfElement.)
Gets or sets an angle to
control the text direction.
The text font.
Gets or sets the pdf
element foreground color.
(Inherited from
PdfElement.)
Gets or sets the gradient
used to fill a shape.
(Inherited from
PdfElement.)
The height of the
destination rectangle
where the text will be
rendered.
Gets or sets the
horizontal text alignment.
Gets or sets a value that
indicates the vertical
distance between the
baselines of adjacent
lines of text.
1031

SelectPdf Pdf Library for .NET


LineStyle

RightToLeft
Rotated

Scaled

Skewed

Text

TextRise

Translated

Transparency

VerticalAlign
Width

WordSpacing
X
Y

Gets or sets the line style


for pdf elements
rendering lines. (Inherited
from PdfElement.)
Indicates if the text is in a
right-to-left language.
A flag to indicate if the
current pdf element was
rotated. (Inherited from
PdfElement.)
A flag to indicate if the
current pdf element was
scaled. (Inherited from
PdfElement.)
A flag to indicate if the
current pdf element was
skewed. (Inherited from
PdfElement.)
The text string that will
be added to the pdf
document.
Gets or sets the distance
to move the text baseline
up or down from its
default location.
A flag to indicate if the
current pdf element was
translated. (Inherited
from PdfElement.)
Gets or sets the pdf
element transparency.
(Inherited from
PdfElement.)
Gets or sets the vertical
text alignment.
The width of destination
rectangle where the text
will be rendered.
Gets or sets an additional
space between words.
Gets or sets the text start
position on the X axis.
Gets or sets the text start
position on the Y axis.

1032

SelectPdf Pdf Library for .NET

See Also
PdfTextElement Class
SelectPdf Namespace

1033

SelectPdf Pdf Library for .NET

PdfTextElement.CharacterSpacing Property
Gets or sets an additional space between characters.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public float CharacterSpacing { get; set; }
VB
Public Property CharacterSpacing As Single
Get
Set
Property Value
Type: Single

See Also
PdfTextElement Class
SelectPdf Namespace

1034

SelectPdf Pdf Library for .NET

PdfTextElement.ClipRectangle Property
A rectangle to be added to the current clipping path.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public RectangleF ClipRectangle { get; set; }
VB
Public Property ClipRectangle As RectangleF
Get
Set
Property Value
Type: RectangleF

See Also
PdfTextElement Class
SelectPdf Namespace

1035

SelectPdf Pdf Library for .NET

PdfTextElement.Direction Property
Gets or sets an angle to control the text direction.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public float Direction { get; set; }
VB
Public Property Direction As Single
Get
Set
Property Value
Type: Single

Remarks
The default value is 0. Adding a value in degrees will rotate the text counterclockwise.

See Also
PdfTextElement Class
SelectPdf Namespace

1036

SelectPdf Pdf Library for .NET

PdfTextElement.Font Property
The text font.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public PdfFont Font { get; set; }
VB
Public Property Font As PdfFont
Get
Set
Property Value
Type: PdfFont

See Also
PdfTextElement Class
SelectPdf Namespace

1037

SelectPdf Pdf Library for .NET

PdfTextElement.Height Property
The height of the destination rectangle where the text will be rendered.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public float Height { get; set; }
VB
Public Property Height As Single
Get
Set
Property Value
Type: Single

Remarks
This property is optional. If not specified, the text will use the height that it needs to
fully render, even though more than one pdf page will be used.

See Also
PdfTextElement Class
SelectPdf Namespace

1038

SelectPdf Pdf Library for .NET

PdfTextElement.HorizontalAlign Property
Gets or sets the horizontal text alignment.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public PdfTextHorizontalAlign HorizontalAlign { get; set; }
VB
Public Property HorizontalAlign As PdfTextHorizontalAlign
Get
Set
Property Value
Type: PdfTextHorizontalAlign

See Also
PdfTextElement Class
SelectPdf Namespace

1039

SelectPdf Pdf Library for .NET

PdfTextElement.Leading Property
Gets or sets a value that indicates the vertical distance between the baselines of
adjacent lines of text.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public float Leading { get; set; }
VB
Public Property Leading As Single
Get
Set
Property Value
Type: Single

See Also
PdfTextElement Class
SelectPdf Namespace

1040

SelectPdf Pdf Library for .NET

PdfTextElement.RightToLeft Property
Indicates if the text is in a right-to-left language.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public bool RightToLeft { get; set; }
VB
Public Property RightToLeft As Boolean
Get
Set
Property Value
Type: Boolean

See Also
PdfTextElement Class
SelectPdf Namespace

1041

SelectPdf Pdf Library for .NET

PdfTextElement.Text Property
The text string that will be added to the pdf document.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public string Text { get; set; }
VB
Public Property Text As String
Get
Set
Property Value
Type: String

Remarks
If the text element is rendered in a pdf template and {page_number} placeholder
appears in this property, it will be replaced with the current pdf page number. By
default the page numbering starts with 1. This can be changed using the
FirstPageNumber property.

If the text element is rendered in a pdf template and {total_pages} placeholder


appears in this property, it will be replaced with the total number of pages in the
generated pdf document. The total number of pages can be incremented with a
value specified by the TotalPagesOffset property. This could be useful when the
generated pdf will be merged with other documents.

See Also
PdfTextElement Class
SelectPdf Namespace

1042

SelectPdf Pdf Library for .NET

PdfTextElement.TextRise Property
Gets or sets the distance to move the text baseline up or down from its default
location.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public float TextRise { get; set; }
VB
Public Property TextRise As Single
Get
Set
Property Value
Type: Single

Remarks
Adjustments to the baseline are useful for drawing superscripts or subscripts.

Positive values of text rise move the baseline up and creates a superscript text.

Negative values of text rise move the baseline down and creates a subscript text.

See Also
PdfTextElement Class
SelectPdf Namespace

1043

SelectPdf Pdf Library for .NET

PdfTextElement.VerticalAlign Property
Gets or sets the vertical text alignment.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public PdfTextVerticalAlign VerticalAlign { get; set; }
VB
Public Property VerticalAlign As PdfTextVerticalAlign
Get
Set
Property Value
Type: PdfTextVerticalAlign

See Also
PdfTextElement Class
SelectPdf Namespace

1044

SelectPdf Pdf Library for .NET

PdfTextElement.Width Property
The width of destination rectangle where the text will be rendered.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public float Width { get; set; }
VB
Public Property Width As Single
Get
Set
Property Value
Type: Single

See Also
PdfTextElement Class
SelectPdf Namespace

1045

SelectPdf Pdf Library for .NET

PdfTextElement.WordSpacing Property
Gets or sets an additional space between words.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public float WordSpacing { get; set; }
VB
Public Property WordSpacing As Single
Get
Set
Property Value
Type: Single

Remarks
The words separator is consider the space character with code 32.

See Also
PdfTextElement Class
SelectPdf Namespace

1046

SelectPdf Pdf Library for .NET

PdfTextElement.X Property
Gets or sets the text start position on the X axis.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public float X { get; set; }
VB
Public Property X As Single
Get
Set
Property Value
Type: Single

See Also
PdfTextElement Class
SelectPdf Namespace

1047

SelectPdf Pdf Library for .NET

PdfTextElement.Y Property
Gets or sets the text start position on the Y axis.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public float Y { get; set; }
VB
Public Property Y As Single
Get
Set
Property Value
Type: Single

See Also
PdfTextElement Class
SelectPdf Namespace

1048

SelectPdf Pdf Library for .NET

PdfTextElementRenderingResult Class
The result of adding a pdf text element to a pdf page or template.

Inheritance Hierarchy
System.Object SelectPdf.PdfRenderingResult
esult

SelectPdf.PdfTextElementRenderingR

Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public class PdfTextElementRenderingResult : PdfRenderingResult
VB
Public Class PdfTextElementRenderingResult
Inherits PdfRenderingResult
The PdfTextElementRenderingResult type exposes the following members.

Properties
Name
PdfPageLastIndex

PdfPageLastRectangle

RemainingText

Description
The index of the pdf page
where the rendering of
the page element ended.
(Inherited from
PdfRenderingResult.)
The bounds inside the pdf
page where the rendering
of the page element
ended. (Inherited from
PdfRenderingResult.)
Gets the text that was not
rendered from the initial
text specified by the
PdfTextElement object.

See Also
SelectPdf Namespace

1049

SelectPdf Pdf Library for .NET

PdfTextElementRenderingResult.PdfTextElementRendering
Result Properties
The PdfTextElementRenderingResult type exposes the following members.

Properties
Name
PdfPageLastIndex

PdfPageLastRectangle

RemainingText

Description
The index of the pdf page
where the rendering of
the page element ended.
(Inherited from
PdfRenderingResult.)
The bounds inside the pdf
page where the rendering
of the page element
ended. (Inherited from
PdfRenderingResult.)
Gets the text that was not
rendered from the initial
text specified by the
PdfTextElement object.

See Also
PdfTextElementRenderingResult Class
SelectPdf Namespace

1050

SelectPdf Pdf Library for .NET

PdfTextElementRenderingResult.RemainingText Property
Gets the text that was not rendered from the initial text specified by the
PdfTextElement object.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public string RemainingText { get; }
VB
Public ReadOnly Property RemainingText As String
Get
Property Value
Type: String

Remarks
A text can be partially rendered if it cannot fit the specified bounds of the text
element (especially the Height).

See Also
PdfTextElementRenderingResult Class
SelectPdf Namespace

1051

SelectPdf Pdf Library for .NET

PdfTextHorizontalAlign Enumeration
Specifies horizontal alignment of text.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public enum PdfTextHorizontalAlign
VB
Public Enumeration PdfTextHorizontalAlign

Members
Member name
Default
Left
Center
Right
Justify

Value
0
1
2
3
4

Description
Default alignment.
Align left.
Center text.
Align right.
Justify text.

See Also
SelectPdf Namespace

1052

SelectPdf Pdf Library for .NET

PdfTextSection Class
Represents a text that can be added to the header or footer templates of a pdf
document.

Inheritance Hierarchy
System.Object SelectPdf.PdfSectionElement

SelectPdf.PdfTextSection

Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public class PdfTextSection : PdfSectionElement
VB
Public Class PdfTextSection
Inherits PdfSectionElement
The PdfTextSection type exposes the following members.

Constructors
Name
PdfTextSection(Single,
Single, String, Font)

PdfTextSection(Single,
Single, Single, String,
Font)

PdfTextSection(Single,
Single, Single, Single,
String, Font)

PdfTextSection(Single,
Single, Single, String,
Font, Color)

PdfTextSection(Single,
Single, Single, Single,
String, Font, Color)

Description
Creates a text object
can be added to the
header or footer
templates of a pdf
document.
Creates a text object
can be added to the
header or footer
templates of a pdf
document.
Creates a text object
can be added to the
header or footer
templates of a pdf
document.
Creates a text object
can be added to the
header or footer
templates of a pdf
document.
Creates a text object
can be added to the
header or footer
templates of a pdf
document.

that

that

that

that

that

1053

SelectPdf Pdf Library for .NET

Properties
Name
BackColor
CharacterSpacing

Direction
EmbedFont

Font
ForeColor
Height

HorizontalAlign
Leading

RightToLeft
Text

TextRise

Transparency
VerticalAlign
Width

WordSpacing
X

Description
Gets or sets the element
background color.
Gets or sets an additional
spacing between
characters.
Gets or sets an angle to
control the text direction.
A flag indicating if the
text font will be
embedded in the pdf
document.
The text font.
Gets or sets the element
foreground color.
The height of the
destination rectangle
where the text will be
rendered.
Gets or sets the
horizontal text alignment.
Gets or sets a value that
indicates the vertical
distance between the
baselines of adjacent
lines of text.
Indicates if the text is in a
right-to-left language.
The text string that will
be added to the pdf
document header or
footer.
Gets or sets the distance
to move the text baseline
up or down from its
default location.
Gets or sets the pdf
element transparency.
Gets or sets the vertical
text alignment.
The width of destination
rectangle where the text
will be rendered.
Gets or sets an additional
space between words.
Gets or sets the text start
1054

SelectPdf Pdf Library for .NET

position on the X axis.


Gets or sets the text start
position on the Y axis.

See Also
SelectPdf Namespace

1055

SelectPdf Pdf Library for .NET

PdfTextSection Constructor
Overload List
Name
PdfTextSection(Single,
Single, String, Font)

PdfTextSection(Single,
Single, Single, String,
Font)

PdfTextSection(Single,
Single, Single, Single,
String, Font)

PdfTextSection(Single,
Single, Single, String,
Font, Color)

PdfTextSection(Single,
Single, Single, Single,
String, Font, Color)

Description
Creates a text object
can be added to the
header or footer
templates of a pdf
document.
Creates a text object
can be added to the
header or footer
templates of a pdf
document.
Creates a text object
can be added to the
header or footer
templates of a pdf
document.
Creates a text object
can be added to the
header or footer
templates of a pdf
document.
Creates a text object
can be added to the
header or footer
templates of a pdf
document.

that

that

that

that

that

See Also
PdfTextSection Class
SelectPdf Namespace

1056

SelectPdf Pdf Library for .NET

PdfTextSection Constructor (Single, Single, String, Font)


Creates a text object that can be added to the header or footer templates of a pdf
document.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public PdfTextSection(
float x,
float y,
string text,
Font font
)
VB
Public Sub New (
x As Single,
y As Single,
text As String,
font As Font
)
Parameters
x
Type: System.Single
The start X coordinate where the text will be rendered.
y
Type: System.Single
The start Y coordinate where the text will be rendered.
text
Type: System.String
The text to be rendered.
font
Type: System.Drawing.Font
The text font.

Remarks
The text element that will be rendered at the specified (x,y) position in the pdf
header or footer using the specified font. The height of the rendered text will be
auto-determined. The width is the available width in page.

See Also
PdfTextSection Class
PdfTextSection Overload

1057

SelectPdf Pdf Library for .NET


SelectPdf Namespace

1058

SelectPdf Pdf Library for .NET

PdfTextSection Constructor (Single, Single, Single, String,


Font)
Creates a text object that can be added to the header or footer templates of a pdf
document.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public PdfTextSection(
float x,
float y,
float width,
string text,
Font font
)
VB
Public Sub New (
x As Single,
y As Single,
width As Single,
text As String,
font As Font
)
Parameters
x
Type: System.Single
The start X coordinate where the text will be rendered.
y
Type: System.Single
The start Y coordinate where the text will be rendered.
width
Type: System.Single
The width of the destination rectangle.
text
Type: System.String
The text to be rendered.
font
Type: System.Drawing.Font
The text font.

1059

SelectPdf Pdf Library for .NET

Remarks
The text element that will be rendered at the specified (x,y) position in the pdf
header or footer using the specified font. The width of the text is specified as
parameter. The height of the rendered text will be auto-determined.

See Also
PdfTextSection Class
PdfTextSection Overload
SelectPdf Namespace

1060

SelectPdf Pdf Library for .NET

PdfTextSection Constructor (Single, Single, Single, Single,


String, Font)
Creates a text object that can be added to the header or footer templates of a pdf
document.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public PdfTextSection(
float x,
float y,
float width,
float height,
string text,
Font font
)
VB
Public Sub New (
x As Single,
y As Single,
width As Single,
height As Single,
text As String,
font As Font
)
Parameters
x
Type: System.Single
The start X coordinate where the text will be rendered.
y
Type: System.Single
The start Y coordinate where the text will be rendered.
width
Type: System.Single
The width of the destination rectangle.
height
Type: System.Single
The height of the destination rectangle.
text
Type: System.String
The text to be rendered.
1061

SelectPdf Pdf Library for .NET


font
Type: System.Drawing.Font
The text font.

Remarks
The text element that will be rendered at the specified (x,y) position in the pdf
header or footer using the specified font. The width and height of the text on the
destination page are also specified.

See Also
PdfTextSection Class
PdfTextSection Overload
SelectPdf Namespace

1062

SelectPdf Pdf Library for .NET

PdfTextSection Constructor (Single, Single, Single, String,


Font, Color)
Creates a text object that can be added to the header or footer templates of a pdf
document.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public PdfTextSection(
float x,
float y,
float width,
string text,
Font font,
Color color
)
VB
Public Sub New (
x As Single,
y As Single,
width As Single,
text As String,
font As Font,
color As Color
)
Parameters
x
Type: System.Single
The start X coordinate where the text will be rendered.
y
Type: System.Single
The start Y coordinate where the text will be rendered.
width
Type: System.Single
The width of the destination rectangle.
text
Type: System.String
The text to be rendered.
font
Type: System.Drawing.Font
The text font.
1063

SelectPdf Pdf Library for .NET


color
Type: System.Drawing.Color
The text color.

Remarks
The text element that will be rendered at the specified (x,y) position in the pdf
header or footer using the specified font and color. The width of the text is specified
as parameter. The height of the rendered text will be auto-determined.

See Also
PdfTextSection Class
PdfTextSection Overload
SelectPdf Namespace

1064

SelectPdf Pdf Library for .NET

PdfTextSection Constructor (Single, Single, Single, Single,


String, Font, Color)
Creates a text object that can be added to the header or footer templates of a pdf
document.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public PdfTextSection(
float x,
float y,
float width,
float height,
string text,
Font font,
Color color
)
VB
Public Sub New (
x As Single,
y As Single,
width As Single,
height As Single,
text As String,
font As Font,
color As Color
)
Parameters
x
Type: System.Single
The start X coordinate where the text will be rendered.
y
Type: System.Single
The start Y coordinate where the text will be rendered.
width
Type: System.Single
The width of the destination rectangle.
height
Type: System.Single
The height of the destination rectangle.
text
1065

SelectPdf Pdf Library for .NET


Type: System.String
The text to be rendered.
font
Type: System.Drawing.Font
The text font.
color
Type: System.Drawing.Color
The text color.

Remarks
The text element that will be rendered at the specified (x,y) position in the pdf
header or footer using the specified font and color. The width and height of the text
on the destination page are also specified.

See Also
PdfTextSection Class
PdfTextSection Overload
SelectPdf Namespace

1066

SelectPdf Pdf Library for .NET

PdfTextSection.PdfTextSection Properties
The PdfTextSection type exposes the following members.

Properties
Name
BackColor
CharacterSpacing

Direction
EmbedFont

Font
ForeColor
Height

HorizontalAlign
Leading

RightToLeft
Text

TextRise

Transparency
VerticalAlign
Width

Description
Gets or sets the element
background color.
Gets or sets an additional
spacing between
characters.
Gets or sets an angle to
control the text direction.
A flag indicating if the
text font will be
embedded in the pdf
document.
The text font.
Gets or sets the element
foreground color.
The height of the
destination rectangle
where the text will be
rendered.
Gets or sets the
horizontal text alignment.
Gets or sets a value that
indicates the vertical
distance between the
baselines of adjacent
lines of text.
Indicates if the text is in a
right-to-left language.
The text string that will
be added to the pdf
document header or
footer.
Gets or sets the distance
to move the text baseline
up or down from its
default location.
Gets or sets the pdf
element transparency.
Gets or sets the vertical
text alignment.
The width of destination
rectangle where the text
1067

SelectPdf Pdf Library for .NET

WordSpacing
X
Y

will be rendered.
Gets or sets an additional
space between words.
Gets or sets the text start
position on the X axis.
Gets or sets the text start
position on the Y axis.

See Also
PdfTextSection Class
SelectPdf Namespace

1068

SelectPdf Pdf Library for .NET

PdfTextSection.BackColor Property
Gets or sets the element background color.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public Color BackColor { get; set; }
VB
Public Property BackColor As Color
Get
Set
Property Value
Type: Color

See Also
PdfTextSection Class
SelectPdf Namespace

1069

SelectPdf Pdf Library for .NET

PdfTextSection.CharacterSpacing Property
Gets or sets an additional spacing between characters.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public float CharacterSpacing { get; set; }
VB
Public Property CharacterSpacing As Single
Get
Set
Property Value
Type: Single

See Also
PdfTextSection Class
SelectPdf Namespace

1070

SelectPdf Pdf Library for .NET

PdfTextSection.Direction Property
Gets or sets an angle to control the text direction.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public float Direction { get; set; }
VB
Public Property Direction As Single
Get
Set
Property Value
Type: Single

Remarks
The default value is 0. Adding a value in degrees will rotate the text counterclockwise.

See Also
PdfTextSection Class
SelectPdf Namespace

1071

SelectPdf Pdf Library for .NET

PdfTextSection.EmbedFont Property
A flag indicating if the text font will be embedded in the pdf document.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public bool EmbedFont { get; set; }
VB
Public Property EmbedFont As Boolean
Get
Set
Property Value
Type: Boolean

See Also
PdfTextSection Class
SelectPdf Namespace

1072

SelectPdf Pdf Library for .NET

PdfTextSection.Font Property
The text font.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public Font Font { get; set; }
VB
Public Property Font As Font
Get
Set
Property Value
Type: Font

See Also
PdfTextSection Class
SelectPdf Namespace

1073

SelectPdf Pdf Library for .NET

PdfTextSection.ForeColor Property
Gets or sets the element foreground color.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public Color ForeColor { get; set; }
VB
Public Property ForeColor As Color
Get
Set
Property Value
Type: Color

See Also
PdfTextSection Class
SelectPdf Namespace

1074

SelectPdf Pdf Library for .NET

PdfTextSection.Height Property
The height of the destination rectangle where the text will be rendered.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public float Height { get; set; }
VB
Public Property Height As Single
Get
Set
Property Value
Type: Single

See Also
PdfTextSection Class
SelectPdf Namespace

1075

SelectPdf Pdf Library for .NET

PdfTextSection.HorizontalAlign Property
Gets or sets the horizontal text alignment.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public PdfTextHorizontalAlign HorizontalAlign { get; set; }
VB
Public Property HorizontalAlign As PdfTextHorizontalAlign
Get
Set
Property Value
Type: PdfTextHorizontalAlign

See Also
PdfTextSection Class
SelectPdf Namespace

1076

SelectPdf Pdf Library for .NET

PdfTextSection.Leading Property
Gets or sets a value that indicates the vertical distance between the baselines of
adjacent lines of text.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public float Leading { get; set; }
VB
Public Property Leading As Single
Get
Set
Property Value
Type: Single

See Also
PdfTextSection Class
SelectPdf Namespace

1077

SelectPdf Pdf Library for .NET

PdfTextSection.RightToLeft Property
Indicates if the text is in a right-to-left language.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public bool RightToLeft { get; set; }
VB
Public Property RightToLeft As Boolean
Get
Set
Property Value
Type: Boolean

See Also
PdfTextSection Class
SelectPdf Namespace

1078

SelectPdf Pdf Library for .NET

PdfTextSection.Text Property
The text string that will be added to the pdf document header or footer.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public string Text { get; set; }
VB
Public Property Text As String
Get
Set
Property Value
Type: String

Remarks
If {page_number} placeholder appears in this property, it will be replaced with the
current pdf page number. By default the page numbering starts with 1. This can be
changed using the FirstPageNumber property.

If {total_pages} placeholder appears in this property, it will be replaced with the


total number of pages in the generated pdf document. The total number of pages
can be incremented with a value specified by the TotalPagesOffset property. This
could be useful when the generated pdf will be merged with other documents.

See Also
PdfTextSection Class
SelectPdf Namespace

1079

SelectPdf Pdf Library for .NET

PdfTextSection.TextRise Property
Gets or sets the distance to move the text baseline up or down from its default
location.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public float TextRise { get; set; }
VB
Public Property TextRise As Single
Get
Set
Property Value
Type: Single

Remarks
Adjustments to the baseline are useful for drawing superscripts or subscripts.

Positive values of text rise move the baseline up and creates a superscript text.

Negative values of text rise move the baseline down and creates a subscript text.

See Also
PdfTextSection Class
SelectPdf Namespace

1080

SelectPdf Pdf Library for .NET

PdfTextSection.Transparency Property
Gets or sets the pdf element transparency.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public int Transparency { get; set; }
VB
Public Property Transparency As Integer
Get
Set
Property Value
Type: Int32

Remarks
The transparency is expressed as a value between 0 and 100.

The value 0 means completely transparent and 100 means completely opaque.

See Also
PdfTextSection Class
SelectPdf Namespace

1081

SelectPdf Pdf Library for .NET

PdfTextSection.VerticalAlign Property
Gets or sets the vertical text alignment.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public PdfTextVerticalAlign VerticalAlign { get; set; }
VB
Public Property VerticalAlign As PdfTextVerticalAlign
Get
Set
Property Value
Type: PdfTextVerticalAlign

See Also
PdfTextSection Class
SelectPdf Namespace

1082

SelectPdf Pdf Library for .NET

PdfTextSection.Width Property
The width of destination rectangle where the text will be rendered.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public float Width { get; set; }
VB
Public Property Width As Single
Get
Set
Property Value
Type: Single

See Also
PdfTextSection Class
SelectPdf Namespace

1083

SelectPdf Pdf Library for .NET

PdfTextSection.WordSpacing Property
Gets or sets an additional space between words.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public float WordSpacing { get; set; }
VB
Public Property WordSpacing As Single
Get
Set
Property Value
Type: Single

Remarks
The words separator is consider the space character with code 32.

See Also
PdfTextSection Class
SelectPdf Namespace

1084

SelectPdf Pdf Library for .NET

PdfTextSection.X Property
Gets or sets the text start position on the X axis.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public float X { get; set; }
VB
Public Property X As Single
Get
Set
Property Value
Type: Single

See Also
PdfTextSection Class
SelectPdf Namespace

1085

SelectPdf Pdf Library for .NET

PdfTextSection.Y Property
Gets or sets the text start position on the Y axis.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public float Y { get; set; }
VB
Public Property Y As Single
Get
Set
Property Value
Type: Single

See Also
PdfTextSection Class
SelectPdf Namespace

1086

SelectPdf Pdf Library for .NET

PdfTextVerticalAlign Enumeration
Specifies vertical alignment of text.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public enum PdfTextVerticalAlign
VB
Public Enumeration PdfTextVerticalAlign

Members
Member name
Top
Middle
Bottom

Value
0
1
2

Description
Align top.
Align center.
Align bottom.

See Also
SelectPdf Namespace

1087

SelectPdf Pdf Library for .NET

PdfViewerFullScreenExitMode Enumeration
Specifies how to display the pdf document on exiting full-screen mode.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public enum PdfViewerFullScreenExitMode
VB
Public Enumeration PdfViewerFullScreenExitMode

Members
Member name
UseNone

Value
0

UseOutlines

UseThumbs

UseOC

Description
Neither document
outline
(bookmarks) nor
thumbnail images
are visible.
Document outline
(bookmarks) are
visible.
Thumbnail images
are visible.
Optional content
group panel is
visible.

See Also
SelectPdf Namespace

1088

SelectPdf Pdf Library for .NET

PdfViewerPageLayout Enumeration
Specifies the page layout to be used when the pdf document is opened in a viewer.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public enum PdfViewerPageLayout
VB
Public Enumeration PdfViewerPageLayout

Members
Member name
SinglePage

Value
0

OneColumn

TwoColumnLeft

TwoColumnRight

Description
Displays one page
at a time.
Displays the pages
in one column.
Displays the pages
in two columns,
with oddnumbered pages
on the left.
Displays the pages
in two columns,
with oddnumbered pages
on the right.

See Also
SelectPdf Namespace

1089

SelectPdf Pdf Library for .NET

PdfViewerPageMode Enumeration
Specifies the pdf document's page mode.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public enum PdfViewerPageMode
VB
Public Enumeration PdfViewerPageMode

Members
Member name
UseNone

Value
0

UseOutlines

UseThumbs

FullScreen

UseOC

UseAttachments

Description
Neither document
outline
(bookmarks) nor
thumbnail images
are visible.
Document outline
(bookmarks) are
visible.
Thumbnail images
are visible.
Full-screen mode,
with no menu bar,
window controls or
any other window
visible.
Optional content
group panel is
visible.
Document
attachments are
visible.

See Also
SelectPdf Namespace

1090

SelectPdf Pdf Library for .NET

PdfViewerPreferences Class
The pdf viewer preferences. Controls how the pdf document appears in a pdf viewer
(like Adobe Reader).

Inheritance Hierarchy
System.Object SelectPdf.PdfViewerPreferences
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public class PdfViewerPreferences
VB
Public Class PdfViewerPreferences
The PdfViewerPreferences type exposes the following members.

Properties
Name
CenterWindow

DisplayDocTitle

FitWindow

HideMenuBar

HideToolbar

Description
Gets or sets a flag
specifying whether to
position the document's
window in the center of
the screen.
Gets or sets a flag
specifying whether the
window's title bar should
display the document
title.
Gets or sets a flag
specifying whether to
resize the document's
window to fit the size of
the first displayed page.
Gets or sets a flag
specifying whether to
hide the pdf viewer
application's menu bar
when the document is
active.
Gets or sets a flag
specifying whether to
hide the pdf viewer
application's tool bars
when the document is
active.
1091

SelectPdf Pdf Library for .NET


HideWindowUI

NonFullScreenPageMode

PageLayout

PageMode

Gets or sets a flag


specifying whether to
hide user interface
elements in the
document's window (such
as scroll bars and
navigation controls),
leaving only the
document's contents
displayed.
Gets or sets the
document page mode
when the pdf viewer
application exits the full
screen mode.
Gets or sets the page
layout to be used when
the document is opened.
Gets or sets the
document page mode
when the pdf document is
opened in a pdf viewer.

See Also
SelectPdf Namespace

1092

SelectPdf Pdf Library for .NET

PdfViewerPreferences.PdfViewerPreferences Properties
The PdfViewerPreferences type exposes the following members.

Properties
Name
CenterWindow

DisplayDocTitle

FitWindow

HideMenuBar

HideToolbar

HideWindowUI

NonFullScreenPageMode

Description
Gets or sets a flag
specifying whether to
position the document's
window in the center of
the screen.
Gets or sets a flag
specifying whether the
window's title bar should
display the document
title.
Gets or sets a flag
specifying whether to
resize the document's
window to fit the size of
the first displayed page.
Gets or sets a flag
specifying whether to
hide the pdf viewer
application's menu bar
when the document is
active.
Gets or sets a flag
specifying whether to
hide the pdf viewer
application's tool bars
when the document is
active.
Gets or sets a flag
specifying whether to
hide user interface
elements in the
document's window (such
as scroll bars and
navigation controls),
leaving only the
document's contents
displayed.
Gets or sets the
document page mode
when the pdf viewer

1093

SelectPdf Pdf Library for .NET

PageLayout

PageMode

application exits the full


screen mode.
Gets or sets the page
layout to be used when
the document is opened.
Gets or sets the
document page mode
when the pdf document is
opened in a pdf viewer.

See Also
PdfViewerPreferences Class
SelectPdf Namespace

1094

SelectPdf Pdf Library for .NET

PdfViewerPreferences.CenterWindow Property
Gets or sets a flag specifying whether to position the document's window in the
center of the screen.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public bool CenterWindow { get; set; }
VB
Public Property CenterWindow As Boolean
Get
Set
Property Value
Type: Boolean

Remarks
The default value for this property is false.

See Also
PdfViewerPreferences Class
SelectPdf Namespace

1095

SelectPdf Pdf Library for .NET

PdfViewerPreferences.DisplayDocTitle Property
Gets or sets a flag specifying whether the window's title bar should display the
document title.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public bool DisplayDocTitle { get; set; }
VB
Public Property DisplayDocTitle As Boolean
Get
Set
Property Value
Type: Boolean

Remarks
The default value for this property is false.

See Also
PdfViewerPreferences Class
SelectPdf Namespace

1096

SelectPdf Pdf Library for .NET

PdfViewerPreferences.FitWindow Property
Gets or sets a flag specifying whether to resize the document's window to fit the
size of the first displayed page.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public bool FitWindow { get; set; }
VB
Public Property FitWindow As Boolean
Get
Set
Property Value
Type: Boolean

Remarks
The default value for this property is false.

See Also
PdfViewerPreferences Class
SelectPdf Namespace

1097

SelectPdf Pdf Library for .NET

PdfViewerPreferences.HideMenuBar Property
Gets or sets a flag specifying whether to hide the pdf viewer application's menu bar
when the document is active.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public bool HideMenuBar { get; set; }
VB
Public Property HideMenuBar As Boolean
Get
Set
Property Value
Type: Boolean

Remarks
The default value for this property is false.

See Also
PdfViewerPreferences Class
SelectPdf Namespace

1098

SelectPdf Pdf Library for .NET

PdfViewerPreferences.HideToolbar Property
Gets or sets a flag specifying whether to hide the pdf viewer application's tool bars
when the document is active.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public bool HideToolbar { get; set; }
VB
Public Property HideToolbar As Boolean
Get
Set
Property Value
Type: Boolean

Remarks
The default value for this property is false.

See Also
PdfViewerPreferences Class
SelectPdf Namespace

1099

SelectPdf Pdf Library for .NET

PdfViewerPreferences.HideWindowUI Property
Gets or sets a flag specifying whether to hide user interface elements in the
document's window (such as scroll bars and navigation controls), leaving only the
document's contents displayed.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public bool HideWindowUI { get; set; }
VB
Public Property HideWindowUI As Boolean
Get
Set
Property Value
Type: Boolean

Remarks
The default value for this property is false.

See Also
PdfViewerPreferences Class
SelectPdf Namespace

1100

SelectPdf Pdf Library for .NET

PdfViewerPreferences.NonFullScreenPageMode Property
Gets or sets the document page mode when the pdf viewer application exits the full
screen mode.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public PdfViewerFullScreenExitMode NonFullScreenPageMode { get;
set; }
VB
Public Property NonFullScreenPageMode As PdfViewerFullScreenExitMode
Get
Set
Property Value
Type: PdfViewerFullScreenExitMode

Remarks
This property is taken into account only if PageMode is set to FullScreen. Otherwise
it is ignored.
The default value for this property is UseNone.

See Also
PdfViewerPreferences Class
SelectPdf Namespace

1101

SelectPdf Pdf Library for .NET

PdfViewerPreferences.PageLayout Property
Gets or sets the page layout to be used when the document is opened.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public PdfViewerPageLayout PageLayout { get; set; }
VB
Public Property PageLayout As PdfViewerPageLayout
Get
Set
Property Value
Type: PdfViewerPageLayout

Remarks
The default value for this property is OneColumn.

See Also
PdfViewerPreferences Class
SelectPdf Namespace

1102

SelectPdf Pdf Library for .NET

PdfViewerPreferences.PageMode Property
Gets or sets the document page mode when the pdf document is opened in a pdf
viewer.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public PdfViewerPageMode PageMode { get; set; }
VB
Public Property PageMode As PdfViewerPageMode
Get
Set
Property Value
Type: PdfViewerPageMode

Remarks
The default value for this property is UseNone.

See Also
PdfViewerPreferences Class
SelectPdf Namespace

1103

SelectPdf Pdf Library for .NET

PdfViewerTextOrder Enumeration
Used in pdf document viewer preferences to specify the reading order for texts.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public enum PdfViewerTextOrder
VB
Public Enumeration PdfViewerTextOrder

Members
Member name
L2R
R2L

Value
0
1

Description
Left to right.
Right to left.

See Also
SelectPdf Namespace

1104

SelectPdf Pdf Library for .NET

WebPageInformation Class
This class provides information about the converted web page (title, description,
keywords).

Inheritance Hierarchy
System.Object SelectPdf.WebPageInformation
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public class WebPageInformation
VB
Public Class WebPageInformation
The WebPageInformation type exposes the following members.

Constructors
Name
WebPageInformation

Description

Name
Description

Description
The web page
description.
The web page keywords.
The web page title.

Properties

Keywords
Title

See Also
SelectPdf Namespace

1105

SelectPdf Pdf Library for .NET

WebPageInformation Constructor
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public WebPageInformation()
VB
Public Sub New

See Also
WebPageInformation Class
SelectPdf Namespace

1106

SelectPdf Pdf Library for .NET

WebPageInformation.WebPageInformation Properties
The WebPageInformation type exposes the following members.

Properties
Name
Description
Keywords
Title

Description
The web page
description.
The web page keywords.
The web page title.

See Also
WebPageInformation Class
SelectPdf Namespace

1107

SelectPdf Pdf Library for .NET

WebPageInformation.Description Property
The web page description.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public string Description { get; set; }
VB
Public Property Description As String
Get
Set
Property Value
Type: String

See Also
WebPageInformation Class
SelectPdf Namespace

1108

SelectPdf Pdf Library for .NET

WebPageInformation.Keywords Property
The web page keywords.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public string Keywords { get; set; }
VB
Public Property Keywords As String
Get
Set
Property Value
Type: String

See Also
WebPageInformation Class
SelectPdf Namespace

1109

SelectPdf Pdf Library for .NET

WebPageInformation.Title Property
The web page title.
Namespace: SelectPdfAssembly: Select.Pdf (in Select.Pdf.dll) Version: 15.1

Syntax
C#
public string Title { get; set; }
VB
Public Property Title As String
Get
Set
Property Value
Type: String

See Also
WebPageInformation Class
SelectPdf Namespace

1110