Skip to content

Commit

Permalink
Add support for web by using archive package. (#49)
Browse files Browse the repository at this point in the history
Fixes #48
  • Loading branch information
NicolaVerbeeck authored Dec 21, 2023
1 parent d34e74c commit e321174
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 7 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
## 0.5.0

- Add support for web by using the archive package. (#48)
- **Breaking**: EOFException and ParseException now no longer implement dart:io's IOException, just base Exception. (#48)

## 0.4.3

- Add more tests
Expand Down
6 changes: 2 additions & 4 deletions lib/src/error/exceptions.dart
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
import 'dart:io';

/// A class of exceptions thrown when an unexpected end of file is reached
class EOFException implements IOException {
class EOFException implements Exception {
const EOFException();

// coverage:ignore-start
Expand All @@ -11,7 +9,7 @@ class EOFException implements IOException {
}

/// A class of exceptions thrown when an unexpected parse error is encountered
class ParseException implements IOException {
class ParseException implements Exception {
final String _message;

const ParseException(this._message);
Expand Down
2 changes: 1 addition & 1 deletion lib/src/utils/filter/flate_decode_filter.dart
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ class FlateDecodeFilter extends StreamFilter {
PDFObject? params,
PDFDictionary streamDictionary,
) {
final decoded = zlib.decode(bytes).asUint8List();
final decoded = const ZLibDecoder().decodeBytes(bytes).asUint8List();
if (params is PDFDictionary) return _decodeWithPredictor(decoded, params);
return decoded;
}
Expand Down
2 changes: 1 addition & 1 deletion lib/src/utils/filter/stream_filter.dart
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import 'dart:io';
import 'dart:typed_data';

import 'package:dart_pdf_reader/dart_pdf_reader.dart';
import 'package:dart_pdf_reader/src/utils/filter/direct_byte_stream.dart';
import 'package:archive/archive.dart';
import 'package:dart_pdf_reader/src/utils/list_extensions.dart';

part 'ascii_85_decode_filter.dart';
Expand Down
5 changes: 4 additions & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
name: dart_pdf_reader
description: Small pure-dart library for parsing PDF files. Supports reading all pdf structures
version: 0.4.3
version: 0.5.0
repository: https://github.com/NicolaVerbeeck/dart_pdf_reader
issue_tracker: https://github.com/NicolaVerbeeck/dart_pdf_reader/issues
topics: [pdf, parser]

environment:
sdk: '>=3.0.0 <4.0.0'

dependencies:
archive: ^3.4.9
charset: ^2.0.1
collection: '>=1.17.0 < 2.0.0'
meta: ^1.9.1
Expand Down

0 comments on commit e321174

Please sign in to comment.