Show / Hide Table of Contents

Class PrinceControl

Class for creating persistent Prince control processes that can be used for multiple consecutive document conversions.

Inheritance
System.Object
PrinceBase
PrinceControl
Inherited Members
PrinceBase.Verbose
PrinceBase.Debug
PrinceBase.Log
PrinceBase.NoWarnCssUnknown
PrinceBase.NoWarnCssUnsupported
PrinceBase.InputType
PrinceBase.BaseUrl
PrinceBase.Iframes
PrinceBase.XInclude
PrinceBase.XmlExternalEntities
PrinceBase.NoNetwork
PrinceBase.NoRedirects
PrinceBase.AuthUser
PrinceBase.AuthPassword
PrinceBase.AuthServer
PrinceBase.AuthScheme
PrinceBase.AuthMethods
PrinceBase.NoAuthPreemptive
PrinceBase.HttpProxy
PrinceBase.HttpTimeout
PrinceBase.Cookies
PrinceBase.CookieJar
PrinceBase.SslCaCert
PrinceBase.SslCaPath
PrinceBase.SslCert
PrinceBase.SslCertType
PrinceBase.SslKey
PrinceBase.SslKeyType
PrinceBase.SslKeyPassword
PrinceBase.SslVersion
PrinceBase.Insecure
PrinceBase.NoParallelDownloads
PrinceBase.JavaScript
PrinceBase.Scripts
PrinceBase.MaxPasses
PrinceBase.StyleSheets
PrinceBase.Media
PrinceBase.NoAuthorStyle
PrinceBase.NoDefaultStyle
PrinceBase.PdfId
PrinceBase.PdfLang
PrinceBase.PdfProfile
PrinceBase.PdfOutputIntent
PrinceBase.PdfScript
PrinceBase.PdfEventScripts
PrinceBase.FileAttachments
PrinceBase.NoArtificialFonts
PrinceBase.NoEmbedFonts
PrinceBase.NoSubsetFonts
PrinceBase.ForceIdentityEncoding
PrinceBase.NoCompress
PrinceBase.NoObjectStreams
PrinceBase.ConvertColors
PrinceBase.FallbackCmykProfile
PrinceBase.TaggedPdf
PrinceBase.PdfForms
PrinceBase.PdfTitle
PrinceBase.PdfSubject
PrinceBase.PdfAuthor
PrinceBase.PdfKeywords
PrinceBase.PdfCreator
PrinceBase.Xmp
PrinceBase.Encrypt
PrinceBase.KeyBits
PrinceBase.UserPassword
PrinceBase.OwnerPassword
PrinceBase.DisallowPrint
PrinceBase.DisallowCopy
PrinceBase.AllowCopyForAccessibility
PrinceBase.DisallowAnnotate
PrinceBase.DisallowModify
PrinceBase.AllowAssembly
PrinceBase.LicenseFile
PrinceBase.LicenseKey
PrinceBase.FailDroppedContent
PrinceBase.FailMissingResources
PrinceBase.FailStrippedTransparency
PrinceBase.FailMissingGlyphs
PrinceBase.FailPdfProfileError
PrinceBase.FailPdfTagError
PrinceBase.FailInvalidLicense
PrinceBase.AddFileAttachment(String)
PrinceBase.FailSafe(Boolean)
PrinceBase.StartPrince(List<String>)
PrinceBase.GetBaseCommandLine()
PrinceBase.ReadMessages(StreamReader)
Namespace: PrinceXML.Wrapper
Assembly: PrinceXML.Wrapper.dll
Syntax
public class PrinceControl : PrinceBase

Constructors

| Improve this Doc View Source

PrinceControl(String, PrinceEvents)

Constructor for PrinceControl.

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

The path of the Prince executable. For example, this may be C:\Program Files\Prince\engine\bin\prince.exe on Windows.

PrinceEvents events

An implementation of PrinceEvents that will receive messages returned from Prince.

Properties

| Improve this Doc View Source

Version

Get the version string for the running Prince process.

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

The version string.

Methods

| Improve this Doc View Source

AddFileAttachment(Byte[], String, String)

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

Declaration
public void AddFileAttachment(byte[] attachment, string fileName, string description)
Parameters
Type Name Description
System.Byte[] attachment

The file attachment as a byte array.

System.String fileName

The filename of the file attachment.

System.String description

The description of the file attachment.

| Improve this Doc View Source

AddPdfEventScript(PdfEvent, Byte[])

Include an AcrosJS script to run on a specific event.

Declaration
public void AddPdfEventScript(PdfEvent pdfEvent, byte[] pdfScript)
Parameters
Type Name Description
PdfEvent pdfEvent

The PDF event.

System.Byte[] pdfScript

The AcroJS script as a byte array.

| Improve this Doc View Source

AddScript(Byte[])

Add a JavaScript script that will run before conversion.

Declaration
public void AddScript(byte[] script)
Parameters
Type Name Description
System.Byte[] script

The script as a byte array.

| Improve this Doc View Source

AddStyleSheet(Byte[])

Add a CSS style sheet that will be applied to each input document.

Declaration
public void AddStyleSheet(byte[] styleSheet)
Parameters
Type Name Description
System.Byte[] styleSheet

The CSS style sheet as a byte array.

| Improve this Doc View Source

Convert(List<String>, Stream)

Convert multiple XML or HTML files to a PDF file.

Declaration
public override 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.

Overrides
PrinceBase.Convert(List<String>, Stream)
| 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 override 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.

Overrides
PrinceBase.Convert(Stream, Stream)
| Improve this Doc View Source

Convert(String, Stream)

Convert an XML or HTML file to a PDF file.

Declaration
public override 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.

Overrides
PrinceBase.Convert(String, Stream)
| Improve this Doc View Source

ConvertString(String, Stream)

Convert an XML or HTML string to a PDF file.

Declaration
public override 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.

Overrides
PrinceBase.ConvertString(String, Stream)
| Improve this Doc View Source

SetPdfScript(Byte[])

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

Declaration
public void SetPdfScript(byte[] pdfScript)
Parameters
Type Name Description
System.Byte[] pdfScript

The AcroJS script as a byte array.

| Improve this Doc View Source

Start()

Start a Prince control process that can be used for multiple consecutive document conversions.

Declaration
public void Start()
| Improve this Doc View Source

Stop()

Stop the Prince control process.

Declaration
public void Stop()
  • Improve this Doc
  • View Source
In This Article
Back to top Generated by DocFX