- IronSecureDoc
- 教程
- 用于IronSecureDoc的REST API
用于IronSecureDoc的REST API
View the article in
English这是您的 IronSecureDoc 实例的 REST API 参考。 本教程假设您已经有一个正在运行的容器实例,如果您想开始,请遵循我们的指南。
跳转到功能:
- 检查许可证密钥
PDF编辑功能
- 编辑区域
签署PDF功能
- 验证证书/签名
保护PDF功能
[{t:(
http://localhost:8080/
的占位符将在所有示例中用于 URL。 请确保将其替换为您的URL。- 确保用实际值替换占位符值(例如,
path/to/your/file.pdf
、certificate_password
等)。 author
、title
和 subject
头包含在所有请求示例中。)
[GET] 健康检查
端点: http://localhost:8080/v1/document-services/ping
用于验证服务器运行状况的健康检查端点。
响应:200 OK:pong
[GET] 检查许可证
端点: http://localhost:8080/v1/document-services/check-license
验证许可证的有效性。
响应:200 OK:Valid
[POST] 编辑文本
端点: http://localhost:8080/v1/document-services/pdfs/redact-text
使用真正的编辑功能隐藏PDF格式文档中的敏感词。 在请求主体中包含一个PDF文件作为pdf_file
对象。
必需的请求主体参数
Name | Data Type | Description |
---|
pdf_file | application/pdf file | The PDF file to redact. |
words_to_redact | array[string] | An array of words to be redacted from the document. |
可选请求体参数
Name | Data Type | Default | Description |
---|
user_password | string | null | User password for the input PDF. Required if the PDF has a user password to grant read access. |
owner_password | string | null | Owner password for the input PDF. Required if the PDF has an owner password to grant access to make modifications. |
specific_pages | array[int] | null | Optionally specify pages to apply to. If left empty, all pages will apply. |
draw_black_box | bool | True | Have a Black Box drawn over redacted text areas. |
match_whole_word | bool | True | Allow partial matches within words be redacted too. |
match_case | bool | null | Match case for the words to be redacted. |
overlay_text | string | null | If your prefer an Overlay Text on the redaction area such as words or symbols, set them here. If not set, a blank character will be used. |
save_as_pdfa | bool | False | Save the PDF with PDF/A-3 compliance. |
save_as_pdfua | bool | False | Save the PDF with PDF/UA compliance. |
可选标题
名称数据类型 | 描述 | 作者 | 字符串 | 设置PDF元数据的作者属性。 |
标题 | 字符串 | 设置PDF元数据的标题属性。 |
主题 | 字符串 | 设置PDF元数据的主题属性。 |
示例:
请求
仅为必填参数:
curl -X POST 'http://localhost:8080/v1/document-services/pdfs/redact-text' \
-H 'accept: */*' \
-H 'Content-Type: multipart/form-data' \
-F 'pdf_file=@sample.pdf;type=application/pdf' \
-F 'words_to_redact="pdf"' \
-F 'draw_black_box=true' \
-F 'match_whole_word=true' \
-F 'match_case=true' \
curl -X POST 'http://localhost:8080/v1/document-services/pdfs/redact-text' \
-H 'accept: */*' \
-H 'Content-Type: multipart/form-data' \
-F 'pdf_file=@sample.pdf;type=application/pdf' \
-F 'words_to_redact="pdf"' \
-F 'draw_black_box=true' \
-F 'match_whole_word=true' \
-F 'match_case=true' \
CURL
所有必填和可选参数:
curl -X POST 'http://localhost:8080/v1/document-services/pdfs/redact-text' \
-H 'accept: */*' \
-H 'author: Iron Software
IRONSECUREDOC' \
-H 'title: WEBSITE DEMO 2024' \
-H 'subject: DEMO EXAMPLE' \
-H 'Content-Type: multipart/form-data' \
-F 'pdf_file=@sample.pdf;type=application/pdf' \
-F 'words_to_redact="word1"' \
-F 'words_to_redact="word2"' \
-F 'draw_black_box=true' \
-F 'match_whole_word=true' \
-F 'match_case=true' \
-F 'user_password="password"' \
-F 'owner_password="5yug2RT45th32h78"' \
-F 'overlay_text="REDACTED"' \
-F 'specific_pages=0' \
-F 'specific_pages=1' \
-F 'save_as_pdfa=false' \
-F 'save_as_pdfua=false' \
curl -X POST 'http://localhost:8080/v1/document-services/pdfs/redact-text' \
-H 'accept: */*' \
-H 'author: Iron Software
IRONSECUREDOC' \
-H 'title: WEBSITE DEMO 2024' \
-H 'subject: DEMO EXAMPLE' \
-H 'Content-Type: multipart/form-data' \
-F 'pdf_file=@sample.pdf;type=application/pdf' \
-F 'words_to_redact="word1"' \
-F 'words_to_redact="word2"' \
-F 'draw_black_box=true' \
-F 'match_whole_word=true' \
-F 'match_case=true' \
-F 'user_password="password"' \
-F 'owner_password="5yug2RT45th32h78"' \
-F 'overlay_text="REDACTED"' \
-F 'specific_pages=0' \
-F 'specific_pages=1' \
-F 'save_as_pdfa=false' \
-F 'save_as_pdfua=false' \
CURL
响应:
[POST] 涂抹正则表达式
端点: http://localhost:8080/v1/document-services/pdfs/redact-regular-expression
使用真正的编辑功能隐藏PDF格式文档中敏感的正则表达式匹配项(如日期、姓名或模式)。 在请求主体中包含一个PDF文件作为pdf_file
对象。
必需的请求主体参数
Name | Data Type | Description |
---|
pdf_file | application/pdf file | The PDF file to redact. |
regular_expression | string | Regular Expression from which matching cases will be redacted from the document. |
可选请求体参数
Name | Data Type | Default | Description |
---|
user_password | string | null | User password for the input PDF. Required if the PDF has a user password to grant read access. |
owner_password | string | null | Owner password for the input PDF. Required if the PDF has an owner password to grant access to make modifications. |
specific_pages | array[int] | null | Optionally specify pages to apply to. If left empty, all pages will apply. |
draw_black_box | bool | True | Have a Black Box drawn over redacted text areas. |
overlay_text | string | null | If your prefer an Overlay Text on the redaction area such as words or symbols, set them here. If not set, a blank character will be used. |
save_as_pdfa | bool | False | Save the PDF with PDF/A-3 compliance. |
save_as_pdfua | bool | False | Save the PDF with PDF/UA compliance. |
可选标题
名称数据类型 | 描述 | 作者 | 字符串 | 设置PDF元数据的作者属性。 |
标题 | 字符串 | 设置PDF元数据的标题属性。 |
主题 | 字符串 | 设置PDF元数据的主题属性。 |
示例:
请求
仅为必填参数:
curl -X 'POST' \
'http://localhost:8080/v1/document-services/pdfs/redact-regular-expression' \
-H 'accept: */*' \
-H 'author: Iron Software
IRONSECUREDOC' \
-H 'title: WEBSITE DEMO 2024' \
-H 'subject: DEMO EXAMPLE' \
-H 'Content-Type: multipart/form-data' \
-F 'pdf_file=@sample.pdf;type=application/pdf' \
-F 'regular_expression="[0-9]"' \
-F 'draw_black_box=true' \
curl -X 'POST' \
'http://localhost:8080/v1/document-services/pdfs/redact-regular-expression' \
-H 'accept: */*' \
-H 'author: Iron Software
IRONSECUREDOC' \
-H 'title: WEBSITE DEMO 2024' \
-H 'subject: DEMO EXAMPLE' \
-H 'Content-Type: multipart/form-data' \
-F 'pdf_file=@sample.pdf;type=application/pdf' \
-F 'regular_expression="[0-9]"' \
-F 'draw_black_box=true' \
CURL
所有必填和可选参数:
curl -X 'POST' \
'http://localhost:8080/v1/document-services/pdfs/redact-regular-expression' \
-H 'accept: */*' \
-H 'author: Iron Software
IRONSECUREDOC' \
-H 'title: WEBSITE DEMO 2024' \
-H 'subject: DEMO EXAMPLE' \
-H 'Content-Type: multipart/form-data' \
-F 'pdf_file=@sample.pdf;type=application/pdf' \
-F 'regular_expression="[0-9]"' \
-F 'draw_black_box=true' \
-F 'user_password="password"' \
-F 'owner_password="5yug2RT45th32h78"' \
-F 'overlay_text="%2A"' \
-F 'specific_pages=0' \
-F 'specific_pages=1' \
-F 'save_as_pdfa=false' \
-F 'save_as_pdfua=false' \
curl -X 'POST' \
'http://localhost:8080/v1/document-services/pdfs/redact-regular-expression' \
-H 'accept: */*' \
-H 'author: Iron Software
IRONSECUREDOC' \
-H 'title: WEBSITE DEMO 2024' \
-H 'subject: DEMO EXAMPLE' \
-H 'Content-Type: multipart/form-data' \
-F 'pdf_file=@sample.pdf;type=application/pdf' \
-F 'regular_expression="[0-9]"' \
-F 'draw_black_box=true' \
-F 'user_password="password"' \
-F 'owner_password="5yug2RT45th32h78"' \
-F 'overlay_text="%2A"' \
-F 'specific_pages=0' \
-F 'specific_pages=1' \
-F 'save_as_pdfa=false' \
-F 'save_as_pdfua=false' \
CURL
响应:
[POST] 编辑区域
端点: http://localhost:8080/v1/document-services/pdfs/redact-region
描述:使用真正的编辑功能隐藏PDF文档中特定区域的敏感文本。 在请求主体中包含一个PDF文件作为pdf_file
对象。
必需的请求主体参数
Name | Data Type | Description |
---|
pdf_file | application/pdf file | The PDF file to redact. |
region_to_redact_x | float | X coordinate of the region to redact, starting from the bottom-left of the page. |
region_to_redact_y | float | Y coordinate of the region to redact, starting from the bottom-left of the page. |
region_to_redact_w | float | Width of the region to redact, starting from the specified X coordinate. |
region_to_redact_h | float | Height of the region to redact, starting from the specified Y coordinate. |
可选请求体参数
Name | Data Type | Default | Description |
---|
user_password | string | null | User password for the input PDF. Required if the PDF has a user password to grant read access. |
owner_password | string | null | Owner password for the input PDF. Required if the PDF has an owner password to grant access to make modifications. |
specific_pages | array[int] | null | Optionally specify pages to apply to. If left empty, all pages will apply. |
draw_black_box | bool | True | Have a Black Box drawn over redacted text areas. |
save_as_pdfa | bool | False | Save the PDF with PDF/A-3 compliance. |
save_as_pdfua | bool | False | Save the PDF with PDF/UA compliance. |
可选标题
名称数据类型 | 描述 | 作者 | 字符串 | 设置PDF元数据的作者属性。 |
标题 | 字符串 | 设置PDF元数据的标题属性。 |
主题 | 字符串 | 设置PDF元数据的主题属性。 |
示例:
请求
仅为必填参数:
curl -X 'POST' \
'http://localhost:8080/v1/document-services/pdfs/redact-region' \
-H 'accept: */*' \
-H 'author: Iron Software
IRONSECUREDOC' \
-H 'title: WEBSITE DEMO 2024' \
-H 'subject: DEMO EXAMPLE' \
-H 'Content-Type: multipart/form-data' \
-F 'pdf_file=@sample.pdf;type=application/pdf' \
-F 'region_to_redact_x=100' \
-F 'region_to_redact_y=150' \
-F 'region_to_redact_w=500' \
-F 'region_to_redact_h=400' \
curl -X 'POST' \
'http://localhost:8080/v1/document-services/pdfs/redact-region' \
-H 'accept: */*' \
-H 'author: Iron Software
IRONSECUREDOC' \
-H 'title: WEBSITE DEMO 2024' \
-H 'subject: DEMO EXAMPLE' \
-H 'Content-Type: multipart/form-data' \
-F 'pdf_file=@sample.pdf;type=application/pdf' \
-F 'region_to_redact_x=100' \
-F 'region_to_redact_y=150' \
-F 'region_to_redact_w=500' \
-F 'region_to_redact_h=400' \
CURL
所有必填和可选参数:
curl -X 'POST' \
'http://localhost:8080/v1/document-services/pdfs/redact-region' \
-H 'accept: */*' \
-H 'author: Iron Software
IRONSECUREDOC' \
-H 'title: WEBSITE DEMO 2024' \
-H 'subject: DEMO EXAMPLE' \
-H 'Content-Type: multipart/form-data' \
-F 'pdf_file=@sample.pdf;type=application/pdf' \
-F 'user_password="password"' \
-F 'owner_password="5yug2RT45th32h78"' \
-F 'region_to_redact_x=100' \
-F 'region_to_redact_y=150' \
-F 'region_to_redact_w=500' \
-F 'region_to_redact_h=400' \
-F 'specific_pages=0' \
-F 'specific_pages=1' \
-F 'save_as_pdfa=false' \
-F 'save_as_pdfua=false' \
curl -X 'POST' \
'http://localhost:8080/v1/document-services/pdfs/redact-region' \
-H 'accept: */*' \
-H 'author: Iron Software
IRONSECUREDOC' \
-H 'title: WEBSITE DEMO 2024' \
-H 'subject: DEMO EXAMPLE' \
-H 'Content-Type: multipart/form-data' \
-F 'pdf_file=@sample.pdf;type=application/pdf' \
-F 'user_password="password"' \
-F 'owner_password="5yug2RT45th32h78"' \
-F 'region_to_redact_x=100' \
-F 'region_to_redact_y=150' \
-F 'region_to_redact_w=500' \
-F 'region_to_redact_h=400' \
-F 'specific_pages=0' \
-F 'specific_pages=1' \
-F 'save_as_pdfa=false' \
-F 'save_as_pdfua=false' \
CURL
响应:
[POST] 认证/应用数字签名
端点: http://localhost:8080/v1/document-services/pdfs/certify
描述:通过证书文件(.p12, .pfx)向PDF文档添加认证,以声明其未被篡改。 在请求主体中包含一个 PDF 文件作为pdf_file
对象,以及一个证书文件作为certificate_file
对象。
必需的请求主体参数
Name | Data Type | Description |
---|
pdf_file | application/pdf file | The PDF file to certify. |
certificate_file | application/x-pkcs12 file | The certificate file (.p12, .pfx) to use for certification. |
certificate_password | string | Password for the provided certificate file. |
certificate_permissions | int | certificate_permissions value | Permissions |
---|
1 | No Changes Allowed. Any further document changes will invalidate the signature. | 2 | Only Additional Signatures and Form Filling Allowed. | 3 | Only AdditionalSignatures, Form Filling, and Annotations Allowed |
|
可选请求体参数
Name | Data Type | Default | Description |
---|
user_password | string | null | User password for the input PDF. Required if the PDF has a user password to grant read access. |
owner_password | string | null | Owner password for the input PDF. Required if the PDF has an owner password to grant access to make modifications. |
save_as_pdfa | bool | False | Save the PDF with PDF/A-3 compliance. |
save_as_pdfua | bool | False | Save the PDF with PDF/UA compliance. |
可选标题
名称数据类型 | 描述 | 作者 | 字符串 | 设置PDF元数据的作者属性。 |
标题 | 字符串 | 设置PDF元数据的标题属性。 |
主题 | 字符串 | 设置PDF元数据的主题属性。 |
示例:
请求
仅为必填参数:
curl -X POST 'http://localhost:8080/v1/document-services/pdfs/certify' \
-H 'accept: */*' \
-H 'Content-Type: multipart/form-data' \
-F 'pdf_file=@sample.pdf;type=application/pdf' \
-F 'certificate_file=@sample.pfx;type=application/x-pkcs12' \
-F 'certificate_password="p4ssw0rd"' \
-F 'certificate_permissions=1' \
curl -X POST 'http://localhost:8080/v1/document-services/pdfs/certify' \
-H 'accept: */*' \
-H 'Content-Type: multipart/form-data' \
-F 'pdf_file=@sample.pdf;type=application/pdf' \
-F 'certificate_file=@sample.pfx;type=application/x-pkcs12' \
-F 'certificate_password="p4ssw0rd"' \
-F 'certificate_permissions=1' \
CURL
所有必填和可选参数:
curl -X POST 'http://localhost:8080/v1/document-services/pdfs/certify' \
-H 'accept: */*' \
-H 'author: Iron Software
IRONSECUREDOC' \
-H 'title: WEBSITE DEMO 2024' \
-H 'subject: DEMO EXAMPLE' \
-H 'Content-Type: multipart/form-data' \
-F 'pdf_file=@sample.pdf;type=application/pdf' \
-F 'certificate_file=@sample.pfx;type=application/x-pkcs12' \
-F 'certificate_password="p4ssw0rd"' \
-F 'certificate_permissions=1' \
-F 'user_password="password"' \
-F 'owner_password="5yug2RT45th32h78"' \
-F 'save_as_pdfa=false' \
-F 'save_as_pdfua=false' \
curl -X POST 'http://localhost:8080/v1/document-services/pdfs/certify' \
-H 'accept: */*' \
-H 'author: Iron Software
IRONSECUREDOC' \
-H 'title: WEBSITE DEMO 2024' \
-H 'subject: DEMO EXAMPLE' \
-H 'Content-Type: multipart/form-data' \
-F 'pdf_file=@sample.pdf;type=application/pdf' \
-F 'certificate_file=@sample.pfx;type=application/x-pkcs12' \
-F 'certificate_password="p4ssw0rd"' \
-F 'certificate_permissions=1' \
-F 'user_password="password"' \
-F 'owner_password="5yug2RT45th32h78"' \
-F 'save_as_pdfa=false' \
-F 'save_as_pdfua=false' \
CURL
响应:
[POST] 使用签名和证书进行签署
端点: http://localhost:8080/v1/document-services/pdfs/sign
描述:在PDF文档中添加图像和认证,通过证书文件(.p12,.pfx)证明该图像未被篡改。 在请求主体中包含一个 PDF 文件作为pdf_file
对象,以及一个证书文件作为certificate_file
对象。
必需的请求主体参数
Name | Data Type | Description |
---|
pdf_file | application/pdf file | The PDF file to certify. |
signature_image_file | image/jpeg or image/png file | The signature image (.png, .jpg, .jpeg) to use for certification. Can be a logo, autograph, etc. |
certificate_file | application/x-pkcs12 file | The certificate file (.p12, .pfx) to use for certification. |
certificate_password | string | Password for the provided certificate file. |
certificate_permissions | int | certificate_permissions value | Permissions |
---|
1 | No Changes Allowed. Any further document changes will invalidate the signature. | 2 | Only Additional Signatures and Form Filling Allowed. | 3 | Only AdditionalSignatures, Form Filling, and Annotations Allowed |
|
sign_specific_page | int | Specify page to apply the image and certificate to. First page is 0. If left empty, only first page will apply. |
signature_image_x | float | The X coordinate of the Rectangle region of the signature image. This starts from the top-left of the page. |
signature_image_y | float | The Y coordinate of the Rectangle region of the signature image. This starts from the top-left of the page. |
signature_image_w | float | The Width of the Rectangle region of the signature image. This starts from the top-left of the page. |
signature_image_h | float | The Height of the Rectangle region of the signature image. This starts from the top-left of the page. |
可选请求体参数
Name | Data Type | Default | Description |
---|
user_password | string | null | User password for the input PDF. Required if the PDF has a user password to grant read access. |
owner_password | string | null | Owner password for the input PDF. Required if the PDF has an owner password to grant access to make modifications. |
specific_pages | array[int] | null | Optionally specify pages to apply to. If left empty, all pages will apply. |
save_as_pdfa | bool | False | Save the PDF with PDF/A-3 compliance. |
save_as_pdfua | bool | False | Save the PDF with PDF/UA compliance. |
可选标题
名称数据类型 | 描述 | 作者 | 字符串 | 设置PDF元数据的作者属性。 |
标题 | 字符串 | 设置PDF元数据的标题属性。 |
主题 | 字符串 | 设置PDF元数据的主题属性。 |
示例:
请求
仅为必填参数:
curl -X POST 'http://localhost:8080/v1/document-services/pdfs/sign' \
-H 'accept: */*' \
-H 'Content-Type: multipart/form-data' \
-F 'pdf_file=@sample.pdf;type=application/pdf' \
-F 'signature_image_file=@autograph.png;type=image/png' \
-F 'certificate_file=@sample.pfx;type=application/x-pkcs12' \
-F 'certificate_password="p4ssw0rd"' \
-F 'certificate_permissions=1' \
-F 'sign_specific_page=0' \
-F 'signature_image_x=100' \
-F 'signature_image_y=150' \
-F 'signature_image_w=500' \
-F 'signature_image_h=400' \
curl -X POST 'http://localhost:8080/v1/document-services/pdfs/sign' \
-H 'accept: */*' \
-H 'Content-Type: multipart/form-data' \
-F 'pdf_file=@sample.pdf;type=application/pdf' \
-F 'signature_image_file=@autograph.png;type=image/png' \
-F 'certificate_file=@sample.pfx;type=application/x-pkcs12' \
-F 'certificate_password="p4ssw0rd"' \
-F 'certificate_permissions=1' \
-F 'sign_specific_page=0' \
-F 'signature_image_x=100' \
-F 'signature_image_y=150' \
-F 'signature_image_w=500' \
-F 'signature_image_h=400' \
CURL
所有必填和可选参数:
curl -X POST 'http://localhost:8080/v1/document-services/pdfs/sign' \
-H 'accept: */*' \
-H 'author: Iron Software
IRONSECUREDOC' \
-H 'title: WEBSITE DEMO 2024' \
-H 'subject: DEMO EXAMPLE' \
-H 'Content-Type: multipart/form-data' \
-F 'pdf_file=@sample.pdf;type=application/pdf' \
-F 'certificate_file=@sample.pfx;type=application/x-pkcs12' \
-F 'certificate_password="p4ssw0rd"' \
-F 'certificate_permissions=0' \
-F 'user_password="password"' \
-F 'owner_password="5yug2RT45th32h78"' \
-F 'save_as_pdfa=false' \
-F 'save_as_pdfua=false' \
-F 'sign_specific_page=0' \
-F 'signature_image_x=100' \
-F 'signature_image_y=150' \
-F 'signature_image_w=500' \
-F 'signature_image_h=400' \
curl -X POST 'http://localhost:8080/v1/document-services/pdfs/sign' \
-H 'accept: */*' \
-H 'author: Iron Software
IRONSECUREDOC' \
-H 'title: WEBSITE DEMO 2024' \
-H 'subject: DEMO EXAMPLE' \
-H 'Content-Type: multipart/form-data' \
-F 'pdf_file=@sample.pdf;type=application/pdf' \
-F 'certificate_file=@sample.pfx;type=application/x-pkcs12' \
-F 'certificate_password="p4ssw0rd"' \
-F 'certificate_permissions=0' \
-F 'user_password="password"' \
-F 'owner_password="5yug2RT45th32h78"' \
-F 'save_as_pdfa=false' \
-F 'save_as_pdfua=false' \
-F 'sign_specific_page=0' \
-F 'signature_image_x=100' \
-F 'signature_image_y=150' \
-F 'signature_image_w=500' \
-F 'signature_image_h=400' \
CURL
响应:
[POST] 验证签名
端点: http://localhost:8080/v1/document-services/pdfs/verify-signatures
描述:验证提供的用户和所有者密码是否对pdf_file
有效
必需的请求主体参数
Name | Data Type | Description |
---|
pdf_file | application/pdf file | The PDF file to encrypt. |
可选请求体参数
名称 | 数据类型 | 默认值 | 描述 |
---|
user_password | 字符串 | null | 输入PDF的用户密码。如果PDF设有用户密码以授予读取权限,则需要此项。 |
owner_password | 字符串 | null | 输入PDF的所有者密码。如果PDF设有所有者密码以授予修改权限,则需要此项。 |
示例:
请求
仅为必填参数:
curl -X POST 'https://api.securedoc.com/v1/document-services/pdfs/verify-signatures' \
-H 'accept: */*' \
-H 'Content-Type: multipart/form-data' \
-F 'pdf_file=@sample.pdf;type=application/pdf' \
curl -X POST 'https://api.securedoc.com/v1/document-services/pdfs/verify-signatures' \
-H 'accept: */*' \
-H 'Content-Type: multipart/form-data' \
-F 'pdf_file=@sample.pdf;type=application/pdf' \
YAML
所有必填和可选参数:
curl -X POST 'https://api.securedoc.com/v1/document-services/pdfs/verify-signatures' \
-H 'accept: */*' \
-H 'author: Iron Software
IRONSECUREDOC' \
-H 'title: WEBSITE DEMO 2024' \
-H 'subject: DEMO EXAMPLE' \
-H 'Content-Type: multipart/form-data' \
-F 'pdf_file=@sample.pdf;type=application/pdf' \
-F 'user_password="password"' \
-F 'owner_password="5yug2RT45th32h78"' \
curl -X POST 'https://api.securedoc.com/v1/document-services/pdfs/verify-signatures' \
-H 'accept: */*' \
-H 'author: Iron Software
IRONSECUREDOC' \
-H 'title: WEBSITE DEMO 2024' \
-H 'subject: DEMO EXAMPLE' \
-H 'Content-Type: multipart/form-data' \
-F 'pdf_file=@sample.pdf;type=application/pdf' \
-F 'user_password="password"' \
-F 'owner_password="5yug2RT45th32h78"' \
YAML
响应:
- 如果存在签名且全部有效,则返回200 OK。
- 如果没有签名或至少一个签名无效,将返回400 BadRequest结果。
[POST] 加密 / 添加密码和权限
端点: http://localhost:8080/v1/document-services/pdfs/encrypt
描述:通过为 PDF 文档加密并设置用户和所有者密码,为其添加一层安全保护。 在请求体中包含一个作为 pdf_file 对象的 PDF 文件。
必需的请求主体参数
名称 | 数据类型 | 描述 |
---|
pdf_file | application/pdf 文件 | 要加密的PDF文件。 |
allow_extracting_content | bool | 允许从PDF文件中提取内容。 |
allow_form_filling | bool | 允许在生成的PDF中填写表单。 |
allow_annotations | bool | 允许在生成的PDF中添加或修改注释。 |
allow_printing | bool | 允许打印生成的PDF。 |
allow_modifications | bool | 允许对生成的PDF进行修改。 |
new_owner_password | string | 生成PDF的新所有者密码。授予完全访问权限,包括更改权限和密码。 |
可选请求体参数
Name | Data Type | Default | Description |
---|
user_password | string | null | User password for the input PDF. Required if the PDF has a user password to grant read access. |
owner_password | string | null | Owner password for the input PDF. Required if the PDF has an owner password to grant access to make modifications. |
new_user_password | string | null | New user password for the output PDF. Grants read access and other specified permissions. |
save_as_pdfa | bool | False | Save the PDF with PDF/A-3 compliance. |
save_as_pdfua | bool | False | Save the PDF with PDF/UA compliance. |
可选标题
名称数据类型 | 描述 | 作者 | 字符串 | 设置PDF元数据的作者属性。 |
标题 | 字符串 | 设置PDF元数据的标题属性。 |
主题 | 字符串 | 设置PDF元数据的主题属性。 |
示例:
请求
仅为必填参数:
curl -X POST 'http://localhost:8080/v1/document-services/pdfs/encrypt' \
-H 'accept: */*' \
-H 'Content-Type: multipart/form-data' \
-F 'pdf_file=@sample.pdf;type=application/pdf' \
-F 'allow_extracting_content=true' \
-F 'allow_form_filling=true' \
-F 'allow_annotations=true' \
-F 'allow_printing=true' \
-F 'allow_modifications=false' \
curl -X POST 'http://localhost:8080/v1/document-services/pdfs/encrypt' \
-H 'accept: */*' \
-H 'Content-Type: multipart/form-data' \
-F 'pdf_file=@sample.pdf;type=application/pdf' \
-F 'allow_extracting_content=true' \
-F 'allow_form_filling=true' \
-F 'allow_annotations=true' \
-F 'allow_printing=true' \
-F 'allow_modifications=false' \
CURL
所有必填和可选参数:
curl -X POST 'http://localhost:8080/v1/document-services/pdfs/encrypt' \
-H 'accept: */*' \
-H 'author: Iron Software
IRONSECUREDOC' \
-H 'title: WEBSITE DEMO 2024' \
-H 'subject: DEMO EXAMPLE' \
-H 'Content-Type: multipart/form-data' \
-F 'pdf_file=@sample.pdf;type=application/pdf' \
-F 'allow_extracting_content=true' \
-F 'allow_form_filling=true' \
-F 'allow_annotations=true' \
-F 'allow_printing=true' \
-F 'allow_modifications=false' \
-F 'user_password="password"' \
-F 'owner_password="5yug2RT45th32h78"' \
-F 'new_user_password="p4ssw0rd"' \
-F 'save_as_pdfa=false' \
-F 'save_as_pdfua=false' \
curl -X POST 'http://localhost:8080/v1/document-services/pdfs/encrypt' \
-H 'accept: */*' \
-H 'author: Iron Software
IRONSECUREDOC' \
-H 'title: WEBSITE DEMO 2024' \
-H 'subject: DEMO EXAMPLE' \
-H 'Content-Type: multipart/form-data' \
-F 'pdf_file=@sample.pdf;type=application/pdf' \
-F 'allow_extracting_content=true' \
-F 'allow_form_filling=true' \
-F 'allow_annotations=true' \
-F 'allow_printing=true' \
-F 'allow_modifications=false' \
-F 'user_password="password"' \
-F 'owner_password="5yug2RT45th32h78"' \
-F 'new_user_password="p4ssw0rd"' \
-F 'save_as_pdfa=false' \
-F 'save_as_pdfua=false' \
CURL
响应:
[POST] 从文档中提取文本
端点: http://localhost:8080/v1/document-services/pdfs/extract
描述:提取文档页面中嵌入的文本。 在请求主体中包含一个PDF文件作为pdf_file
对象。
必需的请求主体参数
Name | Data Type | Description |
---|
pdf_file | application/pdf file | The PDF file to encrypt. |
可选请求体参数
名称 | 数据类型 | 默认值 | 描述 |
---|
user_password | string | null | 输入PDF的用户密码。如果PDF有用户密码以授予读取权限,则需要此密码。 |
owner_password | string | null | 输入PDF的所有者密码。如果PDF有所有者密码以授权修改,则需要此密码。 |
specific_pages | array[int] | null | 可选地指定要应用的页面。如果为空,则应用于所有页面。 |
示例:
请求
仅为必填参数:
curl -X POST 'http://localhost:8080/v1/document-services/pdfs/extract' \
-H 'accept: */*' \
-H 'Content-Type: multipart/form-data' \
-F 'pdf_file=@sample.pdf;type=application/pdf' \
curl -X POST 'http://localhost:8080/v1/document-services/pdfs/extract' \
-H 'accept: */*' \
-H 'Content-Type: multipart/form-data' \
-F 'pdf_file=@sample.pdf;type=application/pdf' \
CURL
所有必填和可选参数:
curl -X POST 'http://localhost:8080/v1/document-services/pdfs/extract' \
-H 'accept: */*' \
-H 'author: Iron Software
IRONSECUREDOC' \
-H 'title: WEBSITE DEMO 2024' \
-H 'subject: DEMO EXAMPLE' \
-H 'Content-Type: multipart/form-data' \
-F 'pdf_file=@sample.pdf;type=application/pdf' \
-F 'user_password="password"' \
-F 'owner_password="5yug2RT45th32h78"' \
-F 'specific_pages=0' \
-F 'specific_pages=1' \
curl -X POST 'http://localhost:8080/v1/document-services/pdfs/extract' \
-H 'accept: */*' \
-H 'author: Iron Software
IRONSECUREDOC' \
-H 'title: WEBSITE DEMO 2024' \
-H 'subject: DEMO EXAMPLE' \
-H 'Content-Type: multipart/form-data' \
-F 'pdf_file=@sample.pdf;type=application/pdf' \
-F 'user_password="password"' \
-F 'owner_password="5yug2RT45th32h78"' \
-F 'specific_pages=0' \
-F 'specific_pages=1' \
CURL
响应:
[POST] 验证文档密码
端点: http://localhost:8080/v1/document-services/pdfs/verify-password
描述:验证提供的用户和所有者密码是否对pdf_file
有效
必需的请求主体参数
Name | Data Type | Description |
---|
pdf_file | application/pdf file | The PDF file. |
user_password | string | User password for the input PDF. Required if the PDF has a user password to grant read access. |
owner_password | string | Owner password for the input PDF. |
示例:
请求
仅为必填参数:
curl -X POST 'https://api.securedoc.com/v1/document-services/pdfs/verify-password' \
-H 'accept: */*' \
-H 'author: Iron Software
IRONSECUREDOC' \
-H 'title: WEBSITE DEMO 2024' \
-H 'subject: DEMO EXAMPLE' \
-H 'Content-Type: multipart/form-data' \
-F 'pdf_file=@sample.pdf;type=application/pdf' \
-F 'user_password="password"' \
-F 'owner_password="5yug2RT45th32h78"' \
curl -X POST 'https://api.securedoc.com/v1/document-services/pdfs/verify-password' \
-H 'accept: */*' \
-H 'author: Iron Software
IRONSECUREDOC' \
-H 'title: WEBSITE DEMO 2024' \
-H 'subject: DEMO EXAMPLE' \
-H 'Content-Type: multipart/form-data' \
-F 'pdf_file=@sample.pdf;type=application/pdf' \
-F 'user_password="password"' \
-F 'owner_password="5yug2RT45th32h78"' \
YAML
响应:
软件工程师
Chaknith 负责 IronXL 和 IronBarcode 的工作。他在 C# 和 .NET 方面拥有深厚的专业知识,帮助改进软件并支持客户。他从用户互动中获得的洞察力,有助于提升产品、文档和整体体验。