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

  • SEARCH
  • Home
  • 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 7895743
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T07:43:02+00:00 2026-06-03T07:43:02+00:00

I am not getting image in pdf i only get text, please help me,

  • 0

I am not getting image in pdf i only get text, please help me,
i’m using iteshsharp 5.2.1 from http://sourceforge.net/projects/itextsharp/

Code of default.aspx.cs

Response.ContentType = "application/pdf";
Response.Cache.SetCacheability(HttpCacheability.NoCache);
StringWriter sw = new StringWriter();
HtmlTextWriter hw = new HtmlTextWriter(sw);
savetopdf.RenderControl(hw);
StringReader sr = new StringReader(sw.ToString());
Document pdfDoc = new Document(PageSize.A4, 10f, 10f, 10f, 0f);
HTMLWorker htmlparser = new HTMLWorker(pdfDoc);
PdfWriter.GetInstance(pdfDoc, Response.OutputStream);
pdfDoc.Open();
htmlparser.Parse(sr);
pdfDoc.Close();
Response.Write(pdfDoc);
Response.End();

Code for default.aspx

<form id="form1" runat="server">
<div id="savetopdf" runat="server">
    <asp:Label ID="lbl" runat="server" Text=" Lorem Ipsum, Dolor"></asp:Label>
    <img src="http://localhost:5583/WebSite1/images/Penguins.jpg" alt="penguins" />
    <img src="http://localhost:5583/WebSite1/images/Tulips.jpg" alt="tulips" />
</div>
</form>
  • 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-06-03T07:43:03+00:00Added an answer on June 3, 2026 at 7:43 am

    HTMLWorker was buggy and has been discontinued in favor of XMLWorker.

    http://sourceforge.net/projects/itextsharp/files/xmlworker/

    The demo :

    http://demo.itextsupport.com/xmlworker/

    Even though the documentation refers to the Java API, the adaptation to C# should be straightforward :

    http://demo.itextsupport.com/xmlworker/itextdoc/index.html

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am generating a pdf file in asp.net c# using itextsharp. i am not
Please have a look at this image Grid Showing Pending Work http://softwaregenius.net/myimages/grid.png The image
I'm converting pdf to html with help GS 9.04. But in result i'm getting
I am not getting my image working. Can anyone tell me what I am
I am using recpatcha on an SSL site but I am not getting the
I'm getting Image (actually instance of Bitmap class) from resources, and (to write it
I am using TCPDF and getting content from a MySQL table row which is
I have an XML file: <root> <DATA> <NAME>ABC</NAME> <IMAGE>http://a2.ak.lscdn.net/imgs/c18196f8-374b-47d2-ad9a-3f2dec64da76/100_q60_.jpg</IMAGE> </DATA> <DATA> <NAME>lmn</NAME> <IMAGE>http://w3devadv.liveproj.com/image.php?img=/deals/2011/0905/13152281143500.jpg</IMAGE> </DATA>
I am not getting my image correctly. I am unsure what is happening. First
I am not getting any error message in browser due to curly brace missing

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.