|
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.
|
|
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!
|
|
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 :)
|
|
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!
|
|
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 ?
|
|
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
|
|
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.aspxhttp://doc.essentialobjects.com/library/4/eo.pdf.htmltopdfoptions.autofity.aspxAutoFitX 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!
|
|
Rank: Newbie Groups: Member
Joined: 7/5/2011 Posts: 4
|
It work fine ! Good job.
I'm going to by it.
Thanks a lot.
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,194
|
Glad to hear that it works for you!
|
|