Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BeginContainer crashes when XGraphics was created from a pdf page #123

Open
fsc-sma opened this issue Jun 7, 2024 · 3 comments
Open

BeginContainer crashes when XGraphics was created from a pdf page #123

fsc-sma opened this issue Jun 7, 2024 · 3 comments
Labels
bug Something isn't working

Comments

@fsc-sma
Copy link

fsc-sma commented Jun 7, 2024

Actual Behavior

With PDFsharp-GDI 6.1.0 the following code crashes:

var pdfDocument = new PdfDocument();
var pdfPage = pdfDocument.AddPage();

var xGraphics = XGraphics.FromPdfPage(pdfPage);
var container = xGraphics.BeginContainer();
xGraphics.EndContainer(container);

Stacktrace:

System.InvalidOperationException : _gfx
   at PdfSharp.Drawing.XGraphics.BeginContainer(XRect dstrect, XRect srcrect, XGraphicsUnit unit)
   at PdfSharp.Drawing.XGraphics.BeginContainer()

Expected Behavior

It should be possible to use containers when XGraphics was created from a pdf page.

@StLange StLange added the bug Something isn't working label Jun 7, 2024
@chrgrwilde
Copy link

Hello guys,
do see a change to get this bug fixed? This bug keeps us from updating from an old version (1.32).
Best regards
Christian

@chrgrwilde
Copy link

Analysing the code, the line throwing this exception came in with a8fe909 /
a8fe909#diff-cdb5c64e8ac174735489f0b45834e0b37717278dc7c8ba6a4ea201bc5bf9c9e7R4351

@ThomasHoevel
Copy link
Member

Thanks for the feedback. We fixed the bug a while ago and fix will be included in PDFsharp 6.2.0 Preview 2 coming later this year.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants