Show / Hide Table of Contents

Class TemplateDocument

Encapsulates a template document that can merged with data to generate any number of PDFs.

Inheritance
System.Object
TemplateDocument
Implements
System.IDisposable
Inherited Members
System.Object.ToString()
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
Namespace: pdftron.PDF
Assembly: PDFNet.dll
Syntax
public sealed class TemplateDocument : IDisposable

Methods

CancelConversion()

Cancel the current template filling, forcing FillTemplateJson to return.

Declaration
public void CancelConversion()

Dispose()

Declaration
public override sealed void Dispose()

Dispose(Boolean)

Declaration
[HandleProcessCorruptedStateExceptions]
protected void Dispose(bool A_0)
Parameters
Type Name Description
System.Boolean A_0

FillTemplateJson(String)

Create a PDF by merging JSON data with this template document.

Declaration
public PDFDoc FillTemplateJson(string json)
Parameters
Type Name Description
System.String json

A JSON dictionary mapping template keys to their replacement content

Returns
Type Description
PDFDoc

The PDFDoc from the template filling result

Finalize()

Declaration
protected void Finalize()

GetConversionStatus()

Get the state of the template filling process.

Declaration
public TemplateDocumentResult GetConversionStatus()
Returns
Type Description
TemplateDocumentResult

GetErrorString()

If the template filling finsihed with some kind of error, this returns the value of the error description; otherwise returns an empty string.

Declaration
public string GetErrorString()
Returns
Type Description
System.String

The error description. Will be blank unless GetConversionStatus returns Failure

GetNumWarnings()

Return the number of warning strings generated during the template filling process. Warning: experimental interface; this method may be renamed or replaced with equivalent functionality in the future.

Declaration
public int GetNumWarnings()
Returns
Type Description
System.Int32

The number of stored warning strings

GetTemplateKeysJson()

Get information about the template keys present in the template document. Returns a JSON dictionary following this form: https://www.pdftron.com/api/web/Core.html#.TemplateSchema.

Declaration
public string GetTemplateKeysJson()
Returns
Type Description
System.String

The template keys info JSON dictionary, serialized into a string

GetWarningString(Int32)

Retrieve warning strings that have been collected during the template filling process. Warning: experimental interface; this method may be renamed or replaced with equivalent functionality in the future.

Declaration
public string GetWarningString(int index)
Parameters
Type Name Description
System.Int32 index

the index of the string to be retrieved. Must be less than GetNumWarnings()

Returns
Type Description
System.String

The value of the particular warning string

IsCancelled()

Has the template filling been cancelled?.

Declaration
public bool IsCancelled()
Returns
Type Description
System.Boolean

Returns true if CancelConversion has been called previously

Implements

System.IDisposable
Back to top Generated by DocFX