Show / Hide Table of Contents

Class PrinceBase

Base class for Prince and PrinceControl.

Inheritance
System.Object
PrinceBase
Prince
PrinceControl
Namespace: PrinceXML.Wrapper
Assembly: PrinceXML.Wrapper.dll
Syntax
public abstract class PrinceBase : object

Constructors

| Improve this Doc View Source

PrinceBase(String, PrinceEvents)

The PrinceBase constructor.

Declaration
protected PrinceBase(string princePath, PrinceEvents events = null)
Parameters
Type Name Description
System.String princePath
PrinceEvents events

Properties

| Improve this Doc View Source

AllowAssembly

Used together with DisallowModify, which creates an exception. It allows the document to be inserted into another document or other pages to be added, but the content of the document cannot be modified.

Declaration
public bool AllowAssembly { get; set; }
Property Value
Type Description
System.Boolean

true if assembly is allowed. Default value is false.

| Improve this Doc View Source

AllowCopyForAccessibility

Used together with DisallowCopy, which creates an exception by enabling text access for screen reader devices for the visually impaired.

Declaration
public bool AllowCopyForAccessibility { get; set; }
Property Value
Type Description
System.Boolean

true if text access is allowed. Default value is false.

| Improve this Doc View Source

AuthMethods

HTTP authentication methods to enable.

Declaration
public List<AuthMethod> AuthMethods { get; }
Property Value
Type Description
List<AuthMethod>

The authentication method to enable.

| Improve this Doc View Source

AuthPassword

Specify the password for HTTP authentication.

Declaration
public string AuthPassword { get; set; }
Property Value
Type Description
System.String

The password for authentication.

| Improve this Doc View Source

AuthScheme

Send username and password credentials only for requests with the given scheme.

Declaration
public AuthScheme AuthScheme { get; set; }
Property Value
Type Description
AuthScheme

The authentication scheme.

| Improve this Doc View Source

AuthServer

Send username and password credentials to the specified server only.

Declaration
public string AuthServer { get; set; }
Property Value
Type Description
System.String

The server to send credentials to (e.g. "localhost:8001"). The default is to send them to any server which challenges for authentication.

| Improve this Doc View Source

AuthUser

Specify the username for HTTP authentication.

Declaration
public string AuthUser { get; set; }
Property Value
Type Description
System.String

The username for authentication.

| Improve this Doc View Source

BaseUrl

Specify the base URL of the input document. This can be used to override the path of the input document, which is convenient when processing local copies of a document from a website.

Declaration
public string BaseUrl { get; set; }
Property Value
Type Description
System.String

The base URL or path of the input document.

| Improve this Doc View Source

ConvertColors

Convert colors to output intent color space.

Declaration
public bool ConvertColors { get; set; }
Property Value
Type Description
System.Boolean

true if colors are converted to output intent color space. Default value is false.

| Improve this Doc View Source

CookieJar

Specify a file containing HTTP cookies.

Declaration
public string CookieJar { get; set; }
Property Value
Type Description
System.String

The filename of the file containing HTTP cookies.

| Improve this Doc View Source

Cookies

Add a value for the Set-Cookie HTTP header value.

Declaration
public List<string> Cookies { get; }
Property Value
Type Description
List<System.String>

The cookie to be added.

| Improve this Doc View Source

Debug

Enable logging of debug messages.

Declaration
public bool Debug { get; set; }
Property Value
Type Description
System.Boolean

true if debug logging is enabled. Default value is false.

| Improve this Doc View Source

DisallowAnnotate

Disallow annotation of the PDF file.

Declaration
public bool DisallowAnnotate { get; set; }
Property Value
Type Description
System.Boolean

true if annotation is disallowed. Default value is false.

| Improve this Doc View Source

DisallowCopy

Disallow modification of the PDF file.

Declaration
public bool DisallowCopy { get; set; }
Property Value
Type Description
System.Boolean

