The following code works...
Pdf pdf = new Pdf(); pdf.Author = "Tommy Wang"; pdf.Creator = "Aspose.Pdf"; pdf.Keywords = "Hello World"; pdf.Subject = "Example"; pdf.Title = "Example"; pdf.Save("c:\\test.pdf"); |
The following code has no effect what so ever...
Document doc = new Document("c:\\k272.pdf.doc"); builder = new DocumentBuilder(doc); builder.Document.BuiltInDocumentProperties["title"].Value = "Test"; //Save the document in Aspose.Pdf.Xml format into a memory stream. MemoryStream stream = new MemoryStream(); doc.Save(stream, SaveFormat.FormatAsposePdf); stream.Seek(0, SeekOrigin.Begin); //Load the document into an XmlDocument XmlDocument xmlDoc = new XmlDocument(); xmlDoc.Load(stream); //Load the XML document into Aspose.Pdf Pdf pdf = new Pdf(); pdf.IsImagesInXmlDeleteNeeded = true; pdf.BindXML(xmlDoc, null); pdf.Author = "Tommy Wang"; pdf.Creator = "Aspose.Pdf"; pdf.Keywords = "Hello World"; pdf.Subject = "Example"; pdf.Title = "TEST"; //doc.BuiltInDocumentProperties["title"].Value.ToString(); //Now produce the PDF file. pdf.Save("c:\\test.pdf"); |
I would expect the above to take the word document, add the data to the pdf and create a new pdf on the c: drive. The pdf gets created but the document properties are always blank.
I also tried adding the information to the word document (our real code uses aspose.word to create the document dynamically) but that had no effect either.
Could you have a look please as we'd like to display the course title, the company name and the department name in the property information.
Thanks
--
Stuart