Skip to content

Commit 4b145be

Browse files
author
kirill.novinskiy
committed
update to 24.9
1 parent a4383e4 commit 4b145be

File tree

10 files changed

+568
-4
lines changed

10 files changed

+568
-4
lines changed

README.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,10 @@ 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 24.8
13-
- Adding Text stamps to multiple pages.
14-
- Adding Image stamps to multiple pages.
12+
## Enhancements in Version 24.9
13+
- Develop DeleteDocumentLayer Method.
14+
- Develop GetDocumentLayers Method.
15+
- How to extract PDF layer elements and create a new PDF
1516
- A new version of Aspose.PDF Cloud was prepared using the latest version of Aspose.PDF for .NET.
1617

1718
## Installation

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"] = "24.8.0"
179+
headerParams["x-aspose-client-version"] = "24.9.0"
180180

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

docs/DocumentLayers.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# DocumentLayers
2+
DocumentLayers response class.
3+
4+
## Properties
5+
Name | Type | Description | Notes
6+
------------ | ------------- | ------------- | -------------
7+
**Layers** | [**[]LayerInfo**](LayerInfo.md) | List of document Layers. | [optional] [default to null]
8+
9+
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)[[View Source]](../document_layers.go)
10+
11+

docs/LayerInfo.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# LayerInfo
2+
3+
4+
## Properties
5+
Name | Type | Description | Notes
6+
------------ | ------------- | ------------- | -------------
7+
**PageNumber** | **int32** | Layer Page Number. | [default to null]
8+
**Id** | **string** | Layer Id. | [optional] [default to null]
9+
**Name** | **string** | Layer Name. | [optional] [default to null]
10+
**Locked** | **bool** | Gets a value indicating whether the layer is locked. | [default to null]
11+
12+
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)[[View Source]](../layer_info.go)
13+
14+

docs/PdfApi.md

