Hi,
I would like to know what would be the best way to detect whether ia pdf
file has CID fonts. As far as I understand, these fonts are used in asian
texts (japanese, chinese, korean, etc). I have the following code:

        PDDocument doc = PDDocument.load(myFile);
        for (int i = 0; i < doc.getNumberOfPages(); ++i)
        {
            PDPage page = doc.getPage(i);
            PDResources res = page.getResources();
            for (COSName fontName : res.getFontNames())
            {
                PDFont font = res.getFont(fontName);
                COSName subType =
font.getCOSObject().getCOSName(COSName.SUBTYPE);
                System.out.println("CID? " + COSName.TYPE0.equals(subType));
                System.out.println("font instanceof PDType0Font? " + (font
instanceof PDType0Font));
            }
        }
Would this be the right way to do it?

I need to detect this and try to create a pdf file from the original, but
without the text.

Any indication is appreciated.

Regards,

Jorge

Reply via email to