Advertisement
Guest User

Untitled

a guest
Apr 21st, 2014
50
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.81 KB | None | 0 0
  1. Object reference not set to an instance of an object.
  2.  
  3. string htmlText = Server.UrlDecode(content);
  4.  
  5. Document document = new Document();
  6.  
  7. StyleSheet styles = new iTextSharp.text.html.simpleparser.StyleSheet();
  8. styles.LoadTagStyle("box_wrap", "border", "1px solid #333");
  9. styles.LoadTagStyle("box_wrap", "line-height", "22px");
  10. styles.LoadTagStyle("box_wrap", "font-size", "12px");
  11. styles.LoadTagStyle("li", "list-style", "none");
  12.  
  13. PdfWriter.GetInstance(document, new FileStream(strSavePath, FileMode.Create));
  14.  
  15. document.Open();
  16. StringReader sr = new StringReader(htmlText);
  17. List<IElement> htmlarraylist = HTMLWorker.ParseToList(new StringReader(htmlText), styles);
  18.  
  19. <img id="img1" runat="server" alt="" src="../Images/hello.png" />
  20.  
  21. <img id="img1" runat="server" alt="" src="http://localhost:1605/Images/hello.png" />
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement