private void parseXref(long xrefPos) { _lexer.Position = xrefPos; _lexer.ReadLexeme(); PDFDictionaryStream xref; if (_lexer.CurrentLexemeEquals("xref")) { readXrefTable(); parseTrailer(); } else if (isCrossReferenceStream(out xref)) { readCrossReferencesEntries(xref); extractTrailer(xref.Dictionary); } else { if (!tryToRepairDocument()) { throw new InvalidDocumentException(); } for (int i = 0; i < _xrefPositions.Count; ++i) { parseXref(_xrefPositions[i]); } return; } parsePrevAndXrefStm(); }
private void parse(Lexer lexer) { lexer.LastParsedByte = lexer.ReadByte(); for (; ;) { if (Lexer.IsEOL(lexer.LastParsedByte)) { lexer.SkipEOL(); } if (lexer.LastParsedByte == -1) { return; } lexer.ReadLexemeWithLastParsedByte(); if (lexer.CurrentLexemeEquals(Beginbfrange)) { loadRange(lexer); } else if (lexer.CurrentLexemeEquals(Beginbfchar)) { loadChar(lexer); } } }