aboutsummaryrefslogtreecommitdiffstats
path: root/src/org/apache/fop/pdf/PDFResources.java
diff options
context:
space:
mode:
authorarved <arved@unknown>2000-03-10 02:46:00 +0000
committerarved <arved@unknown>2000-03-10 02:46:00 +0000
commitb2154ba72daa822884cc0cfec32b982a96f7fe60 (patch)
treee6ae70be11bfda23123f161df2ec4aafbeb6ec89 /src/org/apache/fop/pdf/PDFResources.java
parent49e2668b1bad5f88bc17eaaf1883aa1abc9dc62b (diff)
downloadxmlgraphics-fop-b2154ba72daa822884cc0cfec32b982a96f7fe60.tar.gz
xmlgraphics-fop-b2154ba72daa822884cc0cfec32b982a96f7fe60.zip
support for empty fonts situation
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@193290 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/org/apache/fop/pdf/PDFResources.java')
-rw-r--r--src/org/apache/fop/pdf/PDFResources.java63
1 files changed, 35 insertions, 28 deletions
diff --git a/src/org/apache/fop/pdf/PDFResources.java b/src/org/apache/fop/pdf/PDFResources.java
index 32e39b068..0425f2c3b 100644
--- a/src/org/apache/fop/pdf/PDFResources.java
+++ b/src/org/apache/fop/pdf/PDFResources.java
@@ -98,36 +98,43 @@ public class PDFResources extends PDFObject {
*
* @return the PDF
*/
- public String toPDF() {
- StringBuffer p = new StringBuffer(this.number + " "
- + this.generation
- + " obj\n<< /Font << ");
+ public String toPDF() {
+ StringBuffer p = new StringBuffer(this.number + " "
+ + this.generation
+ + " obj\n<< \n");
+ if(!this.fonts.isEmpty())
+ {
+ p.append("/Font << ");
- /* construct PDF dictionary of font object references */
- Enumeration fontEnumeration = fonts.keys();
- while (fontEnumeration.hasMoreElements()) {
- String fontName = (String) fontEnumeration.nextElement();
- p = p.append("/" + fontName + " "
- + ((PDFFont) fonts.get(fontName)).referencePDF()
- + "\n");
- }
+ /* construct PDF dictionary of font object references */
+ Enumeration fontEnumeration = fonts.keys();
+ while (fontEnumeration.hasMoreElements()) {
+ String fontName = (String) fontEnumeration.nextElement();
+ p = p.append("/" + fontName + " "
+ + ((PDFFont) fonts.get(fontName)).referencePDF()
+ + "\n");
+ }
+
+ p = p.append(">>\n");
+ }
+
+ p.append("/ProcSet [ /PDF /ImageC /Text ] ");
- p = p.append(">>\n/ProcSet [ /PDF /ImageC /Text ] ");
+ if (!this.xObjects.isEmpty())
+ {
+ p = p.append("/XObject <<");
+ for (int i = 1; i < this.xObjects.size(); i++) {
+ p = p.append("/Im" + i + " " +
+ ((PDFXObject)
+ this.xObjects.elementAt(i -
+ 1)).referencePDF()
+ +
+ " \n");
+ }
+ }
- if (!this.xObjects.isEmpty()) {
- p = p.append("/XObject <<");
- for (int i = 1; i < this.xObjects.size(); i++) {
- p = p.append("/Im" + i + " " +
- ((PDFXObject)
- this.xObjects.elementAt(i -
- 1)).referencePDF()
- +
- " \n");
- }
- }
+ p = p.append(">>\nendobj\n");
- p = p.append(">>\nendobj\n");
-
- return p.toString();
- }
+ return p.toString();
+ }
}