Rank: Newbie Groups: Member
Joined: 6/21/2013 Posts: 2
|
I just got started with the tool and I'm looking a way where the converted document would reflect an external css file. Below is my code. Can some one post the code sample please?
Aspx ==== <head runat="server"> </head> <body> <form id="form1" runat="server"> <div> <asp:Literal runat="server" ID="Html" /> <br /> </div> </form> </body>
Code === float marginLeft = 0.5F; float marginTop = 0.5F; float marginRight = 0.5F; float marginBottom = 0.5F; bool autoFitWidth = true;
//Set page layout arguments EO.Pdf.HtmlToPdf.Options.PageSize = pageSize; HtmlToPdf.Options.OutputArea = new RectangleF( marginLeft, marginTop, pageSize.Width - marginLeft - marginRight, pageSize.Height - marginTop - marginBottom);
if (autoFitWidth) { HtmlToPdf.Options.AutoFitX = HtmlToPdfAutoFitMode.ShrinkToFit; } else { HtmlToPdf.Options.AutoFitX = HtmlToPdfAutoFitMode.None; } //HtmlToPdf.Options.BaseUrl = ResolveUrl("~/Styles/test.css"); -- Not working HtmlToPdf.ConvertHtml(Html.Text, @"C:\pdf\template.pdf");
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,195
|
Hi,
No. The styles have to be referenced by your HTML.
Thanks!
|