Free Support Forum - aspose.com

Export Custom Document Properties to Excel

Is there a way to export the values added to the Custom Document Properties collection when saving an excel to PDF? The PDF format supports custom properties and I’ve seen solutions for Aspose.Words but don’t see the same save options available for the excel save to pdf.

@stevenrogers,

Thanks for your query.

I have checked the documents but could not find relevant feature. Please provide us following data:

  1. Sample Excel file having concerned custom properties

  2. Sample output PDF file created by MS Excel containing these custom properties

  3. Steps to print these properties in PDF using Excel

  4. A sample code or document link where you found it in Aspose.Words for our reference

We will provide you our feedback once above mentioned information is available.

I’ll try to respond to these item by item:

  1. See attachment AsposeTest.xlsx(zip), this file has two custom properties set “CustomField1” and “CustomField2.” I was able to do this using the Workbook.CustomDocumentProperties list in Aspose.Cells.
  2. I can’t actually figure out a way to do this, but i’ve included a screenshot from Adobe reader showing where I would expect them to end up in the PDF File. (See AsposeTest.PNG)
  3. It does not appear the native office Export functionality supports this.
  4. I am assuming the functionality i’m looking for is the ExportCustomPropertiesAsMetadata option that’s referenced in this response. This snippet seems to be the equivalent of what I would like to do in Cells.
    Custom Properties Using Aspose.Words

AsposeTest.png (25.6 KB)
AsposeTest.zip (7.1 KB)

@stevenrogers,

Thanks for sharing the files.

I can see custom properties with names as mentioned by you and values CustomValue1, CustomValue2 respectively. But these properties are not displayed in the PDF file. That is why we need to look into it more. We have logged the issue in our database for investigation and for a fix. Once, we will have some news for you, we will update you in this topic.

This issue has been logged as

CELLSNET-46308 - Export Custom Document Properties to PDF

@stevenrogers,

We have added new API: PdfSaveOptions.CustomPropertiesExport. Please try our latest version/fix: Aspose.Cells for .NET v18.8.3:

        Workbook wb = new Workbook(srcFile);
        
        PdfSaveOptions pdfSaveOptions = new PdfSaveOptions();
        pdfSaveOptions.CustomPropertiesExport = PdfCustomPropertiesExport.Standard;

        wb.Save(destFile.pdf, pdfSaveOptions);

The issues you have found earlier (filed as CELLSNET-46308) have been fixed in Aspose.Cells for .NET v18.9. This message was posted using BugNotificationTool from Downloads module by Amjad_Sahi