|
157 | 157 | import com.aspose.asposecloudpdf.model.StrikeOutAnnotation;
|
158 | 158 | import com.aspose.asposecloudpdf.model.StrikeOutAnnotationResponse;
|
159 | 159 | import com.aspose.asposecloudpdf.model.StrikeOutAnnotationsResponse;
|
| 160 | +import com.aspose.asposecloudpdf.model.SvgImages; |
160 | 161 | import com.aspose.asposecloudpdf.model.Table;
|
161 | 162 | import com.aspose.asposecloudpdf.model.TableRecognizedResponse;
|
162 | 163 | import com.aspose.asposecloudpdf.model.TablesRecognizedResponse;
|
@@ -14187,6 +14188,170 @@ public void onRequestProgress(long bytesWritten, long contentLength, boolean don
|
14187 | 14188 | apiClient.executeAsync(call, localVarReturnType, callback);
|
14188 | 14189 | return call;
|
14189 | 14190 | }
|
| 14191 | + /** |
| 14192 | + * Build call for getImagesExtractSvg |
| 14193 | + * @param name The document name. (required) |
| 14194 | + * @param pageNumber The page number. (required) |
| 14195 | + * @param storage The document storage. (optional) |
| 14196 | + * @param folder The document folder. (optional) |
| 14197 | + * @param passBase64 The password (Base64). (optional) |
| 14198 | + * @param progressListener Progress listener |
| 14199 | + * @param progressRequestListener Progress request listener |
| 14200 | + * @return Call to execute |
| 14201 | + * @throws ApiException If fail to serialize the request body object |
| 14202 | + */ |
| 14203 | + public com.squareup.okhttp.Call getImagesExtractSvgCall(String name, Integer pageNumber, String storage, String folder, String passBase64, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { |
| 14204 | + Object localVarPostBody = null; |
| 14205 | + |
| 14206 | + // create path and map variables |
| 14207 | + String localVarPath = "/pdf/{name}/pages/{pageNumber}/images/extract/svg" |
| 14208 | + .replaceAll("\\{" + "name" + "\\}", apiClient.escapePathSegmentString(name.toString())) |
| 14209 | + .replaceAll("\\{" + "pageNumber" + "\\}", apiClient.escapePathSegmentString(pageNumber.toString())); |
| 14210 | + |
| 14211 | + List<Pair> localVarQueryParams = new ArrayList<Pair>(); |
| 14212 | + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); |
| 14213 | + if (storage != null) |
| 14214 | + localVarQueryParams.addAll(apiClient.parameterToPair("storage", storage)); |
| 14215 | + if (folder != null) |
| 14216 | + localVarQueryParams.addAll(apiClient.parameterToPair("folder", folder)); |
| 14217 | + if (passBase64 != null) |
| 14218 | + localVarQueryParams.addAll(apiClient.parameterToPair("passBase64", passBase64)); |
| 14219 | + |
| 14220 | + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); |
| 14221 | + |
| 14222 | + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); |
| 14223 | + |
| 14224 | + final String[] localVarAccepts = { |
| 14225 | + "application/json" |
| 14226 | + }; |
| 14227 | + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); |
| 14228 | + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); |
| 14229 | + |
| 14230 | + final String[] localVarContentTypes = { |
| 14231 | + "application/json" |
| 14232 | + }; |
| 14233 | + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); |
| 14234 | + localVarHeaderParams.put("Content-Type", localVarContentType); |
| 14235 | + |
| 14236 | + if(progressListener != null) { |
| 14237 | + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { |
| 14238 | + @Override |
| 14239 | + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { |
| 14240 | + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); |
| 14241 | + return originalResponse.newBuilder() |
| 14242 | + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) |
| 14243 | + .build(); |
| 14244 | + } |
| 14245 | + }); |
| 14246 | + } |
| 14247 | + |
| 14248 | + String[] localVarAuthNames = new String[] { "JWT" }; |
| 14249 | + return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); |
| 14250 | + } |
| 14251 | + |
| 14252 | + @SuppressWarnings("rawtypes") |
| 14253 | + private com.squareup.okhttp.Call getImagesExtractSvgValidateBeforeCall(String name, Integer pageNumber, String storage, String folder, String passBase64, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { |
| 14254 | + |
| 14255 | + // verify the required parameter 'name' is set |
| 14256 | + if (name == null) { |
| 14257 | + throw new ApiException("Missing the required parameter 'name' when calling getImagesExtractSvg(Async)"); |
| 14258 | + } |
| 14259 | + |
| 14260 | + // verify the required parameter 'pageNumber' is set |
| 14261 | + if (pageNumber == null) { |
| 14262 | + throw new ApiException("Missing the required parameter 'pageNumber' when calling getImagesExtractSvg(Async)"); |
| 14263 | + } |
| 14264 | + |
| 14265 | + |
| 14266 | + com.squareup.okhttp.Call call = getImagesExtractSvgCall(name, pageNumber, storage, folder, passBase64, progressListener, progressRequestListener); |
| 14267 | + return call; |
| 14268 | + |
| 14269 | + } |
| 14270 | + |
| 14271 | + /** |
| 14272 | + * Extract SVG images from document page. |
| 14273 | + * |
| 14274 | + * @param name The document name. (required) |
| 14275 | + * @param pageNumber The page number. (required) |
| 14276 | + * @param storage The document storage. (optional) |
| 14277 | + * @param folder The document folder. (optional) |
| 14278 | + * @param passBase64 The password (Base64). (optional) |
| 14279 | + * @return SvgImages |
| 14280 | + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body |
| 14281 | + */ |
| 14282 | + public SvgImages getImagesExtractSvg(String name, Integer pageNumber, String storage, String folder, String passBase64) throws ApiException { |
| 14283 | + try |
| 14284 | + { |
| 14285 | + ApiResponse<SvgImages> resp = getImagesExtractSvgWithHttpInfo(name, pageNumber, storage, folder, passBase64); |
| 14286 | + return resp.getData(); |
| 14287 | + } |
| 14288 | + catch (ApiException ex) |
| 14289 | + { |
| 14290 | + if (ex.getCode() == 401) |
| 14291 | + { |
| 14292 | + apiClient.requestToken(); |
| 14293 | + ApiResponse<SvgImages> resp = getImagesExtractSvgWithHttpInfo(name, pageNumber, storage, folder, passBase64); |
| 14294 | + return resp.getData(); |
| 14295 | + } |
| 14296 | + throw ex; |
| 14297 | + } |
| 14298 | + } |
| 14299 | + |
| 14300 | + /** |
| 14301 | + * Extract SVG images from document page. |
| 14302 | + * |
| 14303 | + * @param name The document name. (required) |
| 14304 | + * @param pageNumber The page number. (required) |
| 14305 | + * @param storage The document storage. (optional) |
| 14306 | + * @param folder The document folder. (optional) |
| 14307 | + * @param passBase64 The password (Base64). (optional) |
| 14308 | + * @return ApiResponse<SvgImages> |
| 14309 | + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body |
| 14310 | + */ |
| 14311 | + public ApiResponse<SvgImages> getImagesExtractSvgWithHttpInfo(String name, Integer pageNumber, String storage, String folder, String passBase64) throws ApiException { |
| 14312 | + com.squareup.okhttp.Call call = getImagesExtractSvgValidateBeforeCall(name, pageNumber, storage, folder, passBase64, null, null); |
| 14313 | + Type localVarReturnType = new TypeToken<SvgImages>(){}.getType(); |
| 14314 | + return apiClient.execute(call, localVarReturnType); |
| 14315 | + } |
| 14316 | + |
| 14317 | + /** |
| 14318 | + * Extract SVG images from document page. (asynchronously) |
| 14319 | + * |
| 14320 | + * @param name The document name. (required) |
| 14321 | + * @param pageNumber The page number. (required) |
| 14322 | + * @param storage The document storage. (optional) |
| 14323 | + * @param folder The document folder. (optional) |
| 14324 | + * @param passBase64 The password (Base64). (optional) |
| 14325 | + * @param callback The callback to be executed when the API call finishes |
| 14326 | + * @return The request call |
| 14327 | + * @throws ApiException If fail to process the API call, e.g. serializing the request body object |
| 14328 | + */ |
| 14329 | + public com.squareup.okhttp.Call getImagesExtractSvgAsync(String name, Integer pageNumber, String storage, String folder, String passBase64, final ApiCallback<SvgImages> callback) throws ApiException { |
| 14330 | + |
| 14331 | + ProgressResponseBody.ProgressListener progressListener = null; |
| 14332 | + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; |
| 14333 | + |
| 14334 | + if (callback != null) { |
| 14335 | + progressListener = new ProgressResponseBody.ProgressListener() { |
| 14336 | + @Override |
| 14337 | + public void update(long bytesRead, long contentLength, boolean done) { |
| 14338 | + callback.onDownloadProgress(bytesRead, contentLength, done); |
| 14339 | + } |
| 14340 | + }; |
| 14341 | + |
| 14342 | + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { |
| 14343 | + @Override |
| 14344 | + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { |
| 14345 | + callback.onUploadProgress(bytesWritten, contentLength, done); |
| 14346 | + } |
| 14347 | + }; |
| 14348 | + } |
| 14349 | + |
| 14350 | + com.squareup.okhttp.Call call = getImagesExtractSvgValidateBeforeCall(name, pageNumber, storage, folder, passBase64, progressListener, progressRequestListener); |
| 14351 | + Type localVarReturnType = new TypeToken<SvgImages>(){}.getType(); |
| 14352 | + apiClient.executeAsync(call, localVarReturnType, callback); |
| 14353 | + return call; |
| 14354 | + } |
14190 | 14355 | /**
|
14191 | 14356 | * Build call for getImportFieldsFromFdfInStorage
|
14192 | 14357 | * @param name The document name. (required)
|
|
0 commit comments