1 51 package org.apache.fop.pdf; 52 53 import java.io.UnsupportedEncodingException ; 55 56 60 public class PDFFileSpec extends PDFObject { 61 62 65 protected String filename; 66 67 73 public PDFFileSpec(int number, String filename) { 74 75 76 super(number); 77 78 this.filename = filename; 79 } 80 81 86 public byte[] toPDF() { 87 String p = new String (this.number + " " + this.generation 88 + " obj\n<<\n/Type /FileSpec\n" + "/F (" 89 + this.filename + ")\n" + ">>\nendobj\n"); 90 91 try { 92 return p.getBytes(PDFDocument.ENCODING); 93 } catch (UnsupportedEncodingException ue) { 94 return p.getBytes(); 95 } 96 } 97 98 107 } 108 | Popular Tags |