/** * read the next object from the file * @param objNum the object number of the object containing the object * being read; negative only if the object number is unavailable (e.g., if * reading from the trailer, or reading at the top level, in which * case we can expect to be reading an object description) * @param objGen the object generation of the object containing the object * being read; negative only if the objNum is unavailable * @param decrypter the decrypter to use */ private PDFObject readObject( int objNum, int objGen, PDFDecrypter decrypter) throws IOException { return readObject(objNum, objGen, false, decrypter); }
PDFObject testnum= readObject(-1, -1, true, decrypter); if (testnum != null && testnum.getType() == PDFObject.NUMBER) { PDFObject testR= readObject(-1, -1, true, decrypter); if (testR != null && testR.getType() == PDFObject.KEYWORD &&
/** * read the next object from the file * @param buf the buffer to read from * @param objNum the object number of the object containing the object * being read; negative only if the object number is unavailable (e.g., if * reading from the trailer, or reading at the top level, in which * case we can expect to be reading an object description) * @param objGen the object generation of the object containing the object * being read; negative only if the objNum is unavailable * @param decrypter the decrypter to use */ private PDFObject readObject( ByteBuffer buf, int objNum, int objGen, PDFDecrypter decrypter) throws IOException { return readObject(buf, objNum, objGen, false, decrypter); }
PDFObject testnum= readObject(buf, -1, -1, true, decrypter); if (testnum != null && testnum.getType() == PDFObject.NUMBER) { PDFObject testR= readObject(buf, -1, -1, true, decrypter); if (testR != null && testR.getType() == PDFObject.KEYWORD &&
/** * read the next object from the file * @param objNum the object number of the object containing the object * being read; negative only if the object number is unavailable (e.g., if * reading from the trailer, or reading at the top level, in which * case we can expect to be reading an object description) * @param objGen the object generation of the object containing the object * being read; negative only if the objNum is unavailable * @param decrypter the decrypter to use */ private PDFObject readObject( int objNum, int objGen, PDFDecrypter decrypter) throws IOException { return readObject(objNum, objGen, false, decrypter); }
PDFObject testnum= readObject(-1, -1, true, decrypter); if (testnum != null && testnum.getType() == PDFObject.NUMBER) { PDFObject testR= readObject(-1, -1, true, decrypter); if (testR != null && testR.getType() == PDFObject.KEYWORD &&
/** * read an [ array ]. The initial [ has already been read. PDFObjects * are read until ]. * @param objNum the object number of the object containing the dictionary * being read; negative only if the object number is unavailable, which * should only happen if we're reading an array placed directly * in the trailer * @param objGen the object generation of the object containing the object * being read; negative only if the objNum is unavailable * @param decrypter the decrypter to use */ private PDFObject readArray( int objNum, int objGen, PDFDecrypter decrypter) throws IOException { // we've already read the [. Now read objects until ] ArrayList<PDFObject> ary = new ArrayList<PDFObject>(); PDFObject obj; while((obj= readObject(objNum, objGen, decrypter))!=null) { ary.add(obj); } if (buf.get() != ']') { throw new PDFParseException("Array should end with ']'"); } PDFObject[] objlist = new PDFObject[ary.size()]; for (int i = 0; i < objlist.length; i++) { objlist[i] = (PDFObject) ary.get(i); } return new PDFObject(this, PDFObject.ARRAY, objlist); }
/** * read an [ array ]. The initial [ has already been read. PDFObjects * are read until ]. * @param buf the buffer to read from * @param objNum the object number of the object containing the dictionary * being read; negative only if the object number is unavailable, which * should only happen if we're reading an array placed directly * in the trailer * @param objGen the object generation of the object containing the object * being read; negative only if the objNum is unavailable * @param decrypter the decrypter to use */ private PDFObject readArray( ByteBuffer buf, int objNum, int objGen, PDFDecrypter decrypter) throws IOException { // we've already read the [. Now read objects until ] ArrayList<PDFObject> ary = new ArrayList<PDFObject>(); PDFObject obj; while((obj= readObject(buf, objNum, objGen, decrypter))!=null) { ary.add(obj); } if (buf.get() != ']') { throw new PDFParseException("Array should end with ']'"); } PDFObject[] objlist = new PDFObject[ary.size()]; for (int i = 0; i < objlist.length; i++) { objlist[i] = (PDFObject) ary.get(i); } return new PDFObject(this, PDFObject.ARRAY, objlist); }
/** * read an [ array ]. The initial [ has already been read. PDFObjects * are read until ]. * @param objNum the object number of the object containing the dictionary * being read; negative only if the object number is unavailable, which * should only happen if we're reading an array placed directly * in the trailer * @param objGen the object generation of the object containing the object * being read; negative only if the objNum is unavailable * @param decrypter the decrypter to use */ private PDFObject readArray( int objNum, int objGen, PDFDecrypter decrypter) throws IOException { // we've already read the [. Now read objects until ] ArrayList<PDFObject> ary = new ArrayList<PDFObject>(); PDFObject obj; while((obj= readObject(objNum, objGen, decrypter))!=null) { ary.add(obj); } if (buf.get() != ']') { throw new PDFParseException("Array should end with ']'"); } PDFObject[] objlist = new PDFObject[ary.size()]; for (int i = 0; i < objlist.length; i++) { objlist[i] = (PDFObject) ary.get(i); } return new PDFObject(this, PDFObject.ARRAY, objlist); }
PDFObject obj= readObject(objNum, objGen, decrypter); PDFObject endkey= readObject(objNum, objGen, decrypter); if (endkey.getType() != PDFObject.KEYWORD) { throw new PDFParseException("Expected 'stream' or 'endobj'"); endkey= readObject(objNum, objGen, decrypter);
while ((name= readObject(objNum, objGen, decrypter))!=null) { PDFObject value= readObject(objNum, objGen, decrypter); if (value != null) { hm.put(name.getStringValue(), value);
while ((name= readObject(buf, objNum, objGen, decrypter))!=null) { PDFObject value= readObject(buf, objNum, objGen, decrypter); if (value != null) { hm.put(name.getStringValue(), value);
PDFObject obj= readObject(objNum, objGen, decrypter); PDFObject endkey= readObject(objNum, objGen, decrypter); if (endkey.getType() != PDFObject.KEYWORD) { throw new PDFParseException("Expected 'stream' or 'endobj'"); endkey= readObject(objNum, objGen, decrypter);
PDFObject obj= readObject(buf, objNum, objGen, decrypter); PDFObject endkey= readObject(buf, objNum, objGen, decrypter); if (endkey.getType() != PDFObject.KEYWORD) { throw new PDFParseException("Expected 'stream' or 'endobj'"); endkey= readObject(buf, objNum, objGen, decrypter);
while ((name= readObject(objNum, objGen, decrypter))!=null) { PDFObject value= readObject(objNum, objGen, decrypter); if (value != null) { hm.put(name.getStringValue(), value);
obj= readObject(ref.getID(), ref.getGeneration(), decrypter); if (obj == null) { obj = PDFObject.nullObj;
obj= readObject(ref.getID(), ref.getGeneration(), decrypter); readObject(-1, -1, true, IdentityDecrypter.getInstance()); readObject(-1, -1, true, IdentityDecrypter.getInstance()); PDFObject objNumPO= readObject(-1, -1, true, IdentityDecrypter.getInstance()); PDFObject offsetPO= readObject(-1, -1, true, IdentityDecrypter.getInstance()); int objNum = objNumPO.getIntValue(); int offset = offsetPO.getIntValue(); obj= readObject(objNum, 0, IdentityDecrypter.getInstance()); buf = oldBuf;
headerObject = readObject(fileBuf, -1, -1, IdentityDecrypter.getInstance()); if (headerObject.getType() != PDFObject.NUMBER) { readObject(fileBuf, -1, -1, IdentityDecrypter.getInstance()); if (sizeObj.getType() != PDFObject.NUMBER) { throw new PDFParseException("Expected number for length of xref table"); PDFObject trailerdict = readObject(fileBuf, -1, -1, IdentityDecrypter.getInstance()); if (trailerdict.getType() != PDFObject.DICTIONARY) { throw new PDFParseException("Expected dictionary after \"trailer\"");
xrefStream = readObject(fileBuf, -1, -1, IdentityDecrypter.getInstance()); if (!isXrefStream(xrefStream)) { throw new PDFParseException("Object found at offset for cross" +
readObject(fileBuf, -1, -1, IdentityDecrypter.getInstance());