@@ -16351,6 +16351,93 @@ def post_document_page_number_stamps_with_http_info(name, stamp, opts = {})
1635116351 return data, status_code, headers
1635216352 end
1635316353
16354+ # Crop PDF document pages.
16355+ #
16356+ # @param name The document name.
16357+ # @param pages Comma separated list of pages and page ranges. (Example: 1,3-5,8)
16358+ # @param rect Rectangle of document area.
16359+ # @param [Hash] opts the optional parameters
16360+ # @option opts [String] :storage The document storage.
16361+ # @option opts [String] :folder The document folder.
16362+ # @option opts [String] :password Base64 encoded password.
16363+ # @return [AsposeResponse]
16364+ def post_document_pages_crop(name, pages, rect, opts = {})
16365+ @api_client.request_token_if_needed
16366+ data, _status_code, _headers = post_document_pages_crop_with_http_info(name, pages, rect, opts)
16367+ rescue ApiError => error
16368+ if error.code == 401
16369+ @api_client.request_token_if_needed
16370+ data, _status_code, _headers = post_document_pages_crop_with_http_info(name, pages, rect, opts)
16371+ else
16372+ raise
16373+ end
16374+ return data
16375+ end
16376+
16377+ # Crop PDF document pages.
16378+ #
16379+ # @param name The document name.
16380+ # @param pages Comma separated list of pages and page ranges. (Example: 1,3-5,8)
16381+ # @param rect Rectangle of document area.
16382+ # @param [Hash] opts the optional parameters
16383+ # @option opts [String] :storage The document storage.
16384+ # @option opts [String] :folder The document folder.
16385+ # @option opts [String] :password Base64 encoded password.
16386+ # @return [Array<(AsposeResponse, Fixnum, Hash)>] AsposeResponse data, response status code and response headers
16387+ def post_document_pages_crop_with_http_info(name, pages, rect, opts = {})
16388+ if @api_client.config.debugging
16389+ @api_client.config.logger.debug "Calling API: PdfApi.post_document_pages_crop ..."
16390+ end
16391+ # verify the required parameter 'name' is set
16392+ if @api_client.config.client_side_validation && name.nil?
16393+ fail ArgumentError, "Missing the required parameter 'name' when calling PdfApi.post_document_pages_crop"
16394+ end
16395+ # verify the required parameter 'pages' is set
16396+ if @api_client.config.client_side_validation && pages.nil?
16397+ fail ArgumentError, "Missing the required parameter 'pages' when calling PdfApi.post_document_pages_crop"
16398+ end
16399+ # verify the required parameter 'rect' is set
16400+ if @api_client.config.client_side_validation && rect.nil?
16401+ fail ArgumentError, "Missing the required parameter 'rect' when calling PdfApi.post_document_pages_crop"
16402+ end
16403+ # resource path
16404+ local_var_path = "/pdf/{name}/crop".sub('{' + 'name' + '}', name.to_s)
16405+
16406+ # query parameters
16407+ query_params = {}
16408+ query_params[:'pages'] = pages
16409+ query_params[:'storage'] = opts[:'storage'] if !opts[:'storage'].nil?
16410+ query_params[:'folder'] = opts[:'folder'] if !opts[:'folder'].nil?
16411+ query_params[:'password'] = opts[:'password'] if !opts[:'password'].nil?
16412+
16413+ # header parameters
16414+ header_params = {}
16415+ # HTTP header 'Accept' (if needed)
16416+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
16417+ # HTTP header 'Content-Type'
16418+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
16419+
16420+ # form parameters
16421+ form_params = {}
16422+ # Fix header in file
16423+ post_body = nil
16424+
16425+ # http body (model)
16426+ post_body = @api_client.object_to_http_body(rect)
16427+ auth_names = ['JWT']
16428+ data, status_code, headers = @api_client.call_api(:POST, local_var_path,
16429+ :header_params => header_params,
16430+ :query_params => query_params,
16431+ :form_params => form_params,
16432+ :body => post_body,
16433+ :auth_names => auth_names,
16434+ :return_type => 'AsposeResponse')
16435+ if @api_client.config.debugging
16436+ @api_client.config.logger.debug "API called: PdfApi#post_document_pages_crop\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
16437+ end
16438+ return data, status_code, headers
16439+ end
16440+
1635416441 # Rsize PDF document.
1635516442 #
1635616443 # @param name The document name.
0 commit comments