PDFsharp & MigraDoc Foundation

PDFsharp - A .NET library for processing PDF & MigraDoc Foundation - Creating documents on the fly
It is currently Sat Sep 28, 2024 3:16 am

All times are UTC


Forum rules


Please read this before posting on this forum: Forum Rules



Post new topic Reply to topic  [ 2 posts ] 
Author Message
PostPosted: Thu Jul 29, 2010 8:20 pm 
Offline

Joined: Thu Jul 29, 2010 7:53 pm
Posts: 6
Hi Guys,

I have a main table with 1 left 1 middle and 1 right column. I add all my blocks into the middle cell and leave the left and right for formatting. Each block is added to the middle column of the outer table using outertable.AddRow()[1].Elements.AddTable(CreateMyTable()); So each row within the outer table will contain some complicated inner table.

My problem is that i can't seem to get the KeepWith to work on the outer table. The PDFDocumentRenderer.Render method fails with "Object reference not set to an instance of an object" It fails when rendering with the error.

If I comment out the last line below then it works. My code seems sensible, but maybe I'm expecting it to do someting it can't

var borrowerSignatureRow = documentTable.AddRow();
borrowerSignatureRow[1].Elements.Add(CreateBorrowerSignaturetable());

var borrowerWitnessRow = documentTable.AddRow();
borrowerWitnessRow[1].Elements.Add(CreateWitnessTable(false));
borrowerSignatureRow.KeepWith = borrowerWitnessRow.Index; //If I comment this row out it works.


Top
 Profile  
Reply with quote  
PostPosted: Thu Jul 29, 2010 9:44 pm 
Offline

Joined: Thu Jul 29, 2010 7:53 pm
Posts: 6
Hi Guys,

I've resolved this one myself. It stemed from my misunderstanding of how KeepWith works. I originally thought it worked by saying Row a KeepsWith Row e whereby you specify the index of Row E. I now understand that KeepWith requires a 'Number of Rows' rather than a 'End Row Index'.

Cheers


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

All times are UTC


Who is online

Users browsing this forum: Google [Bot] and 37 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