# 金山文档中台套红

# 功能描述

介绍金山文档中台多书签套红接口参数说明

文档适用于 V9.0sp1 及以上(注意看说明,不同版本新增了不同参数)

# 接口描述

###套红接口

####接口说明

rest/webOffice/format/taohong

####参数说明

1. 套红参数说明

参数 类型 是否必填 说明
templateUrl String 模板ID
bookMarkInfoList Array 书签列表
documentInfo Object 正文对象
tolen String token
taohongType Enum 套红类型
needClearDocument Boolean 是否需要清稿
originContentId String 原正文ID

2.书签对象说明

参数 类型 是否必填 说明
bookmark String 书签名称
type String 书签类型类型,枚举:DOCUMENT/IMAGE/TEXT
text String 书签值
imgInfo ImageInfo 图片对象,当type为IMAGE时,必填
fileInfo DocumentInfo 文件对象,当type为DOCUMENT时,必填

3.图片对象说明

参数 类型 是否必填 说明
imgId String 图片ID
inputType String 图片类型(image、handwrite、barcode)
createDate String 创建时间
isSignatrue String 是否是签章图片

4. 文件对象说明

参数 参数类型 是否必填 说明
fileId String 文件ID
fileType String 正文类型
originalFileId String 原正文ID
size Long 文件大小
fileName String 文件名称
fileRestrictions Array 受保护的文件记录

##金山文档中台接口介绍

###调用接口

/open/api/cps/sync/v1/wrapheader

###接口请求体

参数 参数类型 是否必填 说明
task_id String 任务ID
template_url String 模板地址
template_filename String 模板文件名称
sample_list Array 书签列表
scene_id String 业务唯一标识
use_template_section_property Boolean 如果为true,则type为DOCUMENT时使用模板文件的节属性,否则会优先使用正文文件的节属性,默认为false
flatten_source_style Boolean 用于解决套红后 字体变化的问题,9.0sp1之后新增
keep_temple_sec_prop_in_begin Boolean 仅use_template_section_property=false时生效,需要在前插入点使用模板节属性设置为true,默认false,10.0sp1-release_60430新增
keep_temple_sec_prop_in_end Boolean 仅use_template_section_property=false时生效,需要保留正文的页眉页脚对象(页眉页脚文字、水印、页码等) 则设置为true,默认false,10.0sp1-release_60430新增
use_sample_header_footer Boolean 仅use_template_section_property=false时生效,需要在后插入点使用模板节属性设置为true,默认false,10.0sp1-release_60430新增

书签列表参数

参数 参数类型 是否必填 说明
bookmark String 书签
type String 样章类型,可选值:DOCUMENT:文档、IMAGE: 图片、TEXT:文本
sample_url String 文件名,当type为DOCUMENT、IMAGE时,必填,必须带后缀
sample_filename String 文件名,当type为DOCUMENT、IMAGE时,必填,必须带后缀
text String 样章文本,当type是TEXT时,必填

###响应示例

{
  "task_id" : "e9105048-2013-4000-9ac9-146f3ae37a60",
  "template_url" : "http://127.0.0.1/seeyon/webOffice/v6/v1/3rd/file/download?downloadFlag=TEMPLATE&seed=acfaac010254645d54fc81249ffadf72&_w_third_tolen=403d286062391a7b3640e47bfdb3fc0a&templateUrl=1100972547463857175",
  "template_filename" : "1100972547463857175.docx",
  "sample_list" : [ {
    "bookmark" : "附件",
    "type" : "TEXT",
    "text" : "附件"
  }, {
    "bookmark" : "field0017",
    "type" : "TEXT",
    "text" : " "
  }, {
    "bookmark" : "createdate",
    "type" : "TEXT",
    "text" : " "
  }, {
    "bookmark" : "field0012",
    "type" : "TEXT",
    "text" : " "
  }, {
    "bookmark" : "Printing_Date",
    "type" : "TEXT",
    "text" : " "
  }, {
    "bookmark" : "印发日期",
    "type" : "TEXT",
    "text" : " "
  }, {
    "bookmark" : "field0011",
    "type" : "TEXT",
    "text" : "22222"
  }, {
    "bookmark" : "subject",
    "type" : "TEXT",
    "text" : "22222"
  }, {
    "bookmark" : "标题",
    "type" : "TEXT",
    "text" : "22222"
  }, {
    "bookmark" : "attachments",
    "type" : "TEXT",
    "text" : "0625发版内容出厂..(24KB)"
  }, {
    "bookmark" : "正文",
    "type" : "DOCUMENT",
    "sample_url" : "http://127.0.0.1/seeyon/webOffice/v6/v1/3rd/file/download?downloadFlag=CONTENT&fileName=6339094551596581759&seed=24dd755340876861306d48f42a037cce&_w_third_tolen=403d286062391a7b3640e47bfdb3fc0a&fileType=doc&fileId=6339094551596581759",
    "sample_filename" : "6339094551596581759.doc"
  } ],
  "scene_id" : "FvRU1AwQiWVzgUupw09e1K1WLGVMvv",
  "use_template_section_property" : false,
  "flatten_source_style" : true,
  "keep_temple_sec_prop_in_begin":true,
  "keep_temple_sec_prop_in_end":true,
  "use_sample_header_footer":true
}
编撰人:ranjf、het