logo
Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Options
Go to last post Go to first unread
Mikhael  
#1 Posted : Monday, September 28, 2026 8:24:34 AM(UTC)
Mikhael

Rank: Newbie

Groups: Registered
Joined: 4/7/2021(UTC)
Posts: 7
Russian Federation

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.zip

My 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);
}
}
}
}
Users browsing this topic
Guest (3)
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.