Document Attributes

The reserved Document identifier can be used to access the main document’s attributes. Some of these attributes such as PageCount and CurrentPage can also be accessed directly from the ActiveX control properties. Reading/Writing these properties from either the ActiveX control or through the "Document" object will produce the same results.

New v5.0 Attributes

Attribute

Description

Type

Values

Default Value

AppendMergeOptions

Defines various options for handling form fields object names when appending or merging documents. This attribute is useful in order to resolve conflicts when the same object names are used in multiple documents that are being appended or merged.

Enumeration

0: acAppendMergeNone

1: acAppendMergeCreateFieldsTreeA

2: acAppendMergeCreateFieldsTreeB

3: acAppendMergeCreateFieldsTreeAB

4: acAppendMergeRenameConflictingFieldsA

5: acAppendMergeRenameConflictingFieldsB

acAppendMergeNone

AutoPrint

Instructs Acrobat Reader to prompt the user to print the PDF document when it is opened.

This option requires Javascript to be enabled in Acrobat Reader on the client system.

Boolean

False: The document is opened normally with no prompt for printing.

True: The user is prompted with the Print dialogue box.

False

ForceNewNameWhenConflicting

Prevents multiple form field objects from having the same name, this is known as grouped fields.

Boolean

False: Developer is allowed to set the same name to multiple form field objects, i.e. create grouped form field objects.

True: If am object name is already in use, PDF Creator will assign a new name for other objects with the same name, e.g. acField1, acField2, ...

True

(for compatibility with v4.5)

KeepOriginalColors

Colors in a PDF file can be defined using multiple color spaces such as RGB, CMYK or CIE based. This attribute prevents PDF Creator from converting all colors to RGB when the document is modified and resaved.

Boolean

False: All colors are converted to RGB when document is modified

True: The colors of the resaved document preserve the same color space and match the original colors

False

(for compatibility with v4.5)

OCRDataFilesLocation

Defines an alternative location for the Tesseract dictionaries that are needed to perform an OCR on a document.

String

Any valid directory path that contains all the distributable Tesseract files.

None

OpenOtherThanPDF

Allows PDF Creator to directly open and files other than PDF files such as JPeg, TIFF or XPS files.

Boolean

True: PDF Creator will open files other than PDF

False: PDF Creator will raise an exception when an attempt is made to open files other than PDF

True

ScrollThroughPages

*Not available in WinRT

Defines the behavior of the scroll-bars when the document contains multiple pages.

Boolean

False: Scrolling is limited to a single page

True: When the end of a page is reached, the viewer scrolls to the next page

True

UseCropBoxWhenExporting

Limit the JPeg and BMP exports to the contents of the CropBox or page margins.

Boolean

False: The whole page is exported, the size of the resulting image is the size of the page including the margins.

True: The size of the resulting image is the size of the CropBox region only, or the size of the page excluding the margins.

False

UseGdiPlus

*Not available in WinRT

Selects which rendering engine is used to render a page to the screen or printer

Enumeration

0: Use GDI32

1: Use GDI+

2: Use Direct2D

1: Use GDI+ for ActiveX or .Net

2: Use Direct2D for WinRT

 

 

Attribute

Description

Type

Default

ActivateObjects

Determines if an object created by the user is activated after being created.

Boolean

False

AutoAdjustFontSize

When editing text objects adjust automatically the font size to fit all entered text within the object's bounds.

Boolean

False

AutoTabOrder

Used to change the behavior of the Tab key.

AutoTabOrder

 

AutoTabOrder

Name

Description

Value

acAutoTabOrderNone

No Predefined Tab order (follow creation order).

0

acAutoTabOrderHorizontal

Left to Right, then top to bottom.

1

acAutoTabOrderVertical

Top to bottom, then left to right.

2

CheckBoxSize

Forces all checkboxes to be of the specified size.

Long

-1

ClearImagesAfterSavePage

This will remove from memory the images reference by a page after it is saved, thus reducing memory usage when saving a document with a lot of images.

Boolean

False

ClipToBoundaries

When set to True, this property forces all objects to be clipped within the page’s boundaries.

Boolean

True

CurrentPage

Current page number

Long

1

DefaultFormat

Format

 

 

DefaultFont

Default font used for all objects containing text.

String

"Times New Roman, 12, 400, 0,0"

DefaultFontApplyToAll

When true, changing the default font will change the fonts of all objects currently having the default font. When false, only newly created object will be affected.

Boolean

False

DefaultTitleFont

Default font used for cell titles

String

"Times New Roman, 9, 700,0,0"

DeleteBookmarksOfDeletedPages

When set to TRUE, all bookmarks whose destination page is deleted are removed from the bookmarks tree. Note that if a certain bookmark has child nodes, it will be removed along with its children regardless of whether the children point to existing pages or not.

Boolean

 

