/** * Resets the additional pageDictEntries. * @since 5.1.0 */ public void resetPageDictEntries() { pageDictEntries = new PdfDictionary(); }
public void mapClass(PdfName name, PdfObject object) { if (classMap == null) { classMap = new PdfDictionary(); classes = new HashMap<PdfName, PdfObject>(); } classes.put(name,object); }
void setPageAction(final PdfName actionType, final PdfAction action) { if (pageAA == null) { pageAA = new PdfDictionary(); } pageAA.put(actionType, action); }
public ExternalBlankSignatureContainer(PdfName filter, PdfName subFilter) { sigDic = new PdfDictionary(); sigDic.put(PdfName.FILTER, filter); sigDic.put(PdfName.SUBFILTER, subFilter); }
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 = getAsDict(PdfName.USAGE); if (usage == null) { usage = new PdfDictionary(); put(PdfName.USAGE, usage); } return usage; }
public ExternalBlankSignatureContainer(PdfName filter, PdfName subFilter) { sigDic = new PdfDictionary(); sigDic.put(PdfName.FILTER, filter); sigDic.put(PdfName.SUBFILTER, subFilter); }
public void setAppearance(PdfName ap, PdfTemplate template) { PdfDictionary dic = (PdfDictionary)get(PdfName.AP); if (dic == null) dic = new PdfDictionary(); dic.put(ap, template.getIndirectReference()); put(PdfName.AP, dic); if (!form) return; if (templates == null) templates = new HashSet<PdfTemplate>(); templates.add(template); }
/** * Generations the developer extension dictionary corresponding * with the prefix. * @return a PdfDictionary */ public PdfDictionary getDeveloperExtensions() { PdfDictionary developerextensions = new PdfDictionary(); developerextensions.put(PdfName.BASEVERSION, baseversion); developerextensions.put(PdfName.EXTENSIONLEVEL, new PdfNumber(extensionLevel)); return developerextensions; } }
/** * 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); }
/** * Sets the attribute value. * @since 5.3.4 */ public void setAttribute(PdfName name, PdfObject obj){ PdfDictionary attr = getAsDict(PdfName.A); if (attr == null){ attr = new PdfDictionary(); put(PdfName.A, attr); } attr.put(name, obj); }
void addAdditionalAction(final PdfName actionType, final 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; }
private static PdfDictionary createBuiltInFontDictionary(PdfName name) { if (name == null) { return null; } PdfDictionary dictionary = new PdfDictionary(); dictionary.put(PdfName.TYPE, PdfName.FONT); dictionary.put(PdfName.BASEFONT, name); dictionary.put(PdfName.SUBTYPE, PdfName.TYPE1); return dictionary; }
void addAdditionalAction(final PdfName actionType, final 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; }
/** * Sets the attribute value. * @since 5.3.4 */ public void setAttribute(PdfName name, PdfObject obj){ PdfDictionary attr = getAsDict(PdfName.A); if (attr == null){ attr = new PdfDictionary(); put(PdfName.A, attr); } attr.put(name, obj); }
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); }
private PdfDictionary getFontBaseType(PdfIndirectReference CIDFont) { PdfDictionary dic = new PdfDictionary(PdfName.FONT); dic.put(PdfName.SUBTYPE, PdfName.TYPE0); String name = fontName; if (style.length() > 0) name += "-" + style.substring(1); name += "-" + CMap; dic.put(PdfName.BASEFONT, new PdfName(name)); dic.put(PdfName.ENCODING, new PdfName(CMap)); dic.put(PdfName.DESCENDANTFONTS, new PdfArray(CIDFont)); return dic; }
protected void writeOutlines(final PdfDictionary catalog, final 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); }
protected void writeOutlines(final PdfDictionary catalog, final 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); }