Skip to content

Commit 2e91e05

Browse files
committed
Allow "compound" filters that consist of a single named filter (Issue #47)
1 parent 7e3db6b commit 2e91e05

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

CHANGES.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@ v1.1.2 (TBD)
1212
- Fixed an issue with PDF files produced by Crystal Reports (Issue #45)
1313
- Fixed an issue with PDF files produced by Microsoft Reporting Services
1414
(Issue #46)
15+
- Fixed support for compound filters where the filter array consists of a
16+
single named filter (Issue #47)
17+
- Fixed builds on Windows - needed windows.h header for temporary files
18+
(Issue #48)
1519

1620

1721
v1.1.1 (March 20, 2023)

pdfio-stream.c

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -464,11 +464,18 @@ _pdfioStreamOpen(pdfio_obj_t *obj, // I - Object
464464
// Try to decode/decompress the contents of this object...
465465
const char *filter = pdfioDictGetName(dict, "Filter");
466466
// Filter value
467+
pdfio_array_t *fa; // Filter array
468+
469+
if (!filter && (fa = pdfioDictGetArray(dict, "Filter")) != NULL && pdfioArrayGetSize(fa) == 1)
470+
{
471+
// Support single-valued arrays...
472+
filter = pdfioArrayGetName(fa, 0);
473+
}
467474

468475
if (!filter)
469476
{
470477
// No single filter name, do we have a compound filter?
471-
if (pdfioDictGetArray(dict, "Filter"))
478+
if (fa)
472479
{
473480
// TODO: Implement compound filters...
474481
_pdfioFileError(st->pdf, "Unsupported compound stream filter.");

0 commit comments

Comments
 (0)