jQuery in Action, 3rd edition
The moose likes Swing / AWT / SWT and the fly likes Export to pdf Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Export to pdf" Watch "Export to pdf" New topic

Export to pdf

karthik tvn

Joined: Feb 15, 2008
Posts: 13
i have doubt on export to pdf. I have given my code. In that code, i have drawn a circle in jPanel2. I need to export this circle to pdf i.e., export the jPanel2 content to pdf.(In pdf i can print the circle if needs)...

please give any solution or refer any link...
please help me....
Maneesh Godbole
Saloon Keeper

Joined: Jul 26, 2007
Posts: 10826

Using IText you can generate PDF documents through Java.
You might have to convert your "circle" to an image first before inserting it into the PDF.

[How to ask questions] [Donate a pint, save a life!] [Onff-turn it on!]
Ulf Dittmer

Joined: Mar 22, 2005
Posts: 42965
The iText library can export Swing components to PDF. Chapter 12 of the excellent iText in Action book explains this. If you're at all serious about creating PDFs you need this book.
Martijn Verburg

Joined: Jun 24, 2003
Posts: 3275

Search for Open Source java PDF libraries in Google, you'll find plenty of libraries for this task . iText is one and here is a link to several more.

Cheers, Martijn - Blog,
Twitter, PCGen, Ikasan, My The Well-Grounded Java Developer book!,
My start-up.
I agree. Here's the link: http://aspose.com/file-tools
subject: Export to pdf
It's not a secret anymore!