From f5077ee6b25a738fd7355a385b9c35491f7b0f2b Mon Sep 17 00:00:00 2001 From: vignesh66085 Date: Thu, 19 Jun 2025 13:11:11 +0530 Subject: [PATCH 1/6] update : accessibility checker - content --- .../pdf-services-api/howtos/pdf-accessibility-checker-api.md | 2 +- src/pages/resources/openapi.json | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/pages/overview/pdf-services-api/howtos/pdf-accessibility-checker-api.md b/src/pages/overview/pdf-services-api/howtos/pdf-accessibility-checker-api.md index a9fca7714..349716e24 100644 --- a/src/pages/overview/pdf-services-api/howtos/pdf-accessibility-checker-api.md +++ b/src/pages/overview/pdf-services-api/howtos/pdf-accessibility-checker-api.md @@ -3,7 +3,7 @@ title: PDF Accessibility Checker | How Tos | PDF Services API | Adobe PDF Servic --- # PDF Accessibility Checker -The Accessibility Checker API verifies if PDF files meet the machine-verifiable requirements of PDF/UA and WCAG 2.0. It generates a report summarizing the findings of the accessibility checks. Additional human remediation may be required to ensure the reading order of elements is correct and that alternative text tags properly convey the meaning of images. The report contains links to documentation that assists in manually fixing problems using Adobe Acrobat Pro. +The Accessibility Checker API verifies if PDF files meet the machine-verifiable requirements of PDF/UA and WCAG. It generates a report summarizing the findings of the accessibility checks. Additional human remediation may be required to ensure the reading order of elements is correct and that alternative text tags properly convey the meaning of images. The report contains links to documentation that assists in manually fixing problems using Adobe Acrobat Pro. ## API Parameters diff --git a/src/pages/resources/openapi.json b/src/pages/resources/openapi.json index 93066ebf8..0ec0dca16 100644 --- a/src/pages/resources/openapi.json +++ b/src/pages/resources/openapi.json @@ -92,7 +92,7 @@ }, { "name": "PDF Accessibility Checker", - "description": "Accessibility Checker API will check PDF files to see if they meet the machine-verifiable requirements of PDF/UA and WCAG 2.0." + "description": "Accessibility Checker API will check PDF files to see if they meet the machine-verifiable requirements of PDF/UA and WCAG." }, { "name": "PDF Watermark", @@ -7388,7 +7388,7 @@ "PDF Accessibility Checker" ], "summary": "PDF Accessibility Checker Operation", - "description": "Accessibility Checker API will check PDF files to see if they meet the machine-verifiable requirements of PDF/UA and WCAG 2.0. It will generate a report that summarizes the findings of the accessibility checks. Additional human remediation may be required to ensure that the reading order of elements is correct and that alternative text tags properly convey the meaning of an image. The report contains links to documentation that assist in manually fixing problems using Adobe Acrobat Pro.", + "description": "Accessibility Checker API will check PDF files to see if they meet the machine-verifiable requirements of PDF/UA and WCAG. It will generate a report that summarizes the findings of the accessibility checks. Additional human remediation may be required to ensure that the reading order of elements is correct and that alternative text tags properly convey the meaning of an image. The report contains links to documentation that assist in manually fixing problems using Adobe Acrobat Pro.", "operationId": "pdfoperations.accessibilitychecker", "parameters": [ { From ed3c0590e702d54b3727a7c96009d41aac5c3d3d Mon Sep 17 00:00:00 2001 From: Garvit Kansal Date: Wed, 25 Jun 2025 09:34:26 +0530 Subject: [PATCH 2/6] Added Marketing Docs for Python SDK 4.2.0 --- .../howtos/export-pdf-form-data.md | 64 ++++++++++++++- .../howtos/import-pdf-form-data.md | 80 ++++++++++++++++++- src/pages/overview/releasenotes.md | 4 + 3 files changed, 146 insertions(+), 2 deletions(-) diff --git a/src/pages/overview/pdf-services-api/howtos/export-pdf-form-data.md b/src/pages/overview/pdf-services-api/howtos/export-pdf-form-data.md index 187e0f415..64ae33ab5 100644 --- a/src/pages/overview/pdf-services-api/howtos/export-pdf-form-data.md +++ b/src/pages/overview/pdf-services-api/howtos/export-pdf-form-data.md @@ -33,7 +33,7 @@ The sample below exports PDF form data and returns it as a JSON file. Please refer to the [API usage guide](../api-usage.md) to understand how to use our APIs. - + #### Java @@ -80,6 +80,68 @@ public class ExportPDFFormData { } ``` +#### Python + +```python +# Get the samples https://github.com/adobe/pdfservices-python-sdk-samples +# Run the sample: +# python src/exportpdfformdata/export_pdf_form_data.py + +# Initialize the logger +logging.basicConfig(level=logging.INFO) + +class ExportPDFFormData: + def __init__(self): + try: + file = open('../resources/exportPdfFormDataInput.pdf', 'rb') + input_stream = file.read() + file.close() + + # Initial setup, create credentials instance + credentials = ServicePrincipalCredentials( + client_id=os.getenv('PDF_SERVICES_CLIENT_ID'), + client_secret=os.getenv('PDF_SERVICES_CLIENT_SECRET') + ) + + # Creates a PDF Services instance + pdf_services = PDFServices(credentials=credentials) + + # Creates an asset(s) from source file(s) and upload + input_asset = pdf_services.upload(input_stream=input_stream, + mime_type=PDFServicesMediaType.PDF) + + # Creates a new job instance + export_pdf_form_data_job = ExportPDFFormDataJob(input_asset=input_asset) + + # Submit the job and gets the job result + location = pdf_services.submit(export_pdf_form_data_job) + pdf_services_response = pdf_services.get_job_result(location, ExportPDFFormDataResult) + + # Get content from the resulting asset(s) + result_asset = pdf_services_response.get_result().get_asset() + stream_asset = pdf_services.get_content(result_asset) + + # Creates an output stream and copy stream asset's content to it + output_file_path = self.create_output_file_path() + with open(output_file_path, "wb") as file: + file.write(stream_asset.get_input_stream()) + + except (ServiceApiException, ServiceUsageException, SdkException) as e: + logging.exception(f'Exception encountered while executing operation: {e}') + + # Generates a string containing a directory structure and file name for the output file + @staticmethod + def create_output_file_path() -> str: + now = datetime.now() + time_stamp = now.strftime("%Y-%m-%dT%H-%M-%S") + os.makedirs("../../output/ExportPDFFormData", exist_ok=True) + return f"../../output/ExportPDFFormData/export{time_stamp}.json" + + +if __name__ == "__main__": + ExportPDFFormData() +``` + #### REST API ```javascript diff --git a/src/pages/overview/pdf-services-api/howtos/import-pdf-form-data.md b/src/pages/overview/pdf-services-api/howtos/import-pdf-form-data.md index 049317ae7..867cc4f94 100644 --- a/src/pages/overview/pdf-services-api/howtos/import-pdf-form-data.md +++ b/src/pages/overview/pdf-services-api/howtos/import-pdf-form-data.md @@ -33,7 +33,7 @@ The sample below demonstrates how to import form data from a JSON into PDF and g Please refer to the [API usage guide](../api-usage.md) to understand how to use our APIs. - + #### Java @@ -95,6 +95,84 @@ public class ImportPdfFormData { } ``` +#### Python + +```python +# Get the samples https://github.com/adobe/pdfservices-python-sdk-samples +# Run the sample: +# python src/exportpdfformdata/export_pdf_form_data.py + +# Initialize the logger +logging.basicConfig(level=logging.INFO) + +class ImportPDFFormData: + def __init__(self): + try: + file = open('../resources/importPdfFormDataInput.pdf', 'rb') + input_stream = file.read() + file.close() + + # Initial setup, create credentials instance + credentials = ServicePrincipalCredentials( + client_id=os.getenv('PDF_SERVICES_CLIENT_ID'), + client_secret=os.getenv('PDF_SERVICES_CLIENT_SECRET') + ) + + # Creates a PDF Services instance + pdf_services = PDFServices(credentials=credentials) + + # Creates an asset(s) from source file(s) and upload + input_asset = pdf_services.upload(input_stream=input_stream, + mime_type=PDFServicesMediaType.PDF) + + # Form data to be imported + form_data = { + "option_two": "Yes", + "option_one": "Yes", + "name": "garvit", + "option_three": "Off", + "age": "24", + "favorite_movie": "Star Wars Again", + } + + # Create parameters for the job + import_pdf_form_data_params = ImportPDFFormDataParams(json_form_fields_data=form_data) + + # Creates a new job instance + import_pdf_form_data_job = ImportPDFFormDataJob(input_asset=input_asset) + + # Set the parameters for the job + import_pdf_form_data_job.set_params(import_pdf_form_data_params) + + # Submit the job and gets the job result + location = pdf_services.submit(import_pdf_form_data_job) + pdf_services_response = pdf_services.get_job_result(location, ImportPDFFormDataResult) + + # Get content from the resulting asset(s) + result_asset = pdf_services_response.get_result().get_asset() + stream_asset = pdf_services.get_content(result_asset) + + # Creates an output stream and copy stream asset's content to it + output_file_path = self.create_output_file_path() + with open(output_file_path, "wb") as file: + file.write(stream_asset.get_input_stream()) + + except (ServiceApiException, ServiceUsageException, SdkException) as e: + logging.exception(f'Exception encountered while executing operation: {e}') + + # Generates a string containing a directory structure and file name for the output file + @staticmethod + def create_output_file_path() -> str: + now = datetime.now() + time_stamp = now.strftime("%Y-%m-%dT%H-%M-%S") + os.makedirs("../../output/ImportPDFFormData", exist_ok=True) + return f"../../output/ImportPDFFormData/import{time_stamp}.pdf" + + +if __name__ == "__main__": + ImportPDFFormData() +``` + #### REST API ```javascript diff --git a/src/pages/overview/releasenotes.md b/src/pages/overview/releasenotes.md index 487e7b446..eb8198b70 100644 --- a/src/pages/overview/releasenotes.md +++ b/src/pages/overview/releasenotes.md @@ -180,6 +180,10 @@ Upgrading to the latest SDK should not break existing applications. ## Change history +### July 3, 2025; Python SDK 4.2.0 Release + +- Added support for [Export PDF Form Data](../pdf-services-api/howtos/export-pdf-form-data/) and [Import PDF Form Data](../pdf-services-api/howtos/import-pdf-form-data/) operations in PDF Services Python SDK, enabling users to extract and populate form Data. + ### May 22, 2025; .NET SDK 4.3.0 Release - Added support for [Export PDF Form Data](../pdf-services-api/howtos/export-pdf-form-data/) and [Import PDF Form Data](../pdf-services-api/howtos/import-pdf-form-data/) operations in PDF Services .NET SDK, enabling users to extract and populate form Data. From 80a7b5f4b3f9773772c37cbac64e905861cc1fa3 Mon Sep 17 00:00:00 2001 From: vignesh66085 Date: Fri, 27 Jun 2025 16:51:09 +0530 Subject: [PATCH 3/6] update : WCAG 2.0 to the latest version of WCAG --- .../pdf-services-api/howtos/pdf-accessibility-checker-api.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pages/overview/pdf-services-api/howtos/pdf-accessibility-checker-api.md b/src/pages/overview/pdf-services-api/howtos/pdf-accessibility-checker-api.md index 349716e24..c2c2075b7 100644 --- a/src/pages/overview/pdf-services-api/howtos/pdf-accessibility-checker-api.md +++ b/src/pages/overview/pdf-services-api/howtos/pdf-accessibility-checker-api.md @@ -3,7 +3,7 @@ title: PDF Accessibility Checker | How Tos | PDF Services API | Adobe PDF Servic --- # PDF Accessibility Checker -The Accessibility Checker API verifies if PDF files meet the machine-verifiable requirements of PDF/UA and WCAG. It generates a report summarizing the findings of the accessibility checks. Additional human remediation may be required to ensure the reading order of elements is correct and that alternative text tags properly convey the meaning of images. The report contains links to documentation that assists in manually fixing problems using Adobe Acrobat Pro. +The Accessibility Checker API verifies if PDF files meet the machine-verifiable requirements of PDF/UA and the latest version of WCAG. It generates a report summarizing the findings of the accessibility checks. Additional human remediation may be required to ensure the reading order of elements is correct and that alternative text tags properly convey the meaning of images. The report contains links to documentation that assists in manually fixing problems using Adobe Acrobat Pro. ## API Parameters From 0a21f1f4b4ba2fcf5c7c0260f3d308c40ddf5a8c Mon Sep 17 00:00:00 2001 From: mahour Date: Mon, 30 Jun 2025 17:23:48 +0530 Subject: [PATCH 4/6] revert to 5bb1a00d4e802054b78c4ac74c32893aea7efae0 --- .../pdf-services-api/howtos/pdf-accessibility-checker-api.md | 2 +- src/pages/resources/openapi.json | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/pages/overview/pdf-services-api/howtos/pdf-accessibility-checker-api.md b/src/pages/overview/pdf-services-api/howtos/pdf-accessibility-checker-api.md index c2c2075b7..a9fca7714 100644 --- a/src/pages/overview/pdf-services-api/howtos/pdf-accessibility-checker-api.md +++ b/src/pages/overview/pdf-services-api/howtos/pdf-accessibility-checker-api.md @@ -3,7 +3,7 @@ title: PDF Accessibility Checker | How Tos | PDF Services API | Adobe PDF Servic --- # PDF Accessibility Checker -The Accessibility Checker API verifies if PDF files meet the machine-verifiable requirements of PDF/UA and the latest version of WCAG. It generates a report summarizing the findings of the accessibility checks. Additional human remediation may be required to ensure the reading order of elements is correct and that alternative text tags properly convey the meaning of images. The report contains links to documentation that assists in manually fixing problems using Adobe Acrobat Pro. +The Accessibility Checker API verifies if PDF files meet the machine-verifiable requirements of PDF/UA and WCAG 2.0. It generates a report summarizing the findings of the accessibility checks. Additional human remediation may be required to ensure the reading order of elements is correct and that alternative text tags properly convey the meaning of images. The report contains links to documentation that assists in manually fixing problems using Adobe Acrobat Pro. ## API Parameters diff --git a/src/pages/resources/openapi.json b/src/pages/resources/openapi.json index 0ec0dca16..93066ebf8 100644 --- a/src/pages/resources/openapi.json +++ b/src/pages/resources/openapi.json @@ -92,7 +92,7 @@ }, { "name": "PDF Accessibility Checker", - "description": "Accessibility Checker API will check PDF files to see if they meet the machine-verifiable requirements of PDF/UA and WCAG." + "description": "Accessibility Checker API will check PDF files to see if they meet the machine-verifiable requirements of PDF/UA and WCAG 2.0." }, { "name": "PDF Watermark", @@ -7388,7 +7388,7 @@ "PDF Accessibility Checker" ], "summary": "PDF Accessibility Checker Operation", - "description": "Accessibility Checker API will check PDF files to see if they meet the machine-verifiable requirements of PDF/UA and WCAG. It will generate a report that summarizes the findings of the accessibility checks. Additional human remediation may be required to ensure that the reading order of elements is correct and that alternative text tags properly convey the meaning of an image. The report contains links to documentation that assist in manually fixing problems using Adobe Acrobat Pro.", + "description": "Accessibility Checker API will check PDF files to see if they meet the machine-verifiable requirements of PDF/UA and WCAG 2.0. It will generate a report that summarizes the findings of the accessibility checks. Additional human remediation may be required to ensure that the reading order of elements is correct and that alternative text tags properly convey the meaning of an image. The report contains links to documentation that assist in manually fixing problems using Adobe Acrobat Pro.", "operationId": "pdfoperations.accessibilitychecker", "parameters": [ { From b73d428a38d783fb2cb548f084f4158d76445a91 Mon Sep 17 00:00:00 2001 From: Garvit Kansal Date: Thu, 10 Jul 2025 18:28:17 +0530 Subject: [PATCH 5/6] Adding v4.2 SHA Value --- src/pages/overview/pdf-services-api/gettingstarted.md | 4 ++-- src/pages/overview/releasenotes.md | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/pages/overview/pdf-services-api/gettingstarted.md b/src/pages/overview/pdf-services-api/gettingstarted.md index 99224d09e..45d10c206 100644 --- a/src/pages/overview/pdf-services-api/gettingstarted.md +++ b/src/pages/overview/pdf-services-api/gettingstarted.md @@ -636,14 +636,14 @@ For security reasons you may wish to confirm the installer's authenticity. To do 1. After downloading the package zip, run following command ``` -pip hash /pdfservices-sdk-4.1.1.tar.gz +pip hash /pdfservices-sdk-4.2.0.tar.gz ``` 2. Above command will return the hash of downloaded package. 3. Verify the hash matches the value published here. ``` -a7592acd8c93eac52e0d8eae24cf2b8eee331f8704172a7b91ab7891fac5585d +378afa7d3b22683264a1817393932a649b98e4d4b3913816f839de240f7132d5 ``` ## Public API diff --git a/src/pages/overview/releasenotes.md b/src/pages/overview/releasenotes.md index eb8198b70..e9f51e363 100644 --- a/src/pages/overview/releasenotes.md +++ b/src/pages/overview/releasenotes.md @@ -180,7 +180,7 @@ Upgrading to the latest SDK should not break existing applications. ## Change history -### July 3, 2025; Python SDK 4.2.0 Release +### July 10, 2025; Python SDK 4.2.0 Release - Added support for [Export PDF Form Data](../pdf-services-api/howtos/export-pdf-form-data/) and [Import PDF Form Data](../pdf-services-api/howtos/import-pdf-form-data/) operations in PDF Services Python SDK, enabling users to extract and populate form Data. From f5a56208c1e976bdc35124fcb57e748df4c55559 Mon Sep 17 00:00:00 2001 From: Garvit Kansal Date: Thu, 10 Jul 2025 18:31:00 +0530 Subject: [PATCH 6/6] Updating Python SDK v4.2 SHA Value --- .../overview/pdf-accessibility-auto-tag-api/gettingstarted.md | 4 ++-- src/pages/overview/pdf-extract-api/gettingstarted.md | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/pages/overview/pdf-accessibility-auto-tag-api/gettingstarted.md b/src/pages/overview/pdf-accessibility-auto-tag-api/gettingstarted.md index 0578dccfc..810e79e97 100644 --- a/src/pages/overview/pdf-accessibility-auto-tag-api/gettingstarted.md +++ b/src/pages/overview/pdf-accessibility-auto-tag-api/gettingstarted.md @@ -637,14 +637,14 @@ For security reasons you may wish to confirm the installer's authenticity. To do 1. After downloading the package zip, run following command ``` -pip hash /pdfservices-sdk-4.1.1.tar.gz +pip hash /pdfservices-sdk-4.2.0.tar.gz ``` 1. Above command will return the hash of downloaded package. 2. Verify the hash matches the value published here. ``` -a7592acd8c93eac52e0d8eae24cf2b8eee331f8704172a7b91ab7891fac5585d +378afa7d3b22683264a1817393932a649b98e4d4b3913816f839de240f7132d5 ``` ###### To generate tagged PDF from the sample file diff --git a/src/pages/overview/pdf-extract-api/gettingstarted.md b/src/pages/overview/pdf-extract-api/gettingstarted.md index 0fdc53ecf..47887b8d0 100644 --- a/src/pages/overview/pdf-extract-api/gettingstarted.md +++ b/src/pages/overview/pdf-extract-api/gettingstarted.md @@ -637,14 +637,14 @@ For security reasons you may wish to confirm the installer's authenticity. To do 1. After downloading the package zip, run following command ``` -pip hash /pdfservices-sdk-4.1.1.tar.gz +pip hash /pdfservices-sdk-4.2.0.tar.gz ``` 1. Above command will return the hash of downloaded package. 2. Verify the hash matches the value published here. ``` -a7592acd8c93eac52e0d8eae24cf2b8eee331f8704172a7b91ab7891fac5585d +378afa7d3b22683264a1817393932a649b98e4d4b3913816f839de240f7132d5 ``` ###### To extract data from the sample PDF file