public void write(PDDocument doc) throws IOException {
        write(doc, null);
    }
This will write the pdf document. If signature should be created externally,
{@link #writeExternalSignature(byte[])} should be invoked to set signature after calling this method.

@param doc The document to write.
@throws IOException If an error occurs while generating the data.
tika-fuzzing/src/main/java/org/apache/tika/fuzzing/pdf/EvilCOSWriter.java