aboutsummaryrefslogtreecommitdiffstats
path: root/src/java/org/apache/fop/pdf/PDFEncoding.java
diff options
context:
space:
mode:
authorJeremias Maerki <jeremias@apache.org>2003-03-27 10:44:41 +0000
committerJeremias Maerki <jeremias@apache.org>2003-03-27 10:44:41 +0000
commit9413ba3fbda4d02b61f6e854d1bf09de195dd3ab (patch)
treed0ed6e26de1a0bece13ea671e36fe6f15759cf73 /src/java/org/apache/fop/pdf/PDFEncoding.java
parent29290e1b26ffdf806624cdc4b39a9996f6c57116 (diff)
downloadxmlgraphics-fop-9413ba3fbda4d02b61f6e854d1bf09de195dd3ab.tar.gz
xmlgraphics-fop-9413ba3fbda4d02b61f6e854d1bf09de195dd3ab.zip
The PDF object number doesn't get passed to the constructor anymore. Adjust for that.
Use the toPDFString() (returns String) method instead of toPDF() (returns byte[]) where appropriate. String to byte[] conversion is done in PDFObject in a well-defined location instead of scattered around the codebase. git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@196159 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/java/org/apache/fop/pdf/PDFEncoding.java')
-rw-r--r--src/java/org/apache/fop/pdf/PDFEncoding.java22
1 files changed, 9 insertions, 13 deletions
diff --git a/src/java/org/apache/fop/pdf/PDFEncoding.java b/src/java/org/apache/fop/pdf/PDFEncoding.java
index b048cd2db..51a4e4769 100644
--- a/src/java/org/apache/fop/pdf/PDFEncoding.java
+++ b/src/java/org/apache/fop/pdf/PDFEncoding.java
@@ -54,7 +54,6 @@ package org.apache.fop.pdf;
import java.util.List;
import java.util.Map;
import java.util.Iterator;
-import java.util.HashMap;
/**
* class representing an /Encoding object.
@@ -98,17 +97,16 @@ public class PDFEncoding extends PDFObject {
/**
* create the /Encoding object
*
- * @param number the object's number
* @param basename the name of the character encoding schema
*/
- public PDFEncoding(int number, String basename) {
+ public PDFEncoding(String basename) {
/* generic creation of PDF object */
- super(number);
+ super();
/* set fields using paramaters */
this.basename = basename;
- this.differences = new HashMap();
+ this.differences = new java.util.HashMap();
}
/**
@@ -122,14 +120,12 @@ public class PDFEncoding extends PDFObject {
}
/**
- * produce the PDF representation for the object
- *
- * @return the PDF
+ * @see org.apache.fop.pdf.PDFObject#toPDFString()
*/
- public byte[] toPDF() {
- StringBuffer p = new StringBuffer();
- p.append(this.number + " " + this.generation
- + " obj\n<< /Type /Encoding");
+ public String toPDFString() {
+ StringBuffer p = new StringBuffer(128);
+ p.append(getObjectID()
+ + "<< /Type /Encoding");
if ((basename != null) && (!basename.equals(""))) {
p.append("\n/BaseEncoding /" + this.basename);
}
@@ -150,7 +146,7 @@ public class PDFEncoding extends PDFObject {
p.append(" ]");
}
p.append(" >>\nendobj\n");
- return p.toString().getBytes();
+ return p.toString();
}
/*