获取PDF模板文件中所有域信息

更新时间:2020-10-30 10:46:00

接口描述

获取指定路径的Pdf文件中所有的域信息。

接口

DocService.getPdfAllFields(String filePath)

请求参数

参数名称

类型

必选

参数说明

示例值

filePath

String

待读取域信息的PDF文件路径

响应参数

展开全部参数参数名称

类型

必选

参数说明

示例值

GetFieldsResult

GetFieldsResult

errCode

int

错误码,0标识成功,其他均标识失败

msg

String

错误码对应的简要描述

fields

Map

Pdf文件内所有文本域的名称和对应的文本值

请求示例  

        // 获取正式生成服务
        // 获取客户端的代码:ServiceClient getKHD = ServiceClientManager.get("您的pojectId");
        DocService docService = getKHD.docService();

        GetFieldsResult getFieldsResult = docService.getPdfAllFields("D:/abc/e.pdf");
        if (getFieldsResult.getErrCode() != 0)
            System.out.println("失败" + JSONObject.fromObject(getFieldsResult));
        else
            System.out.println("成功" + JSONObject.fromObject(getFieldsResult));

响应示例

{
    "errCode":0,
    "errShow":false,
    "fields":{
        "Signature1":""
    },
    "msg":"成功"
}

错误码

错误码错误描述解决方案


我要纠错