title: Itext, access denied on htmlworker.parseToList
body: <p>I have spent far too long trying to work out why I am getting an access denied here so I am 
  really hoping  someone can help?
  I am using itextsharp, the latest version downloaded today.</p>
  
  <p>I am parsing an html page within my own project so I can convert it to pdf, but everytime I run 
  it I get an access denied on path c:\</p>
  
  <p>For starters I cannot work out why it's trying to access the c drive other than the website directory which it definitely has access to.</p>
  
  <p>And I have tried adding network service with full permission to everything but it didn't work.</p>
  
  <p>I even impersonated an admin user in the web config but I still got access denied.</p>
  
  <p>My code is:</p>
  
  <pre><code>  string download = new WebClient().DownloadString("http://" + HttpContext.Current.Request.Url.Host + "/pagetoparse.aspx?user=" + userName);
  
          string tempFolder = HttpContext.Current.Server.MapPath("pdfs");
          if (!Directory.Exists(tempFolder))
          {
              Directory.CreateDirectory(tempFolder);
          }
          string fileName = Path.Combine(tempFolder, "test3.pdf");
          Document document = new Document(PageSize.A4, 80, 50, 30, 65);
          try
          {
                  PdfWriter writer = PdfWriter.GetInstance(document, new FileStream(fileName, FileMode.Create));
  
                  using (StringReader stringReader = new StringReader(download))
                  {
                      List&lt;IElement&gt; parsedList = HTMLWorker.ParseToList(stringReader, null);//&lt;-- fails here!
                      document.Open();
                      foreach (object item in parsedList)
                      {
                          document.Add((IElement)item);
                      }
                      document.Close();
                  }
  
  
          }
          catch (Exception exc)
          {
              Console.Error.WriteLine(exc.Message);
          }
  
          return document;
  </code></pre>
  
  <p>It must be obvious, what I am doing wrong??</p>
  
  <p>Bex</p>