" + headerBox.getText() + "
"; + } + + for (Task t : tt.getTasks()) { + html += "" + t.getDesc() + "
" + + "" + by5 + "%
"; + return result; + } + + private void savePdfFile(String html, String path) { + Platform.runLater(new Runnable() { + @Override + public void run() { + try { + String k = html; + OutputStream file = new FileOutputStream(new File(path)); + Document document = new Document(); + PdfWriter writer = PdfWriter.getInstance(document, file); + document.open(); + PdfContentByte pdfCB = new PdfContentByte(writer); + WritableImage image = browser.snapshot(null, null); + BufferedImage buffered = SwingFXUtils.fromFXImage(image, null); + Image img = Image.getInstance(pdfCB, buffered, 1); + document.open(); + document.add(img); + document.close(); + savedMsg(); + } catch (Exception ex) { + Debug.stacktrace(ex); + java.awt.EventQueue.invokeLater(() -> { + JOptionPane.showInternalMessageDialog(Main.mainPane, "Error saving: " + ex.getMessage()); + }); + } + } + }); + } + + private void saveFile(String content, String path) { + try { + PrintStream out = new PrintStream(new FileOutputStream(path)); + out.print(content); + savedMsg(); + } catch (Exception ex) { + JOptionPane.showInternalMessageDialog(this, "Error saving: " + ex.getMessage()); + } + } + + private void savedMsg() { + JOptionPane.showInternalMessageDialog(this, "Export complete!"); + } + + // Variables declaration - do not modify//GEN-BEGIN:variables + private javax.swing.JTextField authBox; + private javax.swing.JTextField dateBox; + private javax.swing.JButton exHtml; + private javax.swing.JTextArea headerBox; + private javax.swing.JLabel jLabel1; + private javax.swing.JLabel jLabel2; + private javax.swing.JLabel jLabel3; + private javax.swing.JLabel jLabel4; + private javax.swing.JPanel jPanel1; + private javax.swing.JPanel jPanel2; + private javax.swing.JScrollPane jScrollPane2; + private javax.swing.JButton previewBtn; + private javax.swing.JTextField titleBox; + private javax.swing.JPanel webPanel; + // End of variables declaration//GEN-END:variables +} diff --git a/src/net/apocalypselabs/symat/pretty.css b/src/net/apocalypselabs/symat/pretty.css index f82bc18..803cb05 100644 --- a/src/net/apocalypselabs/symat/pretty.css +++ b/src/net/apocalypselabs/symat/pretty.css @@ -1,3 +1,6 @@ +/* +Public domain. +*/ .header { } diff --git a/src/net/apocalypselabs/symat/tasks.css b/src/net/apocalypselabs/symat/tasks.css new file mode 100644 index 0000000..69441d2 --- /dev/null +++ b/src/net/apocalypselabs/symat/tasks.css @@ -0,0 +1,16 @@ +.task { + border: 1px solid black; + border-radius: 5px; + margin-bottom: 10px; + width: 100%; +} + +.taskheading { + font-size: 150%; +} + +.progress { + background-color: green; + height: 10px; + display: block; +} \ No newline at end of file