public void export(Rectangle boundingBox, PositionTransformation pt) throws ExportException{
		JFileChooser fc = new JFileChooser(AppConfig.getAppConfig().getLastSelectedFileDirectory());
		fc.setDialogTitle("Choose file and type to export");
		// install the file filters
		SingleFileFilter psFf = new EPSFileFilter();
		SingleFileFilter pdfFf = new PDFFileFilter();
		SingleFileFilter posFf = new PositionFileFilter();
		fc.addChoosableFileFilter(posFf);
		fc.addChoosableFileFilter(psFf);
		fc.addChoosableFileFilter(pdfFf);

		fc.setAcceptAllFileFilterUsed(false); // only allow the above file types
		
		if(fc.showSaveDialog(parent) == JFileChooser.APPROVE_OPTION){
			File file = fc.getSelectedFile();
			
			if(file.exists()){
				if(!file.delete()){
					throw new ExportException("Could not replace the file. Maybe the file is in use.");
				}
			}
			// append the default file extension, if not already there
			if(!file.getName().toLowerCase().endsWith(((SingleFileFilter)fc.getFileFilter()).getExtension())){
				//the file does not end with the correct ending. Add it and reopen the file.
				file = new File(file.getPath()+((SingleFileFilter)fc.getFileFilter()).getExtension());
			}
			String p = file.getPath();
			p = p.substring(0, p.length() - file.getName().length()); // remember the selected path
			AppConfig.getAppConfig().lastSelectedFileDirectory = p;
			
			if(file.getName().endsWith(posFf.getExtension())) {
				PositionFileIO.printPos(file.getPath());
			} else if(file.getName().endsWith(psFf.getExtension())){
				graphToPS(file, boundingBox, pt);
			}
			else if(file.getName().endsWith(pdfFf.getExtension())){
				File tmpFile = new File(getEmptyTempFile(""));
				graphToPS(tmpFile, boundingBox, pt);
				psToPdf(tmpFile, file);
				tmpFile.delete();
			}
		}
	}