1 package com.lowagie.text.pdf.collection; 2 3 import com.lowagie.text.pdf.PdfDictionary; 4 import com.lowagie.text.pdf.PdfName; 5 import com.lowagie.text.pdf.PdfNumber; 6 import com.lowagie.text.pdf.PdfObject; 7 import com.lowagie.text.pdf.PdfString; 8 9 public class PdfTargetDictionary extends PdfDictionary { 10 11 15 public PdfTargetDictionary(PdfTargetDictionary nested) { 16 super(); 17 put(PdfName.R, PdfName.P); 18 if (nested != null) 19 setAdditionalPath(nested); 20 } 21 22 26 public PdfTargetDictionary(boolean child) { 27 super(); 28 if (child) { 29 put(PdfName.R, PdfName.C); 30 } 31 else { 32 put(PdfName.R, PdfName.P); 33 } 34 } 35 36 41 public void setEmbeddedFileName(String target) { 42 put(PdfName.N, new PdfString(target, null)); 43 } 44 45 51 public void setFileAttachmentPagename(String name) { 52 put(PdfName.P, new PdfString(name, null)); 53 } 54 55 61 public void setFileAttachmentPage(int page) { 62 put(PdfName.P, new PdfNumber(page)); 63 } 64 65 71 public void setFileAttachmentName(String name) { 72 put(PdfName.A, new PdfString(name, PdfObject.TEXT_UNICODE)); 73 } 74 75 81 public void setFileAttachmentIndex(int annotation) { 82 put(PdfName.A, new PdfNumber(annotation)); 83 } 84 85 90 public void setAdditionalPath(PdfTargetDictionary nested) { 91 put(PdfName.T, nested); 92 } 93 } 94 | Popular Tags |