Hi,
I'm using PDFDocument to generate a PDF, it works as expected. But at the same time, I need to generate a png/image from the same PDF, so I'm trying to use PdfViewer to export as image but having issues with the pdfStream.
These are the steps I'm doing:
-------------
PdfDocument document = new PdfDocument();
...
create pdf contents
...
MemoryStream pdfStream = new MemoryStream();
document.Save(pdfStream);
SfPdfViewer pdfViewer = new SfPdfViewer();
pdfViewer.LoadDocument(pdfViewer);
var imageStream = pdfViewer.ExportAsImage(0);
document.Close(true);
----------------
The issue is that the call to LoadDocument closes the pdfStream and makes the line: var imageStream = pdfViewer.ExportAsImage(0); to fail with an error.
Can you please help?
Many thanks!