@@ -157,6 +157,66 @@ func Test_ConvertDocument_SaveAsDocx(t *testing.T) {
157
157
assert .NotNil (t , actual .GetSaveResult ().GetDestDocument (), "Validate SaveAsDocx response." );
158
158
}
159
159
160
+ // Test for converting document to one of the available formats.
161
+ func Test_ConvertDocument_SaveAsTiff (t * testing.T ) {
162
+ config := ReadConfiguration (t )
163
+ client , ctx := PrepareTest (t , config )
164
+ remoteFolder := remoteBaseTestDataFolder + "/DocumentActions/ConvertDocument"
165
+ localName := "test_multi_pages.docx"
166
+ remoteName := "TestSaveAsTiff.pdf"
167
+
168
+ UploadNextFileToStorage (t , ctx , client , GetLocalFile ("Common/" + localName ), remoteFolder + "/" + remoteName )
169
+
170
+ requestSaveOptions := models.TiffSaveOptionsData {
171
+ FileName : ToStringPointer (baseTestOutPath + "/abc.tiff" ),
172
+ }
173
+
174
+ options := map [string ]interface {}{
175
+ "folder" : remoteFolder ,
176
+ }
177
+
178
+ request := & models.SaveAsTiffRequest {
179
+ Name : ToStringPointer (remoteName ),
180
+ SaveOptions : & requestSaveOptions ,
181
+ Optionals : options ,
182
+ }
183
+
184
+ actual , _ , err := client .WordsApi .SaveAsTiff (ctx , request )
185
+ if err != nil {
186
+ t .Error (err )
187
+ }
188
+
189
+ assert .NotNil (t , actual .GetSaveResult (), "Validate SaveAsTiff response." );
190
+ assert .NotNil (t , actual .GetSaveResult ().GetDestDocument (), "Validate SaveAsTiff response." );
191
+ }
192
+
193
+ // Test for converting document to one of the available formats.
194
+ func Test_ConvertDocument_SaveAsTiffOnline (t * testing.T ) {
195
+ config := ReadConfiguration (t )
196
+ client , ctx := PrepareTest (t , config )
197
+ localName := "test_multi_pages.docx"
198
+
199
+ requestDocument := OpenFile (t , "Common/" + localName )
200
+ requestSaveOptions := models.TiffSaveOptionsData {
201
+ FileName : ToStringPointer (baseTestOutPath + "/abc.tiff" ),
202
+ }
203
+
204
+ options := map [string ]interface {}{
205
+ }
206
+
207
+ request := & models.SaveAsTiffOnlineRequest {
208
+ Document : requestDocument ,
209
+ SaveOptions : & requestSaveOptions ,
210
+ Optionals : options ,
211
+ }
212
+
213
+ _ , _ , err := client .WordsApi .SaveAsTiffOnline (ctx , request )
214
+ if err != nil {
215
+ t .Error (err )
216
+ }
217
+
218
+ }
219
+
160
220
// A test for ConvertDocument.
161
221
func Test_ConvertDocument_ConvertDocument (t * testing.T ) {
162
222
config := ReadConfiguration (t )
0 commit comments