PDFsharp - moved to http://forum.pdfsharp.net/ Forum Index PDFsharp - moved to http://forum.pdfsharp.net/
Please visit the new PDFsharp forum at http://forum.pdfsharp.net/
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Important Notice: We regret to inform you that our free phpBB forum hosting service will be discontinued by the end of June 30, 2024. If you wish to migrate to our paid hosting service, please contact billing@hostonnet.com.
RenderDocument Too sLow

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    PDFsharp - moved to http://forum.pdfsharp.net/ Forum Index -> Support - moved to http://forum.pdfsharp.net/
View previous topic :: View next topic  
Author Message
CarlosMag



Joined: 04 May 2008
Posts: 1
Location: Argentina

PostPosted: Sun May 04, 2008 7:51 pm    Post subject: RenderDocument Too sLow Reply with quote

Hello...

I'm building a Table in a PDF Document in a ASP.NET 2.0 Web Site with then MigraDoc.DocumentObjectModel.Document.

I make a Table with 400 rows (more or less) and when I Render the Document it uses 100% of CPU and it taking a long time to resolve this.

This is my Document generation code.

// Create a new MigraDoc document
Document document = new Document();

document.Info.Title = "MyFileName";
document.Info.Subject = "MySubject";
document.Info.Author = "MyAuthor";
Section section = document.Sections.AddSection();

Table table = new Table();
table.Borders.Width = 0.75;
table.Format.Font.Size = 8;

Column column;
for (Int32 i = 0; i < Headers.Length;i++ ) //Headers is an Array with the Headers List Names
{
column = table.AddColumn(Unit.FromCentimeter(2));
switch (dt.Columns[i].DataType.FullName)
{
case "System.Decimal":
case "System.Int16":
case "System.Int32":
case "System.Int64":
case "System.Double":
column.Format.Alignment = ParagraphAlignment.Right;
break;
case "System.DateTime":
column.Format.Alignment = ParagraphAlignment.Center;
break;
default:
column.Format.Alignment = ParagraphAlignment.Left;
break;
}
}

//Header Row
Row row = table.AddRow();
Cell cell;
row.Shading.Color = Colors.PaleGoldenrod;
for (int i = 0; i < Headers.Length; i++)
{
cell = row.Cells[i];
cell.AddParagraph(Headers[i]);
}

//Data Rows
foreach (DataRow oRow in dt.Rows) //dt is a DataTable
{
row = table.AddRow();
for (int i = 0; i < Headers.Length; i++)
{
cell = row.Cells[i];
cell.AddParagraph(Convert.ToString(oRow[i]));
}
}

table.SetEdge(0, 0, Headers.Length, dt.Rows.Count, Edge.Box, BorderStyle.Single, 1.5, Colors.Black);

table.KeepTogether = false;

section.Add(table);

PdfDocumentRenderer renderer = new PdfDocumentRenderer();
renderer.Document = document;
renderer.RenderDocument(); //Here is the Slow code

There is something wrong?
Thanks afterhand
CarlosMag
Back to top
View user's profile Send private message MSN Messenger
Thomas Hoevel



Joined: 16 Oct 2006
Posts: 387
Location: Cologne, Germany

PostPosted: Mon May 05, 2008 8:11 am    Post subject: Reply with quote

Hello!

This is a known issue.
Previous discussion
This will be optimized in a future release of PDFsharp.
_________________
Regards
Thomas Hoevel
PDFsharp Team
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    PDFsharp - moved to http://forum.pdfsharp.net/ Forum Index -> Support - moved to http://forum.pdfsharp.net/ All times are GMT
Page 1 of 1

 
Jump to:  
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 vote in polls in this forum


Powered by phpBB © phpBB Group. Hosted by phpBB.BizHat.com


Start Your Own YouTube Clone

Free Web Hosting | Free Forum Hosting | FlashWebHost.com | Image Hosting | Photo Gallery | FreeMarriage.com

Powered by PhpBBweb.com, setup your forum now!
For Support, visit Forums.BizHat.com