Class PrintDocument
Represents a printed document in the form of a PDF document.
public class PrintDocument : EncodedFile
- Inheritance
-
PrintDocument
- Inherited Members
Constructors
PrintDocument(string)
Initializes a new instance of the PrintDocument class.
public PrintDocument(string base64EncodedDocument)
Parameters
base64EncodedDocument
stringThe printed document as a Base64-encoded string.
Exceptions
- ArgumentNullException
If
base64EncodedDocument
is null.- FormatException
The length of
base64EncodedDocument
, ignoring white-space characters, is not zero or a multiple of 4.-or-
The format of
base64EncodedDocument
is invalid.base64EncodedDocument
contains a non-base-64 character, more than two padding characters, or a non-white space-character among the padding characters.
Methods
SaveAsFile(string)
Saves this PrintDocument as a PDF formatted file, overwriting the file if it already exists.
public override void SaveAsFile(string fileName)
Parameters
fileName
stringThe full path and file name to save the printed document to.
Exceptions
- ArgumentException
If
fileName
is null or whitespace.-or-
fileName
refers to a non-file device, such as "con:", "com1:", "lpt1:", etc. in an NTFS environment.- NotSupportedException
fileName
refers to a non-file device, such as "con:", "com1:", "lpt1:", etc. in a non-NTFS environment.- DirectoryNotFoundException
The specified path is invalid, such as being on an unmapped drive.
- PathTooLongException
The specified path, file name, or both exceed the system-defined maximum length.