PDFsharp & MigraDoc Foundation

PDFsharp - A .NET library for processing PDF & MigraDoc Foundation - Creating documents on the fly
It is currently Sun Jul 14, 2024 2:45 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 Sep 29, 2011 3:00 pm 
Offline

Joined: Mon Sep 12, 2011 1:09 pm
Posts: 23
I am searching through out my code where the pdf size is defined.But i could not find that.
Please help me to find out the place to define width & height.

please find below the codesnippet i used.

public void Draw(PdfDocument doc)
{
XGraphics gfx = XGraphics.FromPdfPage(doc.AddPage());
foreach (DrawBase item in Items) {
try {

//Start New Page if PageBreak
if (item.GetType() == typeof(PageBreak)) {
if (item.IsConditionTrue())
gfx = XGraphics.FromPdfPage(doc.AddPage());
}

//Skip remaining page(s)
else if (item.GetType() == typeof(Skip)) {
if (item.IsConditionTrue())
break; //skip rest of document
}
//This will draw
else if (item.IsConditionTrue()) {
item.Draw(gfx);
}

}
catch (Exception ex) { Debug.Write("Unable to DRAW object: (" + ex.StackTrace + ")" + GetXml(item)); }
}
}


Top
 Profile  
Reply with quote  
PostPosted: Sat Oct 01, 2011 2:47 pm 
Offline
PDFsharp Expert
User avatar

Joined: Wed Dec 09, 2009 8:59 am
Posts: 343
See the Pagesizes sample:
http://www.pdfsharp.net/wiki/PageSizes-sample.ashx

_________________
Öhmesh Volta ("() => true")
PDFsharp Team Holiday Substitute


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: Bing [Bot], Google [Bot] and 17 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:  
cron
Privacy Policy, Data Protection Declaration, Impressum
Powered by phpBB® Forum Software © phpBB Group