title: iTextSharp external stylesheet
body: <p>I am converting HTML to PDF using iTextSharp but am having problems with styling.</p>
  
  <p>I am using iTextSharp version 5 and am able to style the tags using the following code:</p>
  
  <pre><code>StyleSheet styles = new StyleSheet();
  styles.LoadTagStyle(HtmlTags.H1, HtmlTags.FONTSIZE, "16");
  styles.LoadTagStyle(HtmlTags.P, HtmlTags.FONTSIZE, "10");
  </code></pre>
  
  <p>I then parse the HTML and style sheet using this:</p>
  
  <pre><code>List&lt;IElement&gt; objects = HTMLWorker.ParseToList(new StringReader(htmlText), styles);
  </code></pre>
  
  <p>My question is can i import an external stylesheet in instead of having to specify each one of the tags individually?</p>
  
  <p>I have found this code on earlier posts:</p>
  
  <pre><code>builder.ImportStylesheet(Request.PhysicalApplicationPath + "CSS\\Stylesheet.css");
  </code></pre>
  
  <p>but i cannot seem to get this to work, is this from an older version of iTextSharp which has been taken out of the latest version? </p>