Document Settings


OOo contains numerous document options; these are available in the Tools Options dialog. For example, Text Document contains a Print tab, which allows graphics to be printed, or not. The typical method for modifying properties in a document involves using either "get" and "set" methods , or directly accessing object properties. To access advanced document settings, however, you must use a completely different method. First the document has to create an object that supports the document settings. Every document type, except for the Math type, has the ability to create a service using the createlnstance() method. Table 20 contains a list of the properties common to all of the document setting types.

Table 20: Common document properties in com.sun.star.document.Settings.

Property

Description

ForbiddenCharacters

Allow access to otherwise forbidden characters .

LinkUpdateMode

The update mode for links when loading text documents.

PrinterName

Printer used by the document.

PrinterSetup

Platform- and driver-dependent printer setup data.

IsKernAsianPunctuation

Is kerning applied to Asian punctuation?

CharacterCompressionType

Compression (character spacing) used for Asian characters.

ApplyUserData

Should user -specific settings saved in a document be loaded again?

SaveVersionOnClose

Is a new version created when a modified document is closed?

UpdateFromTemplate

Should a document be updated when its creation template changes?

FieldAutoUpdate

Are text document fields automatically updated?

Current DatabaseDataSource

Name of the data source from which the current data is taken.

Current DatabaseCommand

Displayed object's name (or the SQL statement used).

Current Data baseCommandType

Specifies how to interpret the DataTableName property.

DefaultTabStop

Default tab width.

IsPrintBooklet

Is the document printed as a booklet (brochure)?

IsPrintBookletFront

If True, only the front pages of a booklet are printed.

IsPrintBookletBack

If True, only the back pages of a booklet are printed.

PrintQuality

Quality to use when printing.

ColorTableURL

URL of the color table (SOC file) showing a palette in dialogs that use colors.

PrinterIndependentLayout

If true, do not use printer metrics for layout.

Specific document settings services exist for Writer, Calc, Draw, and Impress documents (see Table 21 ). Although each of these services implements the Settings service as shown in Table 20, all of the properties except for PrinterName and PrinterSetup are optional.

Table 21: Specific document settings service types.

Document Settings Service

Document Type

com.sun.star.text.DocumentSettings

Writer

com.sun.star.sheet.DocumentSettings

Calc

com.sun.star.drawing. DocumentSettings

Draw

com.sun.star.presentation.DocumentSettings

Impress

As shown in Listing 34 and Figure 14, the Writer document settings support the PrintSettings service (see Table 22 ). The Draw and Impress document settings services each contain special settings that apply only to their respective document types.

Table 22: Properties defined by the com.sun.star.text.PrintSettings service.

Property

Description

PrintGraphics

If True, print graphic object.

PrintTables

If True, print text tables.

PrintDrawings

If True, print shapes .

PrintLeftPages

If True, print left pages.

PrintRightPages

If True, print right pages.

PrintControls

If True, print control contained in the document.

PrintReversed

If True, print the pages in reverse order, starting with the last page.

PrintPaperFromSetup

If True, use the paper tray specified for the system printer. If False, use the paper tray specified by the page style.

PrintFaxName

Name of the fax.

PrintAnnotationMode

Specify how notes are printed. Uses com.sun.star.text.NotePrintMode enumerated value. Possible values include NOT, ONLY, DOC_END, or PAGE_END.

PrintProspect

If True, prospect printing is used; however, I cannot find a definition for prospect printing.

PrintPageBackground

If True, the background color and/or background graphic is printed.

PrintBlackFonts

If True, characters are always printed in black.




OpenOffice.org Macros Explained
OpenOffice.org Macros Explained
ISBN: 1930919514
EAN: 2147483647
Year: 2004
Pages: 203

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net