We have tested the scenario using Aspose.PDF for .NET 19.1 and were unable to notice any issue. Would you please try using latest version of the API and in case you still face any issue, please share our input PDF document with us. We will test the scenario in our environment and address it accordingly.
We have tested the scenario in our environment using your document with Aspose.PDF for .NET 19.1 and were still unable to notice any issue. For you kind reference, a resultant PDF is also attached.
Would you please make sure if you are using latest version of the API. In case issue still persists, please share a sample console application which is able to reproduce the issue. We will again test the scenario in our environment and address it accordingly.
The issue is occurring due to usage of same stream object for both loading and saving the document. In case you need to save document using Streams, please try using following code snippet which creates correct output:
using (var stream = CreateStream(dataDir + "0.AcroX.pdf", FileAccess.ReadWrite))
{
using (var fstream = new FileStream(dataDir + "outputuptu.pdf", FileMode.Create))
{
using (var pdfDocument = new Document(stream))
{
pdfDocument.Info.Keywords = "Sample Keyword";
pdfDocument.Save(fstream);
}
}
}
In that case you can use Document.Save() method without any argument to save PDF. We have tested the scenario using this method and noticed that PDF document was not getting updated. Therefore, we have logged an issue as PDFNET-45965 in our issue tracking system for correction. We will further look into details of the issue and keep you posted with the status of its correction. Please be patient and spare us little time.
We regret to share that earlier logged ticket is not yet resolved due to other high priority issues in the queue. However, we have recorded your concerns and will definitely consider them during investigation of the issue. As soon as some significant updates are available, we will share with you. Please spare us little time.