592 Commits

Author SHA1 Message Date
Michael R Sweet
cad8f450ab
Multiple fixes to allow PDFio to read more edge-case PDFs.
- Update _pdfioFileGets to allow for really long lines where it
  doesn't matter if we lose the end of the line.
- Update "startxref" detection at the end of the file.
- Refactor repair logic so that you just get a single WARNING about
  the repair (debug messages available for testing)
- Allow whitespace after the "obj" in the object header.
- Make sure to close xref stream on error.
- Update predictor code to support Colors <= 32 (some implementations
  set Colors to the number of bytes per record in the xref stream,
  which prevents the predictor from doing anything...)
- Allow CR CR in xref table.
- Clear old trailer/root/pages/etc. objects when repairing, update
  existing objects that were already found in load_xref.
- Don't set current object in pdfioObjectCreate/OpenStream if the
  stream can't be created/opened.
2025-04-24 11:09:54 -04:00
Michael R Sweet
278ddb7fa7
Clarify error callback API, and actually use the return value.
Improve repair implementation.
2025-04-23 14:43:14 -04:00
Michael R Sweet
1e6bb710e3
Changelog. 2025-04-23 10:13:35 -04:00
Michael R Sweet
4ca93bd34f
Add support for EncryptMetadata key in encryption dictionary. 2025-04-23 10:07:44 -04:00
Michael R Sweet
404ca72882
Protect against invalid predictor buffer size. 2025-04-23 10:07:26 -04:00
Michael R Sweet
67704ce493
Update corpus test script to use Xpdf's pdfinfo to weed out known-bad PDFs for now. 2025-04-21 16:59:59 -04:00
Michael R Sweet
e983ba98d8
Fix encrypted PDF files with P values >2^31-1. 2025-04-20 17:33:56 -04:00
Michael R Sweet
c23c6dec9a
Tweak script. 2025-04-18 20:00:14 -04:00
Michael R Sweet
5e9617a742
One more Windows build warning. 2025-04-18 18:10:03 -04:00
Michael R Sweet
09ee7d16c1
More test program cleanup to use test header. 2025-04-18 18:08:37 -04:00
Michael R Sweet
078985fc20
Try to eliminate more Windows build warnings. 2025-04-18 17:58:06 -04:00
Michael R Sweet
13fedfc424
Try a macro trick to get rid of some Windows build warnings. 2025-04-18 17:29:02 -04:00
Michael R Sweet
c07927dc2d
Bump copyright on test header since it was updated. 2025-04-18 17:22:15 -04:00
Michael R Sweet
1393cd6c04
Hopefully fix Windows build issues. 2025-04-18 17:07:53 -04:00
Michael R Sweet
b278e33aac
Update unit test program to use test header. 2025-04-18 11:27:12 -04:00
Michael R Sweet
1116e929f7
Add pdfioFileGet/SetLanguage functions (Issue #124) 2025-04-13 20:21:23 -04:00
Michael R Sweet
c75611e274
Update documentation. 2025-04-13 17:15:53 -04:00
Michael R Sweet
c507cabbda
Update Windows DLL exports. 2025-04-13 16:56:50 -04:00
Michael R Sweet
81aeef46d2
Add XMP metadata to output (Issue #103) 2025-04-13 16:56:30 -04:00
Michael R Sweet
ba7371b2e1
Fix location of OutputIntents (catalog, not info dict) 2025-04-13 14:31:14 -04:00
Michael R Sweet
ec64af8b20
Add pdfioFileAddOutputIntent API (Issue #104) 2025-04-13 14:16:53 -04:00
Michael R Sweet
acd68df592
Start work on OutputIntent and better color support in PDFio:
- Add CGATS001-compatible "micro" ICC profile as a standard CMYK color space
  (this is the default used by several Adobe applications)
- Add `PDFIO_CS_CGATS001` color space enum.
- Extend `pdfioArrayCreateColorFromStandard` to support CMYK.
- Extend `pdfioFileCreateImageObjFromFile` to support CMYK JPEG files.
- Update `pdfioFileCreatePage` to add default grayscale, RGB, and CMYK color
  space resources as needed.
2025-04-13 13:31:19 -04:00
Michael R Sweet
3d9c22aa49
Remove old per-object crypto stuff we dont need. 2025-04-13 09:11:43 -04:00
Michael R Sweet
3ae95f1545
Fix decryption of UTF-16 strings (Issue #42) 2025-04-13 09:04:00 -04:00
Michael R Sweet
cfdd6f55d9
Fix decryption of RC4-40 files. 2025-04-13 08:36:58 -04:00
Michael R Sweet
06f38edcc7
Add pdfioFileCreateFontObjFromData function (Issue #120) 2025-04-12 16:25:34 -04:00
Michael R Sweet
76c1cc694f
Bump version for start of 1.6.x development. 2025-04-12 15:52:28 -04:00
Michael R Sweet
4219b8fd77
Update release date. 2025-04-12 15:12:07 -04:00
Michael R Sweet
064e7fa473
Fix makesrcdist script. 2025-04-12 15:11:36 -04:00
Michael R Sweet
ea9b7843fc
Bump version in NuGet files and update docos. v1.5.2 2025-04-12 14:38:40 -04:00
Michael R Sweet
755efe08da
Range check dictionary values in pdfioImageGetBytesPerLine (Issue #121) 2025-04-12 14:33:13 -04:00
Michael R Sweet
0391df5bbd
Add logging of when we are repairing the xref table. 2025-04-07 09:01:41 -04:00
Michael R Sweet
49efd97cab
Discard duplication key/value pairs in dictionaries with a warning message (Issue #118) 2025-04-07 08:58:18 -04:00
Michael R Sweet
d7eb1fc540
One more tweak to the get_date_time function (Issue #115) 2025-04-07 08:20:08 -04:00
Michael R Sweet
7afefda326
More date/time processing fixes (Issue #115) 2025-04-06 12:10:55 -04:00
Michael R Sweet
cbea3ecc2a
Fix timezone offset in date/time values (Issue #115) 2025-04-05 13:48:11 -04:00
Michael R Sweet
130cef8702
Update pdfioinfo example to support Acrobat Form dictionaries as well as indirect references (Issue #114) 2025-04-04 21:24:42 -04:00
Michael R Sweet
0bd9edc845
Move token buffers off the stack (Issue #117) 2025-04-04 21:20:23 -04:00
Michael R Sweet
fe755eac3d
Add PDFIO_MAX_STRING constant to control maximum allowed PDF strings (Issue #117) 2025-04-04 19:27:03 -04:00
Michael R Sweet
8cca645835
Update date/time parsing (Issue #115) 2025-04-04 19:12:16 -04:00
Michael R Sweet
b8ea9ea064
Bump version. 2025-04-04 19:11:54 -04:00
Michael R Sweet
2874022aa4
Allow empty name tokens (Issue #116) 2025-04-04 18:26:35 -04:00
Michael R Sweet
3befcf2fd5
Fix warning about shadowed loop variable. 2025-04-04 18:17:04 -04:00
Michael R Sweet
3b2f7e21d9
Prep for 1.5.1 release. v1.5.1 2025-03-28 14:39:59 -04:00
Michael R Sweet
7e01069c5a
Fix UTF-16 LE support (Issue #112) 2025-03-28 14:29:24 -04:00
Michael R Sweet
88839ccb56
Fix UTF-16 LE support (Issue #112) 2025-03-28 14:28:43 -04:00
Michael R Sweet
ebd5aab39b
Fix handling of 0-length streams (Issue #111) 2025-03-27 12:44:42 -04:00
Michael R Sweet
71d33c03ff
Add PDF merge example. 2025-03-27 11:48:41 -04:00
Michael R Sweet
cfe91b4ea2
Fix output of special characters in name values (Issue #106)
Fix output of special characters in string values (Issue #107)
Fi output of large integers in dictionaries (Issue #108)

Bump version to 1.5.1.
2025-03-24 18:33:24 -04:00
Michael R Sweet
458f366d78
Fix some Unicode font embedding issues:
- Reworked Widths array compression for CID fonts to require at least 4 repeated
  widths.
- Fixed the embedded CMap for Unicode fonts.
v1.5.0
2025-03-06 17:09:27 -05:00