Welcome Guest Search | Active Topics | Sign In | Register

Pdf shrink Options
prashant rawat
Posted: Friday, July 31, 2015 1:56:09 AM
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
eo_support
Posted: Friday, July 31, 2015 9:11:45 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,080
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.aspx

Sometimes 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.aspx

Thanks!
prashant rawat
Posted: Monday, August 3, 2015 2:14:54 PM
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
eo_support
Posted: Monday, August 3, 2015 2:49:23 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,080
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!
prashant rawat
Posted: Monday, August 3, 2015 3:18:30 PM
Rank: Newbie
Groups: Member

Joined: 6/25/2015
Posts: 4
Hi,

could you tell me what kind of html content to block?
eo_support
Posted: Monday, August 3, 2015 3:26:16 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,080
We have no idea. You just need to try and find out.


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.