- IronSecureDoc
- 教程
- IronSecureDoc 的 REST API
IronSecureDoc 的 REST API
2024年7月20日
已更新 2024年10月20日
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:有效
[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. |
選擇性請求主體參數
名稱 | 資料類型 | 預設值 | 描述 |
---|
user_password | string | null | 用於輸入 PDF 的用戶密碼。如果 PDF 有用戶密碼以授予讀取權限,則為必填。 |
owner_password | string | null | 用於輸入 PDF 的擁有者密碼。如果 PDF 有擁有者密碼以授予進行修改的權限,則為必填。 |
specific_pages | array[int] | null | 可選地指定要應用的頁面。如果留空,將應用於所有頁面。 |
draw_black_box | bool | True | 在被編輯的文字區域上繪製黑框。 |
match_whole_word | bool | True | 允許在單詞中進行部分匹配編輯。 |
match_case | bool | null | 匹配要編輯文字的大小寫。 |
overlay_text | string | null | 如果您希望在編輯區域中顯示疊加文字(例如文字或符號),請在此設置。如果不設置,將使用空白字符。 |
save_as_pdfa | bool | False | 將 PDF 保存為符合 PDF/A-3 標準。 |
save_as_pdfua | bool | False | 將 PDF 保存為符合 PDF/UA 標準。 |
可選標頭
名稱 | 資料類型 | 描述 |
---|
author | string | 設置 PDF 中的元數據作者屬性。 |
title | string | 設置 PDF 中的元數據標題屬性。 |
subject | string | 設置 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. |
可選標頭
名稱 | 資料類型 | 描述 |
---|
author | string | 設置 PDF 中的元數據作者屬性。 |
title | string | 設置 PDF 中的元數據標題屬性。 |
subject | string | 設置 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. |
可選標頭
名稱 | 資料類型 | 描述 |
---|
author | string | 設置 PDF 中的元數據作者屬性。 |
title | string | 設置 PDF 中的元數據標題屬性。 |
subject | string | 設置 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] 認證 / 應用數位簽名
Endpoint:http://localhost:8080/v1/document-services/pdfs/certify
描述:使用證書文件(.p12, .pfx)為 PDF 文件添加認證,以確保其未被篡改。 在請求正文中包含一個作為pdf_file
對象的PDF檔案,以及一個作為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 |
|
選擇性請求主體參數
名稱 | 資料類型 | 預設值 | 描述 |
---|
user_password | string | null | 輸入 PDF 的用戶密碼。如果 PDF 有用戶密碼以授予讀取權限,則必須提供。 |
owner_password | string | null | 輸入 PDF 的擁有者密碼。如果 PDF 有擁有者密碼以授予修改權限,則必須提供。 |
save_as_pdfa | bool | False | 將 PDF 保存為符合 PDF/A-3。 |
save_as_pdfua | bool | False | 將 PDF 保存為符合 PDF/UA。 |
可選標頭
名稱 | 資料類型 | 描述 |
---|
author | string | 設置 PDF 中的元數據作者屬性。 |
title | string | 設置 PDF 中的元數據標題屬性。 |
subject | string | 設置 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_file
對象的PDF檔案,以及一個作為certificate_file
對象的證書檔案。
所需請求正文參數
Name | Data Type | Description |
pdf_file
選擇性請求主體參數
名稱 | 資料類型 | 預設值 | 描述 |
---|
user_password | string | null | 輸入PDF的使用者密碼。如果PDF具有使用者密碼以授予讀取權限,則必需。 |
owner_password | string | null | 輸入PDF的所有者密碼。如果PDF具有所有者密碼以授予修改權限,則必需。 |
specific_pages | array[int] | null | 可選指定要應用的頁面。如果留空,則會應用於所有頁面。 |
save_as_pdfa | bool | False | 以PDF/A-3相容性儲存PDF。 |
save_as_pdfua | bool | False | 以PDF/UA相容性儲存PDF。 |
可選標頭
名稱 | 資料類型 | 描述 |
---|
author | string | 設置 PDF 中的元數據作者屬性。 |
title | string | 設置 PDF 中的元數據標題屬性。 |
subject | string | 設置 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. |
選擇性請求主體參數
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. |
範例:
請求
僅限必填參數:
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 文件。
所需請求正文參數
Name | Data Type | Description |
---|
pdf_file | application/pdf file | The PDF file to encrypt. |
allow_extracting_content | bool | Allow the extraction of content from the PDF file. |
allow_form_filling | bool | Allow the filling of forms in the resulting PDF. |
allow_annotations | bool | Allow the addition or modification of annotations in the resulting PDF. |
allow_printing | bool | Allow printing of the resulting PDF. |
allow_modifications | bool | Allow modifications to the resulting PDF. |
new_owner_password | string | New owner password for the output PDF. Grants full access, including changing permissions and passwords. |
選擇性請求主體參數
名稱 | 資料類型 | 預設值 | 説明 |
---|
user_password | string | null | 輸入 PDF 的用戶密碼。如果 PDF 設有用戶密碼以授予讀取權限,則此項為必填。 |
owner_password | string | null | 輸入 PDF 的擁有者密碼。如果 PDF 設有擁有者密碼以授予修改權限,則此項為必填。 |
new_user_password | string | null | 輸出 PDF 的新用戶密碼。授予讀取權限和其他指定權限。 |
save_as_pdfa | bool | False | 以 PDF/A-3 標準存儲 PDF。 |
save_as_pdfua | bool | False | 以 PDF/UA 標準存儲 PDF。 |
可選標頭
名稱 | 資料類型 | 描述 |
---|
author | string | 設置 PDF 中的元數據作者屬性。 |
title | string | 設置 PDF 中的元數據標題屬性。 |
subject | string | 設置 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] 從文件中提取文本
Endpoint: 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. |
選擇性請求主體參數
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. |
範例:
請求
僅限必填參數:
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 方面擁有豐富的專業知識,協助改進軟體並支持客戶。他從用戶互動中獲得的洞察力有助於提高產品、文檔和整體體驗。