When our iScrub product uses ASPOSE to remove PDF metadata from the attached PDF created by Corel PDF Engine 15.0.0.512 the resulting PDF is damaged and cannot be opened. Adobe will report that it is “either not a supported file type or because the file was damaged … and wasn’t correctly decoded”.
This sample was also previously modified by iText Sharp but I have another sample of a PDF created by Corel that was NOT modified by iText Sharp but unfortunately can’t submit that sample. The common thread is PDFs created by Corel.
Is this something you are aware of and working on?
Thanks,
Kristen Theologus
Senior Support Analyst
Esquire Innovations
Hi Kristen,
//Open document<o:p></o:p>
Document pdfDocument = new Document("c:/pdftest/16+-+scheduling+order.pdf");
//Get properties
Console.WriteLine(pdfDocument.Metadata["xmp:CreateDate"]);
Console.WriteLine(pdfDocument.Metadata["xmp:Nickname"]);
Console.WriteLine(pdfDocument.Metadata["xmp:CustomProperty"]);
pdfDocument.RemoveMetadata();
//Save document
pdfDocument.Save(“c:/pdftest/16±+scheduling+order_Metadata_Removed.pdf”);
I will provide the code snippet soon (our developer is on another project). Please do not close issue.
Thanks,
Kristen
Hi Kristen,
Thanks for your patience. Attached is the code snippet you requested.
Hi Kristen,
_filePath=“c:/pdftest/16±+scheduling+order.pdf”;<o:p></o:p>
Document doc = new Document(_filePath);
DocumentInfo info = new DocumentInfo(doc);
info.Remove("Keywords");
info.Keywords = "keywords";
doc.OptimizeResources(Document.OptimizationOptions.All());
doc.Save(“c:/pdftest/Updated_MetaData.pdf”);
I’ve been able to confirm the problem is resolved in Aspose 9.9.0.
Thanks,
Hi Kristen,