Rank: Newbie
Groups: Registered
Joined: 1/20/2016(UTC) Posts: 7
|
I am getting an exception when calling page.render (note that pdf renders fine in chrome browser) Code:
using (var bmp = new PdfBitmap(width, height, BitmapFormats.FXDIB_8bppRgb, buffer, stride))
{
bmp.FillRect(0, 0, width, height, Color.White);
page.Render(bmp, 0, 0, width, height,
Patagames.Pdf.Enums.PageRotate.Normal,
Patagames.Pdf.Enums.RenderFlags.FPDF_GRAYSCALE);
using (FileStream fs = new FileStream("output.png", FileMode.Create))
{
bmp.Image.Save(fs, ImageFormat.Png);
}
}
Attempted to read or write protected memory. This is often an indication that other memory is corrupt. at Patagames.Pdf.Pdfium.FPDF_RenderPageBitmap_native(IntPtr bitmap, IntPtr page, Int32 start_x, Int32 start_y, Int32 size_x, Int32 size_y, Int32 rotate, Int32 flags) at Patagames.Pdf.Pdfium.FPDF_RenderPageBitmap(IntPtr bitmap, IntPtr page, Int32 start_x, Int32 start_y, Int32 size_x, Int32 size_y, PageRotate rotate, RenderFlags flags) at resizePDFimages.Program.makeAllthumbsHT(String pdffile, String savefolder, Int32 height) in E:\UTILS\PARSING_UTILS\C - makethumbs-ALL\Program.cs:line 338 pdf here: https://drive.google.com...kpaSGN3/view?usp=sharingEdited by moderator 9 years ago
| Reason: Not specified
|