asp.net - Error in converting aspx page to html (itextsharp 5.0.6) -


I convert this aspx page into pdf by using this code itextsharp 5.0.6: < pre> use MS = new memorystream () HTML as dim HTML string = VBCR & amp; VbLf & amp; "& Lt; h1 & gt; h1 & lt; / h1 & gt;" & Amp; VbCr & amp; VbLf & amp; "& Lt; p class =" "bo" "& gt; one paragraph & Amp; VbCr & amp; VbLf & amp; "& Lt; ul & gt;" & Amp; VbCr & amp; VbLf & amp; "

  • A & lt; / li & gt;" & Amp; VbCr & amp; VbLf & amp; & Lt; li & gt; Two & lt; / li & gt; " & Amp; VbCr & amp; VbLf & amp;
  • Three & lt; / li & gt; " & Amp; VbCr & amp; VbLf & amp; "& Lt; / ul & gt;" String = Render Controlling Structure (Page) New Style Sheet () styles as dim HTML1 dim styles. Overall Style ("Bow", "Size", "10") Style. Load tag style (HtmlTags.H1, HtmlTags.FONT, "59") styles. LoadTagStyle (HtmlTags.H1, HtmlTags.COLOR, "# ff0000") Styles LoadTextile (HtmlTags.UL, HtmlTags.INDENT, "10") Styles Using the Load Tag style (HtmlTags.LI, HtmlTags.LEADING, "16") the new document (Pages AA, 4.0F, 10.0F, 100FF, 0.0F) document .Setpose size (iTextSharp.text.PageSize .4.Rotate ()) PdfWriter.GetInstance (document, MS) document.Open () document. Add (new paragraph ("It is dimmed")) Documents. Add (new paragraph ("this is an exam")) using the sReader as the new stringbilder (HTML1) as the slow strand TextReader = New String Reader (Html1.ToString ()) as the dim list (IElement K) = HTMLWorker.ParseToList (sReader, Styles) in the list document as IElement for each Elm. Adding the Add End (End of Elm) Next End End End End

    However, I'm having an error on this line while setting the object reference to an object in an example: <> Dim list list (IElement) = HTMLWorker.ParseToList (formerly as sReader, style)

    If I changed the HTML variable HTML1 in this line of code , It's working fine.

      Using sReader as TextReader = New StringReader (Html1.ToString ())   

    Any ideas how I can correct this error Am I Private function RenderControlToString (as control control) String Dims as New StringBuilder () Dim Sw New StringWriter (sb) Mod Authorized New HtmlTextWriter (SW) Control Form As in: Here is the task. RenderControl (Author) Return sb.ToString () End Function

    Thank you for your help.

    itemprop = "text">

    (moved to answer comment)

    for iTextSharp with HTMLWorker is known in & lt problems; Hour & gt; tag Short-term solutions are just to delete those tags but for long term solution XMLWorker which supports those tags and actively develops and

  • Comments

    Popular posts from this blog

    Java - Error: no suitable method found for add(int, java.lang.String) -

    java - JPA TypedQuery: Parameter value element did not match expected type -

    c++ - static template member variable has internal linkage but is not defined -