|
Rank: Advanced Member Groups: Member
Joined: 7/6/2011 Posts: 30
|
I want to use HtmlToPdf to convert an aspx page to pdf. The .aspx has around 80 controls (radiobuttonlists, checkboxlists, textboxes etc). and renders as a pdf of about 13 pages long.
The problem is the controls themselves only seem to render on the first page, after that I only see the text options for the radiobutton and checkboxlists and just the (visible) text from the textboxes. Am I asking too much of it? Or is there a setting somewhere that will help with this? I have the same problem with using ASPXToPDF.
My code is:
HttpResponse response = HttpContext.Current.Response; response.Clear(); response.ClearHeaders(); response.ContentType = "application/pdf"; EO.Pdf.HtmlToPdf.ConvertUrl(Request.Url.AbsoluteUri, response.OutputStream); response.End();
I also tried: ASPXToPDF1.RenderAsPDF();
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,195
|
Hi,
Please check what version you are using. There was a bug like this in older version but it has since been fixed. If the newest build does not solve the problem for you, please try to isolate the problem into a test page and send the test page page to us. Once we have that, we will be happy to take a look.
Thanks!
|
|
Rank: Advanced Member Groups: Member
Joined: 7/6/2011 Posts: 30
|
I only downloaded it this week. Could it be because it is on a trial license?
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,195
|
Hi,
It shouldn't have anything to do with the trial license.
Thanks!
|
|
Rank: Advanced Member Groups: Member
Joined: 7/6/2011 Posts: 30
|
OK. Here is a test page to illustrate the problem. My .aspx: Quote: <%@ Page Language="C#" AutoEventWireup="true" CodeFile="testpdf.aspx.cs" Inherits="Test_testpdf" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <title></title> </head> <body> <form id="form1" runat="server"> <div> <br /> <asp:LinkButton ID="LinkButtonViewPdf" runat="server" OnClick="ButtonViewPdf_Click">Create pdf</asp:LinkButton> <br /> <asp:Label ID="Label2" runat="server" Text="Question 1"></asp:Label> <asp:CheckBoxList ID="CheckBoxList1" runat="server"> <asp:ListItem Text="item 1"></asp:ListItem> <asp:ListItem Text="item 2"></asp:ListItem> <asp:ListItem Text="item 3"></asp:ListItem> <asp:ListItem Text="item 4"></asp:ListItem> <asp:ListItem Text="item 5"></asp:ListItem> <asp:ListItem Text="item 6"></asp:ListItem> </asp:CheckBoxList> <br /> <asp:Label ID="Label1" runat="server" Text="Question 2"></asp:Label> <asp:RadioButtonList runat="server"> <asp:ListItem Text="item 1"></asp:ListItem> <asp:ListItem Text="item 2"></asp:ListItem> <asp:ListItem Text="item 3"></asp:ListItem> <asp:ListItem Text="item 4"></asp:ListItem> <asp:ListItem Text="item 5"></asp:ListItem> <asp:ListItem Text="item 6"></asp:ListItem> </asp:RadioButtonList> <br /> <asp:Label ID="Label3" runat="server" Text="Question 3"></asp:Label> <asp:CheckBoxList ID="CheckBoxList2" runat="server"> <asp:ListItem Text="item 1"></asp:ListItem> <asp:ListItem Text="item 2"></asp:ListItem> <asp:ListItem Text="item 3"></asp:ListItem> <asp:ListItem Text="item 4"></asp:ListItem> <asp:ListItem Text="item 5"></asp:ListItem> <asp:ListItem Text="item 6"></asp:ListItem> </asp:CheckBoxList> <br /> <asp:Label ID="Label4" runat="server" Text="Question 4"></asp:Label> <asp:RadioButtonList ID="RadioButtonList1" runat="server"> <asp:ListItem Text="item 1"></asp:ListItem> <asp:ListItem Text="item 2"></asp:ListItem> <asp:ListItem Text="item 3"></asp:ListItem> <asp:ListItem Text="item 4"></asp:ListItem> <asp:ListItem Text="item 5"></asp:ListItem> <asp:ListItem Text="item 6"></asp:ListItem> </asp:RadioButtonList> <br /> <asp:Label ID="Label5" runat="server" Text="Question 5"></asp:Label> <asp:CheckBoxList ID="CheckBoxList3" runat="server"> <asp:ListItem Text="item 1"></asp:ListItem> <asp:ListItem Text="item 2"></asp:ListItem> <asp:ListItem Text="item 3"></asp:ListItem> <asp:ListItem Text="item 4"></asp:ListItem> <asp:ListItem Text="item 5"></asp:ListItem> <asp:ListItem Text="item 6"></asp:ListItem> </asp:CheckBoxList> <br /> <asp:Label ID="Label6" runat="server" Text="Question 6"></asp:Label> <asp:RadioButtonList ID="RadioButtonList2" runat="server"> <asp:ListItem Text="item 1"></asp:ListItem> <asp:ListItem Text="item 2"></asp:ListItem> <asp:ListItem Text="item 3"></asp:ListItem> <asp:ListItem Text="item 4"></asp:ListItem> <asp:ListItem Text="item 5"></asp:ListItem> <asp:ListItem Text="item 6"></asp:ListItem> </asp:RadioButtonList> <br /> <asp:Label ID="Label7" runat="server" Text="Question 7"></asp:Label> <asp:CheckBoxList ID="CheckBoxList4" runat="server"> <asp:ListItem Text="item 1"></asp:ListItem> <asp:ListItem Text="item 2"></asp:ListItem> <asp:ListItem Text="item 3"></asp:ListItem> <asp:ListItem Text="item 4"></asp:ListItem> <asp:ListItem Text="item 5"></asp:ListItem> <asp:ListItem Text="item 6"></asp:ListItem> </asp:CheckBoxList> <br /> <asp:Label ID="Label8" runat="server" Text="Question8"></asp:Label> <asp:RadioButtonList ID="RadioButtonList3" runat="server"> <asp:ListItem Text="item 1"></asp:ListItem> <asp:ListItem Text="item 2"></asp:ListItem> <asp:ListItem Text="item 3"></asp:ListItem> <asp:ListItem Text="item 4"></asp:ListItem> <asp:ListItem Text="item 5"></asp:ListItem> <asp:ListItem Text="item 6"></asp:ListItem> </asp:RadioButtonList> <br /> <asp:Label ID="Label9" runat="server" Text="Question 9"></asp:Label> <asp:CheckBoxList ID="CheckBoxList5" runat="server"> <asp:ListItem Text="item 1"></asp:ListItem> <asp:ListItem Text="item 2"></asp:ListItem> <asp:ListItem Text="item 3"></asp:ListItem> <asp:ListItem Text="item 4"></asp:ListItem> <asp:ListItem Text="item 5"></asp:ListItem> <asp:ListItem Text="item 6"></asp:ListItem> </asp:CheckBoxList> <br /> <asp:Label ID="Label10" runat="server" Text="Question 10"></asp:Label> <asp:RadioButtonList ID="RadioButtonList4" runat="server"> <asp:ListItem Text="item 1"></asp:ListItem> <asp:ListItem Text="item 2"></asp:ListItem> <asp:ListItem Text="item 3"></asp:ListItem> <asp:ListItem Text="item 4"></asp:ListItem> <asp:ListItem Text="item 5"></asp:ListItem> <asp:ListItem Text="item 6"></asp:ListItem> </asp:RadioButtonList> </div> </form> </body> </html>
And the .cs Quote: using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls;
public partial class Test_testpdf : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) {
} protected void ButtonViewPdf_Click(object sender, EventArgs e) {
//Set the response header HttpResponse response = HttpContext.Current.Response; response.Clear(); response.ClearHeaders(); response.ContentType = "application/pdf";
////Convert to the output stream EO.Pdf.HtmlToPdf.Options.InvisibleElementIds = "LinkButtonViewPdf"; EO.Pdf.HtmlToPdf.ConvertUrl(Request.Url.AbsoluteUri, response.OutputStream); response.End(); } }
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,195
|
Thank you very much for the test page. We will look into it and get back to you as soon as possible.
|
|
Rank: Advanced Member Groups: Member
Joined: 7/6/2011 Posts: 30
|
Thanks. :)
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,195
|
Hi,
We tested your code with the latest build and it works fine.
Thanks
|
|
Rank: Advanced Member Groups: Member
Joined: 7/6/2011 Posts: 30
|
Thank you for checking. I've got it working now on our server, but for whatever reason it is still not playing ball on my development computer.
I have uninstalled eo.pdf and deleted the dll in the bin folder, checked that it can't see the dll, rebooted, re-downloaded the .exe from your site and reinstalled it, still no good. Ah well I can live with it.
|
|