PDF Component

Properties   Methods   Events   Config Settings   Errors  

TBD

Syntax

nsoftware.IPWorksPDF.PDF

Remarks

TBD

Property List


The following is the full list of the properties of the component with short descriptions. Click on the links for further details.

InputFileThe PDF file to process.
InputPDFA byte array containing the PDF document to process.
OutputFileThe path to a local file where the output will be written.
OutputPDFA byte array containing the PDF document after processing.
OverwriteIndicates whether or not the component should overwrite files.

Method List


The following is the full list of the methods of the component with short descriptions. Click on the links for further details.

CloseCloses an opened PDF document.
ConfigSets or retrieves a configuration setting.
OpenOpens a PDF document for processing.
ResetResets the component.

Event List


The following is the full list of the events fired by the component with short descriptions. Click on the links for further details.

ErrorFired when information is available about errors during data delivery.

Config Settings


The following is a list of config settings for the component with short descriptions. Click on the links for further details.

SaveChangesWhether changes made to the PDF document should be saved.
BuildInfoInformation about the product's build.
GUIAvailableWhether or not a message loop is available for processing events.
LicenseInfoInformation about the current license.
MaskSensitiveDataWhether sensitive data is masked in log messages.
UseInternalSecurityAPIWhether or not to use the system security libraries or an internal implementation.

InputFile Property (PDF Component)

The PDF file to process.

Syntax

public string InputFile { get; set; }
Public Property InputFile As String

Default Value

""

Remarks

This property is used to provide a path to the PDF document to be processed. TBD

InputPDF Property (PDF Component)

A byte array containing the PDF document to process.

Syntax

public byte[] InputPDF { get; set; }
Public Property InputPDF As Byte()

Remarks

This property is used to assign a byte array containing the PDF document to be processed. TBD

This property is not available at design time.

OutputFile Property (PDF Component)

The path to a local file where the output will be written.

Syntax

public string OutputFile { get; set; }
Public Property OutputFile As String

Default Value

""

Remarks

This property is used to provide a path where the resulting PDF document will be saved after the operation has completed. TBD

OutputPDF Property (PDF Component)

A byte array containing the PDF document after processing.

Syntax

public byte[] OutputPDF { get; }
Public ReadOnly Property OutputPDF As Byte()

Remarks

This property is used to read the byte array containing the produced output after the operation has completed. It will only be set if the OutputFile properties have not been assigned. TBD

This property is read-only and not available at design time.

Overwrite Property (PDF Component)

Indicates whether or not the component should overwrite files.

Syntax

public bool Overwrite { get; set; }
Public Property Overwrite As Boolean

Default Value

False

Remarks

TBD

Close Method (PDF Component)

Closes an opened PDF document.

Syntax

public void Close();

Async Version
public async Task Close();
public async Task Close(CancellationToken cancellationToken);
Public Sub Close()

Async Version
Public Sub Close() As Task
Public Sub Close(cancellationToken As CancellationToken) As Task

Remarks

It should always be preceded by a call to the Open method.

Example usage: pdf.InputFile = "input.pdf"; pdf.Open(); // some action pdf.Close();

To configure this saving behavior, set the SaveChanges config.

TBD

Config Method (PDF Component)

Sets or retrieves a configuration setting.

Syntax

public string Config(string configurationString);

Async Version
public async Task<string> Config(string configurationString);
public async Task<string> Config(string configurationString, CancellationToken cancellationToken);
Public Function Config(ByVal ConfigurationString As String) As String

Async Version
Public Function Config(ByVal ConfigurationString As String) As Task(Of String)
Public Function Config(ByVal ConfigurationString As String, cancellationToken As CancellationToken) As Task(Of String)

Remarks

Config is a generic method available in every component. It is used to set and retrieve configuration settings for the component.

These settings are similar in functionality to properties, but they are rarely used. In order to avoid "polluting" the property namespace of the component, access to these internal properties is provided through the Config method.

To set a configuration setting named PROPERTY, you must call Config("PROPERTY=VALUE"), where VALUE is the value of the setting expressed as a string. For boolean values, use the strings "True", "False", "0", "1", "Yes", or "No" (case does not matter).

To read (query) the value of a configuration setting, you must call Config("PROPERTY"). The value will be returned as a string.

Open Method (PDF Component)

Opens a PDF document for processing.

Syntax

public void Open();

