Whats the alternative to copyAcroForm?

后端 未结 1 1853
忘掉有多难
忘掉有多难 2020-12-21 10:41

We are currently porting our code base from iText 2.1.7 to iText 5.5.0 (yeah I know.. we had a little longer ;-). Well.. \"now\" that copyAcroForm has gone the way of the D

相关标签:
1条回答
  • 2020-12-21 11:18

    Please take a look at the MergeForms example:

    Document document = new Document();
    PdfCopy copy = new PdfCopy(document, new FileOutputStream(filename));
    copy.setMergeFields();
    document.open();
    for (PdfReader reader : readers) {
        copy.addDocument(reader);
    }
    document.close();
    for (PdfReader reader : readers) {
        reader.close();
    }
    

    One line in particular is very important:

    copy.setMergeFields();
    

    Did you add that line?

    0 讨论(0)
提交回复
热议问题