// ... if (actionDict == null) { actionDict = new PdfDictionary(); // add the newly created action dict widgetRefDict.put(PdfName.AA, actionDict); } // ...
void setPageAction(PdfName actionType, PdfAction action) { if (pageAA == null) { pageAA = new PdfDictionary(); } pageAA.put(actionType, action); }
void setPageAction(PdfName actionType, PdfAction action) { if (pageAA == null) { pageAA = new PdfDictionary(); } pageAA.put(actionType, action); }
/** * Begins a marked content sequence. This sequence will be tagged with the structure <CODE>struc</CODE>. * The same structure can be used several times to connect text that belongs to the same logical segment * but is in a different location, like the same paragraph crossing to another page, for example. * @param struc the tagging structure */ public void beginMarkedContentSequence(PdfStructureElement struc) { PdfDictionary dict = new PdfDictionary(); beginMarkedContentSequence(struc, dict); }
private void pushPageAttributes(PdfDictionary nodePages) { PdfDictionary dic = new PdfDictionary(); if (!pageInh.isEmpty()) { dic.putAll((PdfDictionary)pageInh.get(pageInh.size() - 1)); } for (int k = 0; k < pageInhCandidates.length; ++k) { PdfObject obj = nodePages.get(pageInhCandidates[k]); if (obj != null) dic.put(pageInhCandidates[k], obj); } pageInh.add(dic); }
private PdfDictionary getUsage() { PdfDictionary usage = (PdfDictionary)get(PdfName.USAGE); if (usage == null) { usage = new PdfDictionary(); put(PdfName.USAGE, usage); } return usage; }
PdfDictionary getMK() { PdfDictionary mk = (PdfDictionary)get(PdfName.MK); if (mk == null) { mk = new PdfDictionary(); put(PdfName.MK, mk); } return mk; }
private PdfDictionary getUsage() { PdfDictionary usage = (PdfDictionary)get(PdfName.USAGE); if (usage == null) { usage = new PdfDictionary(); put(PdfName.USAGE, usage); } return usage; }
PdfDictionary getMK() { PdfDictionary mk = (PdfDictionary)get(PdfName.MK); if (mk == null) { mk = new PdfDictionary(); put(PdfName.MK, mk); } return mk; }
protected static PdfDictionary duplicatePdfDictionary(PdfDictionary original, PdfDictionary copy, PdfReader newReader) { if (copy == null) copy = new PdfDictionary(); for (Iterator it = original.getKeys().iterator(); it.hasNext();) { PdfName key = (PdfName)it.next(); copy.put(key, duplicatePdfObject(original.get(key), newReader)); } return copy; }
/** * Indicates that the group should be set to that state when the * document is opened in a viewer application. * @param view the view state */ public void setView(boolean view) { PdfDictionary usage = getUsage(); PdfDictionary dic = new PdfDictionary(); dic.put(PdfName.VIEWSTATE, view ? PdfName.ON : PdfName.OFF); usage.put(PdfName.VIEW, dic); }
/** * Indicates that the group should be set to that state when the * document is opened in a viewer application. * @param view the view state */ public void setView(boolean view) { PdfDictionary usage = getUsage(); PdfDictionary dic = new PdfDictionary(); dic.put(PdfName.VIEWSTATE, view ? PdfName.ON : PdfName.OFF); usage.put(PdfName.VIEW, dic); }
void addAdditionalAction(PdfName actionType, PdfAction action) { if (additionalActions == null) { additionalActions = new PdfDictionary(); } if (action == null) additionalActions.remove(actionType); else additionalActions.put(actionType, action); if (additionalActions.size() == 0) additionalActions = null; }
void addAdditionalAction(PdfName actionType, PdfAction action) { if (additionalActions == null) { additionalActions = new PdfDictionary(); } if (action == null) additionalActions.remove(actionType); else additionalActions.put(actionType, action); if (additionalActions.size() == 0) additionalActions = null; }
protected static PdfDictionary duplicatePdfDictionary(PdfDictionary original, PdfDictionary copy, PdfReader newReader) { if (copy == null) copy = new PdfDictionary(); for (Object o : original.getKeys()) { PdfName key = (PdfName) o; copy.put(key, duplicatePdfObject(original.get(key), newReader)); } return copy; }
public void setAdditionalActions(PdfName key, PdfAction action) { PdfDictionary dic; PdfObject obj = get(PdfName.AA); if (obj != null && obj.isDictionary()) { dic = (PdfDictionary) obj; } else { dic = new PdfDictionary(); } dic.put(key, action); put(PdfName.AA, dic); }
public void setAdditionalActions(PdfName key, PdfAction action) { PdfDictionary dic; PdfObject obj = get(PdfName.AA); if (obj != null && obj.isDictionary()) dic = (PdfDictionary)obj; else dic = new PdfDictionary(); dic.put(key, action); put(PdfName.AA, dic); }
protected void writeOutlines(PdfDictionary catalog, boolean namedAsNames) throws IOException { if (newBookmarks == null || newBookmarks.isEmpty()) return; PdfDictionary top = new PdfDictionary(); PdfIndirectReference topRef = getPdfIndirectReference(); Object[] kids = SimpleBookmark.iterateOutlines(this, topRef, newBookmarks, namedAsNames); top.put(PdfName.FIRST, (PdfIndirectReference)kids[0]); top.put(PdfName.LAST, (PdfIndirectReference)kids[1]); top.put(PdfName.COUNT, new PdfNumber(((Integer)kids[2]).intValue())); addToBody(top, topRef); catalog.put(PdfName.OUTLINES, topRef); }
PdfMediaClipData(String file, PdfFileSpecification fs, String mimeType) throws IOException { put(PdfName.TYPE,new PdfName("MediaClip")); put(PdfName.S, new PdfName("MCD")); put(PdfName.N, new PdfString("Media clip for "+file)); put(new PdfName("CT"), new PdfString(mimeType)); PdfDictionary dic = new PdfDictionary(); dic.put(new PdfName("TF"), new PdfString("TEMPACCESS")); put(new PdfName("P"), dic); put(PdfName.D, fs.getReference()); } }
PdfMediaClipData(String file, PdfFileSpecification fs, String mimeType) throws IOException { put(PdfName.TYPE,new PdfName("MediaClip")); put(PdfName.S, new PdfName("MCD")); put(PdfName.N, new PdfString("Media clip for "+file)); put(new PdfName("CT"), new PdfString(mimeType)); PdfDictionary dic = new PdfDictionary(); dic.put(new PdfName("TF"), new PdfString("TEMPACCESS")); put(new PdfName("P"), dic); put(PdfName.D, fs.getReference()); } }