Skip to content

Commit 5945baf

Browse files
author
Kirill Novinskiy
committed
update to 25.8.0
1 parent b1a2de3 commit 5945baf

File tree

6 files changed

+154
-6
lines changed

6 files changed

+154
-6
lines changed

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,12 @@ These SDKs are now fully supported. If you have any questions, see any bugs or h
99

1010
Extract Text & Images of a PDF document online https://products.aspose.app/pdf/parser.
1111

12-
## Enhancements in Version 25.7
13-
- Add possibility to hide subject field in signature appearance.
12+
## Enhancements in Version 25.8
13+
- Implement document page resize functionality using the Pdf.Cloud API library.
1414
- A new version of Aspose.PDF Cloud was prepared using the latest version of Aspose.PDF for .NET.
1515

16-
## Bugs fixed in Version 25.7
17-
- PostDeleteStamps removing stamps from PDF page is incorrect.
16+
## Bugs fixed in Version 25.8
17+
- Implement delete watermark from PDF document using the Pdf.Cloud API library.
1818

1919
## Installation
2020
```

api_client.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ func (c *APIClient) prepareRequest (
176176

177177
// set custom header
178178
headerParams["x-aspose-client"] = "go sdk"
179-
headerParams["x-aspose-client-version"] = "25.7.0"
179+
headerParams["x-aspose-client-version"] = "25.8.0"
180180

181181
// Detect postBody type and post.
182182
if postBody != nil {

docs/PdfApi.md

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,7 @@ Method | HTTP request | Description
212212
[**PostDocumentImageStamps**](PdfApi.md#PostDocumentImageStamps) | **Post** /pdf/{name}/stamps/image | Add document pages image stamps.
213213
[**PostDocumentImageStampsPageSpecified**](PdfApi.md#PostDocumentImageStampsPageSpecified) | **Post** /pdf/{name}/stamps/image/pagespecified | Add document image stamps to specified pages.
214214
[**PostDocumentPageNumberStamps**](PdfApi.md#PostDocumentPageNumberStamps) | **Post** /pdf/{name}/stamps/pagenumber | Add document page number stamps.
215+
[**PostDocumentPagesResize**](PdfApi.md#PostDocumentPagesResize) | **Post** /pdf/{name}/resize | Rsize PDF document.
215216
[**PostDocumentPagesRotate**](PdfApi.md#PostDocumentPagesRotate) | **Post** /pdf/{name}/rotate | Rotate PDF document.
216217
[**PostDocumentTextFooter**](PdfApi.md#PostDocumentTextFooter) | **Post** /pdf/{name}/footer/text | Add document text footer.
217218
[**PostDocumentTextHeader**](PdfApi.md#PostDocumentTextHeader) | **Post** /pdf/{name}/header/text | Add document text header.
@@ -7254,6 +7255,44 @@ Name | Type | Description | Notes
72547255

72557256
[[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)
72567257

7258+
# **PostDocumentPagesResize**
7259+
> AsposeResponse PostDocumentPagesResize(name, height, width, pages, optional)
7260+
Rsize PDF document.
7261+
7262+
### Required Parameters
7263+
7264+
Name | Type | Description | Notes
7265+
------------- | ------------- | ------------- | -------------
7266+
**name** | **string**| The document name. |
7267+
**height** | **float64**| Page Height |
7268+
**width** | **float64**| Page width |
7269+
**pages** | **string**| Comma separated list of pages and page ranges. (Example: 1,3-5,8) |
7270+
**optional** | **map[string]interface{}** | optional parameters | nil if no parameters
7271+
7272+
### Optional Parameters
7273+
Optional parameters are passed through a map[string]interface{}.
7274+
7275+
Name | Type | Description | Notes
7276+
------------- | ------------- | ------------- | -------------
7277+
**name** | **string**| The document name. |
7278+
**height** | **float64**| Page Height |
7279+
**width** | **float64**| Page width |
7280+
**pages** | **string**| Comma separated list of pages and page ranges. (Example: 1,3-5,8) |
7281+
**storage** | **string**| The document storage. |
7282+
**folder** | **string**| The document folder. |
7283+
**password** | **string**| Base64 encoded password. |
7284+
7285+
### Return type
7286+
7287+
[**AsposeResponse**](AsposeResponse.md)
7288+
7289+
### HTTP request headers
7290+
7291+
- **Content-Type**: application/json
7292+
- **Accept**: application/json
7293+
7294+
[[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)
7295+
72577296
# **PostDocumentPagesRotate**
72587297
> AsposeResponse PostDocumentPagesRotate(name, rotationAngle, pages, optional)
72597298
Rotate PDF document.

document_test.go

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -322,4 +322,23 @@ func TestPostDocumentPagesRotate(t *testing.T) {
322322
} else {
323323
fmt.Printf("%d\tPostDocumentPagesRotate - %db\n", GetBaseTest().GetTestNumber(), response.Code)
324324
}
325+
}
326+
327+
func TestPostDocumentPagesResize(t *testing.T) {
328+
name := "4pages.pdf"
329+
if err := GetBaseTest().UploadFile(name); err != nil {
330+
t.Error(err)
331+
}
332+
args := map[string]interface{}{
333+
"folder": GetBaseTest().remoteFolder,
334+
}
335+
response, httpResponse, err := GetBaseTest().PdfAPI.PostDocumentPagesResize(
336+
name, 100, 200, "2-3", args)
337+
if err != nil {
338+
t.Error(err)
339+
} else if httpResponse.StatusCode < 200 || httpResponse.StatusCode > 299 {
340+
t.Fail()
341+
} else {
342+
fmt.Printf("%d\tPostDocumentPagesResize - %db\n", GetBaseTest().GetTestNumber(), response.Code)
343+
}
325344
}

pdf_api.go

Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17353,6 +17353,96 @@ func (a *PdfApiService) PostDocumentPageNumberStamps(name string, stamp PageNumb
1735317353
return successPayload, localVarHttpResponse, err
1735417354
}
1735517355

17356+
/* PdfApiService Rsize PDF document.
17357+
@param name The document name.
17358+
@param height Page Height
17359+
@param width Page width
17360+
@param pages Comma separated list of pages and page ranges. (Example: 1,3-5,8)
17361+
@param optional (nil or map[string]interface{}) with one or more of:
17362+
@param "storage" (string) The document storage.
17363+
@param "folder" (string) The document folder.
17364+
@param "password" (string) Base64 encoded password.
17365+
@return AsposeResponse*/
17366+
func (a *PdfApiService) PostDocumentPagesResize(name string, height float64, width float64, pages string, localVarOptionals map[string]interface{}) (AsposeResponse, *http.Response, error) {
17367+
var (
17368+
localVarHttpMethod = strings.ToUpper("Post")
17369+
localVarPostBody interface{}
17370+
localVarFileName string
17371+
localVarFileBytes []byte
17372+
successPayload AsposeResponse
17373+
)
17374+
17375+
// create path and map variables
17376+
localVarPath := a.client.cfg.BasePath + "/pdf/{name}/resize"
17377+
localVarPath = strings.Replace(localVarPath, "{"+"name"+"}", fmt.Sprintf("%v", name), -1)
17378+
17379+
localVarHeaderParams := make(map[string]string)
17380+
localVarQueryParams := _url.Values{}
17381+
localVarFormParams := _url.Values{}
17382+
17383+
if err := typeCheckParameter(localVarOptionals["storage"], "string", "storage"); err != nil {
17384+
return successPayload, nil, err
17385+
}
17386+
if err := typeCheckParameter(localVarOptionals["folder"], "string", "folder"); err != nil {
17387+
return successPayload, nil, err
17388+
}
17389+
if err := typeCheckParameter(localVarOptionals["password"], "string", "password"); err != nil {
17390+
return successPayload, nil, err
17391+
}
17392+
17393+
localVarQueryParams.Add("height", parameterToString(height, ""))
17394+
localVarQueryParams.Add("width", parameterToString(width, ""))
17395+
localVarQueryParams.Add("pages", parameterToString(pages, ""))
17396+
if localVarTempParam, localVarOk := localVarOptionals["storage"].(string); localVarOk {
17397+
localVarQueryParams.Add("storage", parameterToString(localVarTempParam, ""))
17398+
}
17399+
if localVarTempParam, localVarOk := localVarOptionals["folder"].(string); localVarOk {
17400+
localVarQueryParams.Add("folder", parameterToString(localVarTempParam, ""))
17401+
}
17402+
if localVarTempParam, localVarOk := localVarOptionals["password"].(string); localVarOk {
17403+
localVarQueryParams.Add("password", parameterToString(localVarTempParam, ""))
17404+
}
17405+
// to determine the Content-Type header
17406+
localVarHttpContentTypes := []string{ "application/json", }
17407+
17408+
// set Content-Type header
17409+
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
17410+
if localVarHttpContentType != "" {
17411+
localVarHeaderParams["Content-Type"] = localVarHttpContentType
17412+
}
17413+
17414+
// to determine the Accept header
17415+
localVarHttpHeaderAccepts := []string{
17416+
"application/json",
17417+
}
17418+
17419+
// set Accept header
17420+
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
17421+
if localVarHttpHeaderAccept != "" {
17422+
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
17423+
}
17424+
r, err := a.client.prepareRequest(localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
17425+
if err != nil {
17426+
return successPayload, nil, err
17427+
}
17428+
17429+
localVarHttpResponse, err := a.client.callAPI(r)
17430+
if err != nil || localVarHttpResponse == nil {
17431+
return successPayload, localVarHttpResponse, err
17432+
}
17433+
defer localVarHttpResponse.Body.Close()
17434+
if localVarHttpResponse.StatusCode >= 300 {
17435+
bodyBytes, _ := io.ReadAll(localVarHttpResponse.Body)
17436+
return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes)
17437+
}
17438+
17439+
if err = deserializeDTO(localVarHttpResponse.Body, &successPayload); err != nil {
17440+
return successPayload, localVarHttpResponse, err
17441+
}
17442+
17443+
return successPayload, localVarHttpResponse, err
17444+
}
17445+
1735617446
/* PdfApiService Rotate PDF document.
1735717447
@param name The document name.
1735817448
@param rotationAngle Rotation Angle (CKW). Can be 90, 180, 270.

uses_cases/pages/pages_launch.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package main
22

33
func main() {
4-
pdfApi := initPdfApi(PDF_API_SID, PDF_API_KEY)
4+
pdfApi := initPdfApi(API_SID, API_KEY)
55

66
AppendNewPage(pdfApi, PDF_DOCUMENT, PDF_OUTPUT, REMOTE_FOLDER)
77

0 commit comments

Comments
 (0)