Also, when creating the graphics object, you need to size it to your
component ie g2 = cb.createGraphics(jWidth,jHeight);

Alternately, you could scale your graphics object appropriately to fit all
of your Jtable. 

-Bill Ensley
Bear Printing

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Mark
Storer
Sent: Wednesday, August 09, 2006 11:03 AM
To: Post all your questions about iText here
Subject: Re: [iText-questions] iText questions

0: MyFirstTable has nothing to do with Graphics2D... there are several more
relevant examples.

1: There's no createGraphicsShapes call in the example you cited, nor any
PdfGraphics2D instances.

createGraphics(...) will create a normal PdfGraphics2D instance wrapping the
PdfContentByte/template/appearance.
createGraphicsShapes converts all text into paths.  The appearance is
identical but:
A) no fonts are needed in the final PDF
B) Because the characters are drawn as paths (line here, curve there), the
final file can be significantly larger.  Each instance of each character
must be completely redrawn.
C) The 'text' cannot be selected/copied/pasted.  It's just a bunch of lines.
To extract the characters, you need to use Optical Character Recognition
(OCR).


2: The dimensions supplied to createGraphics*() are a crop box... anything
outside that area is clipped, as you've seen.  If you want to change the
size of the table, you need to use the appropriate Graphics2D call, "scale(
double x, double y )".

3: That suprises me.  I'd think anything that would be displayed through any
other Graphics2D would show up through PdfGraphics2D.  You might need to
make your crop box larger, but that's just a guess.

--Mark Storer
  Senior Software Engineer
  Cardiff Software

#include <disclaimer>
typedef std::Disclaimer<Cardiff> DisCard;



> -----Original Message-----
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED] Behalf Of 
> [EMAIL PROTECTED]
> Sent: Tuesday, August 08, 2006 5:17 AM
> To: [email protected]
> Subject: [iText-questions] iText questions
> 
> 
> Hi,
> 
> I'm an iText beginner and I need to convert a JTable into .pdf format.
> 
> I use the sample code given on their web site:
> http://itextdocs.lowagie.com/examples/com/lowagie/examples/obj
ects/tables/alternatives/MyFirstTable.java


This is all the code, but I guess only the function print() is important to
answer my questions:
1. Why when g2 is created they use cb.createGraphicsShapes(500, 500) but
when it is changed later on they use g2 = cb.createGraphics(500, 500)

2. I can't figure out how to resize my JTable in the pdf file. When I change
the arguments of createGraphicsShapes(x, y), i get the table clipped off and
also its location in the page changes.

3. Is there any way to print also the JTable header, because now only the
table contents are printed to the .pdf file.

I'd be really grateful if you could answer at least one of my questions!
Thanks in advance!


-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job
easier Download IBM WebSphere Application Server v.1.0.1 based on Apache
Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions


-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job
easier Download IBM WebSphere Application Server v.1.0.1 based on Apache
Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions


-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions

Reply via email to