Hello
I have problems with paragraph alignment. I'm using iText library to generate PDF files from HTML ones, which are in their turn generated by an XML/XSL transformation using JDom.
In the XSL document there is defined an HTML skeleton with <p> tags.
Either if I set <p align="justify"> or <p style="text-align: justify"> doesn't matter,
both don't work and I receive unformatted, left aligned paragraphs in resulting
PDF file.
I'm using SAXmyHtmlHandler from iTextXML.jar as shown :
com.lowagie.text.Document document = new com.lowagie.text.Document(PageSize.A4);
PdfWriter.getInstance(document, baos);
document.setMargins((float)80.0, (float)60.0, (float)80.0, (float)60.0);
document.addAuthor("Author of the Doc");
document.addCreator("Creator of the Doc");
document.addSubject("Subject of the Doc");
document.addCreationDate();
document.addTitle("This is the title");
SAXParser parser = SAXParserFactory.newInstance().newSAXParser();
SAXmyHtmlHandler shh = new SAXmyHtmlHandler(document);
ByteArrayInputStream bais = new ByteArrayInputStream(generatedHTMLString.getBytes());
parser.parse(bais, shh);
bais.close();
byteArray = baos.toByteArray();
document.close();
baos.close();
String pdfFileName = "test.pdf";
FileOutputStream fos = new FileOutputStream(pdfFileName);
fos.write(byteArray);
fos.close();
Could someone help me please ? Is there something wrong ?
In advance many thanks.
-------------------------------------------------------
This SF.Net email sponsored by Black Hat Briefings & Training.
Attend Black Hat Briefings & Training, Las Vegas July 24-29 - digital self defense, top technical experts, no vendor pitches, unmatched networking opportunities. Visit www.blackhat.com
_______________________________________________
iText-questions mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/itext-questions