true if modification is disallowed. Default value is false.

| Improve this Doc View Source

DisallowModify

Disallow modification of the PDF file.

Declaration
public bool DisallowModify { get; set; }
Property Value
Type Description
System.Boolean

true if modification is disallowed. Default value is false.

| Improve this Doc View Source

DisallowPrint

Disallow printing of the PDF file.

Declaration
public bool DisallowPrint { get; set; }
Property Value
Type Description
System.Boolean

true if printing is disallowed. Default value is false.

| Improve this Doc View Source

Encrypt

Specify whether encryption should be applied to the output file.

Declaration
public bool Encrypt { get; set; }
Property Value
Type Description
System.Boolean

true if PDF encryption is enabled. Default value is false.

| Improve this Doc View Source

FailDroppedContent

Fail-safe option that aborts the creation of a PDF if any content is dropped.

Declaration
public bool FailDroppedContent { get; set; }
Property Value
Type Description
System.Boolean

true if fail-safe option is enabled. Default value is false.

| Improve this Doc View Source

FailInvalidLicense

Fail-safe option that aborts the creation of a PDF if the Prince license is invalid or not readable.

Declaration
public bool FailInvalidLicense { get; set; }
Property Value
Type Description
System.Boolean

true if fail-safe option is enabled. Default value is false.

| Improve this Doc View Source

FailMissingGlyphs

Fail-safe option that aborts the creation of a PDF if glyphs cannot be found for any characters.

Declaration
public bool FailMissingGlyphs { get; set; }
Property Value
Type Description
System.Boolean

true if fail-safe option is enabled. Default value is false.

| Improve this Doc View Source

FailMissingResources

Fail-safe option that aborts the creation of a PDF if any resources cannot be loaded.

Declaration
public bool FailMissingResources { get; set; }
Property Value
Type Description
System.Boolean

true if fail-safe option is enabled. Default value is false.

| Improve this Doc View Source

FailPdfProfileError

Fail-safe option that aborts the creation of a PDF if there are problems complying with the specified PDF profile.

Declaration
public bool FailPdfProfileError { get; set; }
Property Value
Type Description
System.Boolean

true if fail-safe option is enabled. Default value is false.

| Improve this Doc View Source

FailPdfTagError

Fail-safe option that aborts the creation of a PDF if there are problems tagging the PDF for accessibility.

Declaration
public bool FailPdfTagError { get; set; }
Property Value
Type Description
System.Boolean

true if fail-safe option is enabled. Default value is false.

| Improve this Doc View Source

FailStrippedTransparency

Fail-safe option that aborts the creation of a PDF if transparent images are used with a PDF profile that does not support opacity.

Declaration
public bool FailStrippedTransparency { get; set; }
Property Value
Type Description
System.Boolean

true if fail-safe option is enabled. Default value is false.

| Improve this Doc View Source

FallbackCmykProfile

Set fallback ICC profile for uncalibrated CMYK.

Declaration
public string FallbackCmykProfile { get; set; }
Property Value
Type Description
System.String

The fallback ICC profile.

| Improve this Doc View Source

FileAttachments

File attachments that will be attached to the PDF file.

Declaration
public List<FileAttachment> FileAttachments { get; }
Property Value
Type Description
List<FileAttachment>

The file attachment.

| Improve this Doc View Source

ForceIdentityEncoding

Ensure that all fonts are encoded in the PDF using their identity encoding (directly mapping to glyph indices), even if they could have used MacRoman or some other encoding.

Declaration
public bool ForceIdentityEncoding { get; set; }
Property Value
Type Description
System.Boolean

true if identity encoding is forced. Default value is false.

| Improve this Doc View Source

HttpProxy

Specify the URL for the HTTP proxy server, if needed.

Declaration
public string HttpProxy { get; set; }
Property Value
Type Description
System.String

The URL for the HTTP proxy server.

| Improve this Doc View Source

