Skip to content

Commit 82230b0

Browse files
authored
Merge pull request #56 from aspose-pdf-cloud/develop
update to 24.5.0
2 parents b80970a + 7b146af commit 82230b0

File tree

5 files changed

+439
-2
lines changed

5 files changed

+439
-2
lines changed

README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,9 +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 24.3
12+
## Enhancements in Version 24.5
1313
- A new version of Aspose.PDF Cloud was prepared using the latest version of Aspose.PDF for .NET.
1414

15+
## Bugs fixed in Version 24.5
16+
- Aspose.PDF Cloud Service Throws Bad Gateway Error intermittently.
17+
1518
## Installation
1619
```
1720
go get -u github.com/aspose-pdf-cloud/aspose-pdf-cloud-go/v24

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

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

convert_test.go

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ import (
2424
"encoding/base64"
2525
"fmt"
2626
"os"
27+
"path/filepath"
2728
"testing"
2829
)
2930

@@ -538,6 +539,25 @@ func TestPutPdfInRequestToXlsx(t *testing.T) {
538539
}
539540
}
540541

542+
func TestPostPdfToXlsx(t *testing.T) {
543+
name := "4pages.pdf"
544+
file, err := os.Open(filepath.Join(GetBaseTest().localTestDataFolder, name))
545+
if err != nil {
546+
t.Error(err)
547+
}
548+
args := map[string]interface{}{
549+
"file": file,
550+
}
551+
response, httpResponse, err := GetBaseTest().PdfAPI.PostPdfToXlsx(args)
552+
if err != nil {
553+
t.Error(err)
554+
} else if httpResponse.StatusCode < 200 || httpResponse.StatusCode > 299 {
555+
t.Fail()
556+
} else {
557+
fmt.Printf("%d\tTestPostPdfToXlsx - %db\n", GetBaseTest().GetTestNumber(), len(response))
558+
}
559+
}
560+
541561
// To HTML
542562
func TestGetPdfInStorageToHtml(t *testing.T) {
543563

@@ -1100,3 +1120,22 @@ func TestPutPdfInRequestToXml(t *testing.T) {
11001120
fmt.Printf("%d\tTestPutPdfInRequestToXml - %d\n", GetBaseTest().GetTestNumber(), response.Code)
11011121
}
11021122
}
1123+
1124+
// To Text
1125+
func TestGetPdfInStorageToText(t *testing.T) {
1126+
name := "4pages.pdf"
1127+
if err := GetBaseTest().UploadFile(name); err != nil {
1128+
t.Error(err)
1129+
}
1130+
args := map[string]interface{}{
1131+
"folder": GetBaseTest().remoteFolder,
1132+
}
1133+
response, httpResponse, err := GetBaseTest().PdfAPI.GetPdfInStorageToText(name, args)
1134+
if err != nil {
1135+
t.Error(err)
1136+
} else if httpResponse.StatusCode < 200 || httpResponse.StatusCode > 299 {
1137+
t.Fail()
1138+
} else {
1139+
fmt.Printf("%d\tGetPdfInStorageToText - %db\n", GetBaseTest().GetTestNumber(), len(response))
1140+
}
1141+
}

docs/PdfApi.md

Lines changed: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,7 @@ Method | HTTP request | Description
153153
[**GetPdfInStorageToPptx**](PdfApi.md#GetPdfInStorageToPptx) | **Get** /pdf/{name}/convert/pptx | Converts PDF document (located on storage) to PPTX format and returns resulting file in response content
154154
[**GetPdfInStorageToSvg**](PdfApi.md#GetPdfInStorageToSvg) | **Get** /pdf/{name}/convert/svg | Converts PDF document (located on storage) to SVG format and returns resulting file in response content
155155
[**GetPdfInStorageToTeX**](PdfApi.md#GetPdfInStorageToTeX) | **Get** /pdf/{name}/convert/tex | Converts PDF document (located on storage) to TeX format and returns resulting file in response content
156+
[**GetPdfInStorageToText**](PdfApi.md#GetPdfInStorageToText) | **Get** /pdf/{name}/convert/text | Converts PDF document (located on storage) to Text format and returns resulting file in response content
156157
[**GetPdfInStorageToTiff**](PdfApi.md#GetPdfInStorageToTiff) | **Get** /pdf/{name}/convert/tiff | Converts PDF document (located on storage) to TIFF format and returns resulting file in response content
157158
[**GetPdfInStorageToXls**](PdfApi.md#GetPdfInStorageToXls) | **Get** /pdf/{name}/convert/xls | Converts PDF document (located on storage) to XLS format and returns resulting file in response content
158159
[**GetPdfInStorageToXlsx**](PdfApi.md#GetPdfInStorageToXlsx) | **Get** /pdf/{name}/convert/xlsx | Converts PDF document (located on storage) to XLSX format and returns resulting file in response content
@@ -208,6 +209,7 @@ Method | HTTP request | Description
208209
[**PostDocumentTextReplace**](PdfApi.md#PostDocumentTextReplace) | **Post** /pdf/{name}/text/replace | Document&#39;s replace text method.
209210
[**PostEncryptDocumentInStorage**](PdfApi.md#PostEncryptDocumentInStorage) | **Post** /pdf/{name}/encrypt | Encrypt document in storage.
210211
[**PostFlattenDocument**](PdfApi.md#PostFlattenDocument) | **Post** /pdf/{name}/flatten | Flatten the document.
212+
[**PostHtmlToPdf**](PdfApi.md#PostHtmlToPdf) | **Post** /pdf/create/html | Convert HTML file (zip archive in request content) to PDF format and return resulting file in response.
211213
[**PostImportFieldsFromFdf**](PdfApi.md#PostImportFieldsFromFdf) | **Post** /pdf/{name}/import/fdf | Update fields from FDF file in request.
212214
[**PostImportFieldsFromXfdf**](PdfApi.md#PostImportFieldsFromXfdf) | **Post** /pdf/{name}/import/xfdf | Update fields from XFDF file in request.
213215
[**PostImportFieldsFromXml**](PdfApi.md#PostImportFieldsFromXml) | **Post** /pdf/{name}/import/xml | Update fields from XML file in request.
@@ -243,6 +245,7 @@ Method | HTTP request | Description
243245
[**PostPageTextReplace**](PdfApi.md#PostPageTextReplace) | **Post** /pdf/{name}/pages/{pageNumber}/text/replace | Page&#39;s replace text method.
244246
[**PostPageTextStamps**](PdfApi.md#PostPageTextStamps) | **Post** /pdf/{name}/pages/{pageNumber}/stamps/text | Add document page text stamps.
245247
[**PostPageUnderlineAnnotations**](PdfApi.md#PostPageUnderlineAnnotations) | **Post** /pdf/{name}/pages/{pageNumber}/annotations/underline | Add document page underline annotations.
248+
[**PostPdfToXlsx**](PdfApi.md#PostPdfToXlsx) | **Post** /pdf/convert/xlsx | Converts PDF document (in request content) to XLSX format and uploads and returns resulting file in response content.
246249
[**PostPopupAnnotation**](PdfApi.md#PostPopupAnnotation) | **Post** /pdf/{name}/annotations/{annotationId}/popup | Add document popup annotations.
247250
[**PostRadioButtonFields**](PdfApi.md#PostRadioButtonFields) | **Post** /pdf/{name}/fields/radiobutton | Add document RadioButton fields.
248251
[**PostSignDocument**](PdfApi.md#PostSignDocument) | **Post** /pdf/{name}/sign | Sign document.
@@ -5251,6 +5254,37 @@ Name | Type | Description | Notes
52515254

52525255
[[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)
52535256

5257+
# **GetPdfInStorageToText**
5258+
> []byte GetPdfInStorageToText(name, optional)
5259+
Converts PDF document (located on storage) to Text format and returns resulting file in response content
5260+
5261+
### Required Parameters
5262+
5263+
Name | Type | Description | Notes
5264+
------------- | ------------- | ------------- | -------------
5265+
**name** | **string**| The document name. |
5266+
**optional** | **map[string]interface{}** | optional parameters | nil if no parameters
5267+
5268+
### Optional Parameters
5269+
Optional parameters are passed through a map[string]interface{}.
5270+
5271+
Name | Type | Description | Notes
5272+
------------- | ------------- | ------------- | -------------
5273+
**name** | **string**| The document name. |
5274+
**folder** | **string**| The document folder. |
5275+
**storage** | **string**| The document storage. |
5276+
5277+
### Return type
5278+
5279+
**[]byte**
5280+
5281+
### HTTP request headers
5282+
5283+
- **Content-Type**: application/json
5284+
- **Accept**: multipart/form-data
5285+
5286+
[[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)
5287+
52545288
# **GetPdfInStorageToTiff**
52555289
> []byte GetPdfInStorageToTiff(name, optional)
52565290
Converts PDF document (located on storage) to TIFF format and returns resulting file in response content
@@ -7109,6 +7143,41 @@ Name | Type | Description | Notes
71097143

71107144
[[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)
71117145

7146+
# **PostHtmlToPdf**
7147+
> []byte PostHtmlToPdf(optional)
7148+
Convert HTML file (zip archive in request content) to PDF format and return resulting file in response.
7149+
7150+
### Required Parameters
7151+
7152+
Name | Type | Description | Notes
7153+
------------- | ------------- | ------------- | -------------
7154+
**optional** | **map[string]interface{}** | optional parameters | nil if no parameters
7155+
7156+
### Optional Parameters
7157+
Optional parameters are passed through a map[string]interface{}.
7158+
7159+
Name | Type | Description | Notes
7160+
------------- | ------------- | ------------- | -------------
7161+
**htmlFileName** | **string**| Name of HTML file in ZIP. |
7162+
**height** | **float64**| Page height |
7163+
**width** | **float64**| Page width |
7164+
**isLandscape** | **bool**| Is page landscaped |
7165+
**marginLeft** | **float64**| Page margin left |
7166+
**marginBottom** | **float64**| Page margin bottom |
7167+
**marginRight** | **float64**| Page margin right |
7168+
**marginTop** | **float64**| Page margin top |
7169+
7170+
### Return type
7171+
7172+
**[]byte**
7173+
7174+
### HTTP request headers
7175+
7176+
- **Content-Type**: multipart/form-data
7177+
- **Accept**: multipart/form-data
7178+
7179+
[[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)
7180+
71127181
# **PostImportFieldsFromFdf**
71137182
> AsposeResponse PostImportFieldsFromFdf(name, optional)
71147183
Update fields from FDF file in request.
@@ -8332,6 +8401,38 @@ Name | Type | Description | Notes
83328401

83338402
[[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)
83348403

8404+
# **PostPdfToXlsx**
8405+
> []byte PostPdfToXlsx(optional)
8406+
Converts PDF document (in request content) to XLSX format and uploads and returns resulting file in response content.
8407+
8408+
### Required Parameters
8409+
8410+
Name | Type | Description | Notes
8411+
------------- | ------------- | ------------- | -------------
8412+
**optional** | **map[string]interface{}** | optional parameters | nil if no parameters
8413+
8414+
### Optional Parameters
8415+
Optional parameters are passed through a map[string]interface{}.
8416+
8417+
Name | Type | Description | Notes
8418+
------------- | ------------- | ------------- | -------------
8419+
**insertBlankColumnAtFirst** | **bool**| Insert blank column at first |
8420+
**minimizeTheNumberOfWorksheets** | **bool**| Minimize the number of worksheets |
8421+
**uniformWorksheets** | **bool**| Uniform worksheets |
8422+
**password** | **string**| The password (Base64). |
8423+
**file** | ***os.File**| A file to be converted. |
8424+
8425+
### Return type
8426+
8427+
**[]byte**
8428+
8429+
### HTTP request headers
8430+
8431+
- **Content-Type**: multipart/form-data
8432+
- **Accept**: multipart/form-data
8433+
8434+
[[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)
8435+
83358436
# **PostPopupAnnotation**
83368437
> AsposeResponse PostPopupAnnotation(name, annotationId, annotation, optional)
83378438
Add document popup annotations.

0 commit comments

Comments
 (0)