EditBackColor

Back color for editable cells and fields in compiled or run mode.

Color

-1 (Transparent)

FileSaveOption

Part of the PDF document to save.

acFileSaveOption

1

acFileSaveOption

Name

Description

Value

acFileSaveDefault

Takes the default Save option stored in the document.

-1

acFileSaveAll

Save document design data and view.

0

acFileSaveView

Save only document view (PDF format).

1

acFileSaveDesign

Save only document design data.

2

acFileSavePDFA_7

Save document in PDF/A format, PDF Specifications.

3

acFileSavePDFA

Save document in PDF/A format, PDF Specifications Version 8.

4

acFileSavePDF14

Save as PDF Specs Ver. 1.4.

5

Fonts(R)

Array of all fonts used in document.

Array

 

HideAnnotations

Show or hide annotations depending on the document’s state.

Integer (combination of values below).

0

HideAnnotations

Name

Description

Value

acHideNever

Always show annotation.

0

acHideInRunMode

Hide annotation when document is in run mode.

1

acHideInDesignMode

Hide annotations when document in design mode.

2

acHideInPrintPreviewMode

Hide annotations when document is in print preview mode.

8

acHideInAnnotationMode

Hide annotations when document is in annotation mode.

16

acHideAlways

Always hide annotation.

255

IgnoreTransparencies

Improve display speed and print quality of certain documents containing transparent images.

Boolean

False

LockLastSelectedTool

Keep the last selected tool active after it is used.

Boolean

True

MinimumGap

Minimum gap in pixels to be displayed between page view and borders.

Long

30 (pixels)

MeasurementUnit

Unit of measurement used for the ruler bars and status bar.

Long

0

HideAnnotations

Name

Description

Value

Millimeters

1 inch=0.1 centimeters.

0

Inches

1 inch=25.4 millimeters.

1

TWIPS

1 inch=1440 TWIPS.

2

ObjectType

Returns the type of object.

IacObjectType

acObjectTypeDocument

PageCount

Number of pages in document.

Long

1

Pages

Array of all pages in document.

Array

Null

ReportState

Current state for document or report.

ReportStateConstants

0: acReportStateRun

ReportStateConstants

Name

Description

Value

acReportStateRun

Document in Run mode.

0

acReportStateDesign

Document in Design mode.

1

acReportStateLoading

Document is being loaded from file.

2

acReportStatePrintPreview

Document in PrintPreview mode.

3

acReportStateAnnotate

Document in annotation mode.

4

Rotate

Page Rotation

RotatePageConstants

0

RotatePageConstants

Name

Description

Value

acRotatePageLeft

90 degrees to the anti-clockwise.

-90

acRotatePageRight

90 degrees to the clockwise.

90

acRotatePageFull

180 degrees (turn page upside-down).

180

ScaleToWindow

Scale Contents to fit window.

acScaleConstants

0: acScaleNone

acScaleConstants

Name

Description

Value

acScaleNone

No scaling.

0

acScaleHorizontal

Fit page width.

1

acScaleVertical

Fit Page Height.

2

acScaleBoth

Fit whole page.

3

ShowObjectBorders

Show borders of all objects on the current page, irrespective of the object’s border property.

acShowObjectsBorders

 

ShowObjectsBorderMarker

Shows a border around every object even when the object’s border properties are not set.

Boolean

False

UnicodeFonts

Sets wheter or not Unicode (CID) fonts will be used.

Boolean

False

ZoomFactor

Zoom factor at which document is viewed.

Long (10 to 1000)

140

 

Database

 

Attribute

Description

Type

DataTableOrView

Main data table or view from which to fetch data.

String

DataSource

MDB file or an ODBC data source.

String

 

Metadata

 

Attribute

Description

Type

Default

Author

Document Author.

String

 

Creator

Document Creating application.

String

Amyuni PDF Creator

Keywords

Document Keywords.

String

 

Producer(R)

Producer (engine).

String

Amyuni PDF Creator 3.0

Subject

Document Subject.

String

 

Title

Document Title.

String

 

Metadata

Specifies the type of metadata in the document.

Long

0

Metadata

Name

Description

Value

None

No Metadata.

0

Basic

Basic XMP metadata generated by PDF Creator.

1

Custom

Custom metadata stream generated by the calling application.

2

PDFA8

PDF/A compatible metadata stream (Acrobat 8).

3

PDFA7

PDF/A compatible metadata stream (Acrobat 7).

4

MetadataStream (R)

A string containing the XML metatadata. In the case of "External", the caller can also define a custom stream that can contain any valid XML block. So for cases 1, 3, and 4, the stream is generated by PDF Creator and is read-only. For 2, the stream is fully controlled by the application.

String

Null

ExtraXMPMetadata

User specific metadata that is compatible with the standard metadata format. This is included in the metadata only if the value of Metadata is 1. See samples below.

