The example code on this javadoc page (for Document) is garbled:
http://itextdocs.lowagie.com/docs/com/lowagie/text/Document.html
(e.g., the third line has HtmlWriter.getInstance which should probably
not be part of the comment)
Looks like carriage returns got clobbered (or left out of the doc comment).
> Example:
>
> // creation of the document with a certain size and certain margins
> Document document = new Document(PageSize.A4, 50, 50, 50, 50);
> try { // creation of the different writers HtmlWriter.getInstance(
> document , System.out); PdfWriter.getInstance(
> document , new FileOutputStream("text.pdf"));
> // we add some meta information to the document
> document.addAuthor("Bruno Lowagie");
> document.addSubject("This is the result of a Test.");
> // we define a header and a footer HeaderFooter header = new
> HeaderFooter(new Phrase("This is a header."), false); HeaderFooter
> footer =
> new HeaderFooter(new Phrase("This is page "), new Phrase("."));
> footer.setAlignment(Element.ALIGN_CENTER);
> document.setHeader(header);
> document.setFooter(footer); // we open the document for
> writing document.open(); document.add(new
> Paragraph("Hello world")); } catch(DocumentException de) {
> System.err.println(de.getMessage()); } document.close();
Cheers
--
Thomas Hundt <[EMAIL PROTECTED]> +1-415-867-6698
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions