Welcome Guest Search | Active Topics | Sign In | Register

ASPXToPDF Single page rendering Options
Seb
Posted: Tuesday, July 5, 2011 8:29:38 AM
Rank: Newbie
Groups: Member

Joined: 7/5/2011
Posts: 4
Hi,

I'm very interested by this solution, it's a fine work.

I have just a last question without answer :
Can we render a web page in a single pdf page ? it's mean the size will be reduce, I agree.
A firefox module do that, it's call "ScreenGrab".

Can you tell me if it's possible, and how ? (if it work I'll buy this control)

Thanks a lot,
Best regards.
eo_support
Posted: Tuesday, July 5, 2011 9:12:40 AM
Rank: Administration
Groups: Administration

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

It is possible if you know the page height. In that case you can set HtmlToPdf.Options.ZoomLevel to manually scale down the page.

Currently the converter support automatically zooming based on page width (setting HtmlToPdf.Options.AutoFitWidth to true), but not on height. If you can wait for a few days, we can add the height option for you. Once we add that, you would set both AutoFitWidth and AutoFitHeight to true, then the converter will automatically fit the HTML page into a single page.

Thanks!
Seb
Posted: Tuesday, July 5, 2011 9:35:42 AM
Rank: Newbie
Groups: Member

Joined: 7/5/2011
Posts: 4
Thanks i just want a little detail :

When I use : ASPXToPDF1.RenderAsPDF(); it work fine, perfect result or near (just need a single page now :p )

but with : HtmlToPdf.ConvertHtml(Session["HTML"].ToString(), @"c:\\test.pdf"); it doesn't work, i don't have any pictures (for example)

I tried to do :

EO.Pdf.HtmlToPdf.Options.PageSize = EO.Pdf.PdfPageSizes.A4;
EO.Pdf.HtmlToPdf.Options.AutoFitWidth = true;
EO.Pdf.HtmlToPdf.Options.ZoomLevel = 10;

ASPXToPDF1.RenderAsPDF();

To see if the parameters change something but it seems no...
Is it normal ?

PS : Tell me when you have put the height autofit, i want to try before buy it :)
eo_support
Posted: Tuesday, July 5, 2011 10:29:42 AM
Rank: Administration
Groups: Administration

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

Check whether you have set HtmlToPdf.Options.BaseUrl. For example, if you have HTML like "<img src='whatever.gif' /> in your HTML, then it will work fine with ConvertUrl/RenderAsPDF but will not work with ConvertHtml unless you set BaseUrl because there is no way for the converter to know the full image Url for that case.

We will reply this thread again when implement AutoFitHeight.

Thanks!
Seb
Posted: Wednesday, July 6, 2011 2:14:32 AM
Rank: Newbie
Groups: Member

Joined: 7/5/2011
Posts: 4
Hi,

i'm sorry but i can't do work the control.
I explain, i want to print the screen like it is show in the webbrowser with users data who's enter on my page. And if i call ConvertUrl it'll reload a page an i lost all data...

The control :
<eo:ASPXToPDF runat="server" ID="ASPXToPDF1" />
with
ASPXToPDF1.RenderAsPDF();

Work fine but i want to set parameters on it for a single page.

If i use ConvertHtml with full path of all my pictures they print them but the disposition isn't right.
I use Absolute position in my css.

The best solution would be something like :

<eo:ASPXToPDF runat="server" ID="ASPXToPDF1" AutoFitHeight="True" />
With
ASPXToPDF1.RenderAsPDF();

Is it possible ?
eo_support
Posted: Wednesday, July 6, 2011 8:37:43 AM
Rank: Administration
Groups: Administration

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

You can just set the parameters before calling RenderAsPDF. For example:

Code: C#
//Set the conversion options. Note that AutoFitHeight does not exist 
//yet, so this code only set AutoFitWidth. Once we add that you will
//be able to set AutoFitWidth at here too
HtmlToPdf.Options.AutoFitWidth = true; 

//Do the conversion
ASPXToPDF1.RenderAsPDF();


Hope this helps.

Thanks
eo_support
Posted: Friday, July 8, 2011 10:32:48 AM
Rank: Administration
Groups: Administration

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

We have posted a new build (.52) that implemented AutoFitX and AutoFitY property:

http://doc.essentialobjects.com/library/4/eo.pdf.htmltopdfoptions.autofitx.aspx
http://doc.essentialobjects.com/library/4/eo.pdf.htmltopdfoptions.autofity.aspx

AutoFitX is an enhancement to AutoFitWidth (Setting AutoFitWidth to true is the same as setting AutoFitX to "ShrinkToFit"). AutoFitY is newly added.

In order to fit your web page into a single PDF page, you would need to set both to "ScaleToFit".

Hope this helps. Please feel free to let us know if you have any more questions.

Thanks!
Seb
Posted: Monday, July 11, 2011 3:48:58 AM
Rank: Newbie
Groups: Member

Joined: 7/5/2011
Posts: 4
It work fine !
Good job.

I'm going to by it.

Thanks a lot.
eo_support
Posted: Monday, July 11, 2011 10:09:44 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,194
Glad to hear that it works for you!


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.