I am experiencing a problem whereby the line spacing seems to be
automagically changing when the content overflows to a new page. Here's the
code I've been using:
ByteArrayOutputStream ba = new ByteArrayOutputStream();
Document document = new Document();
PdfWriter writer = PdfWriter.getInstance(document, ba);
document.setPageSize(pageSize);
PdfPageEventWImage pdfEvent =
new PdfPageEventWImage(
BaseFont.createFont(baseFontPlainFileName,
BaseFont.IDENTITY_H, BaseFont.NOT_EMBEDDED),
BaseFont.createFont(baseFontBoldFileName,
BaseFont.IDENTITY_H, BaseFont.NOT_EMBEDDED),
contentLabel, contentLabelOverflow,
footerText,
headerImage, headerImgHeight, headerImgWidth,
pageOffset);
writer.setPageEvent(pdfEvent);
document.open();
Paragraph para1 = new Paragraph();
para1.setLeading(10f);
para1.add(
new Chunk(
getStringContent(content),
FontFactory.getFont(
"Arial", 10, Font.NORMAL)));
document.add(para1);
pageOffset += pdfEvent.getRelativePage();
document.close();
stream.write(ba.toByteArray());
return pageOffset;
As you can see, I tried using setLeading() but it only seems to set the
spacing on the first page. Once it overflows to the second page it seems to
revert back to some default. I have implemented a custom PdfPageEvent
(PdfPageEventWImage) and also tried setting the leading value in there on
different events, but to no avail. Any suggestions would be greatly
appreciated.
Thanks so much.
--
View this message in context:
http://itext-general.2136553.n4.nabble.com/Line-spacing-changes-on-repeater-page-tp2992533p2992533.html
Sent from the iText - General mailing list archive at Nabble.com.
------------------------------------------------------------------------------
Beautiful is writing same markup. Internet Explorer 9 supports
standards for HTML5, CSS3, SVG 1.1, ECMAScript5, and DOM L2 & L3.
Spend less time writing and rewriting code and more time creating great
experiences on the web. Be a part of the beta today.
http://p.sf.net/sfu/beautyoftheweb
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions
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