Index: pdfbox/src/main/java/org/apache/pdfbox/util/operator/pagedrawer/Invoke.java
===================================================================
--- pdfbox/src/main/java/org/apache/pdfbox/util/operator/pagedrawer/Invoke.java	(revision 1530987)
+++ pdfbox/src/main/java/org/apache/pdfbox/util/operator/pagedrawer/Invoke.java	(working copy)
@@ -88,25 +88,12 @@
                 }
                 int imageWidth = awtImage.getWidth();
                 int imageHeight = awtImage.getHeight();
-                double pageHeight = drawer.getPageSize().getHeight();
 
                 LOG.debug("imageWidth: " + imageWidth + "\t\timageHeight: " + imageHeight);
         
                 Matrix ctm = drawer.getGraphicsState().getCurrentTransformationMatrix();
-                float yScaling = ctm.getYScale();
-                float angle = (float)Math.acos(ctm.getValue(0, 0)/ctm.getXScale());
-                if (ctm.getValue(0, 1) < 0 && ctm.getValue(1, 0) > 0)
-                {
-                    angle = (-1)*angle;
-                }
-                ctm.setValue(2, 1, (float)(pageHeight - ctm.getYPosition() - Math.cos(angle)*yScaling));
-                ctm.setValue(2, 0, (float)(ctm.getXPosition() - Math.sin(angle)*yScaling));
-                // because of the moved 0,0-reference, we have to shear in the opposite direction
-                ctm.setValue(0, 1, (-1)*ctm.getValue(0, 1));
-                ctm.setValue(1, 0, (-1)*ctm.getValue(1, 0));
-                AffineTransform ctmAT = ctm.createAffineTransform();
-                ctmAT.scale(1f/imageWidth, 1f/imageHeight);
-                drawer.drawImage( awtImage, ctmAT ); 
+                AffineTransform imageTransform = ctm.createAffineTransform();
+                drawer.drawImage( awtImage, imageTransform );
             }
             catch( Exception e )
             {
Index: pdfbox/src/main/java/org/apache/pdfbox/pdfviewer/PageDrawer.java
===================================================================
--- pdfbox/src/main/java/org/apache/pdfbox/pdfviewer/PageDrawer.java	(revision 1530987)
+++ pdfbox/src/main/java/org/apache/pdfbox/pdfviewer/PageDrawer.java	(working copy)
@@ -32,7 +32,6 @@
 import java.awt.geom.AffineTransform;
 import java.awt.geom.Area;
 import java.awt.geom.GeneralPath;
-import java.awt.geom.NoninvertibleTransformException;
 import java.awt.geom.Point2D;
 import java.io.IOException;
 import java.util.HashMap;
@@ -142,6 +141,8 @@
         pageSize = pageDimension;
         graphics.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
         graphics.setRenderingHint(RenderingHints.KEY_FRACTIONALMETRICS, RenderingHints.VALUE_FRACTIONALMETRICS_ON);
+        graphics.translate(0, pageSize.height);
+        graphics.scale(1, -1);
         // Only if there is some content, we have to process it.
         // Otherwise we are done here and we will produce an empty page
         if (page.getContents() != null)
@@ -261,18 +262,8 @@
             PDFont font = text.getFont();
             Matrix textPos = text.getTextPos().copy();
             float x = textPos.getXPosition();
-            // the 0,0-reference has to be moved from the lower left (PDF) to the upper left (AWT-graphics)
-            float y = pageSize.height - textPos.getYPosition();
+            float y = textPos.getYPosition();
 
-            // Set translation to 0,0. We only need the scaling and shearing except for type 3 fonts
-            if (!font.isType3Font())
-            {
-                textPos.setValue(2, 0, 0);
-                textPos.setValue(2, 1, 0);
-            }
-            // because of the moved 0,0-reference, we have to shear in the opposite direction
-            textPos.setValue(0, 1, (-1) * textPos.getValue(0, 1));
-            textPos.setValue(1, 0, (-1) * textPos.getValue(1, 0));
             AffineTransform at = textPos.createAffineTransform();
             PDMatrix fontMatrix = font.getFontMatrix();
             // Type3 fonts don't use the same units within the font matrix as all the other fonts
@@ -280,10 +271,6 @@
             {
                 at.scale(fontMatrix.getValue(0, 0), fontMatrix.getValue(1, 1));
             }
-            else
-            {
-                at.scale(fontMatrix.getValue(0, 0) * 1000f, fontMatrix.getValue(1, 1) * 1000f);
-            }
             // TODO setClip() is a massive performance hot spot. Investigate optimization possibilities
             graphics.setClip(graphicsState.getCurrentClippingPath());
 
@@ -298,6 +285,14 @@
                 Glyph2D glyph2D = createGlyph2D(font);
                 if (glyph2D != null)
                 {
+                    AffineTransform fm = new AffineTransform(
+                            fontMatrix.getValue(0, 0),
+                            fontMatrix.getValue(0, 1),
+                            fontMatrix.getValue(1, 0),
+                            fontMatrix.getValue(1, 1),
+                            fontMatrix.getValue(2, 0),
+                            fontMatrix.getValue(2, 1));
+                    at.concatenate(fm);
                     // Let PDFBox render the font if supported
                     drawGlyph2D(glyph2D, text.getCodePoints(), at, x, y);
                 }
@@ -328,47 +323,17 @@
     private void drawGlyph2D(Glyph2D glyph2D, int[] codePoints, AffineTransform at, float x, float y)
             throws IOException
     {
-        Graphics2D g2d = (Graphics2D) graphics;
-        g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
+        graphics.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
         for (int i = 0; i < codePoints.length; i++)
         {
-            if (!at.isIdentity())
+            GeneralPath path = glyph2D.getPathForCharactercode(codePoints[i]);
+            if (path != null)
             {
-                try
-                {
-                    AffineTransform atInv = at.createInverse();
-                    // do only apply the size of the transform, rotation will be realized by rotating the graphics,
-                    // otherwise the hp printers will not render the font
-                    // apply the transformation to the graphics, which should be the same as applying the
-                    // transformation itself to the text
-                    g2d.transform(at);
-                    // translate the coordinates
-                    Point2D.Float newXy = new Point2D.Float(x, y);
-                    atInv.transform(new Point2D.Float(x, y), newXy);
-
-                    GeneralPath path = glyph2D.getPathForCharactercode(codePoints[i]);
-                    if (path != null)
-                    {
-                        g2d.translate(newXy.getX(), newXy.getY());
-                        g2d.fill(path);
-                        g2d.translate(-newXy.getX(), -newXy.getY());
-                    }
-                    // restore the original transformation
-                    g2d.transform(atInv);
-                }
-                catch (NoninvertibleTransformException e)
-                {
-                    LOG.error("Error in " + getClass().getName() + ".drawGlyph2D", e);
-                }
+                AffineTransform oldTransform = graphics.getTransform();
+                graphics.transform(at);
+                graphics.fill(path);
+                graphics.setTransform(oldTransform);
             }
-            else
-            {
-                GeneralPath path = glyph2D.getPathForCharactercode(codePoints[i]);
-                if (path != null)
-                {
-                    g2d.draw(path);
-                }
-            }
         }
     }
 
@@ -432,33 +397,13 @@
     private void writeFont(final Graphics2D g2d, final AffineTransform at, final float x, final float y,
             final GlyphVector glyphs)
     {
-        // check if we have a rotation
-        if (!at.isIdentity())
-        {
-            try
-            {
-                AffineTransform atInv = at.createInverse();
-                // do only apply the size of the transform, rotation will be realized by rotating the graphics,
-                // otherwise the hp printers will not render the font
-                // apply the transformation to the graphics, which should be the same as applying the
-                // transformation itself to the text
-                g2d.transform(at);
-                // translate the coordinates
-                Point2D.Float newXy = new Point2D.Float(x, y);
-                atInv.transform(new Point2D.Float(x, y), newXy);
-                g2d.drawGlyphVector(glyphs, (float) newXy.getX(), (float) newXy.getY());
-                // restore the original transformation
-                g2d.transform(atInv);
-            }
-            catch (NoninvertibleTransformException e)
-            {
-                LOG.error("Error in " + getClass().getName() + ".writeFont", e);
-            }
-        }
-        else
-        {
-            g2d.drawGlyphVector(glyphs, x, y);
-        }
+        AffineTransform oldTransform = g2d.getTransform();
+        g2d.transform(at);
+        // Convert from PDF, where glyphs are upright when direction is from
+        // bottom to top, to AWT, where this is the other way around
+        g2d.scale(1, -1);
+        g2d.drawGlyphVector(glyphs, 0, 0);
+        g2d.setTransform(oldTransform);
     }
 
     /**
@@ -661,7 +606,7 @@
      */
     public double fixY(double y)
     {
-        return pageSize.getHeight() - y;
+        return y;
     }
 
     /**
@@ -862,7 +807,12 @@
     {
         graphics.setComposite(getGraphicsState().getStrokeJavaComposite());
         graphics.setClip(getGraphicsState().getCurrentClippingPath());
-        graphics.drawImage(awtImage, at, null);
+        int width = awtImage.getWidth(null);
+        int height = awtImage.getHeight(null);
+        AffineTransform imageTransform = new AffineTransform(at);
+        imageTransform.scale(1.0 / width, -1.0 / height);
+        imageTransform.translate(0, -height);
+        graphics.drawImage(awtImage, imageTransform, null);
     }
 
     /**
Index: pdfbox/src/main/java/org/apache/pdfbox/pdfviewer/font/TTFGlyph2D.java
===================================================================
--- pdfbox/src/main/java/org/apache/pdfbox/pdfviewer/font/TTFGlyph2D.java	(revision 1530987)
+++ pdfbox/src/main/java/org/apache/pdfbox/pdfviewer/font/TTFGlyph2D.java	(working copy)
@@ -57,7 +57,7 @@
     /**
      * Default scaling value.
      */
-    private static final float DEFAULT_SCALING = 0.001f;
+    private static final float DEFAULT_SCALING = 1.0f;
 
     /**
      * Start of coderanges.
@@ -107,7 +107,7 @@
         HeaderTable header = font.getHeader();
         if (header != null)
         {
-            scale = 1f / header.getUnitsPerEm();
+            scale = 1000f / header.getUnitsPerEm();
         }
         else
         {
@@ -191,7 +191,7 @@
             {
                 endPtIndex++;
             }
-            points[i] = new Point(gd.getXCoordinate(i), -gd.getYCoordinate(i),
+            points[i] = new Point(gd.getXCoordinate(i), gd.getYCoordinate(i),
                     (gd.getFlags(i) & GlyfDescript.ON_CURVE) != 0, endPt);
         }
         return points;
Index: pdfbox/src/main/java/org/apache/pdfbox/pdfviewer/font/CFFGlyph2D.java
===================================================================
--- pdfbox/src/main/java/org/apache/pdfbox/pdfviewer/font/CFFGlyph2D.java	(revision 1530987)
+++ pdfbox/src/main/java/org/apache/pdfbox/pdfviewer/font/CFFGlyph2D.java	(working copy)
@@ -18,10 +18,7 @@
  */
 package org.apache.pdfbox.pdfviewer.font;
 
-import java.awt.geom.AffineTransform;
 import java.awt.geom.GeneralPath;
-import java.awt.geom.Path2D;
-import java.awt.geom.PathIterator;
 import java.io.IOException;
 import java.util.Collection;
 import java.util.HashMap;
@@ -46,7 +43,6 @@
      */
     private static final Log LOG = LogFactory.getLog(CFFGlyph2D.class);
 
-    private float scale = 0.001f;
     private HashMap<Integer, GeneralPath> glyphs = new HashMap<Integer, GeneralPath>();
     private HashMap<Integer, Integer> codeToGlyph = new HashMap<Integer, Integer>();
     private String fontname = null;
@@ -81,9 +77,7 @@
             }
             if (glyph != null)
             {
-                AffineTransform atPath = AffineTransform.getScaleInstance(scale, scale);
-                glyph.transform(atPath);
-                glyphs.put(glyphId, transformGlyph(glyph));
+                glyphs.put(glyphId, glyph);
                 int code = mapping.getSID();
                 String name = mapping.getName();
                 if (nameToCode != null && nameToCode.containsKey(name))
@@ -96,48 +90,6 @@
         }
     }
 
