ListEncodingsPDF.java Source code

Java tutorial

Introduction

Here is the source code for ListEncodingsPDF.java

Source

import com.lowagie.text.pdf.BaseFont;

public class ListEncodingsPDF {
    public static void main(String[] args) {
        try {
            BaseFont bfComic = BaseFont.createFont("c:\\windows\\fonts\\arial.ttf", BaseFont.CP1252,
                    BaseFont.NOT_EMBEDDED);
            System.out.println("postscriptname: " + bfComic.getPostscriptFontName());
            String[] codePages = bfComic.getCodePagesSupported();
            System.out.println("All available encodings:\n\n");
            for (int i = 0; i < codePages.length; i++) {
                System.out.println(codePages[i]);
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}