Custom Property for PDF File

1.5k views Asked by At

I would like to add total page count as a custom property like ms word does as follow.

Is it possible to similar things for pdf? I am also using aspose for file conversion. I converter many kind of file types to pdf but if we want to show also the document's pagen count as the custom property.

1

There are 1 answers

2
Remy On

This is from the Aspose Newsgroup:

//open document
Aspose.Pdf.Document pdfDocument = new Aspose.Pdf.Document("Test.pdf");

//set properties
pdfDocument.Metadata["xmp:Nickname"] = "Nickname";

pdfDocument.Metadata["xmp:CreatorTool"] = "Test Value";

pdfDocument.Metadata["xmp:CustomProperty"] = "Custom Value";

//Convert to PDF/A compliant document
pdfDocument.Validate("log.xml", PdfFormat.PDF_A_1A);

pdfDocument.Convert("log.xml", PdfFormat.PDF_A_1A, ConvertErrorAction.Delete);

//save output document
pdfDocument.Save("output_XMP.pdf");

Is this what you are looking for?