HttpTimeout

Specify the timeout for HTTP requests.

Declaration
public int HttpTimeout { get; set; }
Property Value
Type Description
System.Int32

The HTTP timeout in seconds. Value must be greater than 0. Default value is false.

| Improve this Doc View Source

Iframes

Enable HTML iframes.

Declaration
public bool Iframes { get; set; }
Property Value
Type Description
System.Boolean

true if HTML iframes is enabled. Default value is false.

| Improve this Doc View Source

InputType

Specify the input type of the document. Setting this to InputType.Xml or InputType.Html is required if a document is provided via a Stream or string, as the types of these documents cannot be determined.

Declaration
public InputType InputType { get; set; }
Property Value
Type Description
InputType

The document's input type. Default value is InputType.Auto.

| Improve this Doc View Source

Insecure

Specify whether to disable SSL verification.

Declaration
public bool Insecure { get; set; }
Property Value
Type Description
System.Boolean

true if SSL verification is disabled. Default value is false.

| Improve this Doc View Source

JavaScript

Specify whether JavaScript found in documents should be run.

Declaration
public bool JavaScript { get; set; }
Property Value
Type Description
System.Boolean

true if document scripts should run. Default value is false.

| Improve this Doc View Source

KeyBits

Specify the size of the encryption key.

Declaration
public KeyBits? KeyBits { get; set; }
Property Value
Type Description
System.Nullable<KeyBits>

The size of the encryption key. Default value is KeyBits.Bits128.

| Improve this Doc View Source

LicenseFile

Specify the license file.

Declaration
public string LicenseFile { get; set; }
Property Value
Type Description
System.String

The filename of the license file.

| Improve this Doc View Source

LicenseKey

Specify the license key. This is the <signature> field in the license file.

Declaration
public string LicenseKey { get; set; }
Property Value
Type Description
System.String

The license key.

| Improve this Doc View Source

Log

Specify a file that Prince should use to log messages. If this property is not set, then Prince will not write to any log. This property does not affect the operation of PrinceEvents, which will also receive messages from Prince.

Declaration
public string Log { get; set; }
Property Value
Type Description
System.String

The filename that Prince uses to log messages.

| Improve this Doc View Source

MaxPasses

Defines the maximum number of consequent layout passes.

Declaration
public int MaxPasses { get; set; }
Property Value
Type Description
System.Int32

The number of maximum passes. Value must be greater than 0. Default value is unlimited passes.

| Improve this Doc View Source

Media

Specify the media type.

Declaration
public string Media { get; set; }
Property Value
Type Description
System.String

The media type (e.g. "print", "screen"). Default value is "print".

| Improve this Doc View Source

NoArtificialFonts

Specify whether artificial bold/italic fonts should be generated if necessary.

Declaration
public bool NoArtificialFonts { get; set; }
Property Value
Type Description
System.Boolean

true if artificial bold/italic fonts are disabled. Default value is false.

| Improve this Doc View Source

NoAuthorStyle

Ignore author style sheets.

Declaration
public bool NoAuthorStyle { get; set; }
Property Value
Type Description
System.Boolean

true if author style sheets are ignored. Default value is false.

| Improve this Doc View Source

NoAuthPreemptive

Do not authenticate with named servers until asked.

Declaration
public bool NoAuthPreemptive { get; set; }
Property Value
Type Description
System.Boolean

true if authentication preemptive is disabled. Default value is false.

| Improve this Doc View Source

NoCompress

Specify whether compression should be applied to the output PDF file.

Declaration
public bool NoCompress { get; set; }
Property Value
Type Description
System.Boolean

true if PDF compression is disabled. Default value is false.

| Improve this Doc View Source

NoDefaultStyle

Ignore default style sheets.

Declaration
public bool NoDefaultStyle { get; set; }
Property Value
Type Description
System.Boolean

true if default style sheets are ignored. Default value is false.

