From fff77423e5971623ecf6514198f09188f5ecd436 Mon Sep 17 00:00:00 2001 From: Jasnoor Singh Date: Fri, 4 Oct 2024 14:12:54 +0530 Subject: [PATCH] added import statements to samples --- .../quickstarts/python/index.md | 21 +++++++++++++++++ .../quickstarts/python/index.md | 17 +++++++++++--- .../quickstarts/python/index.md | 23 +++++++++++++++++++ .../quickstarts/python/index.md | 19 ++++++++++++--- 4 files changed, 74 insertions(+), 6 deletions(-) diff --git a/src/pages/overview/document-generation-api/quickstarts/python/index.md b/src/pages/overview/document-generation-api/quickstarts/python/index.md index 9cc6f0460..19b59d21f 100644 --- a/src/pages/overview/document-generation-api/quickstarts/python/index.md +++ b/src/pages/overview/document-generation-api/quickstarts/python/index.md @@ -204,9 +204,30 @@ with open(output_file_path, "wb") as file: Here's the complete application (`src/documentmerge/merge_document_to_pdf.py`): ```python +import json +import logging +import os +from datetime import datetime + +from adobe.pdfservices.operation.auth.service_principal_credentials import ServicePrincipalCredentials +from adobe.pdfservices.operation.exception.exceptions import ServiceApiException, ServiceUsageException, SdkException +from adobe.pdfservices.operation.io.cloud_asset import CloudAsset +from adobe.pdfservices.operation.io.stream_asset import StreamAsset +from adobe.pdfservices.operation.pdf_services import PDFServices +from adobe.pdfservices.operation.pdf_services_media_type import PDFServicesMediaType +from adobe.pdfservices.operation.pdfjobs.jobs.document_merge_job import DocumentMergeJob +from adobe.pdfservices.operation.pdfjobs.params.documentmerge.document_merge_params import DocumentMergeParams +from adobe.pdfservices.operation.pdfjobs.params.documentmerge.output_format import OutputFormat +from adobe.pdfservices.operation.pdfjobs.result.document_merge_result import DocumentMergePDFResult + # Initialize the logger logging.basicConfig(level=logging.INFO) +# This sample illustrates how to merge the Word based document template with the input JSON data to generate +# the output document in the PDF format. +# +# Refer to README.md for instructions on how to run the samples. + class MergeDocumentToPDF: def __init__(self): try: diff --git a/src/pages/overview/pdf-accessibility-auto-tag-api/quickstarts/python/index.md b/src/pages/overview/pdf-accessibility-auto-tag-api/quickstarts/python/index.md index f679d0e77..490646afb 100644 --- a/src/pages/overview/pdf-accessibility-auto-tag-api/quickstarts/python/index.md +++ b/src/pages/overview/pdf-accessibility-auto-tag-api/quickstarts/python/index.md @@ -140,15 +140,26 @@ with open(output_file_path, "wb") as file: Here's the complete application (`autotag.py`): ```python +import logging +import os +from datetime import datetime + +from adobe.pdfservices.operation.auth.service_principal_credentials import ServicePrincipalCredentials +from adobe.pdfservices.operation.exception.exceptions import ServiceApiException, ServiceUsageException, SdkException +from adobe.pdfservices.operation.io.cloud_asset import CloudAsset +from adobe.pdfservices.operation.io.stream_asset import StreamAsset +from adobe.pdfservices.operation.pdf_services import PDFServices +from adobe.pdfservices.operation.pdf_services_media_type import PDFServicesMediaType +from adobe.pdfservices.operation.pdfjobs.jobs.autotag_pdf_job import AutotagPDFJob +from adobe.pdfservices.operation.pdfjobs.result.autotag_pdf_result import AutotagPDFResult + # Initialize the logger logging.basicConfig(level=logging.INFO) - -# # This sample illustrates how to generate a tagged PDF. # # Refer to README.md for instructions on how to run the samples. -# + class AutoTagPDF: def __init__(self): try: diff --git a/src/pages/overview/pdf-electronic-seal-api/quickstarts/python/index.md b/src/pages/overview/pdf-electronic-seal-api/quickstarts/python/index.md index 614c93cbc..01808fc16 100644 --- a/src/pages/overview/pdf-electronic-seal-api/quickstarts/python/index.md +++ b/src/pages/overview/pdf-electronic-seal-api/quickstarts/python/index.md @@ -205,9 +205,32 @@ with open(output_file_path, "wb") as file: Here's the complete application (`src/electronicseal/electronic_seal.py`): ```python +import logging +import os +from datetime import datetime + +from adobe.pdfservices.operation.auth.service_principal_credentials import ServicePrincipalCredentials +from adobe.pdfservices.operation.exception.exceptions import ServiceApiException, ServiceUsageException, SdkException +from adobe.pdfservices.operation.io.cloud_asset import CloudAsset +from adobe.pdfservices.operation.io.stream_asset import StreamAsset +from adobe.pdfservices.operation.pdf_services import PDFServices +from adobe.pdfservices.operation.pdf_services_media_type import PDFServicesMediaType +from adobe.pdfservices.operation.pdfjobs.jobs.eseal_job import PDFElectronicSealJob +from adobe.pdfservices.operation.pdfjobs.params.eseal.csc_auth_context import CSCAuthContext +from adobe.pdfservices.operation.pdfjobs.params.eseal.csc_credentials import CSCCredentials +from adobe.pdfservices.operation.pdfjobs.params.eseal.document_level_permission import DocumentLevelPermission +from adobe.pdfservices.operation.pdfjobs.params.eseal.electronic_seal_params import PDFElectronicSealParams +from adobe.pdfservices.operation.pdfjobs.params.eseal.field_location import FieldLocation +from adobe.pdfservices.operation.pdfjobs.params.eseal.field_options import FieldOptions +from adobe.pdfservices.operation.pdfjobs.result.eseal_pdf_result import ESealPDFResult + # Initialize the logger logging.basicConfig(level=logging.INFO) +# This sample illustrates how to apply electronic seal over the PDF document using default appearance options. +# +# Refer to README.md for instructions on how to run the samples. + class ElectronicSeal: def __init__(self): try: diff --git a/src/pages/overview/pdf-extract-api/quickstarts/python/index.md b/src/pages/overview/pdf-extract-api/quickstarts/python/index.md index 7cc402dfb..941aff31c 100644 --- a/src/pages/overview/pdf-extract-api/quickstarts/python/index.md +++ b/src/pages/overview/pdf-extract-api/quickstarts/python/index.md @@ -163,15 +163,28 @@ for element in data["elements"]: Here's the complete application (`extract.py`): ```python +import logging +import os +from datetime import datetime + +from adobe.pdfservices.operation.auth.service_principal_credentials import ServicePrincipalCredentials +from adobe.pdfservices.operation.exception.exceptions import ServiceApiException, ServiceUsageException, SdkException +from adobe.pdfservices.operation.pdf_services_media_type import PDFServicesMediaType +from adobe.pdfservices.operation.io.cloud_asset import CloudAsset +from adobe.pdfservices.operation.io.stream_asset import StreamAsset +from adobe.pdfservices.operation.pdf_services import PDFServices +from adobe.pdfservices.operation.pdfjobs.jobs.extract_pdf_job import ExtractPDFJob +from adobe.pdfservices.operation.pdfjobs.params.extract_pdf.extract_element_type import ExtractElementType +from adobe.pdfservices.operation.pdfjobs.params.extract_pdf.extract_pdf_params import ExtractPDFParams +from adobe.pdfservices.operation.pdfjobs.result.extract_pdf_result import ExtractPDFResult + # Initialize the logger logging.basicConfig(level=logging.INFO) - -# # This sample illustrates how to extract Text Information from PDF. # # Refer to README.md for instructions on how to run the samples & understand output zip file. -# + class ExtractTextInfoFromPDF: def __init__(self): try: