PDFsharp & MigraDoc Foundation

PDFsharp - A .NET library for processing PDF & MigraDoc Foundation - Creating documents on the fly
It is currently Sun Jul 14, 2024 7:12 pm

All times are UTC


Forum rules


Please read this before posting on this forum: Forum Rules



Post new topic Reply to topic  [ 3 posts ] 
Author Message
PostPosted: Thu Feb 27, 2014 2:18 pm 
Offline

Joined: Thu Feb 27, 2014 2:00 pm
Posts: 2
Hello,

4 times out of 10 , I receive an error with the size of a control.

The XSize.FromSizeF(SizeF size) throws a WidthAndHeightCannotBeNegative exception and the width is coming as a small negative number.

This is the call stack :

PdfSharp.Drawing.XSize..ctor(Double width, Double height) in C:\...\PDFsharp\code\PdfSharp\PdfSharp.Drawing\XSize.cs:ligne 60
PdfSharp.Pdf.PdfRectangle.get_Size() in C:\...\PDFsharp\code\PdfSharp\PdfSharp.Pdf\PdfRectangle.cs:ligne 301
PdfSharp.Pdf.AcroForms.PdfTextField.RenderAppearance() in C:\...\PDFsharp\code\PdfSharp\PdfSharp.Pdf.AcroForms\PdfTextField.cs:ligne 144
PdfSharp.Pdf.AcroForms.PdfTextField.set_Text(String value) in C:\...\PDFsharp\code\PdfSharp\PdfSharp.Pdf.AcroForms\PdfTextField.cs:ligne 64

I can't figured it out , because when I modify the field size of a control and retry (Fake modification) , it's always works then.

Does someone have any clue :?:

Thanks


Top
 Profile  
Reply with quote  
PostPosted: Thu Feb 27, 2014 2:24 pm 
Offline
PDFsharp Guru
User avatar

Joined: Mon Oct 16, 2006 8:16 am
Posts: 3101
Location: Cologne, Germany
Hi!

I don't have a clue. An SSCCE might help us to replicate the problem.

_________________
Regards
Thomas Hoevel
PDFsharp Team


Top
 Profile  
Reply with quote  
PostPosted: Thu Mar 20, 2014 5:35 pm 
Offline

Joined: Thu Feb 27, 2014 2:00 pm
Posts: 2
I resolved my problem by adding Math.abs(). in the PdfRectangle class where my problem was detected.


Attachments:
2014-03-20_1330_001.png
2014-03-20_1330_001.png [ 4.97 KiB | Viewed 5529 times ]
2014-03-20_1330.png
2014-03-20_1330.png [ 6.28 KiB | Viewed 5529 times ]
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 44 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Privacy Policy, Data Protection Declaration, Impressum
Powered by phpBB® Forum Software © phpBB Group