Skip to content

Commit

Permalink
Fix Compressed Cross-Reference ID
Browse files Browse the repository at this point in the history
  • Loading branch information
DavBfr committed Jun 17, 2022
1 parent 21be6b5 commit 0297922
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
5 changes: 5 additions & 0 deletions pdf/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Changelog

## 3.8.2

- Fix Compressed Cross-Reference ID
- Fix exif orientation [deepak786]

## 3.8.1

- Fix large PDF generation on web with compressed xref
Expand Down
7 changes: 4 additions & 3 deletions pdf/lib/src/pdf/xref.dart
Original file line number Diff line number Diff line change
Expand Up @@ -152,14 +152,15 @@ class PdfXrefTable extends PdfDataType {

/// Output a compressed cross-reference table
void outputCompressed(PdfObject object, PdfStream s, PdfDict params) {
// Write this object too
final id = offsets.last.id + 1;
final offset = s.offset;
offsets.add(PdfXref(id, offset));

// Sort all references
offsets.sort((a, b) => a.id.compareTo(b.id));

// Write this object too
final id = offsets.last.id + 1;
offsets.add(PdfXref(id, offset));

params['/Type'] = const PdfName('/XRef');
params['/Size'] = PdfNum(id + 1);

Expand Down
4 changes: 4 additions & 0 deletions printing/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

# 5.9.2

- Added mounted check for setState in printing>preview>raster [Julius Alibrown]

# 5.9.1

- iOS: Set cutLength to be currentSize.height [Liam Downey]
Expand Down

0 comments on commit 0297922

Please sign in to comment.