Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GH-79 nio object parser #251

Merged
merged 59 commits into from
May 8, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
59 commits
Select commit Hold shift + click to select a range
e71c161
GH-79 a sort of, kind of, working prototype
Mar 8, 2022
f363451
GH-79 a sort of, kind of, working a slightly better
Mar 10, 2022
cbfe61c
GH-79 small wins, still lots of work to do.
Jun 3, 2022
e663f91
Merge branch 'master' into GH-79.nio.object.parser
Jun 29, 2022
478f230
GH-79 fix unrelated annotation parsing error.
Nov 10, 2022
f9639a2
GH-79 fix parser offset issue.
Nov 10, 2022
37e83dd
GH-79 update logger
Nov 10, 2022
4120230
GH-79 fix decimal parsing
Nov 10, 2022
e019773
GH-79 some debug helpers
Nov 10, 2022
c7d0a1d
GH-79 fix encryption reference passthrough when parsing arrays
Nov 11, 2022
300513b
GH-79 fix nasty CrossReferenceTable error where subgroups were not pa…
Nov 12, 2022
4a8aeaa
Merge branch 'master' into GH-79.nio.object.parser
Nov 14, 2022
f239c64
GH-79 more encryption reference issues.
Nov 14, 2022
bf7002e
GH-79 fix DictionaryEntries type changes in the lexer.
Nov 17, 2022
0dd8f54
GH-79 touch up white space handling for streams
Nov 19, 2022
406fd56
GH-79 fix incorrect starting object number when parsing xref table
Nov 19, 2022
9a365c5
GH-79 little code clean up.
Nov 23, 2022
efe4d77
GH-79 address parser issue where know types were not returned as obje…
Dec 2, 2022
117a802
Merge branch 'master' into GH-79.nio.object.parser
Jan 13, 2023
7c4de19
Merge branch 'master' into GH-79.nio.object.parser
Jan 13, 2023
cc9e916
GH-79 fix issue trying to load a font data stream as a font object.
Jan 17, 2023
f6cdbb3
GH-79 fix issue where zeroed stream wasn't taking into account the en…
Jan 17, 2023
85312d0
GH-79 make sure we don't clear a valid font bbox.
Jan 17, 2023
814e55c
GH-79 further refinement of the approach.
Jan 22, 2023
e3dcf68
GH-79 cleaned up stream and table cross-reference common code as well…
Jan 23, 2023
70f8c93
GH-79 further clean up and brought back incremental updates for table…
Jan 24, 2023
d2bcdc7
GH-79 attempted cleanup/removal of throwable from code base.
Jan 25, 2023
a2b39a5
GH-80 fix some missing 2 byte hex values from not being rendering cor…
Jan 25, 2023
3c23ad7
GH-79 remove redundant new BufferedOutputStream wrapper.
Jan 25, 2023
34c8282
GH-79 clean up extra new line creation.
Jan 25, 2023
fad1274
GH-79 todo cleanup
Jan 25, 2023
fb53c96
GH-79 refactor a recursive call that was getting away and not really …
Jan 27, 2023
e42ff2b
GH-79 standardize buffer sizes for and minimize parser creation
Jan 29, 2023
8257457
GH-79 fix missing generation when adding a used entry.
Jan 30, 2023
46ed19e
GH-79 fix layer visibility state issue by pulling from catalog when p…
Feb 1, 2023
d572719
GH-79 more exception handling and logging touchups.
Feb 2, 2023
9829529
GH-79 more logging touch ups.
Feb 3, 2023
6b64e7d
GH-79 revert PdfSecurityException change
Feb 3, 2023
4abab2d
GH-79 touch up digital signatures to use the new nio file access.
Feb 8, 2023
00bdb64
GH-79 fix nasty offset issue when reindexing and looking for xref pos…
Feb 14, 2023
1a283d3
GH-79 move annotation to soft references so we less likely to lose re…
Feb 15, 2023
a61d70c
Merge branch 'master' into GH-79.nio.object.parser
Feb 15, 2023
233a2e2
GH-79 revert back to 4 threads.
Feb 16, 2023
a643c74
GH-79 attempt to fix attachments, not there yet
Feb 16, 2023
2ff1c0b
GH-79 migrated to slice over buffer get operations.
Feb 17, 2023
d317f31
GH-79 reworked Parser.getPObject to handle attachments that can span …
Feb 18, 2023
6f6c0da
GH-79 touch up artifacts on icon.
Feb 18, 2023
8850669
GH-79 touch up artifacts on icon.
Feb 18, 2023
81aced7
GH-79 fix issue when loading a catalogue followed by a regular docume…
Feb 18, 2023
e136ee9
GH-79 code clean up
Feb 22, 2023
727afdf
GH-79 code clean up
Feb 22, 2023
7178314
GH-79 more code clean up
Feb 23, 2023
1952e59
GH-79 code clean up
Feb 24, 2023
6186daa
GH-79 code clean up
Feb 24, 2023
10f8261
GH-79 code clean up
Feb 24, 2023
e19723a
GH-79 code clean up
Feb 27, 2023
09fe6a2
GH-79 misc. log combing fixes.
Mar 9, 2023
43625d8
GH-79 address concurrent access/modification during page init when a …
Mar 9, 2023
6450ca1
Merge branch 'master' into GH-79.nio.object.parser
Mar 9, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
GH-79 fix nasty CrossReferenceTable error where subgroups were not pa…
…rsed.
  • Loading branch information
