public class PDFExport {
public static void export(final GraphPageable pageable,Component parentComponent) throws IOException{
final File file=chooseFile(pageable.getRenderer().getProject().getName(),parentComponent);
final JobQueue jobQueue=SessionFactory.getInstance().getJobQueue();
Job job=new Job(jobQueue,"PDF Export","Exporting PDF...",true,parentComponent);
job.addRunnable(new JobRunnable("PDF Export",1.0f){
public Object run() throws Exception{
Document document = new Document();
PdfWriter writer = PdfWriter.getInstance(document, new FileOutputStream(file));
pageable.update();
int pageCount = pageable.getNumberOfPages();