Following code adds svg image
java.io.InputStream inStream = new FileInputStream("./src/imgs/"+imgname);
URI uri = universe.loadSVG(inStream,imgname);
SVGDiagram diagram = universe.getDiagram(uri);
diagram.render(graphics);
Image image = Image.getInstance(template);
image.scaleToFit(PageSize.A4.getWidth(),
PageSize.A4.getHeight());
// image.scalePercent(20);
//document.add(new Paragraph(Chunk.NEWLINE));
document.add(new Paragraph(new
Chunk(imgtitle,FontFactory.getFont("Arial Narrow", 12, Font.BOLD))));
document.add(new Paragraph(Chunk.NEWLINE));
document.add(image);
document.add(new Paragraph(Chunk.NEWLINE));
inStream.close();
Then I add some paragraph
paraStr = paraStr.replaceAll("\n", " ");
paragraph = new Paragraph
(paraStr,FontFactory.getFont("Arial Narrow", 10, Font.NORMAL));
paragraph.setIndentationLeft(120f);
paragraph.setAlignment(Element.ALIGN_LEFT);
document.add(paragraph);
In the result,
------------------------Page Break------------------------
some text/paragraphs
Image Title
{Some space}
Paragraph
----------------------Page Break ------------------------
Image
-------------------- Page Break -------------------------
Actually, it should have appeared after Image title. OR image title and image
should appear in new page, then paragraph text if allowed in page.
let me know I could able to explain my problem properly.
Thanks
- RB
------------------------------------------------------------------------------
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions
Buy the iText book: http://www.1t3xt.com/docs/book.php