We have encountered this exception on multiple PDFs with table of contents or bookmarks:
at org.apache.pdfbox.pdfwriter.compress.COSWriterObjectStream.writeObject(COSWriterObjectStream.java:238)
at org.apache.pdfbox.pdfwriter.compress.COSWriterObjectStream.writeCOSDictionary(COSWriterObjectStream.java:341)
at org.apache.pdfbox.pdfwriter.compress.COSWriterObjectStream.writeObject(COSWriterObjectStream.java:230)
at org.apache.pdfbox.pdfwriter.compress.COSWriterObjectStream.writeObjectsToStream(COSWriterObjectStream.java:119)
at org.apache.pdfbox.pdfwriter.COSWriter.doWriteBodyCompressed(COSWriter.java:499)
at org.apache.pdfbox.pdfwriter.COSWriter.visitFromDocument(COSWriter.java:1307)
We have encountered this exception on multiple PDFs with table of contents or bookmarks: