@@ -187,32 +187,175 @@ The API is completely independent of your operating system, database system or d
187187{{< tabs "example2">}}
188188{{< tab "C#" >}}
189189
190- {{< gist groupdocscloud 9cff9e42173d5964e88b2ee989ce4a83 Annotation_CSharp_Get_Supported_Formats.cs >}}
190+ ``` csharp
191+ using System ;
192+ using GroupDocs .Annotation .Cloud .Sdk .Api ;
193+ using GroupDocs .Annotation .Cloud .Sdk .Client ;
194+
195+ namespace GroupDocs .Annotation .Cloud .Examples .CSharp
196+ {
197+ // Get All Supported Formats
198+ class Get_All_Supported_Formats
199+ {
200+ public static void Run ()
201+ {
202+ var configuration = new Configuration (Common .MyAppSid , Common .MyAppKey );
203+
204+ var apiInstance = new InfoApi (configuration );
205+
206+ try
207+ {
208+ // Get supported file formats
209+ var response = apiInstance .GetSupportedFileFormats ();
210+
211+ foreach (var entry in response .Formats )
212+ {
213+ Console .WriteLine (string .Format (" {0}: {1}" , entry .FileFormat , string .Join (" ," , entry .Extension )));
214+ }
215+ }
216+ catch (Exception e )
217+ {
218+ Console .WriteLine (" Exception while calling Annotation InfoApi: " + e .Message );
219+ }
220+ }
221+ }
222+ }
223+ ```
191224
192225{{< /tab >}}
193226{{< tab "Java" >}}
194227
195- {{< gist groupdocscloud 7e00ab6ab1a8faab84ca2edd2edc30db Annotation_Java_Get_Supported_Formats.java >}}
228+ ``` java
229+ package examples.Supported_File_Formats ;
230+
231+ import com.groupdocs.cloud.annotation.client.* ;
232+ import com.groupdocs.cloud.annotation.model.* ;
233+ import java.util.List ;
234+ import com.groupdocs.cloud.annotation.client.Configuration ;
235+ import com.groupdocs.cloud.annotation.api.* ;
236+ import examples.Utils ;
237+
238+ public class Annotation_Java_Get_Supported_Formats {
239+
240+ public static void main (String [] args ) {
241+
242+ Configuration configuration = new Configuration (Utils . AppSID , Utils . AppKey );
243+ InfoApi apiInstance = new InfoApi (configuration);
244+ try {
245+ FormatsResult response = apiInstance. getSupportedFileFormats();
246+
247+ for (Format format : response. getFormats()) {
248+ System . out. println(format. getFileFormat());
249+ }
250+ } catch (ApiException e) {
251+ System . err. println(" Exception while calling InfoApi:" );
252+ e. printStackTrace();
253+ }
254+ }
255+ }
256+
257+ ```
196258
197259{{< /tab >}}
198260{{< tab "PHP" >}}
199261
200- {{< gist groupdocscloud 9d23670221e0b7b3882f3f3bab9baf9e Annotation_Php_Get_Supported_Formats.php >}}
262+ ``` php
263+ <?php
264+
265+ include(dirname(__DIR__) . '\CommonUtils.php');
266+
267+ try {
268+ $apiInstance = CommonUtils::GetInfoApiInstance();
269+
270+ $response = $apiInstance->getSupportedFileFormats();
271+
272+ echo '<b >Supported file formats<br /></b >';
273+ foreach($response->getFormats() as $key => $format) {
274+ echo $format->getFileFormat(), "(", $format->getExtension(), ")<br />";
275+ }
276+ } catch (Exception $e) {
277+ echo "Something went wrong: ", $e->getMessage(), "\n";
278+ }
279+ ```
201280
202281{{< /tab >}}
203- {{< tab "Node.Js" >}}
282+ {{< tab "Node.js" >}}
283+
284+ ``` js
285+ " use strict" ;
286+ class Annotation_Node_Get_All_Supported_Formats {
287+ static Run () {
288+ // retrieve supported file-formats
289+ infoApi .getSupportedFileFormats ()
290+ .then (function (response ) {
291+ console .log (" Supported file-formats:" );
292+ response .formats .forEach (function (format ) {
293+ console .log (format .fileFormat + " (" + format .extension + " )" + " \n " );
294+ });
295+ })
296+ .catch (function (error ) {
297+ console .log (" Error: " + error .message );
298+ });
299+ }
300+ }
301+ module .exports = Annotation_Node_Get_All_Supported_Formats;
204302
205- {{< gist groupdocscloud 18dbfb11660d5c7555df9b7886856763 Annotation_Node_Get_All_Supported_Formats.js >}}
303+ ```
206304
207305{{< /tab >}}
208306{{< tab "Python" >}}
209307
210- {{< gist groupdocscloud adf9db2b064fbf397457fa83429d9efa Annotation_Python_Get_All_Supported_Formats.py >}}
308+ ``` python
309+ # Import modules
310+ import groupdocs_annotation_cloud
311+
312+ from Common_Utilities.Utils import Common_Utilities;
313+
314+
315+ class Annotation_Python_Get_All_Supported_Formats :
316+
317+ @ classmethod
318+ def Run (self ):
319+ # Create instance of the API
320+ api = Common_Utilities.Get_InfoApi_Instance()
321+
322+ try :
323+ # Retrieve supported file-formats
324+ response = api.get_supported_file_formats()
325+
326+ # Print out supported file-formats
327+ print (" Supported file-formats:" )
328+ for fileformat in response.formats:
329+ print (' {0} ({1} )' .format(fileformat.file_format, fileformat.extension))
330+ except groupdocs_annotation_cloud.ApiException as e:
331+ print (" Exception when calling get_supported_annotation_types: {0} " .format(e.message))
332+ ```
211333
212334{{< /tab >}}
213335{{< tab "Ruby" >}}
214336
215- {{< gist groupdocscloud 13003090505393ddeb57a01bf8b5a823 Annotation_Ruby_Get_Supported_Formats.rb >}}
337+ ``` ruby
338+ # Load the gem
339+ require ' groupdocs_annotation_cloud'
340+ require ' common_utilities/Utils.rb'
341+
342+ class File_Formats
343+ def self .Annotation_Ruby_Get_Supported_Formats ()
344+
345+ # Getting instance of the API
346+ api = Common_Utilities .Get_InfoApi_Instance ()
347+
348+ # Retrieve supported file-formats
349+ $response = api.get_supported_file_formats()
350+
351+ # Print out supported file-formats
352+ puts (" Supported file-formats:" )
353+ $response .formats.each do |format |
354+ puts (" #{ format .file_format} (#{ format .extension} )" )
355+ end
356+ end
357+ end
358+ ```
216359
217360{{< /tab >}}
218361{{< /tabs >}}
0 commit comments