Hello,

what do you exactly mean with "Render just the jtable rows you need for each
page"?

I want to print 32 rows per page (the whole table has about 600 rows). So,
my createGraphics for the first page looks like this:
Graphics2D g2 = cb.createGraphics(1000, 639);

But how can I tell the ContentByte to create the graphics from Position 640
on? What method(s) should I use?

Thanks and regards

Katrin

> -----Original Message-----
> From: [EMAIL PROTECTED] 
> [mailto:[EMAIL PROTECTED] On 
> Behalf Of kgnurps
> Sent: Friday, January 14, 2005 11:54 AM
> To: [email protected]
> Subject: [iText-questions] PdfContentByte and OutOfMemory Exception
> 
> Hello,
> 
> I print a JTable by using following code:
> 
> PdfContentByte cb = writer.getDirectContent();
> cb.saveState();
> Graphics2D g2 = cb.createGraphics(width, heigth);
> table.print(g2);
>  g2.dispose();
> cb.restoreState();
> 
> My problem is a quite big JTable, which needs more than 1 
> page to be print. 
> I use the method cb.createGraphics(1000, 11000) and get an 
> OutOfMemory 
> Exception.
>

That's a really big table.
 
> I want to save the whole JTable graphic into the ContentByte and use 
> g2.clipRect to cut it to several graphics which can be print 
> on several 
> pages.
> 

The clipping must be done at the PdfContentByte not at the Graphics2D.

> But with the exception, this doesn't work. Should I use one 
> PdfContentByte 
> per page? But how can I tell the ContentByte what part I want 
> (there is no 
> createGraphics method with x and y coordinates)?
> 
> So, what should I do?
> 

Render just the jtable rows you need for each page. You you can't do
that, render all the jtable to a PdfTemplate and clip each segment for
each page (with cb.clip()). You'll probably need more memory allocated
to the jvm.


> Thanks and regards,
> 
> Katrin
>  
> 
> 
> 
> -------------------------------------------------------
> The SF.Net email is sponsored by: Beat the post-holiday blues
> Get a FREE limited edition SourceForge.net t-shirt from ThinkGeek.
> It's fun and FREE -- well, almost....http://www.thinkgeek.com/sfshirt
> _______________________________________________
> iText-questions mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/itext-questions
> 


-- 
+++ GMX - die erste Adresse f�r Mail, Message, More +++
1 GB Mailbox bereits in GMX FreeMail http://www.gmx.net/de/go/mail


-------------------------------------------------------
The SF.Net email is sponsored by: Beat the post-holiday blues
Get a FREE limited edition SourceForge.net t-shirt from ThinkGeek.
It's fun and FREE -- well, almost....http://www.thinkgeek.com/sfshirt
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions

Reply via email to