You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We have a PDF with a crop box that doesn't match the media box and we want to create a new PDF without any cropping but whose appearance matches the original when opened in Acrobat or any other reader.
Expected Behavior
Expected behavior is that
XPdfForm.PointWidth and XPdfForm.PointHeight should take the crop box into account
Calling XGraphics.DrawImage when the source image is an XPdfForm should take the crop box into account
Even if those functions don't take the crop box into account, I ought to be able to use the crop box as the srcRect for XGraphics.DrawImage
Actual Behavior
The source page always reports dimensions based on the media box and never the crop box
When I attempt to use the crop box as the srcRect for XGraphics.DrawImage, the image is squished.
Steps to Reproduce the Behavior
See issue submission template for code.
Use XPdfForm.FromStream to open the source PDF and then set the page index.
Create a new destination PDF and PDF page using the width and height of the source page's crop box
Use the XPdfForm object as the source image in a call to XGraphics.DrawImage
Use the source crop box dimensions as the srcRect
Note
I tried this with both the current stable version as well as the new version (PDFSharp-GDI), both from nuget. In the attached code, the WPF project is using the new PDFSharp-GDI. The other projects are using the current stable version. So this is still an issue in the current release candidate.
Thanks!
The text was updated successfully, but these errors were encountered:
I can only speak for myself. Most likely I will not address this with the next NuGet release.
I want to release a new "stable" version before tackling bigger changes that could lead to new bugs.
________________________________
From: Thomas Hövel <[email protected]>
Sent: Tuesday, May 1, 2018 1:07:16 PM
To: empira/PDFsharp
Cc: Peter Moore; Author
Subject: Re: [empira/PDFsharp] Issues with Crop Boxes, XPdfForm, and XGraphics.DrawImage (#54)
I can only speak for myself. Most likely I will not address this with the next NuGet release.
I want to release a new "stable" version before tackling bigger changes that could lead to new bugs.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub<empira/PDFsharp#54 (comment)>, or mute the thread<https://github.com/notifications/unsubscribe-auth/AInpM75o-SV4YVg74eZL6dI42Fb60oG-ks5tuKRUgaJpZM4TaGcg>.
Resources
Issue Submission Code
PNM PDFSharp Issue Submission 2018-04-18.zip
Reporting an Issue Here
We have a PDF with a crop box that doesn't match the media box and we want to create a new PDF without any cropping but whose appearance matches the original when opened in Acrobat or any other reader.
Expected Behavior
Expected behavior is that
XPdfForm.PointWidth
andXPdfForm.PointHeight
should take the crop box into accountXGraphics.DrawImage
when the source image is anXPdfForm
should take the crop box into accountsrcRect
forXGraphics.DrawImage
Actual Behavior
srcRect
forXGraphics.DrawImage
, the image is squished.Steps to Reproduce the Behavior
See issue submission template for code.
XPdfForm.FromStream
to open the source PDF and then set the page index.XPdfForm
object as the source image in a call toXGraphics.DrawImage
srcRect
Note
I tried this with both the current stable version as well as the new version (PDFSharp-GDI), both from nuget. In the attached code, the WPF project is using the new PDFSharp-GDI. The other projects are using the current stable version. So this is still an issue in the current release candidate.
Thanks!
The text was updated successfully, but these errors were encountered: