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 

migradoc tables and adding new pages when out of space

 
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
erik_buchanan@yahoo.com



Joined: 20 Feb 2009
Posts: 8

PostPosted: Fri Feb 20, 2009 11:26 pm    Post subject: migradoc tables and adding new pages when out of space Reply with quote

I found a couple of posts talking about migradoc auto adding pages when you've run out of space, but it doesn't seem to to do this working with tables.

If this is the case is there a way to determine your current position in the document or the remaining space as you're generating the document?

Any help would be great, thanks.
Back to top
View user's profile Send private message
erik_buchanan@yahoo.com



Joined: 20 Feb 2009
Posts: 8

PostPosted: Mon Feb 23, 2009 9:59 pm    Post subject: Here's the code - hope somebody will see what I'm missing. Reply with quote

I get 1 page with 57 rows.
Again thanks for any help...

using System.Data.Sql;
using System.Data.SqlClient;
using MigraDoc.DocumentObjectModel;
using MigraDoc.DocumentObjectModel.Tables;
using MigraDoc.DocumentObjectModel.Shapes;
using MigraDoc.Rendering;
using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Text;
using System.Collections;
using System.Collections.Generic;
using System.Text.RegularExpressions;
using System.Diagnostics;
using System.IO;
using PdfSharp.Pdf;
using PdfSharp.Drawing;
using PdfSharp.Drawing.Layout;
using PdfSharp;
using PdfSharp.Pdf.IO;
using PdfSharp.Pdf.Advanced;
using System.Globalization;
using System.Xml;
using System.Xml.XPath;


public partial class make_transcript : System.Web.UI.Page
{
public string ssn;
public string sql;
public string sql1;
public string sql2;
public string sql3;
public string sql4;
public string aarts_date;
SqlDataAdapter transcript_da;
SqlDataAdapter transcript_crs_da;
SqlDataAdapter transcript_cc_da;
SqlDataAdapter transcript_crd_da;
SqlConnection sqlconnection;
DataSet transcript_ds;
DataSet transcript_crs_ds;
DataSet transcript_cc_ds;
DataSet transcript_crd_ds;
public string status;


protected void Page_Load(object sender, EventArgs e)
{
PdfDocument pdfdocument = new PdfDocument();

page1(pdfdocument);

MemoryStream stream = new MemoryStream();
pdfdocument.Save(stream, false);
Response.Clear();
Response.ContentType = "application/pdf";
Response.AddHeader("content-length", stream.Length.ToString());
Response.BinaryWrite(stream.ToArray());
Response.Flush();
stream.Close();
Response.End();
}
void page1(PdfDocument pdfdocument)
{
PdfPage page = pdfdocument.AddPage();
Document document1 = new Document();

string pagecount = "1";

Section section = document1.AddSection();

MigraDoc.DocumentObjectModel.Tables.Table table1 = section.AddTable();

Column column1 = table1.AddColumn("1.5in");
Column column2 = table1.AddColumn("4in");
Column column3 = table1.AddColumn("1.5in");

for (int P = 0; P < 200; P++)
{
Row row31 = table1.AddRow();
Paragraph paragraph31a = row31.Cells[0].AddParagraph();
paragraph31a.Style = "NORMAL";
paragraph31a.Format.Font.Name = "ARIAL";
paragraph31a.Format.Font.Size = "8";
paragraph31a.Format.Alignment = ParagraphAlignment.Left;
paragraph31a.AddText("ROW " +P.ToString());
}
MigraDoc.Rendering.DocumentRenderer docRenderer = new DocumentRenderer(document1);
docRenderer.PrepareDocument();
XGraphics gfx = XGraphics.FromPdfPage(page);
docRenderer.RenderPage(gfx, 1);
}
}
Back to top
View user's profile Send private message
Thomas Hoevel



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

PostPosted: Tue Feb 24, 2009 8:02 am    Post subject: Reply with quote

It seems you tell PDFsharp to render the first page - so you get one page.
Nothing wrong!

Look here (if you don't need XGraphics):
http://pdfsharp.s3.bizhat.com/viewtopic.php?t=592&highlight=frompdfpage

Look here (if you need XGraphics):
http://pdfsharp.s3.bizhat.com/viewtopic.php?t=556&highlight=frompdfpage
_________________
Regards
Thomas Hoevel
PDFsharp Team
Back to top
View user's profile Send private message Visit poster's website
erik_buchanan@yahoo.com



Joined: 20 Feb 2009
Posts: 8

PostPosted: Tue Feb 24, 2009 3:09 pm    Post subject: Thanks... Reply with quote

Thanks - I was pretty sure it was something I was doing or not doing.
Everything works great now.
Back to top
View user's profile Send private message
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