| Improve this Doc View Source

NoEmbedFonts

Specify whether fonts should be embedded in the output PDF file.

Declaration
public bool NoEmbedFonts { get; set; }
Property Value
Type Description
System.Boolean

true if PDF font embedding is disabled. Default value is false.

| Improve this Doc View Source

NoNetwork

Disable network access (prevents HTTP downloads).

Declaration
public bool NoNetwork { get; set; }
Property Value
Type Description
System.Boolean

true if network access is disabled. Default value is false.

| Improve this Doc View Source

NoObjectStreams

Disable PDF object streams.

Declaration
public bool NoObjectStreams { get; set; }
Property Value
Type Description
System.Boolean

true if PDF object streams are disabled. Default value is false.

| Improve this Doc View Source

NoParallelDownloads

Disable downloading multiple HTTP resources at once.

Declaration
public bool NoParallelDownloads { get; set; }
Property Value
Type Description
System.Boolean

true if parallel downloads are disabled. Default value is false.

| Improve this Doc View Source

NoRedirects

Disable all HTTP and HTTPS redirects.

Declaration
public bool NoRedirects { get; set; }
Property Value
Type Description
System.Boolean

true if redirects are disabled. Default value is false.

| Improve this Doc View Source

NoSubsetFonts

Specify whether embedded fonts should be subset in the output PDF file.

Declaration
public bool NoSubsetFonts { get; set; }
Property Value
Type Description
System.Boolean

true if PDF font subsetting is disabled. Default value is false.

| Improve this Doc View Source

NoWarnCssUnknown

Disable warnings about unknown CSS features.

Declaration
public bool NoWarnCssUnknown { get; set; }
Property Value
Type Description
System.Boolean

true if warnings are disabled. Default value is false.

| Improve this Doc View Source

NoWarnCssUnsupported

Disable warnings about unsupported CSS features.

Declaration
public bool NoWarnCssUnsupported { get; set; }
Property Value
Type Description
System.Boolean

true if warnings are disabled. Default value is false.

| Improve this Doc View Source

OwnerPassword

Specify the owner password for the PDF file.

Declaration
public string OwnerPassword { get; set; }
Property Value
Type Description
System.String

The owner password.

| Improve this Doc View Source

PdfAuthor

Specify the document author for PDF metadata.

Declaration
public string PdfAuthor { get; set; }
Property Value
Type Description
System.String

The document author.

| Improve this Doc View Source

PdfCreator

Specify the document creator for PDF metadata.

Declaration
public string PdfCreator { get; set; }
Property Value
Type Description
System.String

The document creator.

| Improve this Doc View Source

PdfEventScripts

Include an AcrosJS script to run on a specific event.

Declaration
public Dictionary<PdfEvent, string> PdfEventScripts { get; }
Property Value
Type Description
Dictionary<PdfEvent, System.String>

A mapping of PDF events to the filenames or URLs of the AcroJS scripts.

| Improve this Doc View Source

PdfForms

Enable PDF forms by default.

Declaration
public bool PdfForms { get; set; }
Property Value
Type Description
System.Boolean

true if PDF forms is enabled by default. Default value is false.

| Improve this Doc View Source

PdfId

Specify the PDF ID to use.

Declaration
public string PdfId { get; set; }
Property Value
Type Description
System.String

The PDF ID.

| Improve this Doc View Source

PdfKeywords

Specify the document keywords for PDF metadata.

Declaration
public string PdfKeywords { get; set; }
Property Value
Type Description
System.String

The document keywords.

| Improve this Doc View Source

PdfLang

Specify the PDF document's Lang entry in the document catalog.

Declaration
public string PdfLang { get; set; }
Property Value
Type Description
System.String

The PDF document's Lang entry.

| Improve this Doc View Source

PdfOutputIntent

Specify the ICC profile to use.

Declaration
public string PdfOutputIntent { get; set; }
Property Value
Type Description
System.String

