|*Hi ITexters,

  reading through what's available online, I've managed to get 
HTMLWorker to successfully parse HTML to PDF.  It works alright! :)

  I see that I can specify a *||*StyleSheet*||*, but 
http://itext.ugent.be/library/api/com/lowagie/text/html/simpleparser/StyleSheet.html
 
is horribly sparse; which tag/key/value combinations are supported by 
the loadTagStyle(str,str,str) function?

  The best I could find was a snippet on someone's blog, supposedly 
taken from the IText in Action book:

**********
Document document = new Document();
StyleSheet st = new StyleSheet();
st.loadTagStyle("body", "leading", "16,0");
try {
PdfWriter.getInstance(
document, new FileOutputStream("html2.pdf"));
document.open();
ArrayList p = HTMLWorker.parseToList(
new FileReader("../resources/example.html"), st);
for (int k = 0; k < p.size(); ++k)
document.add((Element)p.get(k));
}
catch(Exception e) {
e.printStackTrace();
}
document.close();
*||***********


*||*    Not entirely useful! :)  Any references appreciated.  Just want 
to get into styling text, colors, fonts, backgrounds, etc.

Tia


*|

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions
Buy the iText book: http://itext.ugent.be/itext-in-action/

Reply via email to