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 

Sections in using Document

 
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
Joseph



Joined: 06 May 2009
Posts: 2

PostPosted: Fri May 08, 2009 6:14 pm    Post subject: Sections in using Document Reply with quote

I started by creating a document using PdfDocument but now realise that i need to incorporate the Document object as I need to create paragraphs that will automatically go on to another page when a page is filled. However, I have a slight problem. I create my sections using various methods and then use documentRenderer to format the document as shown below:

MigraDoc.Rendering.DocumentRenderer docR = new DocumentRenderer(doc);
docR.PrepareDocument();

if (docR.FormattedDocument.PageCount > 0)
{
int pageCount = docR.FormattedDocument.PageCount;

for (int i = 1; i < pageCount + 1; i++)
{
PdfPage newpage = document.AddPage();
newpage.Height = XUnit.FromCentimeter(29.7).Point;
newpage.Width = XUnit.FromCentimeter(21.5).Point;
gfx = XGraphics.FromPdfPage(newpage);
docR.RenderPage(gfx, i);
}
}

However, for some reason the sections are appearing on seperate pages instead of one after the other. Does anyone know why this is happening?
Back to top
View user's profile Send private message
Thomas Hoevel



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

PostPosted: Mon May 11, 2009 8:28 am    Post subject: Reply with quote

IIRC sections always start on a new page - they allow you to set a different page size etc.

If you don't want page breaks, just use one section with many paragraphs.
And you can add page breaks (if needed) within a section.
_________________
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