Hi,
I am currently evaluating Spire.PDF: The goal is to open an existing PDF document,
change the DocumentInformation and set some new Custom Attributes (which can be found on the "Custom" Tab when you the PDF properties in Adobe Reader.
Two Questions:
A) How can I set custom attributes?
B) I have tried to set the doc properties similar to the exosting example , but by opening an existing file, they do not show up.
What am I doing wrong?
//Create a pdf document.
PdfDocument doc = new PdfDocument();
doc.LoadFromFile(@"D:\temp\Input.pdf");
//set document info
doc.DocumentInformation.Author = "Harry Hu";
doc.DocumentInformation.Creator = "Harry Hu";
doc.DocumentInformation.Keywords = "pdf, demo, document information";
doc.DocumentInformation.Producer = "Myself";
doc.DocumentInformation.Subject = "Demo of Spire.Pdf";
doc.DocumentInformation.Title = "Document Information";
//file info
doc.FileInfo.CrossReferenceType = PdfCrossReferenceType.CrossReferenceStream;
doc.FileInfo.IncrementalUpdate = false;
doc.FileInfo.Version = PdfVersion.Version1_5;
//Save pdf file.
doc.SaveToFile(@"D:\temp\Properties.pdf");
doc.Close();
regards
Holger