Persits Software, Inc. Web Site
 Navigator:  Home |  Object Reference |  PdfManager
PdfOutline PdfImage
  PdfManager Object
PdfManager is AspPDF.NET's central top-level object. It serves as an "object factory" for other objects, most noticeably PdfDocument. It also provides registration key-related functionality.

Properties Methods
ConfigPath
Expires
Version
RegKey
CreateDocument
CreateParam
InjectTextIntoFile
LoadTextFromFile
LogonUser
OpenDocument
RevertToSelf
SendBinary

Properties


string ConfigPath (Read-only)

Returns the location of the current configuration file. This property was introduced in version 2.1.0.15816 and is useful when the component is used in classic ASP.

DateTime Expires (Read-only)

Returns the component's expiration date obtained from the registration key in use. If the returned value is 9/9/9999, it means the registration key is permanent. Throws an exception if the key cannot be found or is invalid.

string Version (Read-only)

Returns the current component version in the format "X.X.X.X", for example "1.8.0.19283".

string RegKey (Write-only)

Specifies the registration key. If this property is not set, AspPDF.NET will look for a registration key in the current .config file in the <appSettings> section under the name AspPDF_RegKey. If the key is invalid, this property will throw an error exception. AspPDF requires a registration key even for evaluation purposes. A free 30-day evaluation key can be obtained at www.asppdf.net/download.html.

For more information, see Section 1.5 - Expiration Mechanism.


Methods

PdfDocument CreateDocument ( )
PdfDocument CreateDocument ( string ID )
Creates an empty PDF document, returns an instance of the PdfDocument object representing this document.

ID is a binary number, specified as a hex string, to be used as this document's identifier. If this argument is omitted, AspPDF.NET will generate a random 128-bit document identifier. Use this argument only if you need your document to have a specific identifier for accountability or other purposes. The current document identifier can be retrieved via PdfDocument's ID property.


PdfParam CreateParam ( )
PdfParam CreateParam ( string ParamStr )
Creates an instance of the PdfParam object optionally initialized with a parameter string specified by ParamStr. If the ParamStr argument is omitted, the method creates an empty PdfParam object.

For more information about the PdfParam object and parameter strings, see Section 2.3 - PdfParam Object.


string InjectTextIntoFile (string Path, string Text, int Location)
An auxiliary method which places UTF-8 encoded Text into a file specified by Path at a location specified by Location. Returns the filename (without the path) of the file specified by Path.

Use this method to inject a digitial signature generated on a user workstation into a server-side PDF. This functionality is described in Section 8.4 - Client-Side Signing of Server-Side PDFs.

This method was introduced in Version 3.4.


void LogonUser( string Domain, string Username, string Password )
Impersonates a user (usually an admin account) to perform operations that would otherwise fail due to a lack of permissions (such as opening a file from a remote drive, opening a digital certificate from a store, etc.)

string LoadTextFromFile ( string Path )
An auxiliary method which loads a text string from a file specified by Path. A file can be in ANSI or Unicode (little endian, big endian or UTF-8) formats.

All text-handling method such as PdfCanvas.DrawText expect a text string to be passed as an argument. If the text to be drawn resides in a file, the LoadTextFromFile method can be used to load the file into a text string which can them be passed to a text-drawing method.


PdfDocument OpenDocument ( string Path )
PdfDocument OpenDocument ( string Path, string Password )
PdfDocument OpenDocument ( byte [ ] Blob )
PdfDocument OpenDocument ( byte [ ] Blob, string Password )
Opens an existing PDF document from a file specified by Path, or array of bytes specified by Blob. Password optionally specifies an owner or user password in case the document is password-protected.

Generally, the method returns an instance of the PdfDocument object representing the document being opened. If the document is password-protected and Password is missing, the method returns null. If a password is required and an invalid one is specified, or if the file being opened is invalid or corrupt, the method throws an error exception.

For more information about working with existing documents, see Chapter 9 - Working with Existing PDFs.


void RevertToSelf ( )
Ends impersonation begun by LogonUser.

void SendBinary ( string Path )
void SendBinary ( string Path, string ContentType, string DispHeader )
Sends an arbitrary file specified via Path from the server's hard drive to the client browser. This method can only be used under ASP.NET.

A script calling this method must not have any HTML tags in it (not even comments) as they would corrupt the HTTP stream.

ContentType optionally specifies the Content-Type header for the HTTP stream. This argument is "application/pdf" by default.

DispHeader optionally specifies the Content-Disposition header for the HTTP stream. By default, the header is set to "attachment; filename=filename.ext" based on the name of the file being sent. You may choose to pass a value for this argument if you want to specify a filename other than the actual document name.

Usage:

objPDF.SendBinary( @"c:\path\a.pdf", null, "attachment; filename=b.pdf" );


PdfOutline PdfImage
Search AspPDF.net

Newsletter Signup

Other Products
AspPDF
AspUpload
AspJpeg
AspEmail
AspEncrypt
AspGrid
AspUser
  This site is owned and maintained by Persits Software, Inc. Copyright © 2003 - 2014. All Rights Reserved.