public void modifySigningDictionary(PdfDictionary signDic) { signDic.putAll(sigDic); }
public void modifySigningDictionary(PdfDictionary signDic) { signDic.putAll(sigDic); }
/** * Adds a PdfDictionary to the pageInh stack to keep track of the page attributes. * @param nodePages a Pages dictionary */ private void pushPageAttributes(final PdfDictionary nodePages) { PdfDictionary dic = new PdfDictionary(); if (!pageInh.isEmpty()) { dic.putAll(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); }
/** * Adds a PdfDictionary to the pageInh stack to keep track of the page attributes. * @param nodePages a Pages dictionary */ private void pushPageAttributes(final PdfDictionary nodePages) { PdfDictionary dic = new PdfDictionary(); if (!pageInh.isEmpty()) { dic.putAll(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); }
void add(PdfName key, PdfDictionary resource) { if (resource.size() == 0) return; PdfDictionary dic = getAsDict(key); if (dic == null) put(key, resource); else dic.putAll(resource); } }
void add(PdfName key, PdfDictionary resource) { if (resource.size() == 0) return; PdfDictionary dic = getAsDict(key); if (dic == null) put(key, resource); else dic.putAll(resource); } }
/** * merge field attributes from two dictionaries * @param parent one dictionary * @param child the other dictionary * @return a merged dictionary */ protected PdfDictionary mergeAttrib(PdfDictionary parent, PdfDictionary child) { PdfDictionary targ = new PdfDictionary(); if (parent != null) targ.putAll(parent); for (Object element : child.getKeys()) { PdfName key = (PdfName) element; if (key.equals(PdfName.DR) || key.equals(PdfName.DA) || key.equals(PdfName.Q) || key.equals(PdfName.FF) || key.equals(PdfName.DV) || key.equals(PdfName.V) || key.equals(PdfName.FT) || key.equals(PdfName.NM) || key.equals(PdfName.F)) { targ.put(key,child.get(key)); } } return targ; } /**
if (contents != null) { if (contents.isStream()) dic.putAll((PRStream)contents); else bout = reader.getPageContent(pageNumber, file);
/** * merge field attributes from two dictionaries * @param parent one dictionary * @param child the other dictionary * @return a merged dictionary */ protected PdfDictionary mergeAttrib(PdfDictionary parent, PdfDictionary child) { PdfDictionary targ = new PdfDictionary(); if (parent != null) targ.putAll(parent); for (Object element : child.getKeys()) { PdfName key = (PdfName) element; if (key.equals(PdfName.DR) || key.equals(PdfName.DA) || key.equals(PdfName.Q) || key.equals(PdfName.FF) || key.equals(PdfName.DV) || key.equals(PdfName.V) || key.equals(PdfName.FT) || key.equals(PdfName.NM) || key.equals(PdfName.F)) { targ.put(key,child.get(key)); } } return targ; } /**
if (contents != null) { if (contents.isStream()) dic.putAll((PRStream)contents); else bout = reader.getPageContent(pageNumber, file);
if (trailer == null) { trailer = new PdfDictionary(); trailer.putAll(stm);
if (trailer == null) { trailer = new PdfDictionary(); trailer.putAll(stm);
/** * Adds keys to the signature dictionary that define * the field permissions. * This method is only used for signatures that lock fields. * @param crypto the signature dictionary */ private void addFieldMDP(PdfDictionary crypto, PdfDictionary fieldLock) { PdfDictionary reference = new PdfDictionary(); PdfDictionary transformParams = new PdfDictionary(); transformParams.putAll(fieldLock); transformParams.put(PdfName.TYPE, PdfName.TRANSFORMPARAMS); transformParams.put(PdfName.V, new PdfName("1.2")); reference.put(PdfName.TRANSFORMMETHOD, PdfName.FIELDMDP); reference.put(PdfName.TYPE, PdfName.SIGREF); reference.put(PdfName.TRANSFORMPARAMS, transformParams); reference.put(new PdfName("DigestValue"), new PdfString("aa")); PdfArray loc = new PdfArray(); loc.add(new PdfNumber(0)); loc.add(new PdfNumber(0)); reference.put(new PdfName("DigestLocation"), loc); reference.put(new PdfName("DigestMethod"), new PdfName("MD5")); reference.put(PdfName.DATA, writer.reader.getTrailer().get(PdfName.ROOT)); PdfArray types = crypto.getAsArray(PdfName.REFERENCE); if (types == null) types = new PdfArray(); types.add(reference); crypto.put(PdfName.REFERENCE, types); }
/** * Adds keys to the signature dictionary that define * the field permissions. * This method is only used for signatures that lock fields. * @param crypto the signature dictionary */ private void addFieldMDP(PdfDictionary crypto, PdfDictionary fieldLock) { PdfDictionary reference = new PdfDictionary(); PdfDictionary transformParams = new PdfDictionary(); transformParams.putAll(fieldLock); transformParams.put(PdfName.TYPE, PdfName.TRANSFORMPARAMS); transformParams.put(PdfName.V, new PdfName("1.2")); reference.put(PdfName.TRANSFORMMETHOD, PdfName.FIELDMDP); reference.put(PdfName.TYPE, PdfName.SIGREF); reference.put(PdfName.TRANSFORMPARAMS, transformParams); reference.put(new PdfName("DigestValue"), new PdfString("aa")); PdfArray loc = new PdfArray(); loc.add(new PdfNumber(0)); loc.add(new PdfNumber(0)); reference.put(new PdfName("DigestLocation"), loc); reference.put(new PdfName("DigestMethod"), new PdfName("MD5")); reference.put(PdfName.DATA, writer.reader.getTrailer().get(PdfName.ROOT)); PdfArray types = crypto.getAsArray(PdfName.REFERENCE); if (types == null) types = new PdfArray(); types.add(reference); crypto.put(PdfName.REFERENCE, types); }