The ICC profile.

| Improve this Doc View Source

PdfProfile

Specify the PDF profile to use.

Declaration
public PdfProfile PdfProfile { get; set; }
Property Value
Type Description
PdfProfile

The PDF profile.

| Improve this Doc View Source

PdfScript

Include an AcroJS script to run when the PDF is opened.

Declaration
public string PdfScript { get; set; }
Property Value
Type Description
System.String

The filename or URL of the AcroJS script.

| Improve this Doc View Source

PdfSubject

Specify the document subject for PDF metadata.

Declaration
public string PdfSubject { get; set; }
Property Value
Type Description
System.String

The document subject.

| Improve this Doc View Source

PdfTitle

Specify the document title for PDF metadata.

Declaration
public string PdfTitle { get; set; }
Property Value
Type Description
System.String

The document title.

| Improve this Doc View Source

Scripts

JavaScript scripts that will run before conversion.

Declaration
public List<string> Scripts { get; }
Property Value
Type Description
List<System.String>

The filename of the script to run.

| Improve this Doc View Source

SslCaCert

Specify an SSL certificate file.

Declaration
public string SslCaCert { get; set; }
Property Value
Type Description
System.String

The filename of the SSL certificate file.

| Improve this Doc View Source

SslCaPath

Specify an SSL certificate directory.

Declaration
public string SslCaPath { get; set; }
Property Value
Type Description
System.String

The SSL certificate directory.

| Improve this Doc View Source

SslCert

Specify an SSL client certificate file. On MacOS, specify a PKCS#12 file containing a client certificate and private key. Client authentication is not supported on Windows.

Declaration
public string SslCert { get; set; }
Property Value
Type Description
System.String

The filename of the SSL client certificate file.

| Improve this Doc View Source

SslCertType

Specify the SSL client certificate file type. This option is not supported on MacOS or Windows.

Declaration
public SslType SslCertType { get; set; }
Property Value
Type Description
SslType

The SSL client certificate file type.

| Improve this Doc View Source

SslKey

Specify an SSL private key file. This option is not supported on MacOS or Windows.

Declaration
public string SslKey { get; set; }
Property Value
Type Description
System.String

The filename of the SSL private key file.

| Improve this Doc View Source

SslKeyPassword

Specify a password for the SSL private key.

Declaration
public string SslKeyPassword { get; set; }
Property Value
Type Description
System.String

The password for the SSL private key.

| Improve this Doc View Source

SslKeyType

Specify the SSL private key file type. This option is not supported on MacOS or Windows.

Declaration
public SslType SslKeyType { get; set; }
Property Value
Type Description
SslType

The SSL private key file type.

| Improve this Doc View Source

SslVersion

Set the minimum version of SSL to allow.

Declaration
public SslVersion SslVersion { get; set; }
Property Value
Type Description
SslVersion

The minimum version to allow. Default value is SslVersion.Default.

| Improve this Doc View Source

StyleSheets

CSS style sheets that will be applied to each input document.

Declaration
public List<string> StyleSheets { get; }
Property Value
Type Description
List<System.String>

The filename of the CSS style sheet to apply.

| Improve this Doc View Source

TaggedPdf

Enable tagged PDF.

Declaration
public bool TaggedPdf { get; set; }
Property Value
Type Description
System.Boolean

true if tagged PDF is enabled. Default value is false.

| Improve this Doc View Source

UserPassword

Specify the user password for the PDF file.

Declaration
public string UserPassword { get; set; }
Property Value
Type Description
System.String

The user password.

| Improve this Doc View Source

Verbose

Enable logging of informative messages.

Declaration
public bool Verbose { get; set; }
Property Value
Type Description
System.Boolean

true if verbose logging is enabled. Default value is false.

| Improve this Doc View Source

XInclude

Enable XInclude and XML external entities (XXE). Note that XInclude only applies to XML files. To apply it to HTML files, the input format needs to be specified by setting InputType.

