vendredi 22 janvier 2016

how add google fonts to itext

Need your help. I have a simple java class for generate pdf file using itext libary

public void createPdf(String dest) throws IOException, DocumentException {
Document document = new Document();
PdfWriter writer = PdfWriter.getInstance(document, new FileOutputStream(dest));
document.open();
BaseFont bf = BaseFont.createFont(
    FONT, BaseFont.IDENTITY_V, BaseFont.NOT_EMBEDDED);
Font font = new Font(bf, 20);
VerticalText vt = new VerticalText(writer.getDirectContent());
vt.setVerticalLayout(559, 806, 770, 29, 18);
vt.addText(new Phrase("Hello World !!!", font));
vt.go();
document.close();

}

and me need add this font

<link rel="stylesheet" href="http://ift.tt/1CF5UGD">

how I can do it?




Aucun commentaire:

Enregistrer un commentaire