aboutsummaryrefslogtreecommitdiffstats
path: root/src/java/org/apache/fop/render/pdf
diff options
context:
space:
mode:
authorJeremias Maerki <jeremias@apache.org>2008-11-19 20:13:48 +0000
committerJeremias Maerki <jeremias@apache.org>2008-11-19 20:13:48 +0000
commitbe4dc692db093ec6b8039d7e61804e28f1709db4 (patch)
treeaa484221fc31f715fcc9e386afb978e31de8b3a0 /src/java/org/apache/fop/render/pdf
parentdfeb96c655c3e361b5fdf6f0cecbf46adab01a72 (diff)
downloadxmlgraphics-fop-be4dc692db093ec6b8039d7e61804e28f1709db4.tar.gz
xmlgraphics-fop-be4dc692db093ec6b8039d7e61804e28f1709db4.zip
Added page master name to IFDocumentHandler.startPage() method.
Wired together the support for out-of-order rendering (only applicable to PDF) when the intermediate format is not used (in-memory rendering). Fixed a logical bug in IFRenderer that caused some unneeded code. Glyph adjustments (kerning, letter/word space...) were not done right. All painters fixed/adjusted accordingly. Started implementation of the PostScript painter: Supports only text and filled rectangles so far. Work in progress... git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/branches/Temp_AreaTreeNewDesign@719051 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/java/org/apache/fop/render/pdf')
-rw-r--r--src/java/org/apache/fop/render/pdf/PDFContentGenerator.java14
-rw-r--r--src/java/org/apache/fop/render/pdf/PDFDocumentHandler.java3
-rw-r--r--src/java/org/apache/fop/render/pdf/PDFPainter.java10
3 files changed, 7 insertions, 20 deletions
diff --git a/src/java/org/apache/fop/render/pdf/PDFContentGenerator.java b/src/java/org/apache/fop/render/pdf/PDFContentGenerator.java
index 35dc0960a..70e0f7eb5 100644
--- a/src/java/org/apache/fop/render/pdf/PDFContentGenerator.java
+++ b/src/java/org/apache/fop/render/pdf/PDFContentGenerator.java
@@ -186,20 +186,6 @@ public class PDFContentGenerator {
}
/**
- * Converts a transformation matrix from millipoints to points.
- * @param transform the transformation matrix (in millipoints)
- * @return the converted transformation matrix (in points)
- */
- public AffineTransform toPoints(AffineTransform transform) {
- final double[] matrix = new double[6];
- transform.getMatrix(matrix);
- //Convert from millipoints to points
- matrix[4] /= 1000;
- matrix[5] /= 1000;
- return new AffineTransform(matrix);
- }
-
- /**
* Concatenates the given transformation matrix with the current one.
* @param transform the transformation matrix (in points)
*/
diff --git a/src/java/org/apache/fop/render/pdf/PDFDocumentHandler.java b/src/java/org/apache/fop/render/pdf/PDFDocumentHandler.java
index 8937d0d1d..1358b1c5e 100644
--- a/src/java/org/apache/fop/render/pdf/PDFDocumentHandler.java
+++ b/src/java/org/apache/fop/render/pdf/PDFDocumentHandler.java
@@ -168,7 +168,8 @@ public class PDFDocumentHandler extends AbstractBinaryWritingIFDocumentHandler {
}
/** {@inheritDoc} */
- public void startPage(int index, String name, Dimension size) throws IFException {
+ public void startPage(int index, String name, String pageMasterName, Dimension size)
+ throws IFException {
this.pdfResources = this.pdfDoc.getResources();
this.currentPage = this.pdfDoc.getFactory().makePage(
diff --git a/src/java/org/apache/fop/render/pdf/PDFPainter.java b/src/java/org/apache/fop/render/pdf/PDFPainter.java
index 5baaedbea..8e29ded4c 100644
--- a/src/java/org/apache/fop/render/pdf/PDFPainter.java
+++ b/src/java/org/apache/fop/render/pdf/PDFPainter.java
@@ -100,7 +100,7 @@ public class PDFPainter extends AbstractIFPainter {
public void startViewport(AffineTransform transform, Dimension size, Rectangle clipRect)
throws IFException {
generator.saveGraphicsState();
- generator.concatenate(generator.toPoints(transform));
+ generator.concatenate(toPoints(transform));
if (clipRect != null) {
clipRect(clipRect);
}
@@ -114,7 +114,7 @@ public class PDFPainter extends AbstractIFPainter {
/** {@inheritDoc} */
public void startGroup(AffineTransform transform) throws IFException {
generator.saveGraphicsState();
- generator.concatenate(generator.toPoints(transform));
+ generator.concatenate(toPoints(transform));
}
/** {@inheritDoc} */
@@ -196,8 +196,8 @@ public class PDFPainter extends AbstractIFPainter {
if (fill == null) {
return;
}
- generator.endTextObject();
if (rect.width != 0 && rect.height != 0) {
+ generator.endTextObject();
if (fill != null) {
if (fill instanceof Color) {
generator.updateColor((Color)fill, true, null);
@@ -302,7 +302,7 @@ public class PDFPainter extends AbstractIFPainter {
//Fixed width space are rendered as spaces so copy/paste works in a reader
ch = font.mapChar(CharUtilities.SPACE);
int spaceDiff = font.getCharWidth(ch) - font.getCharWidth(orgChar);
- glyphAdjust = -(10 * spaceDiff / fontSize);
+ glyphAdjust = -spaceDiff;
} else {
ch = font.mapChar(orgChar);
}
@@ -314,7 +314,7 @@ public class PDFPainter extends AbstractIFPainter {
}
if (glyphAdjust != 0) {
- textutil.adjustGlyphTJ(-glyphAdjust / 10f);
+ textutil.adjustGlyphTJ(-glyphAdjust / fontSize);
}
}