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

Free Support Forum - aspose.com

Migrating from Aspose 20 to 22 makes PdfSavingOptions change from SavingOptions to FixedSavingOptions

Greetings!
Migrating from Aspose 20 to 22 makes PdfSavingOptions change from SavingOptions to FixedSavingOptions.
In the early version, the one using version 20.5.0, we have:

new Aspose.Words.Saving.PdfSaveOptions
{
    Compliance = Aspose.Words.Saving.PdfCompliance.PdfA1b,
    OptimizeOutput = true,
    PageIndex = firstPage,
    PageCount = pageCount
}

Using the newer version, the 22.5.0, this code returns an error due to FixedSavingOptions doesn’t have PageCount attribute.
I need the old routine.
Is there a way of doing it without rewritting the old class?

Thank you!

@mjmorales Instead of PageIndex and PageCount properties you should use FixedPageSaveOptions.PageSet. In your case code should look like the following:

new Aspose.Words.Saving.PdfSaveOptions
{
    Compliance = Aspose.Words.Saving.PdfCompliance.PdfA1b,
    OptimizeOutput = true,
    PageSet = new PageSet(new PageRange(firstPage, firstPage + pageCount))
};

Unfortunately, you will have to rewrite your code.