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.
Thanks for your query.
I have checked the documents but could not find relevant feature. Please provide us following data:
Sample Excel file having concerned custom properties
Sample output PDF file created by MS Excel containing these custom properties
Steps to print these properties in PDF using Excel
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:
- 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.
- 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)
- It does not appear the native office Export functionality supports this.
- 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
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
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);