/** * Adds or replaces the Collection Dictionary in the Catalog. * @param collection the new collection dictionary. */ void makePackage( PdfCollection collection ) { PdfDictionary catalog = reader.getCatalog(); catalog.put( PdfName.COLLECTION, collection ); }
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); }
PdfName addFont(PdfName name, PdfIndirectReference reference) { name = translateName(name); fontDictionary.put(name, reference); return name; }
PdfName addXObject(PdfName name, PdfIndirectReference reference) { name = translateName(name); xObjectDictionary.put(name, reference); return name; }
PdfName addShading(PdfName name, PdfIndirectReference reference) { name = translateName(name); shadingDictionary.put(name, reference); return name; }
void setPageAction(PdfName actionType, PdfAction action) { if (pageAA == null) { pageAA = new PdfDictionary(); } pageAA.put(actionType, action); }
/** * 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); }
PdfName addShading(PdfName name, PdfIndirectReference reference) { name = translateName(name); shadingDictionary.put(name, reference); return name; }
PdfName addExtGState(PdfName name, PdfIndirectReference reference) { name = translateName(name); extGStateDictionary.put(name, reference); return name; }
/** * 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); }
/** * Adds or replaces the Collection Dictionary in the Catalog. * @param collection the new collection dictionary. */ void makePackage( PdfCollection collection ) { PdfDictionary catalog = reader.getCatalog(); catalog.put( PdfName.COLLECTION, collection ); }
void setPageAction(PdfName actionType, PdfAction action) { if (pageAA == null) { pageAA = new PdfDictionary(); } pageAA.put(actionType, action); }
PdfName addExtGState(PdfName name, PdfIndirectReference reference) { name = translateName(name); extGStateDictionary.put(name, reference); return name; }
PdfName addProperty(PdfName name, PdfIndirectReference reference) { name = translateName(name); propertyDictionary.put(name, reference); return name; }
void readPages() throws IOException { if (refsn != null) return; refsp = null; refsn = new ArrayList(); pageInh = new ArrayList(); iteratePages((PRIndirectReference)reader.catalog.get(PdfName.PAGES)); pageInh = null; reader.rootPages.put(PdfName.COUNT, new PdfNumber(refsn.size())); }
void addDefaultColor(PdfName name, PdfObject obj) { if (obj == null || obj.isNull()) colorDictionary.remove(name); else colorDictionary.put(name, obj); }
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; }
public void setMKBackgroundColor(Color color) { if (color == null) getMK().remove(PdfName.BG); else getMK().put(PdfName.BG, getMKColor(color)); }
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()); } }