Lines changed: 109 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ Method | HTTP request | Description
1111
[**DeleteBookmark**](PdfApi.md#DeleteBookmark) | **Delete** /pdf/{name}/bookmarks/bookmark/{bookmarkPath} | Delete document bookmark by ID.
1212
[**DeleteDocumentAnnotations**](PdfApi.md#DeleteDocumentAnnotations) | **Delete** /pdf/{name}/annotations | Delete all annotations from the document
1313
[**DeleteDocumentBookmarks**](PdfApi.md#DeleteDocumentBookmarks) | **Delete** /pdf/{name}/bookmarks/tree | Delete all document bookmarks.
14+
[**DeleteDocumentLayer**](PdfApi.md#DeleteDocumentLayer) | **Delete** /pdf/{name}/layers | Remove document layer.
1415
[**DeleteDocumentLinkAnnotations**](PdfApi.md#DeleteDocumentLinkAnnotations) | **Delete** /pdf/{name}/links | Delete all link annotations from the document
1516
[**DeleteDocumentStamps**](PdfApi.md#DeleteDocumentStamps) | **Delete** /pdf/{name}/stamps | Delete all stamps from the document
1617
[**DeleteDocumentTables**](PdfApi.md#DeleteDocumentTables) | **Delete** /pdf/{name}/tables | Delete all tables from the document
@@ -50,6 +51,7 @@ Method | HTTP request | Description
5051
[**GetDocumentFreeTextAnnotations**](PdfApi.md#GetDocumentFreeTextAnnotations) | **Get** /pdf/{name}/annotations/freetext | Read document free text annotations.
5152
[**GetDocumentHighlightAnnotations**](PdfApi.md#GetDocumentHighlightAnnotations) | **Get** /pdf/{name}/annotations/highlight | Read document highlight annotations.
5253
[**GetDocumentInkAnnotations**](PdfApi.md#GetDocumentInkAnnotations) | **Get** /pdf/{name}/annotations/ink | Read document ink annotations.
54+
[**GetDocumentLayers**](PdfApi.md#GetDocumentLayers) | **Get** /pdf/{name}/layers | Gets document layers.
5355
[**GetDocumentLineAnnotations**](PdfApi.md#GetDocumentLineAnnotations) | **Get** /pdf/{name}/annotations/line | Read document line annotations.
5456
[**GetDocumentListBoxFields**](PdfApi.md#GetDocumentListBoxFields) | **Get** /pdf/{name}/fields/listbox | Read document listbox fields.
5557
[**GetDocumentMovieAnnotations**](PdfApi.md#GetDocumentMovieAnnotations) | **Get** /pdf/{name}/annotations/movie | Read document movie annotations.
@@ -266,6 +268,7 @@ Method | HTTP request | Description
266268
[**PutCircleAnnotation**](PdfApi.md#PutCircleAnnotation) | **Put** /pdf/{name}/annotations/circle/{annotationId} | Replace document circle annotation
267269
[**PutComboBoxField**](PdfApi.md#PutComboBoxField) | **Put** /pdf/{name}/fields/combobox/{fieldName} | Replace document combobox field
268270
[**PutCreateDocument**](PdfApi.md#PutCreateDocument) | **Put** /pdf/{name} | Create empty document.
271+
[**PutCreatePdfFromLayer**](PdfApi.md#PutCreatePdfFromLayer) | **Put** /pdf/{name}/layers | Create a separate PDF from a PDF Layer and upload resulting file to storage.
269272
[**PutDecryptDocument**](PdfApi.md#PutDecryptDocument) | **Put** /pdf/decrypt | Decrypt document from content.
270273
[**PutDocumentDisplayProperties**](PdfApi.md#PutDocumentDisplayProperties) | **Put** /pdf/{name}/displayproperties | Update document display properties.
271274
[**PutEncryptDocument**](PdfApi.md#PutEncryptDocument) | **Put** /pdf/encrypt | Encrypt document from content.
@@ -600,6 +603,42 @@ Name | Type | Description | Notes
600603

601604
[[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)
602605

606+
# **DeleteDocumentLayer**
607+
> AsposeResponse DeleteDocumentLayer(name, pageNumber, layerId, optional)
608+
Remove document layer.
609+
610+
### Required Parameters
611+
612+
Name | Type | Description | Notes
613+
------------- | ------------- | ------------- | -------------
614+
**name** | **string**| The document name. |
615+
**pageNumber** | **int32**| Layer page. |
616+
**layerId** | **string**| Layer Id. |
617+
**optional** | **map[string]interface{}** | optional parameters | nil if no parameters
618+
619+
### Optional Parameters
620+
Optional parameters are passed through a map[string]interface{}.
621+
622+
Name | Type | Description | Notes
623+
------------- | ------------- | ------------- | -------------
624+
**name** | **string**| The document name. |
625+
**pageNumber** | **int32**| Layer page. |
626+
**layerId** | **string**| Layer Id. |
627+
**folder** | **string**| The document folder. |
628+
**storage** | **string**| The document storage. |
629+
**passBase64** | **string**| The password (Base64). |
630+
631+
### Return type
632+
633+
[**AsposeResponse**](AsposeResponse.md)
634+
635+
### HTTP request headers
636+
637+
- **Content-Type**: application/json
638+
- **Accept**: application/json
639+
640+
[[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)
641+
603642
# **DeleteDocumentLinkAnnotations**
604643
> AsposeResponse DeleteDocumentLinkAnnotations(name, optional)
605644
Delete all link annotations from the document
@@ -1851,6 +1890,38 @@ Name | Type | Description | Notes
18511890

18521891
[[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)
18531892

1893+
# **GetDocumentLayers**
1894+
> DocumentLayers GetDocumentLayers(name, optional)
1895+
Gets document layers.
1896+
1897+
### Required Parameters
1898+
1899+
Name | Type | Description | Notes
1900+
------------- | ------------- | ------------- | -------------
1901+
**name** | **string**| The document name. |
1902+
**optional** | **map[string]interface{}** | optional parameters | nil if no parameters
1903+
1904+
### Optional Parameters
1905+
Optional parameters are passed through a map[string]interface{}.
1906+
1907+
Name | Type | Description | Notes
1908+
------------- | ------------- | ------------- | -------------
1909+
**name** | **string**| The document name. |
1910+
**folder** | **string**| The document folder. |
1911+
**storage** | **string**| The document storage. |
1912+
**passBase64** | **string**| The password (Base64). |
1913+
1914+
### Return type
1915+
1916+
[**DocumentLayers**](DocumentLayers.md)
1917+
1918+
### HTTP request headers
1919+
1920+
- **Content-Type**: application/json
1921+
- **Accept**: application/json
1922+
1923+
[[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)
1924+
18541925
# **GetDocumentLineAnnotations**
18551926
> LineAnnotationsResponse GetDocumentLineAnnotations(name, optional)
18561927
Read document line annotations.
@@ -9118,6 +9189,44 @@ Name | Type | Description | Notes
91189189

91199190
[[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)
91209191

9192+
# **PutCreatePdfFromLayer**
9193+
> AsposeResponse PutCreatePdfFromLayer(name, pageNumber, outPath, layerId, optional)
9194+
Create a separate PDF from a PDF Layer and upload resulting file to storage.
9195+
9196+
### Required Parameters
9197+
9198+
Name | Type | Description | Notes
9199+
------------- | ------------- | ------------- | -------------
9200+
**name** | **string**| The document name. |
9201+
**pageNumber** | **int32**| The page number. |
9202+
**outPath** | **string**| The out path of result image. |
9203+
**layerId** | **string**| Layer Id. |
9204+
**optional** | **map[string]interface{}** | optional parameters | nil if no parameters
9205+
9206+
### Optional Parameters
9207+
Optional parameters are passed through a map[string]interface{}.
9208+
9209+
Name | Type | Description | Notes
9210+
------------- | ------------- | ------------- | -------------
9211+
**name** | **string**| The document name. |
9212+
**pageNumber** | **int32**| The page number. |
9213+
**outPath** | **string**| The out path of result image. |
9214+
**layerId** | **string**| Layer Id. |
9215+
**folder** | **string**| The document folder. |
9216+
**storage** | **string**| The document storage. |
9217+
**passBase64** | **string**| The password (Base64). |
9218+
9219+
### Return type
9220+
9221+
[**AsposeResponse**](AsposeResponse.md)
9222+
9223+
### HTTP request headers
9224+
9225+
- **Content-Type**: application/json
9226+
- **Accept**: application/json
9227+
9228+
[[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)
9229+
91219230
# **PutDecryptDocument**
91229231
> AsposeResponse PutDecryptDocument(outPath, password, optional)
91239232
Decrypt document from content.

document_layers.go

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
/*
2+
*
3+
* Copyright (c) 2024 Aspose.PDF Cloud
4+
* Permission is hereby granted, free of charge, to any person obtaining a copy
5+
* of this software and associated documentation files (the "Software"), to deal
6+
* in the Software without restriction, including without limitation the rights
7+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8+
* copies of the Software, and to permit persons to whom the Software is
9+
* furnished to do so, subject to the following conditions:
10+
* The above copyright notice and this permission notice shall be included in all
11+
* copies or substantial portions of the Software.
12+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
13+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
14+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
15+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
16+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
17+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
18+
* SOFTWARE.
19+
*
20+
*/
21+
22+
package asposepdfcloud
23+
24+
// DocumentLayers response class.
25+
type DocumentLayers struct {
26+
// List of document Layers.
27+
Layers []LayerInfo `json:"Layers,omitempty"`
28+
}

document_layers_test.go

Lines changed: 106 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,106 @@
1+
/**
2+
*
3+
* Copyright (c) 2024 Aspose.PDF Cloud
4+
* Permission is hereby granted, free of charge, to any person obtaining a copy
5+
* of this software and associated documentation files (the "Software"), to deal
6+
* in the Software without restriction, including without limitation the rights
7+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8+
* copies of the Software, and to permit persons to whom the Software is
9+
* furnished to do so, subject to the following conditions:
10+
* The above copyright notice and this permission notice shall be included in all
11+
* copies or substantial portions of the Software.
12+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
13+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
14+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
15+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
16+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
17+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
18+
* SOFTWARE.
19+
*
20+
*/
21+
package asposepdfcloud
22+
23+
import (
24+
"fmt"
25+
"testing"
26+
)
27+
28+
func TestGetDocumentLayers(t *testing.T) {
29+
30+
name := "PdfWithLayers.pdf"
31+
32+
if err := GetBaseTest().UploadFile(name); err != nil {
33+
t.Error(err)
34+
}
35+
36+
args := map[string]interface{}{
37+
"folder": GetBaseTest().remoteFolder,
38+
}
39+
40+
response, httpResponse, err := GetBaseTest().PdfAPI.GetDocumentLayers(name, args)
41+
if err != nil {
42+
t.Error(err)
43+
} else if httpResponse.StatusCode < 200 || httpResponse.StatusCode > 299 {
44+
t.Fail()
45+
} else if len(response.Layers) != 2 {
46+
t.Fail()
47+
} else {
48+
fmt.Printf("%d\tTestGetDocumentLayers - %d\n", GetBaseTest().GetTestNumber(), httpResponse.StatusCode)
49+
}
50+
}
51+
52+
53+
func TestDeleteDocumentLayer(t *testing.T) {
54+
55+
name := "PdfWithLayers.pdf"
56+
57+
if err := GetBaseTest().UploadFile(name); err != nil {
58+
t.Error(err)
59+
}
60+
61+
args := map[string]interface{}{
62+
"folder": GetBaseTest().remoteFolder,
63+
}
64+
65+
response, httpResponse, err := GetBaseTest().PdfAPI.DeleteDocumentLayer(name, 1, "oc1", args)
66+
if err != nil {
67+
t.Error(err)
68+
} else if httpResponse.StatusCode < 200 || httpResponse.StatusCode > 299 {
69+
t.Fail()
70+
} else {
71+
fmt.Printf("%d\tTestDeleteDocumentLayer - %d\n", GetBaseTest().GetTestNumber(), response.Code)
72+
}
73+
74+
layers, httpResponse, err := GetBaseTest().PdfAPI.GetDocumentLayers(name, args)
75+
if err != nil {
76+
t.Error(err)
77+
} else if httpResponse.StatusCode < 200 || httpResponse.StatusCode > 299 {
78+
t.Fail()
79+
} else if len(layers.Layers) != 1 {
80+
t.Fail()
81+
} else {
82+
fmt.Printf("%d\tTestGetDocumentLayers - %d\n", GetBaseTest().GetTestNumber(), httpResponse.StatusCode)
83+
}
84+
}
85+
86+
func TestPutCreatePdfFromLayer(t *testing.T) {
87+
88+
name := "PdfWithLayers.pdf"
89+
90+
if err := GetBaseTest().UploadFile(name); err != nil {
91+
t.Error(err)
92+
}
93+
94+
args := map[string]interface{}{
95+
"folder": GetBaseTest().remoteFolder,
96+
}
97+
98+
response, httpResponse, err := GetBaseTest().PdfAPI.PutCreatePdfFromLayer(name, 1, "output.pdf", "oc1", args)
99+
if err != nil {
100+
t.Error(err)
101+
} else if httpResponse.StatusCode < 200 || httpResponse.StatusCode > 299 {
102+
t.Fail()
103+
} else {
104+
fmt.Printf("%d\tTestDeleteDocumentLayer - %d\n", GetBaseTest().GetTestNumber(), response.Code)
105+
}
106+
}

layer_info.go

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
/*
2+
*
3+
* Copyright (c) 2024 Aspose.PDF Cloud
4+
* Permission is hereby granted, free of charge, to any person obtaining a copy
5+
* of this software and associated documentation files (the "Software"), to deal
6+
* in the Software without restriction, including without limitation the rights
7+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8+
* copies of the Software, and to permit persons to whom the Software is
9+
* furnished to do so, subject to the following conditions:
10+
* The above copyright notice and this permission notice shall be included in all
11+
* copies or substantial portions of the Software.
12+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
13+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
14+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
15+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
16+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
17+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
18+
* SOFTWARE.
19+
*
20+
*/
21+
22+
package asposepdfcloud
23+
24+
type LayerInfo struct {
25+
// Layer Page Number.
26+
PageNumber int32 `json:"PageNumber"`
27+
// Layer Id.
28+
Id string `json:"Id,omitempty"`
29+
// Layer Name.
30+
Name string `json:"Name,omitempty"`
31+
// Gets a value indicating whether the layer is locked.
32+
Locked bool `json:"Locked"`
33+
}

0 commit comments

Comments
 (0)