Welcome Guest Search | Active Topics | Sign In | Register

Dynamic pdf size Options
jake
Posted: Friday, October 28, 2011 2:45:18 PM
Rank: Newbie
Groups: Member

Joined: 10/28/2011
Posts: 3
Is there a way to generate a pdf document from html using EO.pdf 2011.2 .NET that will dynamically resize the pdf document and the output area according to the html that you convert. For instance rather than forcing the converted html to scale down to fit the pdf document and its output area, I would like the pdf document and output area to resize for the html converted so it does not get cut off horizontally and split onto several pages vertically. If there is a way to do this, please let me know.
eo_support
Posted: Friday, October 28, 2011 2:50:13 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,195
Hi,

We have already replied your email. You can do that. Please see your email for details.

Thanks!
master83
Posted: Thursday, May 3, 2012 3:44:48 PM
Rank: Member
Groups: Member

Joined: 3/6/2012
Posts: 19
Can you tell me what is the solution for above problem. I have a similar problem.

Thanks!
eo_support
Posted: Thursday, May 3, 2012 3:49:37 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,195
Hi master83,

Can you PM us with your license ID first? You've been trying our product for quite a while. We will need to verify your license in order to continue offer tech support for you.

Thanks!
master83
Posted: Thursday, May 3, 2012 4:16:07 PM
Rank: Member
Groups: Member

Joined: 3/6/2012
Posts: 19
Sent you my details..

Problem i am facing is.. i have huge chunk of HTML data which i want to render in PDF. problem i facing is defining OutputArea where my pdf will be rendered. right now my pdf contents rendering on a single page and rest of the content are being cut off. i want my all data to render in pdf and if needed it should automatically shift to next page. Hope this helps to understand my problem. this is quite similar to above problem being asked by "jake".

Thanks!
eo_support
Posted: Thursday, May 3, 2012 4:32:57 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,195
Hi,

These are two completely different questions. What you described is the default behavior and you shouldn't need to do anything special to make it happen. Try to run the sample with your HTML and see if the same happens. If the same happens, try to analyze your HTML to see what triggered it. Usually as soon as you see what's triggered it, it would make complete sense to you; If it doesn't, isolate the problem into a small sample and post the sample code, we will then investigate.

Thanks!
master83
Posted: Thursday, May 3, 2012 5:29:35 PM
Rank: Member
Groups: Member

Joined: 3/6/2012
Posts: 19
Hi.

I tried some workaround and it works fine. but when i am trying to add an event for BeforeRenderPage with HtmlToPdfOptions it gives me an exception when I convert my html to pdf.

Here is an exception:

Conversion Failed. Stack empty.

here is my code for BeforeRenderPage event of HtmlToPdfOptions.

PdfPage page = e.Page;
Color bgColor = Color.FromArgb(231, 231, 231);
AcmRender render = new AcmRender(page, 0, new AcmPageLayout(new AcmPadding(0.3f, 0, 0.3f, 0.5f)));
render.SetDefPageSize(PdfPageSizes.A4);
AcmBlock footer = new AcmBlock(new AcmText("Generated on : " + DateTime.Now.ToString(StringFormatClass.BasicDateFormat)));
footer.Style.Border.Top = new AcmLineInfo(AcmLineStyle.Solid, bgColor, 0.01f);
footer.Style.Top = 10.8f;
footer.Style.FontSize = 7f;
footer.Style.HorizontalAlign = AcmHorizontalAlign.Right;
footer.Style.ForegroundColor = bgColor;
render.Render(footer);

Is there any other way to give header and footer for the page when i am using HtmlToPdfConverter?

Thanks!
eo_support
Posted: Thursday, May 3, 2012 5:31:06 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,195
The latest build will fix this problem for you.

Thanks


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.