From 23a283834becf8323489231ed5c48725f9716bb6 Mon Sep 17 00:00:00 2001 From: Andreas Fitzek Date: Wed, 25 Feb 2015 12:50:41 +0100 Subject: fixed base64 image value --- .../gv/egiz/pdfas/lib/testpdfbox/TTFFontTest.java | 45 ++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 pdf-as-pdfbox/src/test/java/at/gv/egiz/pdfas/lib/testpdfbox/TTFFontTest.java (limited to 'pdf-as-pdfbox/src/test/java/at') diff --git a/pdf-as-pdfbox/src/test/java/at/gv/egiz/pdfas/lib/testpdfbox/TTFFontTest.java b/pdf-as-pdfbox/src/test/java/at/gv/egiz/pdfas/lib/testpdfbox/TTFFontTest.java new file mode 100644 index 00000000..fdc59ab8 --- /dev/null +++ b/pdf-as-pdfbox/src/test/java/at/gv/egiz/pdfas/lib/testpdfbox/TTFFontTest.java @@ -0,0 +1,45 @@ +package at.gv.egiz.pdfas.lib.testpdfbox; + +import java.io.File; +import java.util.Iterator; +import java.util.List; + +import org.apache.pdfbox.cos.COSBase; +import org.apache.pdfbox.cos.COSName; +import org.apache.pdfbox.cos.COSObject; +import org.apache.pdfbox.pdmodel.PDDocument; + +public class TTFFontTest { + + public static void main(String[] args) { + try { + PDDocument doc = PDDocument.load(new File("/home/afitzek/Downloads/pdf_groesse/willenserklaerung_signedByUser.pdf")); + + List cosObjects = doc.getDocument().getObjectsByType(COSName.FONT); + + Iterator cosObjectIt = cosObjects.iterator(); + + while(cosObjectIt.hasNext()) { + COSObject cosObject = cosObjectIt.next(); + COSBase subType = cosObject.getItem(COSName.SUBTYPE); + COSBase baseFont = cosObject.getItem(COSName.BASE_FONT); + COSBase aTest = cosObject.getItem(COSName.A); + + System.out.println(aTest); + + if(subType.equals(COSName.TRUE_TYPE)) { + System.out.println("Object Number: " + cosObject.getObjectNumber().intValue() + + subType.toString()); + System.out.println(" BaseFont: " + baseFont.toString()); + } + + + } + + + } catch(Throwable e) { + e.printStackTrace(); + } + } + +} -- cgit v1.2.3