合并不带PDFTK的FDF和PDF [英] Merge FDF and PDF without PDFTK

查看:100
本文介绍了合并不带PDFTK的FDF和PDF的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有一种方法可以合并FDF文件和PDF文件,从而在不使用PDFTK的情况下将所有数据和表格创建为1个pdf格式?

Is there a way to merge FDF file and a PDF File to create a flat format of all the data and form into 1 pdf without using PDFTK?

对此有任何启发,将不胜感激.

Any light shed upon this would be greatly appreciated.

推荐答案

否.没有其他简单的方法可以展平,但是很棒.你为什么还需要其他东西?

No.. There's no other way easy way to flatten, but it's awesome. Why would you need anything else?

PDFTK实际上主要是Java(实际上是数百个Java文件).您可以考虑围绕它包装自己的项目.您正在寻找的功能在这里(java/com/lowagie/text/pdf/AcroFields.java:931):

PDFTK is actually mostly Java (literally hundreds of Java files). You could think about wrapping your own project around it. The functionality that you're looking for is here (java/com/lowagie/text/pdf/AcroFields.java:931):

/** Sets the fields by XFDF merging.
 * @param xfdf the XFDF form
 * @throws IOException on error
 * @throws DocumentException on error
 */
public boolean setFields(XfdfReader xfdf) throws IOException, DocumentException {
    boolean ret_val_b= false; // ssteward
    xfdf.getFields();
    for (Iterator i = fields.keySet().iterator(); i.hasNext();) {
        String f = (String)i.next();
        String v = xfdf.getFieldValue(f);
        String rv = xfdf.getFieldRichValue(f); // ssteward
        if (rv != null)
            ret_val_b= true;
        if (v != null)
            setField(f, v, v, rv); // ssteward
    }
    return ret_val_b; // ssteward
}

这篇关于合并不带PDFTK的FDF和PDF的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