Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
it-linnan committed Sep 12, 2018
1 parent 75838cc commit 49bca33
Showing 1 changed file with 5 additions and 11 deletions.
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

0 comments on commit 49bca33

Please sign in to comment.