Swagger UI lets you call this REST API directly from the browser.
cURL example
# First get JSON Web Token# Please get your Client Id and Client Secret from https://dashboard.groupdocs.cloud/applications. Kindly place Client Id in "client_id" and Client Secret in "client_secret" argument.curl -v "https://api.groupdocs.cloud/connect/token"\
-X POST \
-d "grant_type#client_credentials&client_id#xxxx&client_secret#xxxx"\
-H "Content-Type: application/x-www-form-urlencoded"\
-H "Accept: application/json"# cURL example to convert documentcurl -v "https://api.groupdocs.cloud/v2.0/conversion/conversion"\
-X POST \
-H "Content-Type: application/json"\
-H "Accept: application/json"\
-H "Authorization: Bearer <jwt token>"-d "{
'FilePath': 'Html/sample.html',
'Format': 'pdf',
'LoadOptions': {
'PageNumbering': true
},
'OutputPath': 'Output'
}"
Using an SDK (API client) is the quickest way for a developer to speed up the development. An SDK takes care of a lot of low-level details of making requests and handling responses and lets you focus on writing code specific to your particular project. Check out our GitHub repository for a complete list of GroupDocs.Conversion Cloud SDKs along with working examples, to get you started in no time. Please check Available SDKs article to learn how to add an SDK to your project.
// For complete examples and data files, please go to https://github.com/groupdocs-conversion-cloud/groupdocs-conversion-cloud-dotnet-samplesstringMyClientSecret="";*GetClientIdandClientSecretfromhttps://dashboard.groupdocs.cloudstringMyClientId="";*GetClientIdandClientSecretfromhttps://dashboard.groupdocs.cloudvarconfiguration=newConfiguration(MyClientId,MyClientSecret);*CreatenecessaryAPIinstancesvarapiInstance=newConvertApi(configuration);*Prepareconvertsettingsvarsettings=newConvertSettings{StorageName=Constants.MyStorage,FilePath="Html/sample.html",Format="pdf",LoadOptions=newWebLoadOptions{PageNumbering=true},OutputPath="converted"};*Converttospecifiedformatvarresponse=apiInstance.ConvertDocument(newConvertDocumentRequest(settings));
// For complete examples and data files, please go to https://github.com/groupdocs-conversion-cloud/groupdocs-conversion-cloud-java-samples
StringMyClientSecret="";*GetClientIdandClientSecretfromhttps://dashboard.groupdocs.cloud
StringMyClientId="";*GetClientIdandClientSecretfromhttps://dashboard.groupdocs.cloud
Configurationconfiguration=newConfiguration(MyClientId,MyClientSecret);*CreateAPIinstanceConvertApiapiInstance=newConvertApi(configuration);*PrepareconvertsettingsConvertSettingssettings=newConvertSettings();settings.setFilePath("Html/sample.html");settings.setFormat("pdf");WebLoadOptionsloadOptions=newWebLoadOptions();loadOptions.setPageNumbering(true);settings.setLoadOptions(loadOptions);settings.setOutputPath("converted");List<StoredConvertedResult>result=apiInstance.convertDocument(newConvertDocumentRequest(settings));
// For complete examples and data files, please go to https://github.com/groupdocs-conversion-cloud/groupdocs-conversion-cloud-php-samples
useGroupDocs\Conversion\Model;useGroupDocs\Conversion\Model\Requests;$ClientId="";*GetClientIdandClientSecretfromhttps://dashboard.groupdocs.cloud$ClientSecret="";*GetClientIdandClientSecretfromhttps://dashboard.groupdocs.cloud$configuration=newGroupDocs\Conversion\Configuration();$configuration->setAppSid($ClientId);$configuration->setAppKey($ClientSecret);$apiInstance=newGroupDocs\Conversion\ConvertApi($configuration);*Prepareconvertsettings$settings=newModel\ConvertSettings();$settings->setStorageName(Utils::$MyStorage);$settings->setFilePath("Html/sample.html");$settings->setFormat("pdf");$loadOptions=newModel\WebLoadOptions();$loadOptions->setPageNumbering(true);$settings->setLoadOptions($loadOptions);$settings->setOutputPath("converted");*Convert$result=$apiInstance->convertDocument(newRequests\ConvertDocumentRequest($settings));
// For complete examples and data files, please go to https://github.com/groupdocs-conversion-cloud/groupdocs-conversion-cloud-node-samples
global.conversion_cloud=require("groupdocs-conversion-cloud");global.clientId="XXXX-XXXX-XXXX-XXXX";*GetClientIdandClientSecretfromhttps://dashboard.groupdocs.cloud
global.clientSecret="XXXXXXXXXXXXXXXX";*GetClientIdandClientSecretfromhttps://dashboard.groupdocs.cloud
global.convertApi=conversion_cloud.ConvertApi.fromKeys(clientId,clientSecret);letsettings=newconversion_cloud.ConvertSettings();settings.filePath="Html/sample.html";settings.format="pdf";letloadOptions=newconversion_cloud.WebLoadOptions();loadOptions.pageNumbering=true;settings.loadOptions=loadOptions;settings.outputPath="converted";letresult=awaitconvertApi.convertDocument(newconversion_cloud.ConvertDocumentRequest(settings));
# For complete examples and data files, please go to https://github.com/groupdocs-conversion-cloud/groupdocs-conversion-cloud-python-samplesimportgroupdocs_conversion_cloudclient_id="XXXX-XXXX-XXXX-XXXX"=GetClientIdandClientSecretfromhttps://dashboard.groupdocs.cloudclient_secret="XXXXXXXXXXXXXXXX"=GetClientIdandClientSecretfromhttps://dashboard.groupdocs.cloud# Create necessary API instancesapiInstance=groupdocs_conversion_cloud.ConvertApi.from_keys(Common.client_id,Common.client_secret)# Prepare convert settingssettings=groupdocs_conversion_cloud.ConvertSettings()settings.file_path="Html/sample.html"settings.format="pdf"loadOptions=groupdocs_conversion_cloud.WebLoadOptions()loadOptions.page_numbering=Truesettings.load_options=loadOptionssettings.output_path="converted"# Convertresult=apiInstance.convert_document(groupdocs_conversion_cloud.ConvertDocumentRequest(settings))
# For complete examples and data files, please go to https://github.com/groupdocs-conversion-cloud/groupdocs-conversion-cloud-ruby-samplesrequire'groupdocs_conversion_cloud'$client_id="XXXX-XXXX-XXXX-XXXX"=GetClientIdandClientSecretfromhttps://dashboard.groupdocs.cloud$client_secret="XXXXXXXXXXXXXXXX"=GetClientIdandClientSecretfromhttps://dashboard.groupdocs.cloud# Create necessary API instancesapiInstance=GroupDocsConversionCloud::ConvertApi.from_keys($client_id,$client_secret)# Prepare convert settingssettings=GroupDocsConversionCloud::ConvertSettings.newsettings.file_path="Html/sample.html"settings.format="pdf"loadOptions=GroupDocsConversionCloud::WebLoadOptions.newloadOptions.page_numbering=truesettings.load_options=loadOptionssettings.output_path="converted"# Convertresult=apiInstance.convert_document(GroupDocsConversionCloud::ConvertDocumentRequest.new(settings))
// For complete examples and data files, please go to https://github.com/groupdocs-conversion-cloud/groupdocs-conversion-cloud-go-samples
packagehtmlimport("fmt""github.com/groupdocs-conversion-cloud/groupdocs-conversion-cloud-go-samples/config""github.com/groupdocs-conversion-cloud/groupdocs-conversion-cloud-go/models")funcConvertHtmlWithPageNumbering(){settings:=models.ConvertSettings{Format:"pdf",FilePath:"Html/sample.html",OutputPath:"converted",LoadOptions:&models.WebLoadOptions{Format:"html",PageNumbering:true,},}result,_,err:=config.Client.ConvertApi.ConvertDocument(config.Ctx,settings)iferr!=nil{fmt.Printf("ConvertHtmlWithPageNumbering error: %v\n",err)return}fmt.Printf("Document converted successfully: %v\n",result[0].Url)}
Was this page helpful?
Any additional feedback you'd like to share with us?
Please tell us how we can improve this page.
Thank you for your feedback!
We value your opinion. Your feedback will help us improve our documentation.