Declaration
public bool XInclude { get; set; }
Property Value
Type Description
System.Boolean

true if XInclude and XXE are enabled. Default value is false.

| Improve this Doc View Source

XmlExternalEntities

Enable XML external entities (XXE).

Declaration
public bool XmlExternalEntities { get; set; }
Property Value
Type Description
System.Boolean

true if XXE is enabled. Default value is false.

| Improve this Doc View Source

Xmp

Specify an XMP file that contains XMP metadata to be included in the output PDF file.

Declaration
public string Xmp { get; set; }
Property Value
Type Description
System.String

The filename of the XMP file.

Methods

| Improve this Doc View Source

AddFileAttachment(String)

Add a file attachment that will be attached to the PDF file.

Declaration
public void AddFileAttachment(string url)
Parameters
Type Name Description
System.String url

The URL of the file attachment.

| Improve this Doc View Source

Convert(List<String>, Stream)

Convert multiple XML or HTML files to a PDF file.

Declaration
public abstract bool Convert(List<string> inputPaths, Stream output)
Parameters
Type Name Description
List<System.String> inputPaths

The filenames of the input XML or HTML documents.

Stream output

The output Stream to which Prince will write the PDF output.

Returns
Type Description
System.Boolean

true if a PDF file was generated successfully.

| Improve this Doc View Source

Convert(Stream, Stream)

Convert an XML or HTML stream to a PDF file. Note that it may be helpful to specify a base URL or path from the input document using BaseUrl. This allows relative URLs and paths in the document (e.g. for images) to be resolved correctly.

Declaration
public abstract bool Convert(Stream input, Stream output)
Parameters
Type Name Description
Stream input

The input Stream from which Prince will read the XML or HTML document.

Stream output

The output Stream to which Prince will write the PDF output.

Returns
Type Description
System.Boolean

true if a PDF file was generated successfully.

| Improve this Doc View Source

Convert(String, Stream)

Convert an XML or HTML file to a PDF file.

Declaration
public abstract bool Convert(string inputPath, Stream output)
Parameters
Type Name Description
System.String inputPath

The filename of the input XML or HTML document.

Stream output

The output Stream to which Prince will write the PDF output.

Returns
Type Description
System.Boolean

true if a PDF file was generated successfully.

| Improve this Doc View Source

ConvertString(String, Stream)

Convert an XML or HTML string to a PDF file.

Declaration
public abstract bool ConvertString(string input, Stream output)
Parameters
Type Name Description
System.String input

The XML or HTML document in the form of a string.

Stream output

The output Stream to which Prince will write the PDF output.

Returns
Type Description
System.Boolean

true if a PDF file was generated successfully.

| Improve this Doc View Source

FailSafe(Boolean)

Enables/disables all fail-safe options.

Declaration
public void FailSafe(bool failSafe)
Parameters
Type Name Description
System.Boolean failSafe

The value to set all fail-safe options to.

| Improve this Doc View Source

GetBaseCommandLine()

The common base command lines used by Prince and the Prince control interface.

Declaration
protected List<string> GetBaseCommandLine()
Returns
Type Description
List<System.String>

A list of base command lines.

| Improve this Doc View Source

ReadMessages(StreamReader)

Handle (structured) messages received from Prince.

Declaration
protected bool ReadMessages(StreamReader reader)
Parameters
Type Name Description
StreamReader reader

The reader for messages received from Prince.

Returns
Type Description
System.Boolean

true if Prince returns a "success" message.

| Improve this Doc View Source

StartPrince(List<String>)

Starts a Prince process.

Declaration
protected Process StartPrince(List<string> args)
Parameters
Type Name Description
List<System.String> args

The command line arguments for Prince.

Returns
Type Description
Process

The Prince process.

  • Improve this Doc
  • View Source
In This Article
Back to top Generated by DocFX