Hi Marc,
Thank you for using Syncfusion products.
In order to resolve the exception “Java.IO.IoException: cannot create document. Error 3” , we need to reset the memory stream position to 0 before loading it into SfPdfViewer. Please find the code snippet below which is used to resolve the exception:
Code Snippet:
using (Stream fileStream = typeof(App).GetTypeInfo().Assembly.GetManifestResourceStream(files[0]))
{
var pdfLoadedDocument = new PdfLoadedDocument(fileStream, true);
using (MemoryStream stream = new MemoryStream())
{
pdfLoadedDocument.Save(stream);
pdfLoadedDocument.Close(true);
stream.Position = 0;
pdfViewerControl.LoadDocument(stream);
}
} |
We have also attached simple sample for your reference in the below link to get rid of this exception:
Please try this and let us know whether it resolved the issue at your end.
Regards,
Sathish