title: Hebrew content not displayed when converting html to PDF using iTextSharp 5.5.8?
body: <p>I am using the below code to convert an Html file to Pdf using iTextSharp</p>
  
  <pre><code>    Document doc = new Document(iTextSharp.text.PageSize.A4, 10, 20, 5, 35);
      var writer = PdfWriter.GetInstance(doc, new FileStream(savePath, FileMode.Create));
  
      var xmlWorkerFontProvider = new XMLWorkerFontProvider();
      var cssAppliers = new CssAppliersImpl(new MyFontProvider());
      CssFilesImpl cssFiles = new CssFilesImpl();
      StyleAttrCSSResolver cssResolver = new StyleAttrCSSResolver(cssFiles);
  
      HtmlPipelineContext htmlContext = new HtmlPipelineContext(cssAppliers);
      htmlContext.SetTagFactory(Tags.GetHtmlTagProcessorFactory());
      htmlContext.SetImageProvider(new ITextImageHandler());
  
      IPipeline pipeline = new CssResolverPipeline(cssResolver, new HtmlPipeline(htmlContext, new PdfWriterPipeline(doc, writer)));
      XMLWorker worker = new XMLWorker(pipeline, true);
      XMLParser xmlParser = new XMLParser(true, worker, Encoding.Unicode);
  
      doc.Open();
      doc.NewPage();
      xmlParser.Parse(new StringReader(htmlString.ToString()));
      doc.Close();
  </code></pre>
  
  <p>For English content this is working fine. But if the content is in Hebrew then text is not displayed in the PDF.</p>
  
  <p>I have checked other answers related to this on Stack-overflow but they seem to use HtmlParser which is deprecated. So I don't want to use that. </p>
  
  <p>Please let me know if any thing else is required. Thanks for you time.</p>
  
  <p>Edit: After reading the comments I have tried settings the fonts as well. But still no luck. Below is the updated code.</p>
  
  <pre><code> Document document = new Document();
  
          PdfWriter writer =
              PdfWriter.GetInstance(document, new FileStream(savePath, FileMode.Create));
  
          document.Open();
  
          var cssResolver = new StyleAttrCSSResolver();
          XMLWorkerFontProvider fontProvider =
              new XMLWorkerFontProvider(XMLWorkerFontProvider.DONTLOOKFORFONTS);
          fontProvider.Register(@"E:\fonts\NotoSansHebrew-Regular.ttf");
  
  
          CssAppliers cssAppliers = new CssAppliersImpl(fontProvider);
          HtmlPipelineContext htmlContext = new HtmlPipelineContext(cssAppliers);
          htmlContext.SetTagFactory(Tags.GetHtmlTagProcessorFactory());
          htmlContext.SetImageProvider(new ITextImageHandler());
  
  
          PdfWriterPipeline pdf = new PdfWriterPipeline(document, writer);
          HtmlPipeline html = new HtmlPipeline(htmlContext, pdf);
          CssResolverPipeline css = new CssResolverPipeline(cssResolver, html);
  
  
          XMLWorker worker = new XMLWorker(css, true);
          XMLParser p = new XMLParser(worker);
  
          p.Parse(new StringReader(htmlString.ToString()));
  
          document.Close();
  </code></pre>