title: CSS does not apply while converting HTML to PDF using iTextSharp XMLWorker
body: <p>I am currently working on a POC to demonstrate conversion of HTML to PDF using iTextSharp XMLWorker class.</p>
  
  <ol>
  <li>The CSS file is linked to HTML file using link tag. </li>
  <li>The path of CSS file is a file server path. Its the same directory as the HTML file.</li>
  </ol>
  
  <p>I use the below function to perform the operation. The PDF file gets generated but the CSS file is not applied.</p>
  
  <pre><code>public void Html2Pdf(FileStream inputHtml, Document doc, PdfWriter pdfWriter)
  {
     var cssFiles = new CssFilesImpl();
     cssFiles.Add(XMLWorkerHelper.GetCSS(new FileStream(@"C:\Test_HTML2PDF\Test.css",FileMode.Open)));
     var cssResolver = new StyleAttrCSSResolver(cssFiles);
  
     var htmlContext = new HtmlPipelineContext(new CssAppliersImpl(new XMLWorkerFontProvider()));
     htmlContext.SetAcceptUnknown(true).AutoBookmark(true).SetTagFactory(Tags.GetHtmlTagProcessorFactory());
  
     htmlContext.SetPageSize(new Rectangle(doc.Left, doc.Bottom, doc.Right, doc.Top));
  
     // Pipelines
  
     var pdf = new PdfWriterPipeline(doc, pdfWriter);
          var html = new HtmlPipeline(htmlContext, pdf);
          var css = new CssResolverPipeline(cssResolver, html);
  
     var worker = new XMLWorker(css, true);
     var parser = new XMLParser(worker, Encoding.UTF8);
     parser.Parse(inputHtml, Encoding.UTF8);     
  }
  </code></pre>
  
  <p>Kindly share your inputs / observations on what i have missed and what could be done address this issue.</p>