We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Aspose PDF .NET Incremental Update

Hello,

I see that in Aspose PDF for Java, Document class have a method called saveIncrementally but it is missing in .NET version. Is there a way to save incrementally a PDF even in .Net?
Thanks

@gdiedoardo

You can use Document.Save Method to Save document incrementally (i.e. using incremental update technique).

For example, you can try the following code and share your feedback.

    FileStream fs = new FileStream(dataDir + "Test.pdf", FileMode.Open, FileAccess.ReadWrite);
    Aspose.Pdf.Document thePdf = new Aspose.Pdf.Document(fs);
    ...
    //using Save() method without parameters allows incremental update
    thePdf.Save();

Thank you for your response.
With this code I work directly on the PDF file. It is a way to operate in a stream so I can work in memory?

Thanks

@gdiedoardo

You can load the input file in the MemoryStream but you may face some issues while writing back to the stream because it can not expand and MemoryStreamNotExpandable exception can be thrown.

However, as the Document Constructor supports loading the input file from a stream so please feel free to share if you somehow manage streams for incremental update.