PDFsharp & MigraDoc Foundation

PDFsharp - A .NET library for processing PDF & MigraDoc Foundation - Creating documents on the fly
It is currently Thu Mar 28, 2024 3:12 pm

All times are UTC


Forum rules


Please read this before posting on this forum: Forum Rules



Post new topic Reply to topic  [ 5 posts ] 
Author Message
PostPosted: Fri May 24, 2019 3:36 am 
Offline

Joined: Wed Mar 06, 2013 3:53 pm
Posts: 22
I have a report that has not changed in years. This weekend, suddenly started getting this error. I won't rule out that this might not be bad data on my part, but have no idea where to go. This report is more than 1,000 pages long, it's not going to be easy to find the bad data.

I couldn't possible include all of the code here, this report is far too complex. It's crashing on the 'RenderDocument()';

PdfDocumentRenderer myRender = new PdfDocumentRenderer(true);
myRender.Document = myDocument;
myRender.RenderDocument();
myRender.Save(reportPath);

StackTrace:
at System.ThrowHelper.ThrowArgumentOutOfRangeException(ExceptionArgument argument, ExceptionResource resource)
at MigraDoc.Rendering.TableRenderer.FinishLayoutInfo(Area area, XUnit currentHeight, XUnit startingHeight)
at MigraDoc.Rendering.TableRenderer.Format(Area area, FormatInfo previousFormatInfo)
at MigraDoc.Rendering.TopDownFormatter.FormatOnAreas(XGraphics gfx, Boolean topLevel)
at MigraDoc.Rendering.FormattedDocument.Format(XGraphics gfx)
at MigraDoc.Rendering.DocumentRenderer.PrepareDocument()
at MigraDoc.Rendering.PdfDocumentRenderer.PrepareDocumentRenderer(Boolean prepareCompletely)
at MigraDoc.Rendering.PdfDocumentRenderer.PrepareRenderPages()
at MigraDoc.Rendering.PdfDocumentRenderer.RenderDocument()


Top
 Profile  
Reply with quote  
PostPosted: Fri May 24, 2019 9:44 am 
Offline
PDFsharp Expert
User avatar

Joined: Wed Dec 09, 2009 8:59 am
Posts: 339
briankitt wrote:
This report is more than 1,000 pages long, it's not going to be easy to find the bad data.
If we had the 1000 pages we could start searching for the cause. Without a single page I don't know where to start searching.
An MDDDL file might help us.
http://pdfsharp.net/wiki/MigraDocDDL.ashx

_________________
Öhmesh Volta ("() => true")
PDFsharp Team Holiday Substitute


Top
 Profile  
Reply with quote  
PostPosted: Fri May 24, 2019 6:21 pm 
Offline

Joined: Wed Mar 06, 2013 3:53 pm
Posts: 22
I'll work on getting a file as per your request.


Top
 Profile  
Reply with quote  
PostPosted: Fri May 24, 2019 8:36 pm 
Offline

Joined: Wed Mar 06, 2013 3:53 pm
Posts: 22
I worked to get it as small as I can, yet, still have the issue. Raw file is still 20 MB

I hope .rar works for you. When I used .zip it exceeded maximum size.


Attachments:
MDDDL.rar [87.25 KiB]
Downloaded 373 times
Top
 Profile  
Reply with quote  
PostPosted: Tue May 28, 2019 5:43 am 
Offline

Joined: Wed Mar 06, 2013 3:53 pm
Posts: 22
I found the problem!

There was one situation, where I had a table initialized, but due to a quirky logic error, I initialized it a second time, before I added the columns.

However, this for sure did happen on the old release, and the old release ignored it. This code has not changed in a long time, so PDFSharp used to handle this.

So I fixed my logic error, and I'm working fine now. It would be helpful to have a slightly more useful error message.

The DDL does show that I have a table with no columns or rows.


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 138 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