public void write(FDFDocument doc) throws IOException {
        fdfDocument = doc;
        willEncrypt = false;
        COSDocument cosDoc = fdfDocument.getDocument();
        cosDoc.accept(this);
    }
This will write the fdf document.

@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