From d046451e23ed0a11ab4b0c435e96d73d28e1274a Mon Sep 17 00:00:00 2001 From: Taylor Smith Date: Wed, 6 Dec 2023 13:27:14 -0600 Subject: [PATCH 1/4] Add optional arguments for dotnet --- .../Endpoint Examples/Multipart Payload/exported-form-data.cs | 3 +++ DotNET/Endpoint Examples/Multipart Payload/extracted-text.cs | 3 +++ DotNET/Endpoint Examples/Multipart Payload/merged-pdf.cs | 3 +++ DotNET/Endpoint Examples/Multipart Payload/split-pdf.cs | 3 +++ DotNET/Endpoint Examples/Multipart Payload/word.cs | 3 +++ 5 files changed, 15 insertions(+) diff --git a/DotNET/Endpoint Examples/Multipart Payload/exported-form-data.cs b/DotNET/Endpoint Examples/Multipart Payload/exported-form-data.cs index 191bd6d..22d5fd3 100644 --- a/DotNET/Endpoint Examples/Multipart Payload/exported-form-data.cs +++ b/DotNET/Endpoint Examples/Multipart Payload/exported-form-data.cs @@ -16,6 +16,9 @@ var byteArrayOption = new ByteArrayContent(Encoding.UTF8.GetBytes("xml")); multipartContent.Add(byteArrayOption, "data_format"); + var byteArrayOption2 = new ByteArrayContent(Encoding.UTF8.GetBytes("extracted")); + multipartContent.Add(byteArrayOption2, "output"); + request.Content = multipartContent; var response = await httpClient.SendAsync(request); diff --git a/DotNET/Endpoint Examples/Multipart Payload/extracted-text.cs b/DotNET/Endpoint Examples/Multipart Payload/extracted-text.cs index 37685dd..bdf57e0 100644 --- a/DotNET/Endpoint Examples/Multipart Payload/extracted-text.cs +++ b/DotNET/Endpoint Examples/Multipart Payload/extracted-text.cs @@ -13,6 +13,9 @@ multipartContent.Add(byteAryContent, "file", "file_name"); byteAryContent.Headers.TryAddWithoutValidation("Content-Type", "application/pdf"); + var byteArrayOption = new ByteArrayContent(Encoding.UTF8.GetBytes("on")); + multipartContent.Add(byteArrayOption, "word_style"); + request.Content = multipartContent; var response = await httpClient.SendAsync(request); diff --git a/DotNET/Endpoint Examples/Multipart Payload/merged-pdf.cs b/DotNET/Endpoint Examples/Multipart Payload/merged-pdf.cs index 2174607..66a4c8e 100644 --- a/DotNET/Endpoint Examples/Multipart Payload/merged-pdf.cs +++ b/DotNET/Endpoint Examples/Multipart Payload/merged-pdf.cs @@ -29,6 +29,9 @@ var byteArrayOption4 = new ByteArrayContent(Encoding.UTF8.GetBytes("all")); multipartContent.Add(byteArrayOption4, "pages[]"); + var byteArrayOption5 = new ByteArrayContent(Encoding.UTF8.GetBytes("merged")); + multipartContent.Add(byteArrayOption5, "output"); + request.Content = multipartContent; var response = await httpClient.SendAsync(request); diff --git a/DotNET/Endpoint Examples/Multipart Payload/split-pdf.cs b/DotNET/Endpoint Examples/Multipart Payload/split-pdf.cs index b42ebe9..5bf6ef6 100644 --- a/DotNET/Endpoint Examples/Multipart Payload/split-pdf.cs +++ b/DotNET/Endpoint Examples/Multipart Payload/split-pdf.cs @@ -19,6 +19,9 @@ var byteArrayOption2 = new ByteArrayContent(Encoding.UTF8.GetBytes("2-last")); multipartContent.Add(byteArrayOption2, "pages[]"); + var byteArrayOption3 = new ByteArrayContent(Encoding.UTF8.GetBytes("split")); + multipartContent.Add(byteArrayOption3, "output"); + request.Content = multipartContent; var response = await httpClient.SendAsync(request); diff --git a/DotNET/Endpoint Examples/Multipart Payload/word.cs b/DotNET/Endpoint Examples/Multipart Payload/word.cs index 65f1c07..d4134a7 100644 --- a/DotNET/Endpoint Examples/Multipart Payload/word.cs +++ b/DotNET/Endpoint Examples/Multipart Payload/word.cs @@ -13,6 +13,9 @@ multipartContent.Add(byteAryContent, "file", "file_name"); byteAryContent.Headers.TryAddWithoutValidation("Content-Type", "application/pdf"); + var byteArrayOption = new ByteArrayContent(Encoding.UTF8.GetBytes("converted")); + multipartContent.Add(byteArrayOption, "output"); + request.Content = multipartContent; var response = await httpClient.SendAsync(request); From 5b91dc37e53af90bd590349275024e5952c70850 Mon Sep 17 00:00:00 2001 From: Taylor Smith Date: Wed, 6 Dec 2023 13:29:30 -0600 Subject: [PATCH 2/4] Add optional arguments for javascript --- JavaScript/Endpoint Examples/Multipart Payload/extracted-text.js | 1 + 1 file changed, 1 insertion(+) diff --git a/JavaScript/Endpoint Examples/Multipart Payload/extracted-text.js b/JavaScript/Endpoint Examples/Multipart Payload/extracted-text.js index 30e28df..7a71269 100644 --- a/JavaScript/Endpoint Examples/Multipart Payload/extracted-text.js +++ b/JavaScript/Endpoint Examples/Multipart Payload/extracted-text.js @@ -6,6 +6,7 @@ var fs = require("fs"); // Create a new form data instance and append the PDF file and parameters to it var data = new FormData(); data.append("file", fs.createReadStream("/path/to/file")); +data.append("word_style", "on"); // define configuration options for axios request var config = { From 80701e6fd683371b5a992111d17e535d4fc7f1a4 Mon Sep 17 00:00:00 2001 From: Taylor Smith Date: Wed, 6 Dec 2023 13:31:49 -0600 Subject: [PATCH 3/4] Add optional arguments for php --- PHP/Endpoint Examples/Multipart Payload/extracted-text.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/PHP/Endpoint Examples/Multipart Payload/extracted-text.php b/PHP/Endpoint Examples/Multipart Payload/extracted-text.php index c44ec65..708a101 100644 --- a/PHP/Endpoint Examples/Multipart Payload/extracted-text.php +++ b/PHP/Endpoint Examples/Multipart Payload/extracted-text.php @@ -20,6 +20,10 @@ 'headers' => [ 'Content-Type' => '' // Set the Content-Type header for the file. ] + ], + [ + 'name' => 'word_style', // Specify the field name for the word_style option. + 'contents' => 'on' // Set the value for the output option (in this case, 'on'). ] ] ]; From 9f32834a5c48cb93edb59a3bb641876aa7d1baab Mon Sep 17 00:00:00 2001 From: Taylor Smith Date: Wed, 6 Dec 2023 13:33:57 -0600 Subject: [PATCH 4/4] Add optional arguments for python --- Python/Endpoint Examples/Multipart Payload/extracted-text.py | 1 + 1 file changed, 1 insertion(+) diff --git a/Python/Endpoint Examples/Multipart Payload/extracted-text.py b/Python/Endpoint Examples/Multipart Payload/extracted-text.py index 9cb8b20..15ca8bb 100644 --- a/Python/Endpoint Examples/Multipart Payload/extracted-text.py +++ b/Python/Endpoint Examples/Multipart Payload/extracted-text.py @@ -9,6 +9,7 @@ mp_encoder_extractText = MultipartEncoder( fields={ 'file': ('file_name.pdf', open('/path/to/file', 'rb'), 'application/pdf'), + 'word_style': 'on', } )