private PdfValue _readObj(PdfStreamReader reader, bool compressed) { var value = reader.ReadValue(); var token = (!compressed && reader.Position < reader.Stream.Length) ? reader.ReadToken() : null; if (token != null && value is PdfDictionary && token.Type == PdfValueType.StreamBegin) { var streamBegin = reader.Position; var streamLength = ((PdfDictionary)value).ValueByName <PdfInteger>("Length").Value; reader.Skip(streamLength); reader.ReadToken(PdfValueType.StreamEnd); value = new PdfObjectReader((PdfDictionary)value, new PdfDataStreamReader(_stream, streamBegin, streamLength)); token = (!compressed && reader.Position < reader.Stream.Length) ? reader.ReadToken() : null; } if (token != null && token.Type != PdfValueType.ObjectEnd) { throw new PdfExceptionReader("Missing endobj"); } return(value); }