from the API documentation:

     Paragraph

public*Paragraph*(String  
<http://java.sun.com/j2se/1.5.0/docs/api/java/lang/String.html>  string)

   Constructs a |Paragraph| with a certain |String|.

   *Parameters:*
       |string| - a |String|


This does not state that html is converted. Where did you get that idea?

On 6/07/2011 23:07, Ankit Desai wrote:
Hello,

I am using following code to display HTML content in PDF. Functionality is
to generate a PDF on a button click. Data is coming from database in string
format. Code is a below.

response.setContentType("application/pdf");
response.setHeader("Content-disposition","inline; filename=Report.pdf");

PdfWriter writer2 = PdfWriter.getInstance(doc, response.getOutputStream());

doc.open();

chapter = new Chapter(new Paragraph("Overview", CHAPTER_TITLE_FONT), 1);
section = chapter.addSection(new Paragraph("References\n",
SECTION_TITLE_FONT));
         String pRef = "<ol><li><strong><u><em>number
1</em></u></strong></li><li><strong><u><em>number2</em></u></strong></li><li><strong><u><em>number3</em></u></strong></li></ol>"
    // String coming from data base.

section.add(new Paragraph(pRef));
doc.add(chapter);

Here String pRef is coming from data base.

Now when I open the PDF document, it shows that string as plain text with
HTML tags. It should behave as HTML and display on PDF as HTML text not like
plain text with tags.

-Ankit

--
View this message in context: 
http://itext-general.2136553.n4.nabble.com/How-to-display-HTML-content-in-PDF-tp3650004p3650004.html
Sent from the iText - General mailing list archive at Nabble.com.

------------------------------------------------------------------------------
All of the data generated in your IT infrastructure is seriously valuable.
Why? It contains a definitive record of application performance, security
threats, fraudulent activity, and more. Splunk takes this data and makes
sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-d2d-c2
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions

iText(R) is a registered trademark of 1T3XT BVBA.
Many questions posted to this list can (and will) be answered with a reference 
to the iText book: http://www.itextpdf.com/book/
Please check the keywords list before you ask for examples: 
http://itextpdf.com/themes/keywords.php

--
@redlabbe <http://twitter.com/redlabbe>
redlab-log <http://www.redlab.be/blog>
------------------------------------------------------------------------------
All of the data generated in your IT infrastructure is seriously valuable.
Why? It contains a definitive record of application performance, security 
threats, fraudulent activity, and more. Splunk takes this data and makes 
sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-d2d-c2
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions

iText(R) is a registered trademark of 1T3XT BVBA.
Many questions posted to this list can (and will) be answered with a reference 
to the iText book: http://www.itextpdf.com/book/
Please check the keywords list before you ask for examples: 
http://itextpdf.com/themes/keywords.php

Reply via email to