aboutsummaryrefslogtreecommitdiff
path: root/pdf-as-pdfbox-2/src/main/java/at/gv/egiz/pdfas/lib/impl/pdfbox2/positioning/PositioningPageDrawer.java
diff options
context:
space:
mode:
Diffstat (limited to 'pdf-as-pdfbox-2/src/main/java/at/gv/egiz/pdfas/lib/impl/pdfbox2/positioning/PositioningPageDrawer.java')
-rw-r--r--pdf-as-pdfbox-2/src/main/java/at/gv/egiz/pdfas/lib/impl/pdfbox2/positioning/PositioningPageDrawer.java68
1 files changed, 68 insertions, 0 deletions
diff --git a/pdf-as-pdfbox-2/src/main/java/at/gv/egiz/pdfas/lib/impl/pdfbox2/positioning/PositioningPageDrawer.java b/pdf-as-pdfbox-2/src/main/java/at/gv/egiz/pdfas/lib/impl/pdfbox2/positioning/PositioningPageDrawer.java
new file mode 100644
index 00000000..72c333b7
--- /dev/null
+++ b/pdf-as-pdfbox-2/src/main/java/at/gv/egiz/pdfas/lib/impl/pdfbox2/positioning/PositioningPageDrawer.java
@@ -0,0 +1,68 @@
+package at.gv.egiz.pdfas.lib.impl.pdfbox2.positioning;
+
+import java.awt.Color;
+import java.awt.Paint;
+import java.io.IOException;
+
+import org.apache.pdfbox.pdmodel.graphics.color.PDColor;
+import org.apache.pdfbox.rendering.PageDrawer;
+import org.apache.pdfbox.rendering.PageDrawerParameters;
+
+public class PositioningPageDrawer extends PageDrawer{
+
+ public PositioningPageDrawer(PageDrawerParameters parameters)
+ throws IOException {
+ super(parameters);
+ // TODO Auto-generated constructor stub
+ }
+
+ private static final Color POSCOLOR = new Color(234, 14, 184, 211);
+
+ @Override
+ protected Paint getPaint(PDColor color){
+ return POSCOLOR;
+ }
+
+// @Override
+// protected void showGlyph(Matrix textRenderingMatrix, PDFont font, int code, String unicode,Vector displacement) throws IOException{
+// // bbox in EM -> user units
+// Shape bbox = new Rectangle2D.Float(0, 0, font.getWidth(code) / 1000, 1);
+// AffineTransform at = textRenderingMatrix.createAffineTransform();
+// bbox = at.createTransformedShape(bbox);
+//
+// // save
+// Graphics2D graphics = getGraphics();
+//
+// // draw
+// graphics.setClip(graphics.getDeviceConfiguration().getBounds());
+// graphics.setColor(POSCOLOR);
+// graphics.setStroke(new BasicStroke(.5f));
+// graphics.draw(bbox);
+//
+// // restore
+// }
+//
+// @Override
+// public void fillPath(int windingRule) throws IOException
+// {
+// // bbox in user units
+// Shape bbox = getLinePath().getBounds2D();
+//
+// // draw path (note that getLinePath() is now reset)
+// //super.fillPath(windingRule);
+//
+// // save
+// Graphics2D graphics = getGraphics();
+//
+//
+// // draw
+// graphics.setClip(graphics.getDeviceConfiguration().getBounds());
+// graphics.setColor(POSCOLOR);
+// graphics.setStroke(new BasicStroke(.5f));
+// graphics.draw(bbox);
+//
+// }
+
+
+
+}