Skip to content
This repository has been archived by the owner on Aug 2, 2019. It is now read-only.

Fix #175 #176

Open
wants to merge 1 commit into
base: smooth-scroll
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 5 additions & 11 deletions PdfiumViewer/PdfPrintDocument.cs
Original file line number Diff line number Diff line change
Expand Up @@ -187,19 +187,13 @@ private void RenderPage(PrintPageEventArgs e, int page, double left, double top,
left += (width - scaledWidth) / 2;
top += (height - scaledHeight) / 2;

_document.Render(
page,
e.Graphics,
Image image = _document.Render(0,
AdjustDpi(e.Graphics.DpiX, e.PageBounds.Width),
AdjustDpi(e.Graphics.DpiX, e.PageBounds.Height),
e.Graphics.DpiX,
e.Graphics.DpiY,
new Rectangle(
AdjustDpi(e.Graphics.DpiX, left),
AdjustDpi(e.Graphics.DpiY, top),
AdjustDpi(e.Graphics.DpiX, scaledWidth),
AdjustDpi(e.Graphics.DpiY, scaledHeight)
),
PdfRenderFlags.ForPrinting | PdfRenderFlags.Annotations
);
PdfRotation.Rotate0, PdfRenderFlags.Annotations);
e.Graphics.DrawImageUnscaled(image, e.PageBounds.Location);
}

private static void Swap(ref double a, ref double b)
Expand Down