[iText-questions] Problem with different font-sizes in one paragraph
Hello everybody, I want to build paragraph-objects with a couple of chunks that have different font-sizes. for example: doc.open(); Paragraph p = new Paragraph(); Chunk c = new Chunk("We hate to write dummy-sentences. "); for(int i = 0; i < 4; i++, p.add(c)); Chunk theProblem = new Chunk("Attention "); theProblem.getFont().setSize(30); p.add(theProblem); doc.add(p); As you can see the last Chunk doesn't fit to the line and overdraws some of the words above. I know that I can change the line-spacing with "p.setLeading(x);" but that changes the leading of the whole paragraph. In this case I need the spacing just in the line where the words doesn't fit. Is there an elegant way to add different leading-values to a single paragraph or have I go to the low-level-programming? -- View this message in context: http://www.nabble.com/Problem-with-different-font-sizes-in-one-paragraph-tp25748056p25748056.html Sent from the iText - General mailing list archive at Nabble.com. -- Come build with us! The BlackBerry® Developer Conference in SF, CA is the only developer event you need to attend this year. Jumpstart your developing skills, take BlackBerry mobile applications to market and stay ahead of the curve. Join us from November 9-12, 2009. Register now! http://p.sf.net/sfu/devconf ___ iText-questions mailing list iText-questions@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/itext-questions Buy the iText book: http://www.1t3xt.com/docs/book.php Check the site with examples before you ask questions: http://www.1t3xt.info/examples/ You can also search the keywords list: http://1t3xt.info/tutorials/keywords/
Re: [iText-questions] PdfPTable in a PdfPCell with indentation
I tried many ways, but it seems that there is no way to change the indentation of a single PdfPTable unless using a paragraph. I know that I can use the padding of the cell, but then i will write 2 methods with the same content: one method for changing a single table via Paragraph-Indentation and one using the padding of the cells for nested tables. The source is a XML-Document, where tables can be nested into other tables. I have a recursive method for creating tables in others so it wouldn't be a good way to use 2 methods or the same thing. -- View this message in context: http://www.nabble.com/PdfPTable-in-a-PdfPCell-with-indentation-tp23295526p23299708.html Sent from the iText - General mailing list archive at Nabble.com. -- Register Now & Save for Velocity, the Web Performance & Operations Conference from O'Reilly Media. Velocity features a full day of expert-led, hands-on workshops and two days of sessions from industry leaders in dedicated Performance & Operations tracks. Use code vel09scf and Save an extra 15% before 5/3. http://p.sf.net/sfu/velocityconf ___ iText-questions mailing list iText-questions@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/itext-questions Buy the iText book: http://www.1t3xt.com/docs/book.php Check the site with examples before you ask questions: http://www.1t3xt.info/examples/ You can also search the keywords list: http://1t3xt.info/tutorials/keywords/
[iText-questions] PdfPTable in a PdfPCell with indentation
Hi, I have a Paragraph which contains a PdfPTable, so that I can change the indentation of the table with the Paragraph. The Problem is, when I put the Paragraph with the table into another PdfPTable, the inner table isn't rendered. public static void main(String[] args) { try { Document doc = new Document(); PdfWriter writer = PdfWriter.getInstance(doc, new FileOutputStream("test01.pdf")); doc.open(); PdfPTable table1 = new PdfPTable(2); table1.addCell(new Phrase("content")); PdfPTable table2 = new PdfPTable(2); table2.addCell("content 2"); table2.addCell("content 3"); Paragraph g = new Paragraph(); //Paragraph is needed to change g.add(table2); //indentation of table2 table1.addCell(g); doc.add(table1); doc.close(); }catch(Exception e){e.printStackTrace();} } -- View this message in context: http://www.nabble.com/PdfPTable-in-a-PdfPCell-with-indentation-tp23295526p23295526.html Sent from the iText - General mailing list archive at Nabble.com. -- Register Now & Save for Velocity, the Web Performance & Operations Conference from O'Reilly Media. Velocity features a full day of expert-led, hands-on workshops and two days of sessions from industry leaders in dedicated Performance & Operations tracks. Use code vel09scf and Save an extra 15% before 5/3. http://p.sf.net/sfu/velocityconf ___ iText-questions mailing list iText-questions@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/itext-questions Buy the iText book: http://www.1t3xt.com/docs/book.php Check the site with examples before you ask questions: http://www.1t3xt.info/examples/ You can also search the keywords list: http://1t3xt.info/tutorials/keywords/