-    private GeneralPath transformGlyph(GeneralPath glyph)
-    {
-        // we have to invert all y-coordinates due to the moved 0,0-reference
-        PathIterator iter = glyph.getPathIterator(null);
-        float[] currentSegment = new float[6];
-        Path2D.Float path = new Path2D.Float(iter.getWindingRule());
-        boolean glyphTransformed = false;
-        while (!iter.isDone())
-        {
-            glyphTransformed = true;
-            int type = iter.currentSegment(currentSegment);
-            switch (type)
-            {
-            case PathIterator.SEG_MOVETO:
-                path.moveTo(currentSegment[0], -currentSegment[1]);
-                break;
-            case PathIterator.SEG_LINETO:
-                path.lineTo(currentSegment[0], -currentSegment[1]);
-                break;
-            case PathIterator.SEG_QUADTO:
-                path.quadTo(currentSegment[0], -currentSegment[1], currentSegment[2], -currentSegment[3]);
-                break;
-            case PathIterator.SEG_CUBICTO:
-                path.curveTo(currentSegment[0], -currentSegment[1], currentSegment[2], -currentSegment[3],
-                        currentSegment[4], -currentSegment[5]);
-                break;
-            case PathIterator.SEG_CLOSE:
-                path.closePath();
-                break;
-            }
-            iter.next();
-        }
-        if (glyphTransformed)
-        {
-            return new GeneralPath(path);
-        }
-        else
-        {
-            return glyph;
-        }
-    }
-
     /**
      * {@inheritDoc}
      */
