diff --git a/README.md b/README.md index 891d9ec..10e8e42 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ Convert API lets you effortlessly convert file formats and types. [Cloudmersive Document and Data Conversion API](https://www.cloudmersive.com/convert-api) provides advanced document conversion, editing and generation capabilities. - API version: v1 -- Package version: 1.8.4 +- Package version: 1.8.5 ## Requirements @@ -230,7 +230,8 @@ Class | Method | HTTP request | Description *MergeDocumentApi* | [**mergeDocumentDocxMulti**](docs/Api/MergeDocumentApi.md#mergedocumentdocxmulti) | **POST** /convert/merge/docx/multi | Merge Multple Word DOCX Together *MergeDocumentApi* | [**mergeDocumentPdf**](docs/Api/MergeDocumentApi.md#mergedocumentpdf) | **POST** /convert/merge/pdf | Merge Two PDF Files Together *MergeDocumentApi* | [**mergeDocumentPdfMulti**](docs/Api/MergeDocumentApi.md#mergedocumentpdfmulti) | **POST** /convert/merge/pdf/multi | Merge Multple PDF Files Together -*MergeDocumentApi* | [**mergeDocumentPng**](docs/Api/MergeDocumentApi.md#mergedocumentpng) | **POST** /convert/merge/png/vertical | Merge Multple PNG Files Together +*MergeDocumentApi* | [**mergeDocumentPng**](docs/Api/MergeDocumentApi.md#mergedocumentpng) | **POST** /convert/merge/png/vertical | Merge Two PNG Files Together +*MergeDocumentApi* | [**mergeDocumentPngMulti**](docs/Api/MergeDocumentApi.md#mergedocumentpngmulti) | **POST** /convert/merge/png/vertical/multi | Merge Multple PNG Files Together *MergeDocumentApi* | [**mergeDocumentPptx**](docs/Api/MergeDocumentApi.md#mergedocumentpptx) | **POST** /convert/merge/pptx | Merge Two PowerPoint PPTX Together *MergeDocumentApi* | [**mergeDocumentPptxMulti**](docs/Api/MergeDocumentApi.md#mergedocumentpptxmulti) | **POST** /convert/merge/pptx/multi | Merge Multple PowerPoint PPTX Together *MergeDocumentApi* | [**mergeDocumentTxt**](docs/Api/MergeDocumentApi.md#mergedocumenttxt) | **POST** /convert/merge/txt | Merge Two Text (TXT) Files Together diff --git a/composer.json b/composer.json index ba3b030..6b4fe45 100644 --- a/composer.json +++ b/composer.json @@ -1,6 +1,6 @@ { "name": "cloudmersive/cloudmersive_document_convert_api_client", - "version": "1.8.4", + "version": "1.8.5", "description": "", "keywords": [ "swagger", diff --git a/docs/Api/EditPdfApi.md b/docs/Api/EditPdfApi.md index ded6471..b6c0bf3 100644 --- a/docs/Api/EditPdfApi.md +++ b/docs/Api/EditPdfApi.md @@ -422,7 +422,7 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) # **editPdfGetPdfTextByPages** -> \Swagger\Client\Model\PdfTextByPageResult editPdfGetPdfTextByPages($input_file) +> \Swagger\Client\Model\PdfTextByPageResult editPdfGetPdfTextByPages($input_file, $text_formatting_mode) Get text in a PDF document by page @@ -445,9 +445,10 @@ $apiInstance = new Swagger\Client\Api\EditPdfApi( $config ); $input_file = "/path/to/file.txt"; // \SplFileObject | Input file to perform the operation on. +$text_formatting_mode = "text_formatting_mode_example"; // string | Optional; specify how whitespace should be handled when converting the document to text. Possible values are 'preserveWhitespace' which will attempt to preserve whitespace in the document and relative positioning of text within the document, and 'minimizeWhitespace' which will not insert additional spaces into the document in most cases. Default is 'preserveWhitespace'. try { - $result = $apiInstance->editPdfGetPdfTextByPages($input_file); + $result = $apiInstance->editPdfGetPdfTextByPages($input_file, $text_formatting_mode); print_r($result); } catch (Exception $e) { echo 'Exception when calling EditPdfApi->editPdfGetPdfTextByPages: ', $e->getMessage(), PHP_EOL; @@ -460,6 +461,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **input_file** | **\SplFileObject**| Input file to perform the operation on. | + **text_formatting_mode** | **string**| Optional; specify how whitespace should be handled when converting the document to text. Possible values are 'preserveWhitespace' which will attempt to preserve whitespace in the document and relative positioning of text within the document, and 'minimizeWhitespace' which will not insert additional spaces into the document in most cases. Default is 'preserveWhitespace'. | [optional] ### Return type diff --git a/docs/Api/MergeDocumentApi.md b/docs/Api/MergeDocumentApi.md index 2f80c56..53fd1fc 100644 --- a/docs/Api/MergeDocumentApi.md +++ b/docs/Api/MergeDocumentApi.md @@ -8,7 +8,8 @@ Method | HTTP request | Description [**mergeDocumentDocxMulti**](MergeDocumentApi.md#mergeDocumentDocxMulti) | **POST** /convert/merge/docx/multi | Merge Multple Word DOCX Together [**mergeDocumentPdf**](MergeDocumentApi.md#mergeDocumentPdf) | **POST** /convert/merge/pdf | Merge Two PDF Files Together [**mergeDocumentPdfMulti**](MergeDocumentApi.md#mergeDocumentPdfMulti) | **POST** /convert/merge/pdf/multi | Merge Multple PDF Files Together -[**mergeDocumentPng**](MergeDocumentApi.md#mergeDocumentPng) | **POST** /convert/merge/png/vertical | Merge Multple PNG Files Together +[**mergeDocumentPng**](MergeDocumentApi.md#mergeDocumentPng) | **POST** /convert/merge/png/vertical | Merge Two PNG Files Together +[**mergeDocumentPngMulti**](MergeDocumentApi.md#mergeDocumentPngMulti) | **POST** /convert/merge/png/vertical/multi | Merge Multple PNG Files Together [**mergeDocumentPptx**](MergeDocumentApi.md#mergeDocumentPptx) | **POST** /convert/merge/pptx | Merge Two PowerPoint PPTX Together [**mergeDocumentPptxMulti**](MergeDocumentApi.md#mergeDocumentPptxMulti) | **POST** /convert/merge/pptx/multi | Merge Multple PowerPoint PPTX Together [**mergeDocumentTxt**](MergeDocumentApi.md#mergeDocumentTxt) | **POST** /convert/merge/txt | Merge Two Text (TXT) Files Together @@ -280,9 +281,9 @@ Name | Type | Description | Notes # **mergeDocumentPng** > string mergeDocumentPng($input_file1, $input_file2) -Merge Multple PNG Files Together +Merge Two PNG Files Together -Combine multiple PNG files into a single PNG document, preserving the order of the input documents in the combined document by stacking them vertically +Combine two PNG files into a single PNG document, preserving the order of the input documents in the combined document by stacking them vertically ### Example ```php @@ -334,6 +335,79 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) +# **mergeDocumentPngMulti** +> string mergeDocumentPngMulti($input_file1, $input_file2, $input_file3, $input_file4, $input_file5, $input_file6, $input_file7, $input_file8, $input_file9, $input_file10) + +Merge Multple PNG Files Together + +Combine multiple PNG files into a single PNG document, preserving the order of the input documents in the combined document by stacking them vertically + +### Example +```php +setApiKey('Apikey', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('Apikey', 'Bearer'); + +$apiInstance = new Swagger\Client\Api\MergeDocumentApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$input_file1 = "/path/to/file.txt"; // \SplFileObject | First input file to perform the operation on. +$input_file2 = "/path/to/file.txt"; // \SplFileObject | Second input file to perform the operation on. +$input_file3 = "/path/to/file.txt"; // \SplFileObject | Third input file to perform the operation on. +$input_file4 = "/path/to/file.txt"; // \SplFileObject | Fourth input file to perform the operation on. +$input_file5 = "/path/to/file.txt"; // \SplFileObject | Fifth input file to perform the operation on. +$input_file6 = "/path/to/file.txt"; // \SplFileObject | Sixth input file to perform the operation on. +$input_file7 = "/path/to/file.txt"; // \SplFileObject | Seventh input file to perform the operation on. +$input_file8 = "/path/to/file.txt"; // \SplFileObject | Eighth input file to perform the operation on. +$input_file9 = "/path/to/file.txt"; // \SplFileObject | Ninth input file to perform the operation on. +$input_file10 = "/path/to/file.txt"; // \SplFileObject | Tenth input file to perform the operation on. + +try { + $result = $apiInstance->mergeDocumentPngMulti($input_file1, $input_file2, $input_file3, $input_file4, $input_file5, $input_file6, $input_file7, $input_file8, $input_file9, $input_file10); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling MergeDocumentApi->mergeDocumentPngMulti: ', $e->getMessage(), PHP_EOL; +} +?> +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **input_file1** | **\SplFileObject**| First input file to perform the operation on. | + **input_file2** | **\SplFileObject**| Second input file to perform the operation on. | + **input_file3** | **\SplFileObject**| Third input file to perform the operation on. | [optional] + **input_file4** | **\SplFileObject**| Fourth input file to perform the operation on. | [optional] + **input_file5** | **\SplFileObject**| Fifth input file to perform the operation on. | [optional] + **input_file6** | **\SplFileObject**| Sixth input file to perform the operation on. | [optional] + **input_file7** | **\SplFileObject**| Seventh input file to perform the operation on. | [optional] + **input_file8** | **\SplFileObject**| Eighth input file to perform the operation on. | [optional] + **input_file9** | **\SplFileObject**| Ninth input file to perform the operation on. | [optional] + **input_file10** | **\SplFileObject**| Tenth input file to perform the operation on. | [optional] + +### Return type + +**string** + +### Authorization + +[Apikey](../../README.md#Apikey) + +### HTTP request headers + + - **Content-Type**: multipart/form-data + - **Accept**: application/octet-stream + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + # **mergeDocumentPptx** > string mergeDocumentPptx($input_file1, $input_file2) diff --git a/docs/Model/GetDocxPagesRequest.md b/docs/Model/GetDocxPagesRequest.md index f878200..2e77da2 100644 --- a/docs/Model/GetDocxPagesRequest.md +++ b/docs/Model/GetDocxPagesRequest.md @@ -5,6 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **input_file_bytes** | **string** | Optional: Bytes of the input file to operate on | [optional] **input_file_url** | **string** | Optional: URL of a file to operate on as input. This can be a public URL, or you can also use the begin-editing API to upload a document and pass in the secure URL result from that operation as the URL here (this URL is not public). | [optional] +**maximum_pages** | **int** | Optional: Maximum number of pages to return; set to 0 or do not supply to return all pages | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/lib/Api/EditPdfApi.php b/lib/Api/EditPdfApi.php index 1035893..23522f6 100644 --- a/lib/Api/EditPdfApi.php +++ b/lib/Api/EditPdfApi.php @@ -2006,14 +2006,15 @@ protected function editPdfGetMetadataRequest($input_file) * Get text in a PDF document by page * * @param \SplFileObject $input_file Input file to perform the operation on. (required) + * @param string $text_formatting_mode Optional; specify how whitespace should be handled when converting the document to text. Possible values are 'preserveWhitespace' which will attempt to preserve whitespace in the document and relative positioning of text within the document, and 'minimizeWhitespace' which will not insert additional spaces into the document in most cases. Default is 'preserveWhitespace'. (optional) * * @throws \Swagger\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \Swagger\Client\Model\PdfTextByPageResult */ - public function editPdfGetPdfTextByPages($input_file) + public function editPdfGetPdfTextByPages($input_file, $text_formatting_mode = null) { - list($response) = $this->editPdfGetPdfTextByPagesWithHttpInfo($input_file); + list($response) = $this->editPdfGetPdfTextByPagesWithHttpInfo($input_file, $text_formatting_mode); return $response; } @@ -2023,15 +2024,16 @@ public function editPdfGetPdfTextByPages($input_file) * Get text in a PDF document by page * * @param \SplFileObject $input_file Input file to perform the operation on. (required) + * @param string $text_formatting_mode Optional; specify how whitespace should be handled when converting the document to text. Possible values are 'preserveWhitespace' which will attempt to preserve whitespace in the document and relative positioning of text within the document, and 'minimizeWhitespace' which will not insert additional spaces into the document in most cases. Default is 'preserveWhitespace'. (optional) * * @throws \Swagger\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \Swagger\Client\Model\PdfTextByPageResult, HTTP status code, HTTP response headers (array of strings) */ - public function editPdfGetPdfTextByPagesWithHttpInfo($input_file) + public function editPdfGetPdfTextByPagesWithHttpInfo($input_file, $text_formatting_mode = null) { $returnType = '\Swagger\Client\Model\PdfTextByPageResult'; - $request = $this->editPdfGetPdfTextByPagesRequest($input_file); + $request = $this->editPdfGetPdfTextByPagesRequest($input_file, $text_formatting_mode); try { $options = $this->createHttpClientOption(); @@ -2098,13 +2100,14 @@ public function editPdfGetPdfTextByPagesWithHttpInfo($input_file) * Get text in a PDF document by page * * @param \SplFileObject $input_file Input file to perform the operation on. (required) + * @param string $text_formatting_mode Optional; specify how whitespace should be handled when converting the document to text. Possible values are 'preserveWhitespace' which will attempt to preserve whitespace in the document and relative positioning of text within the document, and 'minimizeWhitespace' which will not insert additional spaces into the document in most cases. Default is 'preserveWhitespace'. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function editPdfGetPdfTextByPagesAsync($input_file) + public function editPdfGetPdfTextByPagesAsync($input_file, $text_formatting_mode = null) { - return $this->editPdfGetPdfTextByPagesAsyncWithHttpInfo($input_file) + return $this->editPdfGetPdfTextByPagesAsyncWithHttpInfo($input_file, $text_formatting_mode) ->then( function ($response) { return $response[0]; @@ -2118,14 +2121,15 @@ function ($response) { * Get text in a PDF document by page * * @param \SplFileObject $input_file Input file to perform the operation on. (required) + * @param string $text_formatting_mode Optional; specify how whitespace should be handled when converting the document to text. Possible values are 'preserveWhitespace' which will attempt to preserve whitespace in the document and relative positioning of text within the document, and 'minimizeWhitespace' which will not insert additional spaces into the document in most cases. Default is 'preserveWhitespace'. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function editPdfGetPdfTextByPagesAsyncWithHttpInfo($input_file) + public function editPdfGetPdfTextByPagesAsyncWithHttpInfo($input_file, $text_formatting_mode = null) { $returnType = '\Swagger\Client\Model\PdfTextByPageResult'; - $request = $this->editPdfGetPdfTextByPagesRequest($input_file); + $request = $this->editPdfGetPdfTextByPagesRequest($input_file, $text_formatting_mode); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -2168,11 +2172,12 @@ function ($exception) { * Create request for operation 'editPdfGetPdfTextByPages' * * @param \SplFileObject $input_file Input file to perform the operation on. (required) + * @param string $text_formatting_mode Optional; specify how whitespace should be handled when converting the document to text. Possible values are 'preserveWhitespace' which will attempt to preserve whitespace in the document and relative positioning of text within the document, and 'minimizeWhitespace' which will not insert additional spaces into the document in most cases. Default is 'preserveWhitespace'. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function editPdfGetPdfTextByPagesRequest($input_file) + protected function editPdfGetPdfTextByPagesRequest($input_file, $text_formatting_mode = null) { // verify the required parameter 'input_file' is set if ($input_file === null) { @@ -2188,6 +2193,10 @@ protected function editPdfGetPdfTextByPagesRequest($input_file) $httpBody = ''; $multipart = false; + // header params + if ($text_formatting_mode !== null) { + $headerParams['textFormattingMode'] = ObjectSerializer::toHeaderValue($text_formatting_mode); + } // form params diff --git a/lib/Api/MergeDocumentApi.php b/lib/Api/MergeDocumentApi.php index a7107ff..1bee1b1 100644 --- a/lib/Api/MergeDocumentApi.php +++ b/lib/Api/MergeDocumentApi.php @@ -1365,7 +1365,7 @@ protected function mergeDocumentPdfMultiRequest($input_file1, $input_file2, $inp /** * Operation mergeDocumentPng * - * Merge Multple PNG Files Together + * Merge Two PNG Files Together * * @param \SplFileObject $input_file1 First input file to perform the operation on. (required) * @param \SplFileObject $input_file2 Second input file to perform the operation on (more than 2 can be supplied). (required) @@ -1383,7 +1383,7 @@ public function mergeDocumentPng($input_file1, $input_file2) /** * Operation mergeDocumentPngWithHttpInfo * - * Merge Multple PNG Files Together + * Merge Two PNG Files Together * * @param \SplFileObject $input_file1 First input file to perform the operation on. (required) * @param \SplFileObject $input_file2 Second input file to perform the operation on (more than 2 can be supplied). (required) @@ -1459,7 +1459,7 @@ public function mergeDocumentPngWithHttpInfo($input_file1, $input_file2) /** * Operation mergeDocumentPngAsync * - * Merge Multple PNG Files Together + * Merge Two PNG Files Together * * @param \SplFileObject $input_file1 First input file to perform the operation on. (required) * @param \SplFileObject $input_file2 Second input file to perform the operation on (more than 2 can be supplied). (required) @@ -1480,7 +1480,7 @@ function ($response) { /** * Operation mergeDocumentPngAsyncWithHttpInfo * - * Merge Multple PNG Files Together + * Merge Two PNG Files Together * * @param \SplFileObject $input_file1 First input file to perform the operation on. (required) * @param \SplFileObject $input_file2 Second input file to perform the operation on (more than 2 can be supplied). (required) @@ -1642,6 +1642,366 @@ protected function mergeDocumentPngRequest($input_file1, $input_file2) ); } + /** + * Operation mergeDocumentPngMulti + * + * Merge Multple PNG Files Together + * + * @param \SplFileObject $input_file1 First input file to perform the operation on. (required) + * @param \SplFileObject $input_file2 Second input file to perform the operation on. (required) + * @param \SplFileObject $input_file3 Third input file to perform the operation on. (optional) + * @param \SplFileObject $input_file4 Fourth input file to perform the operation on. (optional) + * @param \SplFileObject $input_file5 Fifth input file to perform the operation on. (optional) + * @param \SplFileObject $input_file6 Sixth input file to perform the operation on. (optional) + * @param \SplFileObject $input_file7 Seventh input file to perform the operation on. (optional) + * @param \SplFileObject $input_file8 Eighth input file to perform the operation on. (optional) + * @param \SplFileObject $input_file9 Ninth input file to perform the operation on. (optional) + * @param \SplFileObject $input_file10 Tenth input file to perform the operation on. (optional) + * + * @throws \Swagger\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return string + */ + public function mergeDocumentPngMulti($input_file1, $input_file2, $input_file3 = null, $input_file4 = null, $input_file5 = null, $input_file6 = null, $input_file7 = null, $input_file8 = null, $input_file9 = null, $input_file10 = null) + { + list($response) = $this->mergeDocumentPngMultiWithHttpInfo($input_file1, $input_file2, $input_file3, $input_file4, $input_file5, $input_file6, $input_file7, $input_file8, $input_file9, $input_file10); + return $response; + } + + /** + * Operation mergeDocumentPngMultiWithHttpInfo + * + * Merge Multple PNG Files Together + * + * @param \SplFileObject $input_file1 First input file to perform the operation on. (required) + * @param \SplFileObject $input_file2 Second input file to perform the operation on. (required) + * @param \SplFileObject $input_file3 Third input file to perform the operation on. (optional) + * @param \SplFileObject $input_file4 Fourth input file to perform the operation on. (optional) + * @param \SplFileObject $input_file5 Fifth input file to perform the operation on. (optional) + * @param \SplFileObject $input_file6 Sixth input file to perform the operation on. (optional) + * @param \SplFileObject $input_file7 Seventh input file to perform the operation on. (optional) + * @param \SplFileObject $input_file8 Eighth input file to perform the operation on. (optional) + * @param \SplFileObject $input_file9 Ninth input file to perform the operation on. (optional) + * @param \SplFileObject $input_file10 Tenth input file to perform the operation on. (optional) + * + * @throws \Swagger\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of string, HTTP status code, HTTP response headers (array of strings) + */ + public function mergeDocumentPngMultiWithHttpInfo($input_file1, $input_file2, $input_file3 = null, $input_file4 = null, $input_file5 = null, $input_file6 = null, $input_file7 = null, $input_file8 = null, $input_file9 = null, $input_file10 = null) + { + $returnType = 'string'; + $request = $this->mergeDocumentPngMultiRequest($input_file1, $input_file2, $input_file3, $input_file4, $input_file5, $input_file6, $input_file7, $input_file8, $input_file9, $input_file10); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + 'string', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation mergeDocumentPngMultiAsync + * + * Merge Multple PNG Files Together + * + * @param \SplFileObject $input_file1 First input file to perform the operation on. (required) + * @param \SplFileObject $input_file2 Second input file to perform the operation on. (required) + * @param \SplFileObject $input_file3 Third input file to perform the operation on. (optional) + * @param \SplFileObject $input_file4 Fourth input file to perform the operation on. (optional) + * @param \SplFileObject $input_file5 Fifth input file to perform the operation on. (optional) + * @param \SplFileObject $input_file6 Sixth input file to perform the operation on. (optional) + * @param \SplFileObject $input_file7 Seventh input file to perform the operation on. (optional) + * @param \SplFileObject $input_file8 Eighth input file to perform the operation on. (optional) + * @param \SplFileObject $input_file9 Ninth input file to perform the operation on. (optional) + * @param \SplFileObject $input_file10 Tenth input file to perform the operation on. (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function mergeDocumentPngMultiAsync($input_file1, $input_file2, $input_file3 = null, $input_file4 = null, $input_file5 = null, $input_file6 = null, $input_file7 = null, $input_file8 = null, $input_file9 = null, $input_file10 = null) + { + return $this->mergeDocumentPngMultiAsyncWithHttpInfo($input_file1, $input_file2, $input_file3, $input_file4, $input_file5, $input_file6, $input_file7, $input_file8, $input_file9, $input_file10) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation mergeDocumentPngMultiAsyncWithHttpInfo + * + * Merge Multple PNG Files Together + * + * @param \SplFileObject $input_file1 First input file to perform the operation on. (required) + * @param \SplFileObject $input_file2 Second input file to perform the operation on. (required) + * @param \SplFileObject $input_file3 Third input file to perform the operation on. (optional) + * @param \SplFileObject $input_file4 Fourth input file to perform the operation on. (optional) + * @param \SplFileObject $input_file5 Fifth input file to perform the operation on. (optional) + * @param \SplFileObject $input_file6 Sixth input file to perform the operation on. (optional) + * @param \SplFileObject $input_file7 Seventh input file to perform the operation on. (optional) + * @param \SplFileObject $input_file8 Eighth input file to perform the operation on. (optional) + * @param \SplFileObject $input_file9 Ninth input file to perform the operation on. (optional) + * @param \SplFileObject $input_file10 Tenth input file to perform the operation on. (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function mergeDocumentPngMultiAsyncWithHttpInfo($input_file1, $input_file2, $input_file3 = null, $input_file4 = null, $input_file5 = null, $input_file6 = null, $input_file7 = null, $input_file8 = null, $input_file9 = null, $input_file10 = null) + { + $returnType = 'string'; + $request = $this->mergeDocumentPngMultiRequest($input_file1, $input_file2, $input_file3, $input_file4, $input_file5, $input_file6, $input_file7, $input_file8, $input_file9, $input_file10); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'mergeDocumentPngMulti' + * + * @param \SplFileObject $input_file1 First input file to perform the operation on. (required) + * @param \SplFileObject $input_file2 Second input file to perform the operation on. (required) + * @param \SplFileObject $input_file3 Third input file to perform the operation on. (optional) + * @param \SplFileObject $input_file4 Fourth input file to perform the operation on. (optional) + * @param \SplFileObject $input_file5 Fifth input file to perform the operation on. (optional) + * @param \SplFileObject $input_file6 Sixth input file to perform the operation on. (optional) + * @param \SplFileObject $input_file7 Seventh input file to perform the operation on. (optional) + * @param \SplFileObject $input_file8 Eighth input file to perform the operation on. (optional) + * @param \SplFileObject $input_file9 Ninth input file to perform the operation on. (optional) + * @param \SplFileObject $input_file10 Tenth input file to perform the operation on. (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function mergeDocumentPngMultiRequest($input_file1, $input_file2, $input_file3 = null, $input_file4 = null, $input_file5 = null, $input_file6 = null, $input_file7 = null, $input_file8 = null, $input_file9 = null, $input_file10 = null) + { + // verify the required parameter 'input_file1' is set + if ($input_file1 === null) { + throw new \InvalidArgumentException( + 'Missing the required parameter $input_file1 when calling mergeDocumentPngMulti' + ); + } + // verify the required parameter 'input_file2' is set + if ($input_file2 === null) { + throw new \InvalidArgumentException( + 'Missing the required parameter $input_file2 when calling mergeDocumentPngMulti' + ); + } + + $resourcePath = '/convert/merge/png/vertical/multi'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // form params + if ($input_file1 !== null) { + $multipart = true; + $formParams['inputFile1'] = \GuzzleHttp\Psr7\try_fopen(ObjectSerializer::toFormValue($input_file1), 'rb'); + } + // form params + if ($input_file2 !== null) { + $multipart = true; + $formParams['inputFile2'] = \GuzzleHttp\Psr7\try_fopen(ObjectSerializer::toFormValue($input_file2), 'rb'); + } + // form params + if ($input_file3 !== null) { + $multipart = true; + $formParams['inputFile3'] = \GuzzleHttp\Psr7\try_fopen(ObjectSerializer::toFormValue($input_file3), 'rb'); + } + // form params + if ($input_file4 !== null) { + $multipart = true; + $formParams['inputFile4'] = \GuzzleHttp\Psr7\try_fopen(ObjectSerializer::toFormValue($input_file4), 'rb'); + } + // form params + if ($input_file5 !== null) { + $multipart = true; + $formParams['inputFile5'] = \GuzzleHttp\Psr7\try_fopen(ObjectSerializer::toFormValue($input_file5), 'rb'); + } + // form params + if ($input_file6 !== null) { + $multipart = true; + $formParams['inputFile6'] = \GuzzleHttp\Psr7\try_fopen(ObjectSerializer::toFormValue($input_file6), 'rb'); + } + // form params + if ($input_file7 !== null) { + $multipart = true; + $formParams['inputFile7'] = \GuzzleHttp\Psr7\try_fopen(ObjectSerializer::toFormValue($input_file7), 'rb'); + } + // form params + if ($input_file8 !== null) { + $multipart = true; + $formParams['inputFile8'] = \GuzzleHttp\Psr7\try_fopen(ObjectSerializer::toFormValue($input_file8), 'rb'); + } + // form params + if ($input_file9 !== null) { + $multipart = true; + $formParams['inputFile9'] = \GuzzleHttp\Psr7\try_fopen(ObjectSerializer::toFormValue($input_file9), 'rb'); + } + // form params + if ($input_file10 !== null) { + $multipart = true; + $formParams['inputFile10'] = \GuzzleHttp\Psr7\try_fopen(ObjectSerializer::toFormValue($input_file10), 'rb'); + } + // body params + $_tempBody = null; + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/octet-stream'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/octet-stream'], + ['multipart/form-data'] + ); + } + + // for model (json/xml) + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + $httpBody = $_tempBody; + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('Apikey'); + if ($apiKey !== null) { + $headers['Apikey'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\build_query($queryParams); + return new Request( + 'POST', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + /** * Operation mergeDocumentPptx * diff --git a/lib/Configuration.php b/lib/Configuration.php index ea45dc1..9727f37 100644 --- a/lib/Configuration.php +++ b/lib/Configuration.php @@ -88,7 +88,7 @@ class Configuration * * @var string */ - protected $userAgent = 'Swagger-Codegen/1.8.4/php'; + protected $userAgent = 'Swagger-Codegen/1.8.5/php'; /** * Debug switch (default set to false) @@ -397,7 +397,7 @@ public static function toDebugReport() $report .= ' OS: ' . php_uname() . PHP_EOL; $report .= ' PHP Version: ' . PHP_VERSION . PHP_EOL; $report .= ' OpenAPI Spec Version: v1' . PHP_EOL; - $report .= ' SDK Package Version: 1.8.4' . PHP_EOL; + $report .= ' SDK Package Version: 1.8.5' . PHP_EOL; $report .= ' Temp Folder Path: ' . self::getDefaultConfiguration()->getTempFolderPath() . PHP_EOL; return $report; diff --git a/lib/Model/GetDocxPagesRequest.php b/lib/Model/GetDocxPagesRequest.php index 47e0808..41c18b2 100644 --- a/lib/Model/GetDocxPagesRequest.php +++ b/lib/Model/GetDocxPagesRequest.php @@ -59,7 +59,8 @@ class GetDocxPagesRequest implements ModelInterface, ArrayAccess */ protected static $swaggerTypes = [ 'input_file_bytes' => 'string', - 'input_file_url' => 'string' + 'input_file_url' => 'string', + 'maximum_pages' => 'int' ]; /** @@ -69,7 +70,8 @@ class GetDocxPagesRequest implements ModelInterface, ArrayAccess */ protected static $swaggerFormats = [ 'input_file_bytes' => 'byte', - 'input_file_url' => null + 'input_file_url' => null, + 'maximum_pages' => 'int32' ]; /** @@ -100,7 +102,8 @@ public static function swaggerFormats() */ protected static $attributeMap = [ 'input_file_bytes' => 'InputFileBytes', - 'input_file_url' => 'InputFileUrl' + 'input_file_url' => 'InputFileUrl', + 'maximum_pages' => 'MaximumPages' ]; /** @@ -110,7 +113,8 @@ public static function swaggerFormats() */ protected static $setters = [ 'input_file_bytes' => 'setInputFileBytes', - 'input_file_url' => 'setInputFileUrl' + 'input_file_url' => 'setInputFileUrl', + 'maximum_pages' => 'setMaximumPages' ]; /** @@ -120,7 +124,8 @@ public static function swaggerFormats() */ protected static $getters = [ 'input_file_bytes' => 'getInputFileBytes', - 'input_file_url' => 'getInputFileUrl' + 'input_file_url' => 'getInputFileUrl', + 'maximum_pages' => 'getMaximumPages' ]; /** @@ -185,6 +190,7 @@ public function __construct(array $data = null) { $this->container['input_file_bytes'] = isset($data['input_file_bytes']) ? $data['input_file_bytes'] : null; $this->container['input_file_url'] = isset($data['input_file_url']) ? $data['input_file_url'] : null; + $this->container['maximum_pages'] = isset($data['maximum_pages']) ? $data['maximum_pages'] : null; } /** @@ -271,6 +277,30 @@ public function setInputFileUrl($input_file_url) return $this; } + + /** + * Gets maximum_pages + * + * @return int + */ + public function getMaximumPages() + { + return $this->container['maximum_pages']; + } + + /** + * Sets maximum_pages + * + * @param int $maximum_pages Optional: Maximum number of pages to return; set to 0 or do not supply to return all pages + * + * @return $this + */ + public function setMaximumPages($maximum_pages) + { + $this->container['maximum_pages'] = $maximum_pages; + + return $this; + } /** * Returns true if offset exists. False otherwise. * diff --git a/packageconfig.json b/packageconfig.json index cfd8e51..69111c9 100644 --- a/packageconfig.json +++ b/packageconfig.json @@ -1,5 +1,5 @@ { - "artifactVersion": "1.8.4", + "artifactVersion": "1.8.5", "gitUserId": "Cloudmersive", "gitRepoId": "Cloudmersive.APIClient.PHP.DocumentAndDataConvert", "composerVendorName": "cloudmersive", diff --git a/test/Api/MergeDocumentApiTest.php b/test/Api/MergeDocumentApiTest.php index 941eb2c..2ebeda3 100644 --- a/test/Api/MergeDocumentApiTest.php +++ b/test/Api/MergeDocumentApiTest.php @@ -114,13 +114,23 @@ public function testMergeDocumentPdfMulti() /** * Test case for mergeDocumentPng * - * Merge Multple PNG Files Together. + * Merge Two PNG Files Together. * */ public function testMergeDocumentPng() { } + /** + * Test case for mergeDocumentPngMulti + * + * Merge Multple PNG Files Together. + * + */ + public function testMergeDocumentPngMulti() + { + } + /** * Test case for mergeDocumentPptx * diff --git a/test/Model/GetDocxPagesRequestTest.php b/test/Model/GetDocxPagesRequestTest.php index 7b376a9..0a4b178 100644 --- a/test/Model/GetDocxPagesRequestTest.php +++ b/test/Model/GetDocxPagesRequestTest.php @@ -90,4 +90,11 @@ public function testPropertyInputFileBytes() public function testPropertyInputFileUrl() { } + + /** + * Test attribute "maximum_pages" + */ + public function testPropertyMaximumPages() + { + } }