|
1 |
| - [](https://github.com/aspose-cells-cloud/aspose-cells-cloud-go/blob/master/LICENSE) |
| 1 | + [](https://github.com/aspose-cells-cloud/aspose-cells-cloud-go/blob/master/LICENSE) |
2 | 2 |
|
3 | 3 | Aspose.Cells Cloud for Go enables you to handle various aspects of Excel files, including cell data, styles, formulas, charts, pivot tables, data validation, comments, drawing objects, images, hyperlinks, and so on. Additionally, it supports operations such as splitting, merging, repairing, and converting to other compatible file formats.
|
4 | 4 |
|
@@ -71,39 +71,35 @@ Full list of issues covering all changes in this release:
|
71 | 71 |
|
72 | 72 | To get started with Aspose.Cells Cloud for Go, follow these steps:
|
73 | 73 |
|
74 |
| -1. Create an account at [Aspose for Cloud](https://dashboard.aspose.cloud/#/apps) and obtain your application information. |
75 |
| -2. Download the code and add or modify your application by referring to cells_cloud_test.go. |
76 |
| -3. If you prefer to use [Go Module](https://pkg.go.dev), import "github.com/aspose-cells-cloud/aspose-cells-cloud-go/v24" in your code. |
| 74 | +- Create an account at [Aspose for Cloud](https://dashboard.aspose.cloud/#/apps) and obtain your application client id and secret. |
| 75 | +- Create a directory for your project and a main.go file within. Add the following code to your main.go. |
77 | 76 |
|
78 | 77 | ```golang
|
79 |
| - remoteFolder := "TestData/In" |
80 |
| - localFolder := "testdata/" |
81 |
| - localName := "Book1.xlsx" |
82 |
| - remoteName := "Book1.xlsx" |
83 |
| - instance := asposecellscloud.NewCellsApiService(os.Getenv("ProductClientId"), os.Getenv("ProductClientSecret"), "https://api.aspose.cloud", "v3.0") |
84 |
| - |
85 |
| - localNameRequest := new(asposecellscloud.UploadFileRequest) |
86 |
| - localNameRequest.UploadFiles = make(map[string]string) |
87 |
| - localNameRequest.UploadFiles[localName] = localFolder + localName |
88 |
| - localNameRequest.Path = remoteFolder + "/" + remoteName |
89 |
| - localNameRequest.StorageName = "" |
90 |
| - instance.UploadFile(localNameRequest) |
91 |
| - |
92 |
| - newfilename := "TestData/OutResult/PostExcelSaveAs.pdf" |
93 |
| - |
94 |
| - var saveOptions = new(asposecellscloud.PdfSaveOptions) |
95 |
| - saveOptions.SaveFormat = "pdf" |
96 |
| - |
97 |
| - request := new(asposecellscloud.PostWorkbookSaveAsRequest) |
98 |
| - request.Name = remoteName |
99 |
| - request.Newfilename = newfilename |
100 |
| - request.SaveOptions = saveOptions |
101 |
| - request.Folder = remoteFolder |
102 |
| - _, httpResponse, err := instance.PostWorkbookSaveAs(request) |
103 |
| - if err != nil { |
104 |
| - println(err) |
| 78 | +package main |
| 79 | + |
| 80 | +import ( |
| 81 | + "os" |
| 82 | + . "github.com/aspose-cells-cloud/aspose-cells-cloud-go/v25" |
| 83 | +) |
| 84 | + |
| 85 | +func main() { |
| 86 | + instance := NewCellsApiService(os.Getenv("ProductClientId"), os.Getenv("ProductClientSecret")) |
| 87 | + request := PutConvertWorkbookRequest{File: map[string]string{"Book1.xlsx": "TestData/Book1.xlsx"}, Format: "pdf"} |
| 88 | + data, _, err := instance.PutConvertWorkbook(&request) |
| 89 | + if err == nil { |
| 90 | + file, _ := os.OpenFile("Book1.pdf", os.O_WRONLY|os.O_CREATE|os.O_APPEND, 0644) |
| 91 | + file.Write(data) |
| 92 | + defer file.Close() |
105 | 93 | }
|
106 |
| - println(httpResponse.StatusCode) |
| 94 | +} |
| 95 | +``` |
| 96 | + |
| 97 | +- Initialize project go.mod , fetch the dependencies for your project, and run your created application.. |
| 98 | + |
| 99 | +```bash |
| 100 | +go mod init main |
| 101 | +go mod tidy |
| 102 | +go run main.go |
107 | 103 | ```
|
108 | 104 |
|
109 | 105 | ## Aspose.Cells Cloud SDKs in Popular Languages
|
|
0 commit comments