List of usage examples for com.itextpdf.text FontFactory HELVETICA
String HELVETICA
To view the source code for com.itextpdf.text FontFactory HELVETICA.
Click Source Link
From source file:storybook.export.ExportPDF.java
void writeText(String str) { SbApp.trace("ExportPDF.writeText(" + str + ")"); try {//from ww w . j a v a 2 s. com outDoc.add(new Phrase(str + "\n", FontFactory.getFont(FontFactory.HELVETICA, 10))); } catch (DocumentException ex) { SbApp.error("ExportPDF.writeText(" + str + ")", ex); } }
From source file:userInterface.SystemAdmin.PovertyAnalysisJPanel.java
private void downloadPDFJButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_downloadPDFJButtonActionPerformed Document document = new Document(); try {/*ww w . ja va 2 s . com*/ PdfWriter writer = PdfWriter.getInstance(document, new FileOutputStream("AddTableExample.pdf")); document.open(); Font helveticaBold = FontFactory.getFont(FontFactory.HELVETICA, 16, Font.NORMAL, new GrayColor(1)); Font helveticaNormal = FontFactory.getFont(FontFactory.HELVETICA, 12, Font.NORMAL, new GrayColor(1)); Paragraph paragraphOne = new Paragraph("Safety Meter Report", helveticaBold); document.add(paragraphOne); document.add(new Paragraph(" ")); DefaultTableModel model = (DefaultTableModel) povertyJTable.getModel(); int numRows = model.getRowCount(); int numColum = model.getColumnCount(); int i, j = 0; for (i = 0; i < numRows; i++) { Paragraph info = new Paragraph("Network Name is " + model.getValueAt(i, 0), helveticaNormal); Paragraph sectionContent3 = new Paragraph( "Average Income of A Person is $" + model.getValueAt(i, 2), helveticaNormal); info.add(sectionContent3); Paragraph sectionContent1 = new Paragraph("Crime Rate is " + model.getValueAt(i, 6) + "%", helveticaNormal); info.add(sectionContent1); Paragraph sectionContent2 = new Paragraph("Poverty Rate is " + model.getValueAt(i, 4) + "%", helveticaNormal); info.add(sectionContent2); Paragraph sectionContent4 = new Paragraph( "Percentage of People Having FireArms " + model.getValueAt(i, 3) + "%", helveticaNormal); info.add(sectionContent4); document.add(info); Paragraph space = new Paragraph(" ", helveticaNormal); document.add(space); } //document.add(table); document.close(); writer.close(); JOptionPane.showMessageDialog(povertyJTable, "Please visit Downloads folder to view your report"); } catch (Exception e) { JOptionPane.showMessageDialog(povertyJTable, e); } }