We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Custom properties missing when saving as PDF

If I save a word document as pdf, custom properties are not saved, See code below:

var wdoc = new Document();

wdoc.BuiltInDocumentProperties.Title = "My Title";

wdoc.CustomDocumentProperties.Add("prop1", "val1");

wdoc.CustomDocumentProperties.Add("prop2", "val3");

wdoc.CustomDocumentProperties.Add("prop3", "val3");

wdoc.Save(@"c:\WORD.docx", Aspose.Words.SaveFormat.Docx);

wdoc.Save(@"c:\PDF.pdf", Aspose.Words.SaveFormat.Pdf);

In PDF.pdf file standard property (Title = My Title) exists, but all custom properties are missing.

Any suggestions?

Thank you

Alexei

Hi Alexei,

Thanks for your inquiry. Please use the PdfSaveOptions.ExportCustomPropertiesAsMetadata property to get or set a value determining whether or not to export CustomDocumentProperties as Metadata. The default value is false. When this value is set to true custom document properties are exported in PDF document as metadata.

The namespace of exported properties in XMP packet is “custprops”. Every property has an associated xml-element “custprops:Property1”, “custprops:Property2” and so on. There is “rdf:Description” element inside property element. The description element has two elements “custprops:Name”, containing custom property’s name as a value of this xml-element, and “custprops:Value”, containing custom property’s value as value of this xml-element.


var wdoc = new Document();

wdoc.BuiltInDocumentProperties.Title = "My Title";

wdoc.CustomDocumentProperties.Add("prop1", "val1");

wdoc.CustomDocumentProperties.Add("prop2", "val3");

wdoc.CustomDocumentProperties.Add("prop3", "val3");

wdoc.Save(MyDir + "WORD.docx", Aspose.Words.SaveFormat.Docx);

PdfSaveOptions options = new PdfSaveOptions();

options.ExportCustomPropertiesAsMetadata = true;

wdoc.Save(MyDir + "PDF.pdf", options);

This is not what I wan, I would like to see my custom properties in Document Properties / Custom tab. They don't appear there....

Any suggestions?

Thank you,

Alexei

Hi Alexei,

Thanks for your inquiry. Unfortunately, Aspose.Words does not support the requested feature at the moment. However, I have logged this feature request as WORDSNET-10048 in our issue tracking system. You will be notified via this forum thread once this feature is available.

We apologize for your inconvenience.

The issues you have found earlier (filed as WORDSNET-10048) have been fixed in this .NET update and this Java update.


This message was posted using Notification2Forum from Downloads module by aspose.notifier.