I am using the latest version of Aspose.PDF for .NET 19.1.
I can still reproduce the issue. Here is some sample code:
using System;
using System.IO;
using Aspose.Pdf;
namespace AsposePDFsample
{
public class Program
{
public static Stream CreateStream(string path, FileAccess fileAccess)
{
return new FileStream(path, FileMode.Open, fileAccess, fileAccess == FileAccess.Read ? FileShare.ReadWrite : FileShare.None);
}
public static void Main(string[] args)
{
Console.WriteLine("Please enter the path of the PDF document!");
string path = Console.ReadLine();
using (var stream = CreateStream(path, FileAccess.ReadWrite))
{
using (var pdfDocument = new Document(stream))
{
pdfDocument.Info.Keywords = "Sample Keyword";
pdfDocument.Save(stream);
}
}
Console.ReadKey();
}
}
}