public void invoke(PdfContentStreamProcessor processor, PdfLiteral operator, ArrayList operands) { processor.invokeOperator(new PdfLiteral("T*"), new ArrayList(0)); processor.invokeOperator(new PdfLiteral("Tj"), operands); } }
if (bf.size() > lit.getPosLength()) { throw new IllegalArgumentException("The key " + key.toString() + " is too big. Is " + bf.size() + ", reserved " + lit.getPosLength()); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ System.arraycopy(bf.getBuffer(), 0, this.bout, lit.getPosition(), bf.size()); } else { this.raf.seek(lit.getPosition()); this.raf.write(bf.getBuffer(), 0, bf.size());
String lit = ((PdfLiteral)in).toString(); if (lit.equals("true") || lit.equals("false")) { return new PdfBoolean(lit); return new PdfLiteral(lit);
sigStandard.setSignInfo(getPrivKey(), getCertChain(), getCrlList()); PdfString contents = (PdfString)sigStandard.get(PdfName.CONTENTS); PdfLiteral lit = new PdfLiteral((contents.toString().length() + (PdfName.ADOBE_PPKLITE.equals(getFilter())?0:64)) * 2 + 2); exclusionLocations.put(PdfName.CONTENTS, lit); sigStandard.put(PdfName.CONTENTS, lit); lit = new PdfLiteral(80); exclusionLocations.put(PdfName.BYTERANGE, lit); sigStandard.put(PdfName.BYTERANGE, lit); PdfLiteral lit = new PdfLiteral(80); exclusionLocations.put(PdfName.BYTERANGE, lit); cryptoDictionary.put(PdfName.BYTERANGE, lit); PdfName key = (PdfName)entry.getKey(); Integer v = (Integer)entry.getValue(); lit = new PdfLiteral(v.intValue()); exclusionLocations.put(key, lit); cryptoDictionary.put(key, lit); int byteRangePosition = ((PdfLiteral)exclusionLocations.get(PdfName.BYTERANGE)).getPosition(); exclusionLocations.remove(PdfName.BYTERANGE); int idx = 1; for (Iterator it = exclusionLocations.values().iterator(); it.hasNext();) { PdfLiteral lit = (PdfLiteral)it.next(); int n = lit.getPosition(); range[idx++] = n; range[idx++] = lit.getPosLength() + n;
/** * Invokes an operator. * @param operator the PDF Syntax of the operator * @param operands a list with operands */ private void invokeOperator(PdfLiteral operator, ArrayList operands){ ContentOperator op = (ContentOperator)operators.get(operator.toString()); if (op == null){ //System.out.println("Skipping operator " + operator); return; } op.invoke(this, operator, operands); }
PdfSigGenericPKCS sig = sigApp.getSigStandard(); PdfLiteral lit = (PdfLiteral)sig.get(PdfName.CONTENTS); int totalBuf = (lit.getPosLength() - 2) / 2; byte buf[] = new byte[8192]; int n;
this.sigStandard.setSignInfo(getPrivKey(), getCertChain(), getCrlList()); final PdfString contents = (PdfString)this.sigStandard.get(PdfName.CONTENTS); PdfLiteral lit = new PdfLiteral((contents.toString().length() + (PdfName.ADOBE_PPKLITE.equals(getFilter())?0:64)) * 2 + 2); this.exclusionLocations.put(PdfName.CONTENTS, lit); this.sigStandard.put(PdfName.CONTENTS, lit); lit = new PdfLiteral(80); this.exclusionLocations.put(PdfName.BYTERANGE, lit); this.sigStandard.put(PdfName.BYTERANGE, lit); PdfLiteral lit = new PdfLiteral(80); this.exclusionLocations.put(PdfName.BYTERANGE, lit); this.cryptoDictionary.put(PdfName.BYTERANGE, lit); final PdfName key = (PdfName)entry.getKey(); final Integer v = (Integer)entry.getValue(); lit = new PdfLiteral(v.intValue()); this.exclusionLocations.put(key, lit); this.cryptoDictionary.put(key, lit); final int byteRangePosition = ((PdfLiteral)this.exclusionLocations.get(PdfName.BYTERANGE)).getPosition(); this.exclusionLocations.remove(PdfName.BYTERANGE); int idx = 1; for (final Iterator it = this.exclusionLocations.values().iterator(); it.hasNext();) { final PdfLiteral lit = (PdfLiteral)it.next(); final int n = lit.getPosition(); this.range[idx++] = n; this.range[idx++] = lit.getPosLength() + n;
/** * Invokes an operator. * @param operator the PDF Syntax of the operator * @param operands a list with operands */ public void invokeOperator(PdfLiteral operator, ArrayList operands){ ContentOperator op = (ContentOperator)operators.get(operator.toString()); if (op == null){ //System.out.println("Skipping operator " + operator); return; } op.invoke(this, operator, operands); }
final PdfSigGenericPKCS sig = this.sigApp.getSigStandard(); final PdfLiteral lit = (PdfLiteral)sig.get(PdfName.CONTENTS); final int totalBuf = (lit.getPosLength() - 2) / 2; byte buf[] = new byte[8192]; int n;
public void invoke(PdfContentStreamProcessor processor, PdfLiteral operator, ArrayList operands) { PdfNumber aw = (PdfNumber)operands.get(0); PdfNumber ac = (PdfNumber)operands.get(1); PdfString string = (PdfString)operands.get(2); ArrayList twOperands = new ArrayList(1); twOperands.add(0, aw); processor.invokeOperator(new PdfLiteral("Tw"), twOperands); ArrayList tcOperands = new ArrayList(1); tcOperands.add(0, ac); processor.invokeOperator(new PdfLiteral("Tc"), tcOperands); ArrayList tickOperands = new ArrayList(1); tickOperands.add(0, string); processor.invokeOperator(new PdfLiteral("'"), tickOperands); } }
PdfLiteral lit = new PdfLiteral( (contents.toString().length() + (PdfName.ADOBE_PPKLITE .equals(getFilter()) ? 0 : 64)) * 2 + 2); exclusionLocations.put(PdfName.CONTENTS, lit); sigStandard.put(PdfName.CONTENTS, lit); lit = new PdfLiteral(80); exclusionLocations.put(PdfName.BYTERANGE, lit); sigStandard.put(PdfName.BYTERANGE, lit); writer.addToBody(sigStandard, refSig, false); } else { PdfLiteral lit = new PdfLiteral(80); exclusionLocations.put(PdfName.BYTERANGE, lit); cryptoDictionary.put(PdfName.BYTERANGE, lit); PdfName key = (PdfName) entry.getKey(); Integer v = (Integer) entry.getValue(); lit = new PdfLiteral(v); exclusionLocations.put(key, lit); cryptoDictionary.put(key, lit); .get(PdfName.BYTERANGE)).getPosition(); exclusionLocations.remove(PdfName.BYTERANGE); int idx = 1; for (Iterator it = exclusionLocations.values().iterator(); it.hasNext();) { PdfLiteral lit = (PdfLiteral) it.next(); int n = lit.getPosition(); range[idx++] = n; range[idx++] = lit.getPosLength() + n;
bf.reset(); obj.toPdf(null, bf); if (bf.size() > lit.getPosLength()) throw new IllegalArgumentException(MessageLocalization.getComposedMessage("the.key.1.is.too.big.is.2.reserved.3", key.toString(), String.valueOf(bf.size()), String.valueOf(lit.getPosLength()))); if (tempFile == null) System.arraycopy(bf.getBuffer(), 0, bout, lit.getPosition(), bf.size()); else { raf.seek(lit.getPosition()); raf.write(bf.getBuffer(), 0, bf.size());
String lit = ((PdfLiteral)in).toString(); if (lit.equals("true") || lit.equals("false")) { return new PdfBoolean(lit); return new PdfLiteral(lit);
/** * Invokes an operator. * * @param operator * the PDF Syntax of the operator * @param operands * a list with operands * @param resources * Pdf Resources found in the file containing the stream. */ public void invokeOperator(PdfLiteral operator, ArrayList<PdfObject> operands, PdfDictionary resources) { String operatorName = operator.toString(); ContentOperator op = lookupOperator(operatorName); if (op == null) { // System.out.println("Skipping operator " + operator); return; } // System.err.println(operator); // System.err.println(operands); op.invoke(operands, this, resources); }
PdfSigGenericPKCS sig = sigApp.getSigStandard(); PdfLiteral lit = (PdfLiteral)sig.get(PdfName.CONTENTS); int totalBuf = (lit.getPosLength() - 2) / 2; byte[] buf = new byte[8192]; int n;
public void invoke(PdfContentStreamProcessor processor, PdfLiteral operator, ArrayList operands) { float ty = ((PdfNumber)operands.get(1)).floatValue(); ArrayList tlOperands = new ArrayList(1); tlOperands.add(0, new PdfNumber(-ty)); processor.invokeOperator(new PdfLiteral("TL"), tlOperands); processor.invokeOperator(new PdfLiteral("Td"), operands); } }
bf.reset(); obj.toPdf(null, bf); if (bf.size() > lit.getPosLength()) throw new IllegalArgumentException( MessageLocalization.getComposedMessage( "the.key.1.is.too.big.is.2.reserved.3", key.toString(), String.valueOf(bf.size()), String.valueOf(lit.getPosLength()))); if (tempFile == null) System.arraycopy(bf.getBuffer(), 0, bout, lit.getPosition(), bf.size()); else { raf.seek(lit.getPosition()); raf.write(bf.getBuffer(), 0, bf.size());
private PdfDictionary getFontDescriptor() { PdfDictionary dic = new PdfDictionary(PdfName.FONTDESCRIPTOR); dic.put(PdfName.ASCENT, new PdfLiteral((String)fontDesc.get("Ascent"))); dic.put(PdfName.CAPHEIGHT, new PdfLiteral((String)fontDesc.get("CapHeight"))); dic.put(PdfName.DESCENT, new PdfLiteral((String)fontDesc.get("Descent"))); dic.put(PdfName.FLAGS, new PdfLiteral((String)fontDesc.get("Flags"))); dic.put(PdfName.FONTBBOX, new PdfLiteral((String)fontDesc.get("FontBBox"))); dic.put(PdfName.FONTNAME, new PdfName(fontName + style)); dic.put(PdfName.ITALICANGLE, new PdfLiteral((String)fontDesc.get("ItalicAngle"))); dic.put(PdfName.STEMV, new PdfLiteral((String)fontDesc.get("StemV"))); PdfDictionary pdic = new PdfDictionary(); pdic.put(PdfName.PANOSE, new PdfString((String)fontDesc.get("Panose"), null)); dic.put(PdfName.STYLE, pdic); return dic; }
private PdfDictionary getFontDescriptor() { PdfDictionary dic = new PdfDictionary(PdfName.FONTDESCRIPTOR); dic.put(PdfName.ASCENT, new PdfLiteral((String)fontDesc.get("Ascent"))); dic.put(PdfName.CAPHEIGHT, new PdfLiteral((String)fontDesc.get("CapHeight"))); dic.put(PdfName.DESCENT, new PdfLiteral((String)fontDesc.get("Descent"))); dic.put(PdfName.FLAGS, new PdfLiteral((String)fontDesc.get("Flags"))); dic.put(PdfName.FONTBBOX, new PdfLiteral((String)fontDesc.get("FontBBox"))); dic.put(PdfName.FONTNAME, new PdfName(fontName + style)); dic.put(PdfName.ITALICANGLE, new PdfLiteral((String)fontDesc.get("ItalicAngle"))); dic.put(PdfName.STEMV, new PdfLiteral((String)fontDesc.get("StemV"))); PdfDictionary pdic = new PdfDictionary(); pdic.put(PdfName.PANOSE, new PdfString((String)fontDesc.get("Panose"), null)); dic.put(PdfName.STYLE, pdic); return dic; }
private PdfDictionary getFontDescriptor() { PdfDictionary dic = new PdfDictionary(PdfName.FONTDESCRIPTOR); dic.put(PdfName.ASCENT, new PdfLiteral((String) fontDesc.get("Ascent"))); dic.put(PdfName.CAPHEIGHT, new PdfLiteral((String) fontDesc.get("CapHeight"))); dic.put(PdfName.DESCENT, new PdfLiteral((String) fontDesc.get("Descent"))); dic.put(PdfName.FLAGS, new PdfLiteral((String) fontDesc.get("Flags"))); dic.put(PdfName.FONTBBOX, new PdfLiteral((String) fontDesc.get("FontBBox"))); dic.put(PdfName.FONTNAME, new PdfName(fontName + style)); dic.put(PdfName.ITALICANGLE, new PdfLiteral((String) fontDesc.get("ItalicAngle"))); dic.put(PdfName.STEMV, new PdfLiteral((String) fontDesc.get("StemV"))); PdfDictionary pdic = new PdfDictionary(); pdic.put(PdfName.PANOSE, new PdfString((String) fontDesc.get("Panose"), null)); dic.put(PdfName.STYLE, pdic); return dic; }