Java Mailing List Archive

http://www.junlu.com/

Home » Home (12/2007) » iText »

Re: [iText-questions] Adding a JPanel into the flow of a
 PDFDocu  ment

Bill Ensley

2006-07-17

Replies:

create a fresh Document using a ByteArrayOutputStream,
 
Get it's content as a Graphics2D Object
Draw to it
 
Close it.
 
Use it as an image.
 
I believe that the tutorial has something similar to this.
 
-Bill Ensley
Bear Printing
 
 


From: itext-questions-bounces@lists.sourceforge.net [mailto:itext-questions-bounces@lists.sourceforge.net] On Behalf Of Brian Ewers
Sent: Monday, July 17, 2006 3:38 PM
To: 'Post all your questions about iText here'
Subject: Re: [iText-questions] Adding a JPanel into the flow of a PDFDocu ment

How do you convert a JPanel into a PDF ('in memory')?

 

Thanks

 


From: Bill Ensley [mailto:bill@bearprinting.com]
Sent: Monday, July 17, 2006 3:24 PM
To: 'Post all your questions about iText here'
Subject: Re: [iText-questions] Adding a JPanel into the flow of a PDF Document

 

You can use a pdf as an image to insert into the flow of an existing document.

 

Make your JPanel into a PDF in memory and then use that as your image.

 

-Bill Ensley

Bear Printing

 


From: itext-questions-bounces@lists.sourceforge.net [mailto:itext-questions-bounces@lists.sourceforge.net] On Behalf Of Brian Ewers
Sent: Monday, July 17, 2006 3:20 PM
To: 'itext-questions@lists.sourceforge.net'
Subject: [iText-questions] Adding a JPanel into the flow of a PDF Document

I have figured out how to add a JPanel into a PDF Document.

 

However, I have not figured out how to add the new Graphics2D object

into the flow of an existing document.

 

This just adds it to the entire page:

Graphics2D g2d = cb.createGraphics(PageSize.A4.width(),PageSize.A4.height());

 

Do I need to convert the JPanel to an Image and then do

document.add(Image)??

 

Thanks

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
iText-questions mailing list
iText-questions@(protected)
https://lists.sourceforge.net/lists/listinfo/itext-questions
©2008 junlu.com - Jax Systems, LLC, U.S.A.