I already have PDF files on the network share. I just want to display the PDF in an image control using Image.ImageURL = “image.ashx” so when the page reposts the handler returns an output stream which updates the image.
So far the only thing I’ve found that works is a complex process of converting the PDF (in sPath) to a memorystream using PDFConverter and SavaAsTIFF (you might to check your spelling on Sava).
PdfConverter conv = new PdfConverter();
conv.BindPdf(sPath);
conv.DoConvert();
MemoryStream ms = new MemoryStream();
conv.SavaAsTIFF(ms);
Then I convert the memory stream to a bitmap bmp
Bitmap bmp = new Bitmap(ms);
and finally saving the bitmap -
bmp.Save(Context.Response.OutputStream, ImageFormat.Jpeg);
That works, but there HAS to be a simpler way!
P.S. The original PDF can have multiple pages, each of which I want to display separately, as thumbnails.
This message was posted using Page2Forum from Fill Pdf Form Fields - Aspose.Pdf.Kit Demos