aboutsummaryrefslogtreecommitdiff
path: root/pdf-as-pdfbox-2/src/test
diff options
context:
space:
mode:
authorChristian Maierhofer <cmaierhofer@iaik.tugraz.at>2016-06-08 08:12:21 +0200
committerAndreas Fitzek <andreas.fitzek@iaik.tugraz.at>2016-08-17 16:45:49 +0200
commitc4e41301d0746ce57044a3aa41375cff3a9f2b5e (patch)
treebdf13d0a0d7fae97215a84286e31ff894bacc979 /pdf-as-pdfbox-2/src/test
parenta7945fff6ca14d35ac75039712736dddc6d48e90 (diff)
downloadpdf-as-4-c4e41301d0746ce57044a3aa41375cff3a9f2b5e.tar.gz
pdf-as-4-c4e41301d0746ce57044a3aa41375cff3a9f2b5e.tar.bz2
pdf-as-4-c4e41301d0746ce57044a3aa41375cff3a9f2b5e.zip
initial pdfbox-2 commit
Diffstat (limited to 'pdf-as-pdfbox-2/src/test')
-rw-r--r--pdf-as-pdfbox-2/src/test/java/at/gv/egiz/pdfas/lib/testpdfbox/TTFFontTest.java45
1 files changed, 45 insertions, 0 deletions
diff --git a/pdf-as-pdfbox-2/src/test/java/at/gv/egiz/pdfas/lib/testpdfbox/TTFFontTest.java b/pdf-as-pdfbox-2/src/test/java/at/gv/egiz/pdfas/lib/testpdfbox/TTFFontTest.java
new file mode 100644
index 00000000..ca45354b
--- /dev/null
+++ b/pdf-as-pdfbox-2/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<COSObject> cosObjects = doc.getDocument().getObjectsByType(COSName.FONT);
+
+ Iterator<COSObject> 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() +
+ subType.toString());
+ System.out.println(" BaseFont: " + baseFont.toString());
+ }
+
+
+ }
+
+
+ } catch(Throwable e) {
+ e.printStackTrace();
+ }
+ }
+
+}