Hi Guys,

 

I'm trying to create a PDF using HTMLWorker, but the problem is, the generated 
pdf is not showing the blue color and underline for any hyperlink.

 

Below is my code :

 

import java.io.FileOutputStream;
import java.io.FileReader;
import java.util.ArrayList;

import com.lowagie.text.Document;
import com.lowagie.text.Element;
import com.lowagie.text.html.simpleparser.HTMLWorker;
import com.lowagie.text.html.simpleparser.StyleSheet;
import com.lowagie.text.pdf.PdfWriter;

public class MainClass {
public static void main(String[] args) throws Exception {
Document document = new Document();
StyleSheet styles = new StyleSheet();
// styles.loadTagStyle("a", "underline", "1");
PdfWriter.getInstance(document, new FileOutputStream("html3.pdf"));
document.open();


ArrayList objects;
objects = HTMLWorker.parseToList(new FileReader("tempHtml.html"), styles);
for (int k = 0; k < objects.size(); ++k)
document.add((Element) objects.get(k));

document.close();
}
}
 
Attached are the two files.
 
any help is highly appreciated.
 
Thanks
Rahul


_________________________________________________________________
Twice the fun—Share photos while you chat with Windows Live Messenger.
http://www.microsoft.com/india/windows/windowslive/messenger.aspx

Attachment: html3.pdf
Description: Adobe PDF document

Heading 1
Content comes here Hyperlink come other content. 

  • Content comes here;
  • Content comes here;


Heading 2
Content comes here Hyperlink.

  • Content comes here;
  • Content comes here;

 

 

------------------------------------------------------------------------------
This SF.net email is sponsored by:
High Quality Requirements in a Collaborative Environment.
Download a free trial of Rational Requirements Composer Now!
http://p.sf.net/sfu/www-ibm-com
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions

Buy the iText book: http://www.1t3xt.com/docs/book.php

Reply via email to