David PHAM-VAN

Fix large PDF generation on web with compressed xref

# Changelog
## 3.8.1
- Fix large PDF generation on web with compressed xref
## 3.8.0
- Update xml dependency range
... ...
... ... @@ -14,6 +14,7 @@
* limitations under the License.
*/
import 'dart:math' as math;
import 'dart:typed_data';
import 'data_types.dart';
... ... @@ -185,11 +186,7 @@ class PdfXrefTable extends PdfDataType {
params['/Index'] = PdfArray.fromNum(blocks);
}
var bytes = 2; // A pdf less than 256 bytes is unlikely
while (1 << (bytes * 8) < offset) {
bytes++;
}
final bytes = (math.log(offset) ~/ math.ln2) ~/ 8;
final w = [1, bytes, 1];
params['/W'] = PdfArray.fromNum(w);
final wl = w.reduce((a, b) => a + b);
... ...
... ... @@ -3,7 +3,7 @@ description: A pdf producer for Dart. It can create pdf files for both web or fl
homepage: https://github.com/DavBfr/dart_pdf/tree/master/pdf
repository: https://github.com/DavBfr/dart_pdf
issue_tracker: https://github.com/DavBfr/dart_pdf/issues
version: 3.8.0
version: 3.8.1
environment:
sdk: ">=2.12.0 <3.0.0"
... ...