|
Rank: Newbie Groups: Member
Joined: 6/25/2015 Posts: 4
|
hi,
i have problem when generate pdf using RenderAsPDF() method .pdf file goes to shrink to left .we have three instance on server and two of working right and live application have this issue. i am not able find out . plz give some solution
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,229
|
Hi, The converter will try to automatically detect the page width and then use that to calculate zoom factor. See here for more details: http://www.essentialobjects.com/doc/pdf/htmltopdf/auto_fit.aspxSometimes if you have JavaScript code or CSS that adds very wide element, or CSS didn't get loaded correctly, then it would trigger the output to be resized incorrectly. So you can try to comment them out step by step to see what triggers the problem. If the problem is related to CSS, then you can check whether the DNS is setup properly on your server: http://www.essentialobjects.com/doc/web/aspxtopdf/troubleshoot.aspxThanks!
|
|
Rank: Newbie Groups: Member
Joined: 6/25/2015 Posts: 4
|
Hi,
i also check DNS setting in hosts file in drivers folder here my site url map to server local ip.not to public ip this is my code sample please check in this code i simply use it ,if need to work more then plz suggest me asap, protected void ToPDF_BeforeRender(object sender, EventArgs e) { try { if (Convert.ToString(ConfigurationManager.AppSettings["isLandScape"]) == "True") { HtmlToPdf.Options.PageSize = new System.Drawing.SizeF(11.5f, 11.9f); //HtmlToPdf.Options.PageSize = new System.Drawing.SizeF(PdfPageSizes.A4.Height, PdfPageSizes.A4.Width); } HtmlToPdf.Options.NoScript = false; HtmlToPdf.Options.MaxLoadWaitTime = 1000000; } catch { } } most of the report i have in landscape layout .i simply define a4 height as width and width as height . could you please check this code .in some report i used convertHtml() method and define output area but in this report also having shrink issue page layout as landscape.
thanks
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,229
|
Hi,
Your code looks fine. You probably want to comment contents out of your original HTML page block by block in order to find out what triggers the problem. very often as soon as you find out the trigger it would start to make sense to you.
Thanks!
|
|
Rank: Newbie Groups: Member
Joined: 6/25/2015 Posts: 4
|
Hi,
could you tell me what kind of html content to block?
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,229
|
We have no idea. You just need to try and find out.
|
|