Patrick Corless committed Nov 12, 2022
commit 300513b77c42c12a0a0001733f5b9b158f30dc91
Original file line number Diff line number Diff line change
Expand Up @@ -72,12 +72,10 @@ public DictionaryEntries getTrailerDictionary() {

public PObject loadObject(ObjectLoader objectLoader, Reference reference, Name hint)
throws ObjectStateException, CrossReferenceStateException, IOException {
if (crossReferences != null) {
PObject tmp;
for (CrossReference crossReference : crossReferences) {
tmp = crossReference.loadObject(objectLoader, reference, hint);
if (tmp != null) return tmp;
}
PObject tmp;
for (CrossReference crossReference : crossReferences) {
tmp = crossReference.loadObject(objectLoader, reference, hint);
if (tmp != null) return tmp;
}
return null;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -186,20 +186,27 @@ public CrossReference getCrossReference(ByteBuffer byteBuffer, int starXref)

private CrossReference parseCrossReferenceTable(DictionaryEntries dictionaryEntries, Lexer objectLexer, ByteBuffer byteBuffer,
int start, int end) throws IOException {
// allocate to a new buffer as the data is well defined.
// allocate to a new buffer as the data is well-defined.
ByteBuffer xrefTableBuffer = ByteBufferUtil.copyObjectStreamSlice(byteBuffer, start, end);
CrossReferenceTable crossReferenceTable = new CrossReferenceTable(library, dictionaryEntries);
objectLexer.setByteBuffer(xrefTableBuffer);
int startObjectNumber = (Integer) objectLexer.nextToken();
int numberOfObjects = (Integer) objectLexer.nextToken();
for (int i = 0; i < numberOfObjects; i++) {
int offset = (Integer) objectLexer.nextToken();
int generation = (Integer) objectLexer.nextToken();
int state = (Integer) objectLexer.nextToken();
if (state == OperandNames.OP_n) {
crossReferenceTable.addEntry(new CrossReferenceUsedEntry(startObjectNumber + i, generation, offset));
// parse the sub groupings
while (true) {
Integer startObjectNumber = (Integer) objectLexer.nextToken();
// buffer end will result in a null token
if (startObjectNumber == null) break;
int numberOfObjects = (Integer) objectLexer.nextToken();
for (int i = 0; i < numberOfObjects; i++) {
int offset = (Integer) objectLexer.nextToken();
int generation = (Integer) objectLexer.nextToken();
int state = (Integer) objectLexer.nextToken();
if (state == OperandNames.OP_n) {
crossReferenceTable.addEntry(
new CrossReferenceUsedEntry(startObjectNumber + i, generation, offset));
}
}
}

return crossReferenceTable;
}

Expand Down