This is a migrated thread and some comments may be shown as answers.

Howto set PDF-"Document Information" properties when exporting

3 Answers 150 Views
RichTextBox
This is a migrated thread and some comments may be shown as answers.
Mi
Top achievements
Rank 1
Mi asked on 01 Jul 2012, 02:56 PM
Hi!

I need to set some document information keys of an exported PDF-file.

In an exported PDF-file, all I can see are some hardcoded(?) properties like Producer="Telerik RadRichTextBox" and Creator.

How can I set Title, Subject, Keywords, Creator and Author of the exported PDF-File?

Thanks!

3 Answers, 1 is accepted

Sort by
0
Accepted
Kammen
Telerik team
answered on 04 Jul 2012, 01:42 PM
Hi Mi,
Unfortunately these are hard-coded in the current version. We, however, decided to expose such settings in PdfExportSettings class through DocumentInfo property. The new property will be available in the next LIB (Latest Internal Build), expected next week, and will be officially included in 2012 Q2 SP1, expected in late July.
How to change the default PdfExportSettings can be found in this help article.

We have added points to your account for the suggestions. Don't hesitate to contact us if you have other questions.

Kind regards,

Kammen
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

0
Robert
Top achievements
Rank 1
answered on 05 Jul 2012, 12:33 PM
Are document properties available for the XAML documents? Or is this still to come?

For example, I would like to be able to record a document version type. As my current project expands and I add more features to the RadRichTextBox, I will need some way to determine if the document being Imported was created as a version 1, 2 or 3 etc.

Thanks.
0
Mihail
Telerik team
answered on 10 Jul 2012, 01:39 PM
Hello Rob,

RadDocument does not have such document properties, as such properties are not directly related to the implementation of RadRichTextBox, but to the specific use of the control. Logically, this information does not belong to the document and had better be saved somewhere else.

For example, if you are saving the documents in a database, what you can do is to add a field to store this information. In case you are saving the documents as files, this meta data can be included in the name of the file or even in the path where you store the document.

Having said that, if you still believe that the document is the right place to include such metadata, there is a way to add this information to the document. You could use the DocumentVariables property of RadDocument like this:

this.editor.Document.DocumentVariables.Add("DocumentVersion", 5);

This property will be exported like this:
<t:RadDocument.DocumentVariableList>
  <t:DocumentVariableInfo Name="DocumentVersion" Value="5" />
</t:RadDocument.DocumentVariableList>

and after import, its value can be retrieved as follows:
this.editor.Document.DocumentVariables["DocumentVersion"]

 I hope this answers your question.

All the best,
Mihail
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

Tags
RichTextBox
Asked by
Mi
Top achievements
Rank 1
Answers by
Kammen
Telerik team
Robert
Top achievements
Rank 1
Mihail
Telerik team
Share this question
or