Skip to content

Commit 7b146af

Browse files
update to 24.5.0
1 parent f9550f8 commit 7b146af

File tree

4 files changed

+158
-4
lines changed

4 files changed

+158
-4
lines changed

README.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +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.4
13-
- Convert PDF to optimized Text.
14-
- Convert PDF to EXCEL without Cloud Storage.
12+
## Enhancements in Version 24.5
1513
- A new version of Aspose.PDF Cloud was prepared using the latest version of Aspose.PDF for .NET.
1614

15+
## Bugs fixed in Version 24.5
16+
- Aspose.PDF Cloud Service Throws Bad Gateway Error intermittently.
17+
1718
## Installation
1819
```
1920
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.4.0"
179+
headerParams["x-aspose-client-version"] = "24.5.0"
180180

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

docs/PdfApi.md

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -209,6 +209,7 @@ Method | HTTP request | Description
209209
[**PostDocumentTextReplace**](PdfApi.md#PostDocumentTextReplace) | **Post** /pdf/{name}/text/replace | Document's replace text method.
210210
[**PostEncryptDocumentInStorage**](PdfApi.md#PostEncryptDocumentInStorage) | **Post** /pdf/{name}/encrypt | Encrypt document in storage.
211211
[**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.
212213
[**PostImportFieldsFromFdf**](PdfApi.md#PostImportFieldsFromFdf) | **Post** /pdf/{name}/import/fdf | Update fields from FDF file in request.
213214
[**PostImportFieldsFromXfdf**](PdfApi.md#PostImportFieldsFromXfdf) | **Post** /pdf/{name}/import/xfdf | Update fields from XFDF file in request.
214215
[**PostImportFieldsFromXml**](PdfApi.md#PostImportFieldsFromXml) | **Post** /pdf/{name}/import/xml | Update fields from XML file in request.
@@ -7142,6 +7143,41 @@ Name | Type | Description | Notes
71427143

71437144
[[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)
71447145

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+
71457181
# **PostImportFieldsFromFdf**
71467182
> AsposeResponse PostImportFieldsFromFdf(name, optional)
71477183
Update fields from FDF file in request.

pdf_api.go

Lines changed: 117 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17091,6 +17091,123 @@ func (a *PdfApiService) PostFlattenDocument(name string, localVarOptionals map[s
1709117091
return successPayload, localVarHttpResponse, err
1709217092
}
1709317093

17094+
/* PdfApiService Convert HTML file (zip archive in request content) to PDF format and return resulting file in response.
17095+
@param optional (nil or map[string]interface{}) with one or more of:
17096+
@param "htmlFileName" (string) Name of HTML file in ZIP.
17097+
@param "height" (float64) Page height
17098+
@param "width" (float64) Page width
17099+
@param "isLandscape" (bool) Is page landscaped
17100+
@param "marginLeft" (float64) Page margin left
17101+
@param "marginBottom" (float64) Page margin bottom
17102+
@param "marginRight" (float64) Page margin right
17103+
@param "marginTop" (float64) Page margin top
17104+
@return []byte*/
17105+
func (a *PdfApiService) PostHtmlToPdf(localVarOptionals map[string]interface{}) ([]byte, *http.Response, error) {
17106+
var (
17107+
localVarHttpMethod = strings.ToUpper("Post")
17108+
localVarPostBody interface{}
17109+
localVarFileName string
17110+
localVarFileBytes []byte
17111+
successPayload []byte
17112+
)
17113+
17114+
// create path and map variables
17115+
localVarPath := a.client.cfg.BasePath + "/pdf/create/html"
17116+
17117+
localVarHeaderParams := make(map[string]string)
17118+
localVarQueryParams := _url.Values{}
17119+
localVarFormParams := _url.Values{}
17120+
17121+
if err := typeCheckParameter(localVarOptionals["htmlFileName"], "string", "htmlFileName"); err != nil {
17122+
return successPayload, nil, err
17123+
}
17124+
if err := typeCheckParameter(localVarOptionals["height"], "float64", "height"); err != nil {
17125+
return successPayload, nil, err
17126+
}
17127+
if err := typeCheckParameter(localVarOptionals["width"], "float64", "width"); err != nil {
17128+
return successPayload, nil, err
17129+
}
17130+
if err := typeCheckParameter(localVarOptionals["isLandscape"], "bool", "isLandscape"); err != nil {
17131+
return successPayload, nil, err
17132+
}
17133+
if err := typeCheckParameter(localVarOptionals["marginLeft"], "float64", "marginLeft"); err != nil {
17134+
return successPayload, nil, err
17135+
}
17136+
if err := typeCheckParameter(localVarOptionals["marginBottom"], "float64", "marginBottom"); err != nil {
17137+
return successPayload, nil, err
17138+
}
17139+
if err := typeCheckParameter(localVarOptionals["marginRight"], "float64", "marginRight"); err != nil {
17140+
return successPayload, nil, err
17141+
}
17142+
if err := typeCheckParameter(localVarOptionals["marginTop"], "float64", "marginTop"); err != nil {
17143+
return successPayload, nil, err
17144+
}
17145+
17146+
if localVarTempParam, localVarOk := localVarOptionals["htmlFileName"].(string); localVarOk {
17147+
localVarQueryParams.Add("htmlFileName", parameterToString(localVarTempParam, ""))
17148+
}
17149+
if localVarTempParam, localVarOk := localVarOptionals["height"].(float64); localVarOk {
17150+
localVarQueryParams.Add("height", parameterToString(localVarTempParam, ""))
17151+
}
17152+
if localVarTempParam, localVarOk := localVarOptionals["width"].(float64); localVarOk {
17153+
localVarQueryParams.Add("width", parameterToString(localVarTempParam, ""))
17154+
}
17155+
if localVarTempParam, localVarOk := localVarOptionals["isLandscape"].(bool); localVarOk {
17156+
localVarQueryParams.Add("isLandscape", parameterToString(localVarTempParam, ""))
17157+
}
17158+
if localVarTempParam, localVarOk := localVarOptionals["marginLeft"].(float64); localVarOk {
17159+
localVarQueryParams.Add("marginLeft", parameterToString(localVarTempParam, ""))
17160+
}
17161+
if localVarTempParam, localVarOk := localVarOptionals["marginBottom"].(float64); localVarOk {
17162+
localVarQueryParams.Add("marginBottom", parameterToString(localVarTempParam, ""))
17163+
}
17164+
if localVarTempParam, localVarOk := localVarOptionals["marginRight"].(float64); localVarOk {
17165+
localVarQueryParams.Add("marginRight", parameterToString(localVarTempParam, ""))
17166+
}
17167+
if localVarTempParam, localVarOk := localVarOptionals["marginTop"].(float64); localVarOk {
17168+
localVarQueryParams.Add("marginTop", parameterToString(localVarTempParam, ""))
17169+
}
17170+
// to determine the Content-Type header
17171+
localVarHttpContentTypes := []string{ "multipart/form-data", }
17172+
17173+
// set Content-Type header
17174+
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
17175+
if localVarHttpContentType != "" {
17176+
localVarHeaderParams["Content-Type"] = localVarHttpContentType
17177+
}
17178+
17179+
// to determine the Accept header
17180+
localVarHttpHeaderAccepts := []string{
17181+
"multipart/form-data",
17182+
}
17183+
17184+
// set Accept header
17185+
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
17186+
if localVarHttpHeaderAccept != "" {
17187+
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
17188+
}
17189+
r, err := a.client.prepareRequest(localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
17190+
if err != nil {
17191+
return successPayload, nil, err
17192+
}
17193+
17194+
localVarHttpResponse, err := a.client.callAPI(r)
17195+
if err != nil || localVarHttpResponse == nil {
17196+
return successPayload, localVarHttpResponse, err
17197+
}
17198+
defer localVarHttpResponse.Body.Close()
17199+
if localVarHttpResponse.StatusCode >= 300 {
17200+
bodyBytes, _ := io.ReadAll(localVarHttpResponse.Body)
17201+
return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes)
17202+
}
17203+
successPayload, err = io.ReadAll(localVarHttpResponse.Body)
17204+
if err != nil {
17205+
return successPayload, localVarHttpResponse, err
17206+
}
17207+
17208+
return successPayload, localVarHttpResponse, err
17209+
}
17210+
1709417211
/* PdfApiService Update fields from FDF file in request.
1709517212
@param name The document name.
1709617213
@param optional (nil or map[string]interface{}) with one or more of:

0 commit comments

Comments
 (0)