ComHelper Class
Contains methods that can be useful for users which are calling GemBox.Pdf component using COM interop.
- Inheritance:
- System.ObjectComHelper
Constructors
ComHelper()
Initializes a new instance of the ComHelper class.
Methods
GetFormFields(Object)
Gets all fields from the PDF document's interactive form.
public ArrayList GetFormFields(object document)
Public Function GetFormFields(document As Object) As ArrayList
Parameters
document
- System.Object
The PdfDocument instance from which to retrieve the PdfField elements.
Returns
- System.Collections.ArrayList
Array of interactive form fields.
Load(String)
Loads a PDF document from a file with the specified path and with the Default options.
Parameters
path
- System.String
The path to a file from which to load a PDF document.
Returns
A loaded PDF document.
Exceptions
- System.ArgumentNullException
path
is null.
PDF file is encrypted and the password is required to load a PDF document. Use LoadWithOptions(String, Object) method and provide a valid Password.
LoadWithOptions(String, Object)
Loads a PDF document from a file with the specified path and with the specified options.
public PdfDocument LoadWithOptions(string path, object options)
Public Function LoadWithOptions(path As String, options As Object) As PdfDocument
Parameters
path
- System.String
The path to a file from which to load a PDF document.
options
- System.Object
The options used for loading a PdfDocument from a PDF file.
Returns
A loaded PDF document.
Exceptions
- System.ArgumentNullException
path
is null or options
is null.
PDF file is encrypted and the Password is invalid.
Save(Object, String)
Saves the entire PDF document to a file with the specified path.
Use SaveOptions to specify options used for saving the PdfDocument to a PDF file.
public void Save(object document, string path)
Public Sub Save(document As Object, path As String)
Parameters
document
- System.Object
The PdfDocument instance which to save.
path
- System.String
The path to a file to which to save a PDF document.
Exceptions
- System.ArgumentNullException
path
is null.
SetLicense(String)
Sets the license (serial) key.
Parameters
serialKey
- System.String
The serial key.
Remarks
You should call this method before using any other class from GemBox.Pdf assembly.
Key can only be set once (if you try to set another key, exception will be thrown).
The best place to call this method is from static constructor of your application's main class.
Valid serial key has multiple groups of alphanumeric characters, separated with dashes.
To use the assembly in free limited mode, use FREE-LIMITED-KEY as serialKey
.
For more information about GemBox.Pdf evaluation and licensing, see evaluation and licensing.