I implemented a docx to pdf conversion using the Golang API as followed:
50 file, err := os.Open(origPath)
51 if err != nil {
52 return nil, err
53 }
54 if _, err := file.Seek(0, 0); err != nil {
55 return nil, err
56 }
57
58
59 // save converted pdf
60 resp, err := pr.client.WordsApi.ConvertDocument(pr.ctx, file, “pdf”, nil)
61 defer resp.Body.Close()
62 if err != nil {
63 return nil, err
64 }
I’ve also set up the client as followed and update the config.json file with the sid key and app key generated from https://dashboard.aspose.cloud:
28 // parse config file
29 config, err := models.NewConfiguration(“config.json”)
30 if err != nil {
31 return nil, err
32 }
33 // create API client
34 client, err := api.NewAPIClient(config)
35 if err != nil {
36 return nil, err
37 }
ConvertDocument() returns an “EOF” error. When I instrumented the ConvertDocument() function, it got a 401 status from client.callAPI() [https://github.com/aspose-words-cloud/aspose-words-cloud-go/blob/master/v2110/tests/convert_document_test.go#L196]
Could you help me figure out what the issue is? Do I need to provide additional info for authentication?