Setting Document Information
To set the document information, enter values in the Author, Comment, Company, CreationTime, Creator, Keywords, Manager, Operator, Producer, RevisionTime, Subject, and Title properties either in the designer, in code, or in the Document Information dialog box.
In the Designer
1. In the Properties window for C1PrintDocument, locate the DocumentInfo property and expand the property node.
2. Enter values and press ENTER when finished to set the property.
Note: Some properties have built-in editors to help you set the property, such as:
Clicking the ellipsis button next to the Keywords property opens the String Collection Editor, where you can enter keywords for the document.
Clicking the drop-down arrow next to the CreationTime or RevisionTime properties allows you to choose a date.
The default value for the Creator property is ComponentOne Document Engine.
In Code
The following code should be added to the Form_Load event.
To set the Author property, add the following code:
Me.C1PrintDocument1.DocumentInfo.Author = "Jane Doe"
• C#
this.c1PrintDocument1.DocumentInfo.Author = "Jane Doe";
To set the Comment property, add the following code:
Me.C1PrintDocument1.DocumentInfo.Comment = "This is a C1PrintDocument file."
• C#
this.c1PrintDocument1.DocumentInfo.Comment = "This is a C1PrintDocument file.";
To set the Company property, add the following code:
Me.C1PrintDocument1.DocumentInfo.Company = "ComponentOne"
• C#
this.c1PrintDocument1.DocumentInfo.Company = "ComponentOne";
To set the CreationTime property, add the following code:
Me.C1PrintDocument1.DocumentInfo.CreationTime = "4/4/06"
• C#
this.c1PrintDocument1.DocumentInfo.CreationTime = "4/4/06";
To set the Creator property, add the following code. The default value is ComponentOne Document Engine.
Me.C1PrintDocument1.DocumentInfo.Creator = "C1PrintPreview"
• C#
this.c1PrintDocument1.DocumentInfo.Creator = "C1PrintPreview";
To set the Keywords property, add the following code. Keywords should be separated with a space.
Me.C1PrintDocument1.DocumentInfo.Keywords = New String() {"C1PrintPreview ComponentOne C1PrintDocument"}
• C#
this.c1PrintDocument1.DocumentInfo.Keywords = new string() {"C1PrintPreview ComponentOne C1PrintDocument"}
To set the Manager property, add the following code:
Me.C1PrintDocument1.DocumentInfo.Manager = "John Smith"
• C#
this.c1PrintDocument1.DocumentInfo.Manager = "John Smith";
To set the Operator property, add the following code:
Me.C1PrintDocument1.DocumentInfo.Operator = "Joe Brown"
• C#
this.c1PrintDocument1.DocumentInfo.Operator = "Joe Brown";
To set the Producer property, add the following code:
Me.C1PrintDocument1.DocumentInfo.Producer = "ComponentOne Preview for WinForms"
• C#
this.c1PrintDocument1.DocumentInfo.Producer = "ComponentOne Preview for WinForms";
To set the RevisionTime property, add the following code:
Me.C1PrintDocument1.DocumentInfo.RevisionTime = "4/5/05"
• C#
this.c1PrintDocument1.DocumentInfo.RevisionTime = "4/5/05";
To set the Subject property, add the following code:
Me.C1PrintDocument1.DocumentInfo.Subject = "Document Creation"
• C#
this.c1PrintDocument1.DocumentInfo.Subject = "Document Creation";
To set the Title property, add the following code:
Me.C1PrintDocument1.DocumentInfo.Title = "Creating Documents with C1PrintPreview"
• C#
this.c1PrintDocument1.DocumentInfo.Title = "Creating Documents with C1PrintPreview";
In the Document Information Dialog Box
You can also set the document information properties for C1PrintDocument in the preview using the Document Information dialog box.
1. Click the Document information button located on the toolbar.
The Document Information dialog box will open.
2. Enter values in the dialog box. Note that information that has already been set will also appear.
3. When finished, click OK to close the dialog box.
|