|
Rank: Newbie Groups: Member
Joined: 10/18/2012 Posts: 6
|
Hi. I've been using the EO PDF library to generate output for large floorplan drawings that contain multiple overlaid layers. I use the following c# statements to generate the PDF:
HtmlToPdf.Options.PageSize = new SizeF(PdfPageSizes.A3.Height, PdfPageSizes.A3.Width); HtmlToPdf.Options.AutoFitX = HtmlToPdfAutoFitMode.None; HtmlToPdf.ConvertHtml(reportHtm, streamPdf);
The default 1 inch page margin appears in the resulting PDF. I've been asked to minimize the margin. To do so, I've tried:
HtmlToPdf.Options.OutputArea = new RectangleF(0.5f, 0.5f, 9f, 15f);
And various tweaks to this. Nothing I do has any effect on the margin size. Is there anything obvious that I'm not doing?
Thanks for your help, Bernie
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,195
|
|
|
Rank: Newbie Groups: Member
Joined: 10/18/2012 Posts: 6
|
Thank you for your prompt response. Should the following sequence of statements have the intended effect?
HtmlToPdf.Options.PageSize = new SizeF(PdfPageSizes.A3.Height, PdfPageSizes.A3.Width); HtmlToPdf.Options.AutoFitX = HtmlToPdfAutoFitMode.None; HtmlToPdf.Options.OutputArea = new RectangleF(0.5f, 0.5f, 9f, 15f); HtmlToPdf.ConvertHtml(reportHtm, streamPdf);
Thanks, Bernie
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,195
|
Hi,
Your code looks fine. Even though your page size is 16.5 by 11.7. So your left and top margin will be 0.5, but your right margin will be much bigger (16.5 - 0.5 - 9 = 7), and the bottom will overflow because you set your output area to be 15 inch high but your page is only 11.7 inch high.
Thanks!
|
|