Hello,
I am creating a
multi-page document in whcih I am embedding images. Below, as you can see, I
have a table, where the left side is some simple text, and the left side is a
embeded thumbnail. All works well, but when I queries upon 10,000 images, the
JVM on my local box(testing) was holding all the data in memory. And of
course, I noticed a huge performance impact. So when I run on production,
someone can query on 100,000 images, and may bring the box
down.
So in the case of
what I am attempting to do, is there a way to perform virtual writes, while I am
creating the document?
Thanks,
Scott
Paragraph headline = new Paragraph("Query
Show Images", headFont);
headline.setAlignment(Paragraph.ALIGN_CENTER);
document.add(headline);
headline.setAlignment(Paragraph.ALIGN_CENTER);
document.add(headline);
String query = "select * from asset where path like '%hiddenval%'";
RowEnum re = dh.getRows(query);
Table tw = new
Table(2);
Cell
c1;
while (re.next()) {
c1 = new Cell(new Paragraph(re.getString("path")));
tw.addCell(c1);
// if image good
if (isImageValid(re.getString("asset_id"))) {
c1 = embedImage(re.getString("asset_id"), new Cell());
tw.addCell(c1);
} else {
c1 = new Cell("Default Image.");
tw.addCell(c1);
}
}
document.add(tw);
while (re.next()) {
c1 = new Cell(new Paragraph(re.getString("path")));
tw.addCell(c1);
// if image good
if (isImageValid(re.getString("asset_id"))) {
c1 = embedImage(re.getString("asset_id"), new Cell());
tw.addCell(c1);
} else {
c1 = new Cell("Default Image.");
tw.addCell(c1);
}
}
document.add(tw);
