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

Free Support Forum - aspose.com

Saving/retrieving custom properties to/from PDF

I am setting properties on a word document, then saving as both a pdf and as a docx file.

in my SaveAsPDF function, I am calling setting the options as:

PdfSaveOptions pOptions = new PdfSaveOptions();
pOptions.CustomPropertiesExport = PdfCustomPropertiesExport.Metadata;

I have also tried setting pdfCustomPropertiesExport.Standard.

wasn’t sure what to include in my load options, so I have set to this:

PdfLoadOptions loadOptions = new PdfLoadOptions();
AsposeDocument = new Aspose.Words.Document(aFile, loadOptions);

when I save as a docx file, I have no issue retrieving the custom properties.
image.png (5.4 KB)

when I save as a pdf file, however -
if I use standard, then the result it total garbage:
image.png (4.0 KB)

if I use metadata, retrieving the properties is resulting in an access violation

code I’m using to add properties:

AsposeDocument.CustomDocumentProperties.Add(Name, Value.ToString());

code I’m using to get properties:

public string getValue(string Name)
{
      CustomDocumentProperties props;
      props = AsposeDocument.CustomDocumentProperties;
      DocumentProperty aProp = props[Name];
      return aProp.ToString();
}

Metadata.zip (83.8 KB)
standard.zip (83.7 KB)

attached are the files that are output. standard.zip is where I saved pdf with standard setting, metadata.zip is where I saved pdf with metadata setting

@conniem Thank you for reporting this problem to us. I have logged it as WORDSNET-23315. We will keep you informed and let you know once it is resolved.