Hi Team,
We recently updated the Aspose.PDF.dll version 23.6.
After updating we are getting below error while adding a Image to the PDF.
I could find the same error reported in below thread long back but couldn’t find any solutions. Is there a fix/any workaround for this?
https://forum.aspose.com/t/could-not-load-file-or-assenbly-aspose-imaging-version-22-5-0-0/247892
Code snippet:
Pdf.Document pdfDoc = new Pdf.Document();
using (MemoryStream byteStream = new MemoryStream(documentData))
{
pdfDoc.Pages.Add();
Pdf.Page page = pdfDoc.Pages[1];
page.AddImage(byteStream, page.GetPageRect(false));
}
return pdfDoc;
Error Message:
Invalid image stream (Could not load file or assembly ‘Aspose.Imaging, Version=23.5.0.0, Culture=neutral, PublicKeyToken=716fcc553a201e56’ or one of its dependencies. The system cannot find the file specified.)
Exception Type: System.ArgumentException
HResult: -2147024809
Source: Aspose.PDF
TargetSite: Void #=zXQkmo1II5XgQ0jUe4g==(System.IO.Stream, #=z7azlXfd9OpQr4VVGb9m8NmF3mZO7w$O40A1Q8bI5L5vb, #=zlZ6ALFULL_R9eHH9k$jWkxNungh9dSi1kQ==, Int32, System.Drawing.Image ByRef, System.IO.Stream)
StackTrace: at Aspose.Pdf.XImageCollection.#=zXQkmo1II5XgQ0jUe4g==(Stream #=zmpvdKoU=, #=z7azlXfd9OpQr4VVGb9m8NmF3mZO7w$O40A1Q8bI5L5vb #=zKfBOf64=, #=zlZ6ALFULL_R9eHH9k$jWkxNungh9dSi1kQ== #=z6pggJ6g=, Int32 #=zsEszqF4=, Image& #=z_By7zjaqCkw5, Stream #=zWR41AD1JbkLhocm$a39ZwyM=)
at Aspose.Pdf.XImageCollection.#=zydts02x$JdnV(Int32 #=z9vEF16M=, Stream #=zmpvdKoU=, Int32 #=zsEszqF4=, Boolean #=zLCBPEfrSgOmK, ImageFilterType #=zmDdsHME=, Byte #=z9FHAFJq6$PAY, Boolean #=zMmM23$I=, String& #=z8RLGq7Dy_rCF, Stream #=zWR41AD1JbkLhocm$a39ZwyM=, Boolean #=zbbDYaV7IQDsL, Boolean #=zGJd3z5yaTKDMCPuSqg==)
at Aspose.Pdf.XImageCollection.#=zydts02x$JdnV(Int32 #=z9vEF16M=, Stream #=zmpvdKoU=, Int32 #=zsEszqF4=, Boolean #=zLCBPEfrSgOmK, ImageFilterType #=zmDdsHME=, Boolean #=zMmM23$I=, Stream #=zWR41AD1JbkLhocm$a39ZwyM=)
at Aspose.Pdf.XImageCollection.#=zqjEKHF8=(Stream #=zmpvdKoU=, Int32 #=zsEszqF4=, Boolean #=zLCBPEfrSgOmK, ImageFilterType #=zmDdsHME=, Boolean #=zMmM23$I=, Stream #=zWR41AD1JbkLhocm$a39ZwyM=)
at Aspose.Pdf.Page.#=zK6vdKsI=(Stream #=zmpvdKoU=, Rectangle #=zKx8r14U=, Matrix #=z4w0OXZ66Cio7, CompositingParameters #=z8ClHcqAd42oaZV9lA102QC0=, Boolean #=z4U88DFg=, Boolean #=zLCBPEfrSgOmK, #=zlZ6ALFULL_R9eHH9k$jWk_qQmuhrxEotgQ==& #=zaGimHjXiNp1L, Stream #=zWR41AD1JbkLhocm$a39ZwyM=, Boolean #=zY$MXQN8=, Int32 #=zDTlckp9JCtRO)
at Aspose.Pdf.Page.#=zK6vdKsI=(Stream #=zmpvdKoU=, Rectangle #=zKx8r14U=, Matrix #=z4w0OXZ66Cio7, CompositingParameters #=z8ClHcqAd42oaZV9lA102QC0=, #=zlZ6ALFULL_R9eHH9k$jWk_qQmuhrxEotgQ==& #=zaGimHjXiNp1L, Boolean #=zY$MXQN8=, Int32 #=zDTlckp9JCtRO)
at Aspose.Pdf.Page.#=zK6vdKsI=(Stream #=zmpvdKoU=, Rectangle #=zKx8r14U=, CompositingParameters #=z8ClHcqAd42oaZV9lA102QC0=)
at Aspose.Pdf.Page.AddImage(Stream imageStream, Rectangle imageRect)
Thank You!