diff --git a/Python/Endpoint Examples/Multipart Payload/bmp.py b/Python/Endpoint Examples/Multipart Payload/bmp.py index 59b5a79..80ea9db 100644 --- a/Python/Endpoint Examples/Multipart Payload/bmp.py +++ b/Python/Endpoint Examples/Multipart Payload/bmp.py @@ -8,7 +8,7 @@ # This sample takes in a PDF and converts all pages into grayscale BMP files. mp_encoder_bmp = MultipartEncoder( fields={ - 'file': ('file_name', open('/path/to/file', 'rb'), 'application/pdf'), + 'file': ('file_name.pdf', open('/path/to/file', 'rb'), 'application/pdf'), 'pages': '1-last', 'resolution': '600', 'color_model': 'gray', diff --git a/Python/Endpoint Examples/Multipart Payload/compressed-pdf.py b/Python/Endpoint Examples/Multipart Payload/compressed-pdf.py index aa5573e..6fa692d 100644 --- a/Python/Endpoint Examples/Multipart Payload/compressed-pdf.py +++ b/Python/Endpoint Examples/Multipart Payload/compressed-pdf.py @@ -9,7 +9,7 @@ # We have preset 'high', 'medium', and 'low' compression levels available for use. These preset levels do not require the 'profile' parameter. mp_encoder_compressedPdf = MultipartEncoder( fields={ - 'file': ('file_name', open('/path/to/file', 'rb'), 'application/pdf'), + 'file': ('file_name.pdf', open('/path/to/file', 'rb'), 'application/pdf'), 'output' : 'example_compressedPdf_out', 'compression_level': 'medium', } diff --git a/Python/Endpoint Examples/Multipart Payload/decrypted-pdf.py b/Python/Endpoint Examples/Multipart Payload/decrypted-pdf.py index 84ce01d..7803660 100644 --- a/Python/Endpoint Examples/Multipart Payload/decrypted-pdf.py +++ b/Python/Endpoint Examples/Multipart Payload/decrypted-pdf.py @@ -8,7 +8,7 @@ # This sample demonstrates decryption of a PDF with the password 'password'. mp_encoder_decryptedPdf = MultipartEncoder( fields={ - 'file': ('file_name', open('/path/to/file', 'rb'), 'application/pdf'), + 'file': ('file_name.pdf', open('/path/to/file', 'rb'), 'application/pdf'), 'output' : 'example_decryptedPdf_out', 'current_open_password': 'password', } diff --git a/Python/Endpoint Examples/Multipart Payload/encrypted-pdf.py b/Python/Endpoint Examples/Multipart Payload/encrypted-pdf.py index 52990b0..01258da 100644 --- a/Python/Endpoint Examples/Multipart Payload/encrypted-pdf.py +++ b/Python/Endpoint Examples/Multipart Payload/encrypted-pdf.py @@ -8,7 +8,7 @@ # This sample demonstrates encryption of a PDF with the password 'password'. mp_encoder_encryptedPdf = MultipartEncoder( fields={ - 'file': ('file_name', open('/path/to/file', 'rb'), 'application/pdf'), + 'file': ('file_name.pdf', open('/path/to/file', 'rb'), 'application/pdf'), 'output' : 'example_encryptedPdf_out', 'new_open_password': 'password', } diff --git a/Python/Endpoint Examples/Multipart Payload/exported-form-data.py b/Python/Endpoint Examples/Multipart Payload/exported-form-data.py index da7fea6..ffed996 100644 --- a/Python/Endpoint Examples/Multipart Payload/exported-form-data.py +++ b/Python/Endpoint Examples/Multipart Payload/exported-form-data.py @@ -8,7 +8,7 @@ # This sample demonstrates encryption of a PDF with the password 'password'. mp_encoder_exportedFormData = MultipartEncoder( fields={ - 'file': ('file_name', open('/path/to/file', 'rb'), 'application/pdf'), + 'file': ('file_name.pdf', open('/path/to/file', 'rb'), 'application/pdf'), 'output' : 'example_exportedFormData_out', 'data_format': 'xml', } diff --git a/Python/Endpoint Examples/Multipart Payload/extracted-text.py b/Python/Endpoint Examples/Multipart Payload/extracted-text.py index e6677a6..9cb8b20 100644 --- a/Python/Endpoint Examples/Multipart Payload/extracted-text.py +++ b/Python/Endpoint Examples/Multipart Payload/extracted-text.py @@ -8,7 +8,7 @@ #This sample demonstrates extracting the text from a document to return as JSON mp_encoder_extractText = MultipartEncoder( fields={ - 'file': ('file_name', open('/path/to/file', 'rb'), 'application/pdf'), + 'file': ('file_name.pdf', open('/path/to/file', 'rb'), 'application/pdf'), } ) diff --git a/Python/Endpoint Examples/Multipart Payload/flattened-annotations-pdf.py b/Python/Endpoint Examples/Multipart Payload/flattened-annotations-pdf.py index f7d7211..1a4e1d1 100644 --- a/Python/Endpoint Examples/Multipart Payload/flattened-annotations-pdf.py +++ b/Python/Endpoint Examples/Multipart Payload/flattened-annotations-pdf.py @@ -6,7 +6,7 @@ mp_encoder_flattenedPDF = MultipartEncoder( fields={ - 'file': ('file_name', open('/path/to/file', 'rb'), 'application/pdf'), + 'file': ('file_name.pdf', open('/path/to/file', 'rb'), 'application/pdf'), 'output' : 'example_out' } ) diff --git a/Python/Endpoint Examples/Multipart Payload/flattened-forms-pdf.py b/Python/Endpoint Examples/Multipart Payload/flattened-forms-pdf.py index e520f7c..3c84986 100644 --- a/Python/Endpoint Examples/Multipart Payload/flattened-forms-pdf.py +++ b/Python/Endpoint Examples/Multipart Payload/flattened-forms-pdf.py @@ -6,7 +6,7 @@ mp_encoder_flattenedPDF = MultipartEncoder( fields={ - 'file': ('file_name', open('/path/to/file', 'rb'), 'application/pdf'), + 'file': ('file_name.pdf', open('/path/to/file', 'rb'), 'application/pdf'), 'output' : 'example_out' } ) diff --git a/Python/Endpoint Examples/Multipart Payload/flattened-layers-pdf.py b/Python/Endpoint Examples/Multipart Payload/flattened-layers-pdf.py index 6b3d313..ad88e17 100644 --- a/Python/Endpoint Examples/Multipart Payload/flattened-layers-pdf.py +++ b/Python/Endpoint Examples/Multipart Payload/flattened-layers-pdf.py @@ -6,7 +6,7 @@ mp_encoder_flattenedPDF = MultipartEncoder( fields={ - 'file': ('file_name', open('/path/to/file', 'rb'), 'application/pdf'), + 'file': ('file_name.pdf', open('/path/to/file', 'rb'), 'application/pdf'), 'output' : 'example_out' } ) diff --git a/Python/Endpoint Examples/Multipart Payload/flattened-transparencies-pdf.py b/Python/Endpoint Examples/Multipart Payload/flattened-transparencies-pdf.py index e2a7ed4..64ff129 100644 --- a/Python/Endpoint Examples/Multipart Payload/flattened-transparencies-pdf.py +++ b/Python/Endpoint Examples/Multipart Payload/flattened-transparencies-pdf.py @@ -9,7 +9,7 @@ # We have preset 'high', 'medium', and 'low' quality levels available for use. These preset levels do not require the 'profile' parameter. mp_encoder_flattenTransparenciesPdf = MultipartEncoder( fields={ - 'file': ('file_name', open('/path/to/file', 'rb'), 'application/pdf'), + 'file': ('file_name.pdf', open('/path/to/file', 'rb'), 'application/pdf'), 'output' : 'example_flattenedPdf_out', 'quality': 'medium', } diff --git a/Python/Endpoint Examples/Multipart Payload/gif.py b/Python/Endpoint Examples/Multipart Payload/gif.py index 35b5248..fbdf3e4 100644 --- a/Python/Endpoint Examples/Multipart Payload/gif.py +++ b/Python/Endpoint Examples/Multipart Payload/gif.py @@ -8,7 +8,7 @@ # This sample takes in a PDF and converts all pages into grayscale GIF files. mp_encoder_gif = MultipartEncoder( fields={ - 'file': ('file_name', open('/path/to/file', 'rb'), 'application/pdf'), + 'file': ('file_name.pdf', open('/path/to/file', 'rb'), 'application/pdf'), 'pages': '1-last', 'resolution': '600', 'color_model': 'gray', diff --git a/Python/Endpoint Examples/Multipart Payload/jpg.py b/Python/Endpoint Examples/Multipart Payload/jpg.py index af37431..e71a00d 100644 --- a/Python/Endpoint Examples/Multipart Payload/jpg.py +++ b/Python/Endpoint Examples/Multipart Payload/jpg.py @@ -8,7 +8,7 @@ # This sample takes in a PDF and converts all pages into JPEG files. mp_encoder_jpg = MultipartEncoder( fields={ - 'file': ('file_name', open('/path/to/file', 'rb'), 'application/pdf'), + 'file': ('file_name.pdf', open('/path/to/file', 'rb'), 'application/pdf'), 'pages': '1-last', 'resolution': '600', 'color_model': 'cmyk', diff --git a/Python/Endpoint Examples/Multipart Payload/linearized-pdf.py b/Python/Endpoint Examples/Multipart Payload/linearized-pdf.py index 4b7d2a7..1c0238f 100644 --- a/Python/Endpoint Examples/Multipart Payload/linearized-pdf.py +++ b/Python/Endpoint Examples/Multipart Payload/linearized-pdf.py @@ -8,7 +8,7 @@ # This sample demonstrates linearizing a PDF file. mp_encoder_linearizedPdf = MultipartEncoder( fields={ - 'file': ('file_name', open('/path/to/file', 'rb'), 'application/pdf'), + 'file': ('file_name.pdf', open('/path/to/file', 'rb'), 'application/pdf'), 'output' : 'example_linearizedPdf_out', } ) diff --git a/Python/Endpoint Examples/Multipart Payload/merged-pdf.py b/Python/Endpoint Examples/Multipart Payload/merged-pdf.py index c21449a..80474bb 100644 --- a/Python/Endpoint Examples/Multipart Payload/merged-pdf.py +++ b/Python/Endpoint Examples/Multipart Payload/merged-pdf.py @@ -11,8 +11,8 @@ # Array of tuples that contains information about the 2 files that will be merged files = [ - ('file_name', open('/path/to/file', 'rb'), 'application/pdf'), - ('file_name', open('/path/to/file', 'rb'), 'application/pdf') + ('file_name.pdf', open('/path/to/file', 'rb'), 'application/pdf'), + ('file_name2.pdf', open('/path/to/file', 'rb'), 'application/pdf') ] # Structure the data that will be sent to POST merge request as an array of tuples diff --git a/Python/Endpoint Examples/Multipart Payload/pdf-info.py b/Python/Endpoint Examples/Multipart Payload/pdf-info.py index ee2ef55..63b315e 100644 --- a/Python/Endpoint Examples/Multipart Payload/pdf-info.py +++ b/Python/Endpoint Examples/Multipart Payload/pdf-info.py @@ -8,7 +8,7 @@ #This sample demonstrates querying the title, page count, document language and author mp_encoder_pdfInfo = MultipartEncoder( fields={ - 'file': ('file_name', open('/path/to/file', 'rb'), 'application/pdf'), + 'file': ('file_name.pdf', open('/path/to/file', 'rb'), 'application/pdf'), 'queries': 'title,page_count,doc_language,author', } ) diff --git a/Python/Endpoint Examples/Multipart Payload/pdf-with-added-image.py b/Python/Endpoint Examples/Multipart Payload/pdf-with-added-image.py index 9bd0c35..56fad3b 100644 --- a/Python/Endpoint Examples/Multipart Payload/pdf-with-added-image.py +++ b/Python/Endpoint Examples/Multipart Payload/pdf-with-added-image.py @@ -6,8 +6,8 @@ mp_encoder_pdfWithAddedImage = MultipartEncoder( fields={ - 'file': ('file_name', open('/path/to/file', 'rb'), 'application/pdf'), - 'image_file': ('file_name', open('/path/to/file', 'rb'), 'image/jpeg'), + 'file': ('file_name.pdf', open('/path/to/file', 'rb'), 'application/pdf'), + 'image_file': ('file_name.jpg', open('/path/to/file', 'rb'), 'image/jpeg'), 'output' : 'example_out', 'x' : '10', 'y' : '10', diff --git a/Python/Endpoint Examples/Multipart Payload/pdf-with-imported-form-data.py b/Python/Endpoint Examples/Multipart Payload/pdf-with-imported-form-data.py index 5efc371..8590bcf 100644 --- a/Python/Endpoint Examples/Multipart Payload/pdf-with-imported-form-data.py +++ b/Python/Endpoint Examples/Multipart Payload/pdf-with-imported-form-data.py @@ -6,8 +6,8 @@ mp_encoder_importFormData = MultipartEncoder( fields={ - 'file': ('file_name', open('/path/to/file', 'rb'), 'application/pdf'), - 'data_file': ('file_name', open('/path/to/datafile', 'rb'), 'application/xml'), # Update for your data file format + 'file': ('file_name.pdf', open('/path/to/file', 'rb'), 'application/pdf'), + 'data_file': ('file_name.xml', open('/path/to/datafile', 'rb'), 'application/xml'), # Update for your data file format 'output' : 'example_out' } ) diff --git a/Python/Endpoint Examples/Multipart Payload/pdf.py b/Python/Endpoint Examples/Multipart Payload/pdf.py index 8ead4dc..f21d414 100644 --- a/Python/Endpoint Examples/Multipart Payload/pdf.py +++ b/Python/Endpoint Examples/Multipart Payload/pdf.py @@ -10,7 +10,7 @@ # Please see https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types/Common_types for more information about MIME types. mp_encoder_pdf = MultipartEncoder( fields={ - 'file': ('file_name', open('/path/to/file', 'rb'), 'image/tiff'), + 'file': ('file_name.tif', open('/path/to/file', 'rb'), 'image/tiff'), 'output' : 'example_pdf_out', } ) diff --git a/Python/Endpoint Examples/Multipart Payload/pdfa.py b/Python/Endpoint Examples/Multipart Payload/pdfa.py index aacfd95..dc39123 100644 --- a/Python/Endpoint Examples/Multipart Payload/pdfa.py +++ b/Python/Endpoint Examples/Multipart Payload/pdfa.py @@ -7,7 +7,7 @@ # The /pdfa endpoint can take a single PDF file or id as input. mp_encoder_pdfa = MultipartEncoder( fields={ - 'file': ('file_name', open('/path/to/file', 'rb'), 'application/pdf'), + 'file': ('file_name.pdf', open('/path/to/file', 'rb'), 'application/pdf'), 'output_type': 'PDF/A-1b', 'rasterize_if_errors_encountered': 'on', 'output' : 'example_pdfa_out', diff --git a/Python/Endpoint Examples/Multipart Payload/pdfx.py b/Python/Endpoint Examples/Multipart Payload/pdfx.py index 1ecf041..ef2aa6f 100644 --- a/Python/Endpoint Examples/Multipart Payload/pdfx.py +++ b/Python/Endpoint Examples/Multipart Payload/pdfx.py @@ -7,7 +7,7 @@ # The /pdfx endpoint can take a single PDF file or id as input. mp_encoder_pdfx = MultipartEncoder( fields={ - 'file': ('file_name', open('/path/to/file', 'rb'), 'application/pdf'), + 'file': ('file_name.pdf', open('/path/to/file', 'rb'), 'application/pdf'), 'output_type': 'PDF/X-4', 'output' : 'example_pdfx_out' } diff --git a/Python/Endpoint Examples/Multipart Payload/png.py b/Python/Endpoint Examples/Multipart Payload/png.py index 97c5e43..6f6600f 100644 --- a/Python/Endpoint Examples/Multipart Payload/png.py +++ b/Python/Endpoint Examples/Multipart Payload/png.py @@ -8,7 +8,7 @@ # This sample takes in a PDF and converts all pages into grayscale PNG files. mp_encoder_png = MultipartEncoder( fields={ - 'file': ('file_name', open('/path/to/file', 'rb'), 'application/pdf'), + 'file': ('file_name.pdf', open('/path/to/file', 'rb'), 'application/pdf'), 'pages': '1-last', 'resolution': '600', 'color_model': 'gray', diff --git a/Python/Endpoint Examples/Multipart Payload/restricted-pdf.py b/Python/Endpoint Examples/Multipart Payload/restricted-pdf.py index 0f8ffbc..2dc4c0c 100644 --- a/Python/Endpoint Examples/Multipart Payload/restricted-pdf.py +++ b/Python/Endpoint Examples/Multipart Payload/restricted-pdf.py @@ -8,7 +8,7 @@ # This sample demonstrates setting the permissions password to 'password' and adding restrictions. mp_encoder_restrictedPdf = MultipartEncoder( fields=[ - ('file', ('file_name', open('/path/to/file', 'rb'), 'application/pdf')), + ('file', ('file_name.pdf', open('/path/to/file', 'rb'), 'application/pdf')), ('output', 'example_restrictedPdf_out'), ('new_permissions_password', 'password'), ('restrictions', 'print_high'), diff --git a/Python/Endpoint Examples/Multipart Payload/split-pdf.py b/Python/Endpoint Examples/Multipart Payload/split-pdf.py index 6ce3fa8..f6d402b 100644 --- a/Python/Endpoint Examples/Multipart Payload/split-pdf.py +++ b/Python/Endpoint Examples/Multipart Payload/split-pdf.py @@ -9,7 +9,7 @@ # Create a list of tuples for data that will be sent to the request split_request_data = [] -split_request_data.append(('file',('file_name', open('/path/to/file', 'rb'), 'application/pdf'))) +split_request_data.append(('file',('file_name.pdf', open('/path/to/file', 'rb'), 'application/pdf'))) split_request_data.append(('pages', '1,2,5')) split_request_data.append(('pages', '3,4')) split_request_data.append(('output', 'example_splitPdf_out')) diff --git a/Python/Endpoint Examples/Multipart Payload/tif.py b/Python/Endpoint Examples/Multipart Payload/tif.py index f4bbfa0..3a99202 100644 --- a/Python/Endpoint Examples/Multipart Payload/tif.py +++ b/Python/Endpoint Examples/Multipart Payload/tif.py @@ -8,7 +8,7 @@ # This sample takes in a PDF and converts all pages into grayscale TIFF files. mp_encoder_tif = MultipartEncoder( fields={ - 'file': ('file_name', open('/path/to/file', 'rb'), 'application/pdf'), + 'file': ('file_name.pdf', open('/path/to/file', 'rb'), 'application/pdf'), 'pages': '1-last', 'resolution': '600', 'color_model': 'gray', diff --git a/Python/Endpoint Examples/Multipart Payload/unrestricted-pdf.py b/Python/Endpoint Examples/Multipart Payload/unrestricted-pdf.py index 2b53388..de03561 100644 --- a/Python/Endpoint Examples/Multipart Payload/unrestricted-pdf.py +++ b/Python/Endpoint Examples/Multipart Payload/unrestricted-pdf.py @@ -8,7 +8,7 @@ # This sample demonstrates removing security restrictions from a PDF. mp_encoder_unrestrictedPdf = MultipartEncoder( fields={ - 'file': ('file_name', open('/path/to/file', 'rb'), 'application/pdf'), + 'file': ('file_name.pdf', open('/path/to/file', 'rb'), 'application/pdf'), 'output' : 'example_unrestrictedPdf_out', 'current_permissions_password': 'password' } diff --git a/Python/Endpoint Examples/Multipart Payload/upload.py b/Python/Endpoint Examples/Multipart Payload/upload.py index d8aae1a..60bb3a1 100644 --- a/Python/Endpoint Examples/Multipart Payload/upload.py +++ b/Python/Endpoint Examples/Multipart Payload/upload.py @@ -12,9 +12,9 @@ # The 'application/pdf' string below is known as a MIME type, which is a label used to identify the type of a file so that it is handled properly by software. # Please see https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types/Common_types for more information about MIME types. files = [ - ('file_name', open('/path/to/file', 'rb'), 'application/pdf'), - ('file_name', open('/path/to/file', 'rb'), 'application/pdf'), - ('file_name', open('/path/to/file', 'rb'), 'image/jpeg') + ('file_name.pdf', open('/path/to/file', 'rb'), 'application/pdf'), + ('file_name2.pdf', open('/path/to/file', 'rb'), 'application/pdf'), + ('file_name.jpg', open('/path/to/file', 'rb'), 'image/jpeg') ] # Structure the data that will be sent to POST upload request as an array of tuples diff --git a/Python/Endpoint Examples/Multipart Payload/watermarked-pdf.py b/Python/Endpoint Examples/Multipart Payload/watermarked-pdf.py index 98aa404..2b7e494 100644 --- a/Python/Endpoint Examples/Multipart Payload/watermarked-pdf.py +++ b/Python/Endpoint Examples/Multipart Payload/watermarked-pdf.py @@ -6,7 +6,7 @@ mp_encoder_watermarkedPDF = MultipartEncoder( fields={ - 'file': ('file_name', open('/path/to/file', 'rb'), 'application/pdf'), + 'file': ('file_name.pdf', open('/path/to/file', 'rb'), 'application/pdf'), 'watermark_text': 'watermark', 'output' : 'example_out' } diff --git a/Python/Endpoint Examples/Multipart Payload/zip.py b/Python/Endpoint Examples/Multipart Payload/zip.py index 62967eb..066ee9d 100644 --- a/Python/Endpoint Examples/Multipart Payload/zip.py +++ b/Python/Endpoint Examples/Multipart Payload/zip.py @@ -12,9 +12,9 @@ # The 'application/pdf' string below is known as a MIME type, which is a label used to identify the type of a file so that it is handled properly by software. # Please see https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types/Common_types for more information about MIME types. files = [ - ('file_name', open('/path/to/file', 'rb'), 'application/pdf'), - ('file_name', open('/path/to/file', 'rb'), 'image/tiff'), - ('file_name', open('/path/to/file', 'rb'), 'image/bmp') + ('file_name.pdf', open('/path/to/file', 'rb'), 'application/pdf'), + ('file_name.tif', open('/path/to/file', 'rb'), 'image/tiff'), + ('file_name.bmp', open('/path/to/file', 'rb'), 'image/bmp') ] # Structure the data that will be sent to POST zip request as an array of tuples