Example usage for com.lowagie.text.pdf BaseFont WINANSI

List of usage examples for com.lowagie.text.pdf BaseFont WINANSI

Introduction

In this page you can find the example usage for com.lowagie.text.pdf BaseFont WINANSI.

Prototype

String WINANSI

To view the source code for com.lowagie.text.pdf BaseFont WINANSI.

Click Source Link

Document

A possible encoding.

Usage

From source file:tufts.vue.PresentationNotes.java

License:Educational Community License

private static void drawSequenceNumber(PdfWriter writer, float x, float y, int seq) {
    PdfContentByte cb = writer.getDirectContent();
    try {/*w w w. ja  va2s . c om*/
        cb.setFontAndSize(BaseFont.createFont(BaseFont.HELVETICA, BaseFont.WINANSI, false), 16);
    } catch (DocumentException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    } catch (IOException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    }
    cb.beginText();
    cb.showTextAligned(Element.ALIGN_CENTER, new Integer(seq).toString() + ".", x, y, 0f);
    cb.endText();
    cb.stroke();

    //return tp2;
}

From source file:uk.org.rbc1b.roms.controller.volunteer.VolunteerBadgePdfView.java

License:Open Source License

/**
 * Adds a Barcode39 of the id number of a Volunteer to the Badge.
 *
 * @param content to be added//from   w ww.  j  a v  a2 s . co m
 * @param id volunteer id
 * @throws DocumentException
 * @throws IOException
 */
private static void addBarcode(PdfContentByte contentByte, Integer id) throws IOException, DocumentException {
    Barcode39 barcode = new Barcode39();
    BaseFont baseFont = BaseFont.createFont(BaseFont.HELVETICA, BaseFont.WINANSI, BaseFont.EMBEDDED);
    barcode.setFont(baseFont);
    barcode.setSize(6);
    barcode.setCode(id.toString());
    contentByte.setColorFill(Color.BLACK);
    Image baecodeImg = barcode.createImageWithBarcode(contentByte, null, null);
    contentByte.addImage(baecodeImg, 75, 0, 0, 35, 338, 344);
}