Async Version
public async Task Open();
public async Task Open(CancellationToken cancellationToken);
Public Sub Open()

Async Version
Public Sub Open() As Task
Public Sub Open(cancellationToken As CancellationToken) As Task

Remarks

When finished, call Close to complete or discard the operation. TBD

Reset Method (PDF Component)

Resets the component.

Syntax

public void Reset();

Async Version
public async Task Reset();
public async Task Reset(CancellationToken cancellationToken);
Public Sub Reset()

Async Version
Public Sub Reset() As Task
Public Sub Reset(cancellationToken As CancellationToken) As Task

Remarks

This method is used to reset the component's properties to their default values. TBD

Error Event (PDF Component)

Fired when information is available about errors during data delivery.

Syntax

public event OnErrorHandler OnError;

public delegate void OnErrorHandler(object sender, PDFErrorEventArgs e);

public class PDFErrorEventArgs : EventArgs {
  public int ErrorCode { get; }
  public string Description { get; }
}
Public Event OnError As OnErrorHandler

Public Delegate Sub OnErrorHandler(sender As Object, e As PDFErrorEventArgs)

Public Class PDFErrorEventArgs Inherits EventArgs
  Public ReadOnly Property ErrorCode As Integer
  Public ReadOnly Property Description As String
End Class

Remarks

The Error event is fired in case of exceptional conditions during message processing. Normally the component throws an exception.

The ErrorCode parameter contains an error code, and the Description parameter contains a textual description of the error. For a list of valid error codes and their descriptions, please refer to the Error Codes section.

Config Settings (PDF Component)

The component accepts one or more of the following configuration settings. Configuration settings are similar in functionality to properties, but they are rarely used. In order to avoid "polluting" the property namespace of the component, access to these internal properties is provided through the Config method.

PDF Config Settings

SaveChanges:   Whether changes made to the PDF document should be saved.

This setting specifies whether and how changes made to the PDF document should be saved when the Close method is called. Possible values are:

0 Discard all changes.
This was originally a bool parameter of the Close method, but we moved it to config for symmetry with Open (no parameters). TBD

Base Config Settings

BuildInfo:   Information about the product's build.

When queried, this setting will return a string containing information about the product's build.

GUIAvailable:   Whether or not a message loop is available for processing events.

In a GUI-based application, long-running blocking operations may cause the application to stop responding to input until the operation returns. The component will attempt to discover whether or not the application has a message loop and, if one is discovered, it will process events in that message loop during any such blocking operation.

In some non-GUI applications, an invalid message loop may be discovered that will result in errant behavior. In these cases, setting GUIAvailable to false will ensure that the component does not attempt to process external events.

LicenseInfo:   Information about the current license.

When queried, this setting will return a string containing information about the license this instance of a component is using. It will return the following information:

  • Product: The product the license is for.
  • Product Key: The key the license was generated from.
  • License Source: Where the license was found (e.g., RuntimeLicense, License File).
  • License Type: The type of license installed (e.g., Royalty Free, Single Server).
  • Last Valid Build: The last valid build number for which the license will work.
MaskSensitiveData:   Whether sensitive data is masked in log messages.

In certain circumstances it may be beneficial to mask sensitive data, like passwords, in log messages. Set this to true to mask sensitive data. The default is true.

This setting only works on these components: AS3Receiver, AS3Sender, Atom, Client(3DS), FTP, FTPServer, IMAP, OFTPClient, SSHClient, SCP, Server(3DS), Sexec, SFTP, SFTPServer, SSHServer, TCPClient, TCPServer.

UseInternalSecurityAPI:   Whether or not to use the system security libraries or an internal implementation.

When set to false, the component will use the system security libraries by default to perform cryptographic functions where applicable. In this case, calls to unmanaged code will be made. In certain environments, this is not desirable. To use a completely managed security implementation, set this setting to true.

Setting this configuration setting to true tells the component to use the internal implementation instead of using the system security libraries.

On Windows, this setting is set to false by default. On Linux/macOS, this setting is set to true by default.

If using the .NET Standard Library, this setting will be true on all platforms. The .NET Standard library does not support using the system security libraries.

Note: This setting is static. The value set is applicable to all components used in the application.

When this value is set, the product's system dynamic link library (DLL) is no longer required as a reference, as all unmanaged code is stored in that file.

Trappable Errors (PDF Component)

PDF Errors

104   Cannot read or write file.