Rank: Newbie Groups: Member
Joined: 6/25/2015 Posts: 1
|
Hi there,
I am trying to create a pdf with no margins using the code below. Thin white lines on the top and right sides of the pdf. The only way I can get the lines to disappear is if I use whole numbers for the PageSize/OutputArea which isn't a solution as we need the content to fit on standard paper sizes. Please help.
Thanks.
public static byte[] ConvertHtml(string html) {
var stream = new MemoryStream();
var options = new HtmlToPdfOptions(); options.PageSize = new SizeF(8.3f, 11.8f); options.OutputArea = new RectangleF(0.0f, 0.0f, 8.3f, 11.8f); options.AutoFitX = HtmlToPdfAutoFitMode.ScaleToFit; HtmlToPdf.ConvertHtml(html, stream, options);
return stream.ToArray();
}
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,229
|
Hi,
Your code is fine. Most likely the line is caused by something in your HTML. So you will want to use a regular browser to load the HTML and see if you can find what's in the HTML that caused it.
Thanks!
|