public void generatePDF() {
		EventQueue.invokeLater(new Runnable() {

			@Override
			public void run() {
				try {
					document = new Document();
					String inputFile = "RAPORT.html";
					String outputFile = "RAPORT.pdf";
					String url = new File(inputFile).toURI().toURL().toString();
					OutputStream os = new FileOutputStream(outputFile);
					ITextRenderer renderer = new ITextRenderer();
					renderer.setDocument(url);
					renderer.layout();
					renderer.createPDF(os);
					os.close();
				} catch (Exception e) {
					JOptionPane.showMessageDialog(null,
							"Nie mozna zapisac pliku");
					System.err.println(e);
				}
			}
		});

	}