Hello,
Newest PDFium craches when I try use it to render PDF file page.
I included the source file to this archive:
https://fcoder.net/ex/mb/crash_report.zipMy code snippet is below.
Could you please fix this issue?
Mikhael
---
private void button1_Click(object sender, EventArgs e)
{
var sSrcPdf = @"C:\Users\Mikhael\Desktop\myliweihao\5\MP_1790218154145_6272.pdf";
var sOutFolder = @"C:\out";
using (var doc = PdfDocument.Load(sSrcPdf)) // C# Read PDF Document
{
int idx = 0;
foreach (var page in doc.Pages)
{
int width = (int)(page.Width / 72.0 * 96);
int height = (int)(page.Height / 72.0 * 96);
using (var bitmap = new PdfBitmap(width, height, true))
{
bitmap.FillRect(0, 0, width, height, FS_COLOR.White);
page.Render(bitmap, 0, 0, width, height, PageRotate.Normal, RenderFlags.FPDF_LCD_TEXT);
bitmap.Image.Save(sOutFolder + $"\\page_{idx++}", ImageFormat.Png);
}
}
}
}