Exception in Saving PDF document

When we are opening and saving this PDF document using Aspose.PDF, an exception is raised

   public static void OpenSave(String sourcePath, String OutputPath)
    {
        Document document = new Document(sourcePath);
        document.Save(OutputPath);
        Console.ReadLine();
    }

Please find StrackTrace of exception

at #=zDUgL8jwm$0K5xoMgYJvSl3rYvSI3ZEksM6FMpfg1FAsw$07XhyZryvg=.#=z5kv9J0XGeOrE()
at #=zDUgL8jwm$0K5xoMgYJvSl3rYvSI3ZEksM6FMpfg1FAsw$07XhyZryvg=.#=zcH_Sd$I=()
at #=ztbI98D3PO5f$Mdhi2bmH9h5JdKzzDisQaZeboKRrS6h1f1pnaFiDjRE=.#=zfZrTHC8=()
at #=zDUgL8jwm$0K5xoMgYJvSl3rYvSI3ZEksM6FMpfg1FAsw$07XhyZryvg=.#=zmNkgaQY=(XmlTextWriter #=z3oProAA=, PdfFormat #=zjG5WWXo=, Document #=znuxannU=, Boolean #=zV_1Anq192S3b, ConvertErrorAction #=z6UxTngE=)
at Aspose.Pdf.Document.#=zrsUNOe8=(XmlTextWriter #=z3oProAA=, PdfFormat #=zjG5WWXo=, Boolean #=zV_1Anq192S3b, ConvertErrorAction #=z6UxTngE=)
at Aspose.Pdf.Document.#=zuO43z5WC9S4I(Stream #=zq1uhYC0=, SaveOptions #=zcoAPxT8fjLuM)
at Aspose.Pdf.Document.#=zcA$RKQk0I$aR(String #=zATXmD3etxRSS)
at Aspose.Pdf.Document.Save(String outputFileName)
at AsponsePDF.Program.OpenSave(String sourcePath, String OutputPath)
1afcd1ba-924b-43a8-b0de-321d8149f84b.zip (184.4 KB)

@crshekharam

The issue seems related to PDF/A compliance which is applied to the source PDF document. After removing the compliance, the document gets resaved successfully:

Document doc = new Document(dataDir + "1afcd1ba-924b-43a8-b0de-321d8149f84b.pdf");
doc.RemovePdfaCompliance();
doc.Save(dataDir + "resave.pdf");

resave.pdf (205.7 KB)