PDF Plugin for Xojo |

# EinhugurPDFWriter.PDFDocument Class (console safe)

A class that represents a PDF document.

Object
PDFDocument

class EinhugurPDFWriter.PDFDocument

#### Constructors

PDFDocument (console safe) | Default constructor with no parameters.
PDFDocument (console safe) | Constructor that takes ZipEngineHandle as parameter to enable compression in the PDF document.

#### Properties

Author (console safe) | Sets or gets the Author meta tag.
Creator (console safe) | Sets or gets the Creator meta tag.
KeyWords (console safe) | Sets or gets the KeyWords meta tag.
LastErrorDetailNumber (console safe) | Returns detail number if there is any for the last error number that occurred, or zero if no error or no detail number.
LastErrorNumber (console safe) | Returns the last error number that occurred, or zero if no error.
Mode (console safe) | Sets the mode that the document should be opened in. The value of this can be any of the values that are defined in the PDFDocument.DocumentModeEnum
Subject (console safe) | Sets or gets the Subject meta tag.
Title (console safe) | Sets or gets the Title meta tag.
UseExceptions (console safe) | Set to true right after creating instance of the PDFDocument to enable exceptions.

#### Methods

AddPage (console safe) | Adds a page to the PDF document and returns the new Page object.
AttachFile | Attaches file to the PDF document. This file will not be visible part of the document but will be in the documents file repository.
ClearError (console safe) | Clears the values in the LastErrorNumber and LastErrorDetailNumber properties.
CreateExtendedGraphicsState (console safe) | Creates a ExtendedGraphicsState object.
CreateOutline (console safe) | Creates a Outline object for the PDF outline tree.
GetFont (console safe) | GetsFont built in non unicode front by name.
LoadImage (console safe) | Loads a image from RawBitMap into the PDF document.
LoadJPEGImage (console safe) | Loads a JPEG image into the PDF document from a string buffer. The image will be stored as native JPG in the PDF document, making the compression of it very good.
LoadTrueTypeFont (console safe) | Loads a TrueType font TrueType font (.ttf) file.
LoadTrueTypeFont (console safe) | Loads a TrueType font TrueType font (.ttc) collection file.
LoadType1Font (console safe) | Loads Type1 Postscript font from files.
Save (console safe) | Saves the generated PDF to a file.
SaveToMemoryBlock (console safe) | Saves the generated PDF to a MemoryBlock.
SaveToString (console safe) | Saves the generated PDF to a string.
SetEncryptionMode (console safe) | Sets the encryption mode.
SetPassword (console safe) | Sets a password for the document. If the password is set, document contents are encrypted.
SetPermission (console safe) | Sets the permission flags for the document.

#### Events

ErrorLog | A event that gives you chance to get live feed of error events from the PDFDocument.
ResolveFont | This event is called if you have font encoding set to automatic and the internal handler does not think it has good font in the stock-fonts to handle the given text.

#### Enumerations

DocumentModeEnum | Enum that represents startup modes. Your PDFDocument can request in what mode it should be opened. But some PDF viewers will ignore it.
LanguageScript | Enum that represents language scripts. Language scripts are used for automatic detection of language script system.s
EncryptModeEnum | Enum that represents encryption modes. This enum is used with the SetEncryptionMode method.

#### Constants

PERMISSION_READ = 0 | User can read the document. This is the minimum permission, so if you set any one of the others then you always get read also regardless if this flag is set or not.
PERMISSION_PRINT = 4 | User can print the document
PERMISSION_EDIT_ALL = 8 | User can edit the contents of the document other than annotations, form fields.
PERMISSION_COPY = 16 | User can copy the text and the graphics of the document.
PERMISSION_EDIT = 32 | User can add or modify the annotations and form fields of the document.

#### Supported Platforms:

- macOS Intel 64 bit
- macOS Apple Silicon
- Windows 32 bit
- Windows 64 bit
- Windows ARM 64 bit
- Linux 32 bit
- Linux 64 bit
- Linux ARM 32 bit
- Linux ARM 64 bit
- iOS