PDFsharp & MigraDoc Foundation

PDFsharp - A .NET library for processing PDF & MigraDoc Foundation - Creating documents on the fly
It is currently Mon Jul 15, 2024 2:55 pm

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: Tue Jun 12, 2012 4:01 am 
Offline

Joined: Tue Jun 12, 2012 3:35 am
Posts: 1
I need to create a arbitrary size page, especially with a huge height. So, I tried the sample HelloWorld project, and add page like this :

PdfDocument document = new PdfDocument();
document.Info.Title = "Created with PDFsharp";
PdfPage page = document.AddPage();
page.Width = 400;
page.Height = 14400;

XGraphics gfx = XGraphics.FromPdfPage(page);
XPdfFontOptions options = new XPdfFontOptions(PdfFontEncoding.Unicode, PdfFontEmbedding.Always);
XFont font = new XFont("Times New Roman", 20, XFontStyle.BoldItalic);
gfx.DrawString("Hello, World!", font, XBrushes.Black,
new XPoint(0, 80));
// Save the document...
const string filename = "HelloWorld_tempfile.pdf";
document.Save(filename);
// ...and start a viewer.
Process.Start(filename);


I can only set the page height less or equal to 14400. If I set a number large that this, nothing will be save in the PDF file.
Could anyone tell me how to create a page higher that 14400? or 14400 is the upper limit?
Thank you.


Top
 Profile  
Reply with quote  
PostPosted: Wed Jun 13, 2012 8:12 am 
Offline
PDFsharp Guru
User avatar

Joined: Mon Oct 16, 2006 8:16 am
Posts: 3101
Location: Cologne, Germany
Hi!
Adobe PDF Reference wrote:
The minimum allowed page size is 3 by 3 units in default user space; the maximum
is 14,400 by 14,400 units.

That's a size of 200" or 5.12 metres.

_________________
Regards
Thomas Hoevel
PDFsharp Team


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 62 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