PDFsharp & MigraDoc Foundation

PDFsharp - A .NET library for processing PDF & MigraDoc Foundation - Creating documents on the fly
It is currently Fri Aug 23, 2019 2:30 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
 Post subject: Migradoc exception
PostPosted: Fri Jun 07, 2019 2:42 pm 
Offline

Joined: Wed Nov 28, 2018 11:34 am
Posts: 3
Hello,

I've got the following error when using migradoc 1.32
Code:
   à System.Collections.ArrayList.get_Item(Int32 index)
   à MigraDoc.DocumentObjectModel.Tables.Table.get_Item(Int32 rwIdx, Int32 clmIdx)
   à MigraDoc.DocumentObjectModel.Visitors.MergedCellList.GetEffectiveBorders(Cell cell)
   à MigraDoc.Rendering.TableRenderer.FormatCells()
   à MigraDoc.Rendering.TableRenderer.InitFormat(Area area, FormatInfo previousFormatInfo)
   à MigraDoc.Rendering.TableRenderer.Format(Area area, FormatInfo previousFormatInfo)
   à MigraDoc.Rendering.TopDownFormatter.FormatOnAreas(XGraphics gfx, Boolean topLevel)
   à MigraDoc.Rendering.FormattedDocument.Format(XGraphics gfx)
   à MigraDoc.Rendering.DocumentRenderer.PrepareDocument()
   à MigraDoc.Rendering.PdfDocumentRenderer.PrepareDocumentRenderer(Boolean prepareCompletely)
   à MigraDoc.Rendering.PdfDocumentRenderer.PrepareRenderPages()
   à MigraDoc.Rendering.PdfDocumentRenderer.RenderDocument()


Any idea what is the problem ?


Top
 Profile  
Reply with quote  
 Post subject: Re: Migradoc exception
PostPosted: Fri Jun 07, 2019 3:52 pm 
Offline
PDFsharp Expert
User avatar

Joined: Sat Mar 14, 2015 10:15 am
Posts: 479
Location: CCAA
Which error? Maybe "Index out of range"?

Try 1.50 stable and use the IssueSubmissionTemplate if the problem persists.

_________________
Best regards
Thomas
(Freelance Software Developer with several years of MigraDoc/PDFsharp experience)


Top
 Profile  
Reply with quote  
 Post subject: Re: Migradoc exception
PostPosted: Tue Jun 11, 2019 4:27 pm 
Offline

Joined: Wed Nov 28, 2018 11:34 am
Posts: 3
Yes I've got an index out of range.
I've debugged with the MigraDoc-WPF source code and the error is in MergedCellList.cs line 201:
Code:
Cell bottomBorderCell = cell.Table[cell.Row.Index + cell.mergeDown, cell.Column.Index];

I've got 10 rows in the Table and cell.Row.Index == 9 and cell.mergeDown == 3. So the addition is more than 10.

However I just don't know what I have done to be out of range.
Any idea what I have done wrong ?


Top
 Profile  
Reply with quote  
 Post subject: Re: Migradoc exception
PostPosted: Wed Jun 12, 2019 9:11 am 
Offline
PDFsharp Guru
User avatar

Joined: Mon Oct 16, 2006 8:16 am
Posts: 2959
Location: Cologne, Germany
loic caouen wrote:
Any idea what I have done wrong ?
The MergeDown value is too large. You are trying to merge a row with a row that does not exist.
Assign plausible values to the MergeDown property.

_________________
Regards
Thomas Hoevel
PDFsharp Team


Top
 Profile  
Reply with quote  
 Post subject: Re: Migradoc exception
PostPosted: Thu Jun 13, 2019 4:24 pm 
Offline

Joined: Wed Nov 28, 2018 11:34 am
Posts: 3
Yes you're right, my cells number is too small compared to the merging value.
Thanks for your help.


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: Google [Bot] and 181 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