String

Null

 

Printing

 

Attribute

Description

Type

Default

DestinationFile

Document is printed to a file as opposed to a real printer.

String

 

DuplexPrinting

Double-sided printing

acDuplexPrinting

0:acDuplexPrintingrDefault

acDuplexPrinting

Name

Description

Value

acDuplexPrintingDefault

No Metadata

0

acDuplexPrintingNever

Basic XMP metadata generated by PDF Creator.

1

acDuplexPrintingVertical

Custom metadata stream generated by the calling application.

2

acDuplexPrintingHorizontal

PDF/A compatible metadata stream (Acrobat 8).

3

FormToBinMap

Assign each paper size to a specific printer tray See samples below.

String

 

PrintAsImage

Each page is printed as a single image.

Boolean

False

PrinterName

Name of target printer.

String

 

PrinterDevMode

Devmode structure associated with target printer. See samples below.

byte[]

 

PrintSequence

Sequence in which pages are printed.

Long[]

 

ScaleToPrinter

Scale contents to fit in printed page.

acScaleConstants

0: acScaleNone

acScaleConstants

Name

Description

Value

acScaleNone

acScaleNone

acScaleNone

acScaleHorizontal

acScaleHorizontal

acScaleHorizontal

acScaleVertical

acScaleVertical

acScaleVertical

acScaleBoth

acScaleBoth

acScaleBoth

TraySelection

Determines how the control selects paper trays when printing.

Long

0

acScaleConstants

Name

Description

Value

PDF File Settings

According to settings in the PDF File, if any.

0

Destination Printer

Set by destination printer.

1

Form To Bin Map

Depending on the value of the FormToBinMap property.

2

XPagesPerSheet

Determines how many pages are printed on a single sheet of paper.

Long

1

YPagesPerSheet

Determines how many pages are printed on a single sheet of paper.

Long

1

 

Security

 

Attribute

Description

Type

Default

OwnerPassword

Owner password supplied when opening or encrypting the document.

String

 

PageNumbers

Returns the PageNumbers object.

IacObject

 

Permissions (R)

Combination of flags that determines which operations are enabled in a password protected document.

Long

-64

Permissions

Name

Description

Value

Allow Print

Printing is allowed.

4

Modify Document

User allowed to modify document contents.

8

Copy From Document

User allowed to copy content from document.

16

Edit Annotations and Fields

User is allowed to modify annotations and form fields.

32

Permissions All

User has full permissions.

-64

Security (R)

Specifies whether the document is protected by a password.

Long

0: acNoPasswordSecurity

Name

Description

Value

No Password

Document is not encrypted.

0

40 bit encryption

Document is moderately encrypted.

40

128 bit encryption

Document is strongly encrypted.

128

UserPassword

User password supplied when opening or encrypting the document.

String

 

UseSystemFonts

Whenever possible, use the fonts installed on the system rather than the fonts embedded in the PDF file.

Boolean

True

 

ExtraXMPMetadata

Custome XMP metadata must be a buffer of XML that described an xml element names "rdf :Description", which should define a new namespace, and, rdf :about must be a blank string. Below is an example buffer, where the bold-italic text should be replaced by developer specific values.

 

Example:

<rdf:Description rdf:about='' xmlns:namespace='your-name-space'>

. . .

Your own XML content here.

. . .

</rdf:Description>

 

FormToBinMap

This is a string of the format:

(Printer1) Size1 Tray1 Size2 Tray2 (Printer2) Size1 Tray1 Size2 Tray2.

 

Example in C#:

// Printer: Amyuni PDF Converter

// Size: 5 * Legal (8.5 x 14 in.)

// Tray: 256  * ID bin value generated by printer

axPDFCreactiveX1.set_ObjectAttribute("Document", "FormToBinMap", "(HP Lasertjet 4100) 5 256 3 257");

// 0: PDF file setting if any

// 1: Set by the destination printer

// 2: Set depending on the FormToBinMap

axPDFCreactiveX1.set_ObjectAttribute("Document", "TraySelection", 2);

//Print to default printer

axPDFCreactiveX1.Print("", 0);

 

PrinterDevMode

 

Example in C#:

private void buttonPrinterSetup_Click(object sender, System.EventArgs e)

{

// This method causes the printer setup page to show. When OK is

// pressed the PrinterDevMode property is set in the document.

pdf.PrinterSetup();

// Now that the property is set, we can call get_ObjectAttribute

//to retrieve its value. The value is a byte array.

object set1 = pdf.get_ObjectAttribute("Document", "PrinterDevMode" );

/* Here, we directly set the same value we obtained. We could however, have saved it aside and used the     command below to restore the printer settings to settings1 after the user had brought up and changed  the printer settings a few times.*/

pdf.set_ObjectAttribute("Document", "PrinterDevMode", set1);

}