Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3440990
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T08:29:53+00:00 2026-05-18T08:29:53+00:00

I am using code from other question and i am getting the error as

  • 0

I am using code from other question and i am getting the error as

Error 1 The non-generic type
‘iTextSharp.text.List’ cannot be used
with type arguments

Error 2 The name ‘HTMLWorker’ does not
exist in the current context

Error 3 The type or namespace name
‘HTMLWorker’ could not be found (are
you missing a using directive or an
assembly reference?)

My code so far is as follows:

protected void Button2_Click(object sender, EventArgs e)
{
    //Extract data from Page (pd).
    Label16.Text = Editor1.Content; // Attribute    

    // makae ready HttpContext
    HttpContext.Current.Response.Clear();
    HttpContext.Current.Response.ContentType = "application/pdf";

    // Create PDF document
    Document pdfDocument = new Document(PageSize.A4, 80, 50, 30, 65);
    //PdfWriter pw = PdfWriter.GetInstance(pdfDocument, HttpContext.Current.Response.OutputStream);
    PdfWriter.GetInstance(pdfDocument, HttpContext.Current.Response.OutputStream);

    pdfDocument.Open();
    //WebClient wc = new WebClient();
    string htmlText = Editor1.Content;

    List<IElement> htmlarraylist = HTMLWorker.ParseToList(new StringReader(htmlText), null);
    for (int k = 0; k < htmlarraylist.Count; k++)
    {
        pdfDocument.Add((IElement)htmlarraylist[k]);
    }

    //pdfDocument.Add(new Paragraph(IElement));
    pdfDocument.Close();
    HttpContext.Current.Response.End();

}

Please Help me to resolve the error. What i am trying is to get the contents (non html) from htmleditor and display in a pdf file. please confirm me whether what i am trying to do is correct or not.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-18T08:29:53+00:00Added an answer on May 18, 2026 at 8:29 am

    1.Prefix your List like

    System.Collections.Generics.List<IElement> htmlarraylist
    

    2.Looks like you didn’t import the namespace of HTMLWorker

    EDIT:I googled for you ,the namespace could be any of these three.I doubt it could be the last one,but i am not sure.

    using iTextSharp.text;
    using iTextSharp.text.pdf;
    using iTextSharp.text.html.simpleparser;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm getting an issue while using EF4, when I'm trying to verify if object
Please help me figure this out. I apologize if this is a duplicate question,
Alright this is the result of a couple of other questions. It appears I
Continuing on from ideas in: Are there any provable real-world languages? I don't know
I was given an assignment to develop a very simple weather app in Android
I have a method where I am passing in two object, which have the
Just got query regarding c malloc() function. I am read()ing x number of bytes
I started learning c++ about 3 weeks ago after 2 years of java. It
I'm an experienced C++/.NET/Java Windows/web programmer trying to learn (Common) Lisp. I'm reading Practical

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.