3. Convert to Word Processing Document Formats
Leave feedback
On this page
GroupDocs.Conversion Cloud REST API allows us to convert the supported document formats to Word Processing Document Formats and returns the output document storage URL and also support to get the result as a stream.
Convert to Words Formats
You can convert the supported document formats to Word Processing Document Formats and get the output as a storage URL
Resource
HTTPPOST~/conversion
Swagger UI lets you call this REST API directly from the browser.
The API is completely independent of your operating system, database system or development language. We provide and support API SDKs in many development languages in order to make it even easier to integrate. You can see our available SDKs list here.
usingSystem;usingSystem.Collections.Generic;usingGroupDocs.Conversion.Cloud.Sdk.Api;usingGroupDocs.Conversion.Cloud.Sdk.Client;usingGroupDocs.Conversion.Cloud.Sdk.Model;usingGroupDocs.Conversion.Cloud.Sdk.Model.Requests;namespaceGroupDocs.Conversion.Cloud.Examples.CSharp{// Convert to Words with load and save optionsclassConvert_To_Words{publicstaticvoidRun(){varconfiguration=newConfiguration(Common.MyAppSid,Common.MyAppKey);varapiInstance=newConvertApi(configuration);try{// convert settingsvarsettings=newConvertSettings{StorageName=Common.MyStorage,FilePath="conversions/sample.pdf",Format="docx",LoadOptions=newPdfLoadOptions(){Password="",HidePdfAnnotations=true,RemoveEmbeddedFiles=false,FlattenAllFields=true},ConvertOptions=newDocxConvertOptions(){FromPage=1,PagesCount=2,Zoom=100,Dpi=300},OutputPath="converted/towords"};// convert to specified formatList<StoredConvertedResult>response=apiInstance.ConvertDocument(newConvertDocumentRequest(settings));Console.WriteLine("Document conveted successfully: "+response[0].Url);}catch(Exceptione){Console.WriteLine("Exception when calling ConvertApi: "+e.Message);}}}}
<?phpinclude(dirname(__DIR__).'\CommonUtils.php');$convertApi=CommonUtils::GetConvertApiInstance();try{$settings=newGroupDocs\Conversion\Model\ConvertSettings();$settings->setStorageName(CommonUtils::$MyStorage);$settings->setFilePath("conversions\\sample.pdf");$settings->setFormat("docx");$loadOptions=newGroupDocs\Conversion\Model\PdfLoadOptions();$loadOptions->setPassword("");$loadOptions->setHidePdfAnnotations(true);$loadOptions->setRemoveEmbeddedFiles(false);$loadOptions->setFlattenAllFields(true);$settings->setLoadOptions($loadOptions);$convertOptions=newGroupDocs\Conversion\Model\DocxConvertOptions();$convertOptions->setFromPage(1);$convertOptions->setPagesCount(2);$convertOptions->setZoom(100);$convertOptions->setDpi(300.0);$settings->setConvertOptions($convertOptions);$settings->setOutputPath("converted\\towords");$request=newGroupDocs\Conversion\Model\Requests\ConvertDocumentRequest($settings);$response=$convertApi->convertDocument($request);echo"Document converted successfully: ",$response[0]->getUrl();}catch(Exception$e){echo"Something went wrong: ",$e->getMessage(),"<br />";PHP_EOL;}?>
packageexamples.Working_With_Conversions;importcom.groupdocs.cloud.conversion.api.*;importcom.groupdocs.cloud.conversion.client.ApiException;importcom.groupdocs.cloud.conversion.model.*;importcom.groupdocs.cloud.conversion.model.requests.*;importexamples.Utils;importjava.util.List;publicclassConversion_Java_Convert_To_Words{publicstaticvoidmain(String[]args){ConvertApiapiInstance=newConvertApi(Utils.AppSID,Utils.AppKey);try{ConvertSettingssettings=newConvertSettings();settings.setStorageName(Utils.MYStorage);settings.setFilePath("conversions\\sample.pdf");settings.setFormat("docx");PdfLoadOptionsloadOptions=newPdfLoadOptions();loadOptions.setPassword("");loadOptions.setHidePdfAnnotations(true);loadOptions.setRemoveEmbeddedFiles(false);loadOptions.setFlattenAllFields(true);settings.setLoadOptions(loadOptions);DocxConvertOptionsconvertOptions=newDocxConvertOptions();convertOptions.setFromPage(1);convertOptions.setPagesCount(2);convertOptions.setZoom(100);convertOptions.setDpi(300.0);settings.setConvertOptions(convertOptions);settings.setOutputPath("converted\\towords");// convert to specified format
List<StoredConvertedResult>response=apiInstance.convertDocument(newConvertDocumentRequest(convertSettings));System.out.println("Document converted successfully: "+response.size());}catch(ApiExceptione){System.err.println("Exception while calling ConvertApi:");e.printStackTrace();}}}
# Load the gemrequire'groupdocs_conversion_cloud'require'common_utilities/Utils.rb'classWorking_With_Conversionsdefself.Conversion_Ruby_Convert_To_Words()# Getting instance of the APIapi=Common_Utilities.Get_ConvertApi_Instance()$settings=GroupDocsConversionCloud::ConvertSettings.new()$settings.storage_name=$myStorage;$settings.file_path="converted/topdf/password-protected.pdf"$settings.format="docx"$loadOptions=GroupDocsConversionCloud::PdfLoadOptions.new()$loadOptions.password="password"$loadOptions.hide_pdf_annotations=true$loadOptions.remove_embedded_files=false$loadOptions.flatten_all_fields=true$settings.load_options=$loadOptions$convertOptions=GroupDocsConversionCloud::DocxConvertOptions.new()$convertOptions.from_page=1$convertOptions.pages_count=1$settings.convert_options=$convertOptions$settings.output_path="converted/todocx"$request=GroupDocsConversionCloud::ConvertDocumentRequest.new($settings)$response=api.convert_document($request)puts("Document converted successfully: "+($response).to_s)endend
# Import modulesimportgroupdocs_conversion_cloudfromCommon_Utilities.UtilsimportCommon_UtilitiesclassConversion_Python_Convert_To_Words:@classmethoddefRun(self):# Create instance of the APIapi=Common_Utilities.Get_ConvertApi_Instance()try:settings=groupdocs_conversion_cloud.ConvertSettings()settings.storage_name=Common_Utilities.myStorage;settings.file_path="converted/topdf/password-protected.pdf"settings.format="docx"loadOptions=groupdocs_conversion_cloud.PdfLoadOptions()loadOptions.password="password"loadOptions.hide_pdf_annotations=TrueloadOptions.remove_embedded_files=FalseloadOptions.flatten_all_fields=Truesettings.load_options=loadOptionsconvertOptions=groupdocs_conversion_cloud.DocxConvertOptions()convertOptions.from_page=1convertOptions.pages_count=1settings.convert_options=convertOptionssettings.output_path="converted\\todocx"request=groupdocs_conversion_cloud.ConvertDocumentRequest(settings)response=api.convert_document(request)print("Document converted successfully: "+str(response))exceptgroupdocs_conversion_cloud.ApiExceptionase:print("Exception while calling API: {0}".format(e.message))
// For complete examples and data files, please go to https://github.com/groupdocs-conversion-cloud/groupdocs-conversion-cloud-go-samples
packageconvertimport("fmt""os""github.com/groupdocs-conversion-cloud/groupdocs-conversion-cloud-go-samples/config""github.com/groupdocs-conversion-cloud/groupdocs-conversion-cloud-go/models")funcConvertToWord(){settings:=models.ConvertSettings{Format:"docx",FilePath:"Pdf/sample.pdf",OutputPath:"converted",}result,_,err:=config.Client.ConvertApi.ConvertDocument(config.Ctx,settings)iferr!=nil{fmt.Printf("ConvertToWord error: %v\n",err)return}}
Convert to Word Processing Document Formats with Stream Output
You can convert the supported document formats to Word Processing Document Formats and get the output as stream.
Resource
HTTP POST ~/conversion
Swagger UI lets you call this REST API directly from the browser.
The API is completely independent of your operating system, database system or development language. We provide and support API SDKs in many development languages in order to make it even easier to integrate. You can see our available SDKs list here.
Convert to Word Processing Document Formats with Stream Output
usingSystem;usingSystem.Collections.Generic;usingSystem.IO;usingGroupDocs.Conversion.Cloud.Sdk.Api;usingGroupDocs.Conversion.Cloud.Sdk.Client;usingGroupDocs.Conversion.Cloud.Sdk.Model;usingGroupDocs.Conversion.Cloud.Sdk.Model.Requests;namespaceGroupDocs.Conversion.Cloud.Examples.CSharp{// Convert to Words with load and save options with output as iostreamclassConvert_To_Words_Stream{publicstaticvoidRun(){varconfiguration=newConfiguration(Common.MyAppSid,Common.MyAppKey);varapiInstance=newConvertApi(configuration);try{// convert settingsvarsettings=newConvertSettings{StorageName=Common.MyStorage,FilePath="conversions/sample.pdf",Format="docx",LoadOptions=newPdfLoadOptions(){Password="",HidePdfAnnotations=true,RemoveEmbeddedFiles=false,FlattenAllFields=true},ConvertOptions=newDocxConvertOptions(){FromPage=1,PagesCount=2,Zoom=100,Dpi=300},OutputPath=null// set OutputPath as null will result the output as document IOStream};// convert to specified formatStreamresponse=apiInstance.ConvertDocumentDownload(newConvertDocumentRequest(settings));Console.WriteLine("Document conveted successfully: "+response.Length.ToString());}catch(Exceptione){Console.WriteLine("Exception when calling ConvertApi: "+e.Message);}}}}
packageexamples.Working_With_Conversions;importcom.groupdocs.cloud.conversion.api.*;importcom.groupdocs.cloud.conversion.client.ApiException;importcom.groupdocs.cloud.conversion.model.*;importcom.groupdocs.cloud.conversion.model.requests.*;importexamples.Utils;importjava.util.stream.*;publicclassConversion_Java_Convert_To_Words_Stream{publicstaticvoidmain(String[]args){ConvertApiapiInstance=newConvertApi(Utils.AppSID,Utils.AppKey);try{ConvertSettingssettings=newConvertSettings();settings.setStorageName(Utils.MYStorage);settings.setFilePath("conversions\\sample.pdf");settings.setFormat("docx");PdfLoadOptionsloadOptions=newPdfLoadOptions();loadOptions.setPassword("");loadOptions.setHidePdfAnnotations(true);loadOptions.setRemoveEmbeddedFiles(false);loadOptions.setFlattenAllFields(true);settings.setLoadOptions(loadOptions);DocxConvertOptionsconvertOptions=newDocxConvertOptions();convertOptions.setFromPage(1);convertOptions.setPagesCount(2);convertOptions.setZoom(100);convertOptions.setDpi(300.0);settings.setConvertOptions(convertOptions);// set OutputPath as empty will result the output as document IOStream
settings.setOutputPath("");// convert to specified format
Streamresponse=apiInstance.convertDocument(newConvertDocumentRequest(convertSettings));System.out.println("Document converted successfully: "+response);}catch(ApiExceptione){System.err.println("Exception while calling ConvertApi:");e.printStackTrace();}}}
<?phpinclude(dirname(__DIR__).'\CommonUtils.php');$convertApi=CommonUtils::GetConvertApiInstance();try{$settings=newGroupDocs\Conversion\Model\ConvertSettings();$settings->setStorageName(CommonUtils::$MyStorage);$settings->setFilePath("conversions\\sample.pdf");$settings->setFormat("docx");$loadOptions=newGroupDocs\Conversion\Model\PdfLoadOptions();$loadOptions->setPassword("");$loadOptions->setHidePdfAnnotations(true);$loadOptions->setRemoveEmbeddedFiles(false);$loadOptions->setFlattenAllFields(true);$settings->setLoadOptions($loadOptions);$convertOptions=newGroupDocs\Conversion\Model\DocxConvertOptions();$convertOptions->setFromPage(1);$convertOptions->setPagesCount(2);$convertOptions->setZoom(100);$convertOptions->setDpi(300.0);$settings->setConvertOptions($convertOptions);// set OutputPath as empty will result the output as document Stream'
$settings->setOutputPath("");$request=newGroupDocs\Conversion\Model\Requests\ConvertDocumentRequest($settings);$response=$convertApi->convertDocumentDownload($request);echo"Document converted successfully: Document Size: ",$response->getSize();}catch(Exception$e){echo"Something went wrong: ",$e->getMessage(),"<br />";PHP_EOL;}?>
# Load the gemrequire'groupdocs_conversion_cloud'require'common_utilities/Utils.rb'classWorking_With_Conversionsdefself.Conversion_Ruby_Convert_To_Words_Stream()# Getting instance of the APIapi=Common_Utilities.Get_ConvertApi_Instance()$settings=GroupDocsConversionCloud::ConvertSettings.new()$settings.storage_name=$myStorage;$settings.file_path="converted/topdf/password-protected.pdf"$settings.format="docx"$loadOptions=GroupDocsConversionCloud::PdfLoadOptions.new()$loadOptions.password="password"$loadOptions.hide_pdf_annotations=true$loadOptions.remove_embedded_files=false$loadOptions.flatten_all_fields=true$settings.load_options=$loadOptions$convertOptions=GroupDocsConversionCloud::DocxConvertOptions.new()$convertOptions.from_page=1$convertOptions.pages_count=1$settings.convert_options=$convertOptions# leave OutputPath will result the output as document IOStream$request=GroupDocsConversionCloud::ConvertDocumentRequest.new($settings)$response=api.convert_document($request)puts("Document converted successfully: "+($response.length).to_s)endend
"use strict";classConversion_Node_Convert_To_Words_Stream{staticRun(){varsettings=newgroupdocs_conversion_cloud_1.ConvertSettings();settings.storageName=myStorage;settings.filePath="converted/topdf/password-protected.pdf";settings.format="docx";varloadOptions=newgroupdocs_conversion_cloud_1.PdfLoadOptions();loadOptions.password="password";loadOptions.hidePdfAnnotations=true;loadOptions.removeEmbeddedFiles=false;loadOptions.flattenAllFields=true;settings.loadOptions=loadOptions;varconvertOptions=newgroupdocs_conversion_cloud_1.DocxConvertOptions();convertOptions.fromPage=1;convertOptions.pagesCount=1;settings.convertOptions=convertOptions;settings.outputPath=null;// set OutputPath as null will result the output as document IOStream
varrequest=newgroupdocs_conversion_cloud_1.ConvertDocumentRequest(settings);convertApi.convertDocumentDownload(request).then(function(response){console.log("Document converted successfully: "+response.length);}).catch(function(error){console.log("Error: "+error.message);});}}module.exports=Conversion_Node_Convert_To_Words_Stream;
# Import modulesimportgroupdocs_conversion_cloudfromCommon_Utilities.UtilsimportCommon_UtilitiesclassConversion_Python_Convert_To_Words_Stream:@classmethoddefRun(self):# Create instance of the APIapi=Common_Utilities.Get_ConvertApi_Instance()try:settings=groupdocs_conversion_cloud.ConvertSettings()settings.storage_name=Common_Utilities.myStorage;settings.file_path="converted/topdf/password-protected.pdf"settings.format="docx"loadOptions=groupdocs_conversion_cloud.PdfLoadOptions()loadOptions.password="password"loadOptions.hide_pdf_annotations=TrueloadOptions.remove_embedded_files=FalseloadOptions.flatten_all_fields=Truesettings.load_options=loadOptionsconvertOptions=groupdocs_conversion_cloud.DocxConvertOptions()convertOptions.from_page=1convertOptions.pages_count=1settings.convert_options=convertOptionssettings.output_path=None# leave OutputPath will result the output as document IOStreamrequest=groupdocs_conversion_cloud.ConvertDocumentRequest(settings)response=api.convert_document_download(request)print("Document converted successfully: "+str(len(response)))exceptgroupdocs_conversion_cloud.ApiExceptionase:print("Exception while calling API: {0}".format(e.message))
// For complete examples and data files, please go to https://github.com/groupdocs-conversion-cloud/groupdocs-conversion-cloud-go-samples
packageconvertimport("fmt""os""github.com/groupdocs-conversion-cloud/groupdocs-conversion-cloud-go-samples/config""github.com/groupdocs-conversion-cloud/groupdocs-conversion-cloud-go/models")funcConvertToWord(){settings:=models.ConvertSettings{Format:"docx",FilePath:"Pdf/sample.pdf",}result,_,err:=config.Client.ConvertApi.ConvertDocument(config.Ctx,settings)iferr!=nil{fmt.Printf("ConvertToWord error: %v\n",err)return}// Get file info
fileInfo,errInfo:=result.Stat()iferrInfo!=nil{t.Error(errInfo)}// Get the size of the file
fileSize:=fileInfo.Size()}
Convert to WordProcessing with Advanced Options
This example demonstrates how to convert pdf documents into word processing documents with advanced conversion options.
There are steps that usage of GroupDocs.Conversion Cloud consists of:
Step 3 is not needed if the “OutputPath” option is not provided: the convert API method will return the converted document in the response body.
Resource
HTTP POST ~/conversion
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': 'Pdf/sample.pdf',
'Format': 'docx',
'ConvertOptions': {
'FromPage': 1,
'PagesCount': 2
},
'OutputPath': 'Output'
}"
The API is completely independent of your operating system, database system or development language. We provide and support API SDKs in many development languages in order to make it even easier to integrate. You can see our available SDKs list here.
// For complete examples and data files, please go to https://github.com/groupdocs-conversion-cloud/groupdocs-conversion-cloud-dotnet-samplesstringMyAppKey="";// Get AppKey and AppSID from https://dashboard.groupdocs.cloudstringMyAppSid="";// Get AppKey and AppSID from https://dashboard.groupdocs.cloudvarconfiguration=newConfiguration(MyAppSid,MyAppKey);// Create necessary API instancesvarapiInstance=newConvertApi(configuration);// Prepare convert settingsvarsettings=newConvertSettings{FilePath="Pdf/sample.pdf",Format="docx",LoadOptions=newPdfLoadOptions{Password="",HidePdfAnnotations=true,RemoveEmbeddedFiles=false,FlattenAllFields=true},ConvertOptions=newDocxConvertOptions(),OutputPath="converted"};// Convert to specified formatvarresponse=apiInstance.ConvertDocument(newConvertDocumentRequest(settings));
// For complete examples and data files, please go to https://github.com/groupdocs-conversion-cloud/groupdocs-conversion-cloud-java-samples
StringMyAppKey="";// Get AppKey and AppSID from https://dashboard.groupdocs.cloud
StringMyAppSid="";// Get AppKey and AppSID from https://dashboard.groupdocs.cloud
Configurationconfiguration=newConfiguration(MyAppSid,MyAppKey);// Create API instance
ConvertApiapiInstance=newConvertApi(configuration);// Prepare convert settings
ConvertSettingssettings=newConvertSettings();settings.setFilePath("Pdf/sample.pdf");settings.setFormat("docx");PdfLoadOptionsloadOptions=newPdfLoadOptions();loadOptions.setPassword("");loadOptions.setHidePdfAnnotations(true);loadOptions.setRemoveEmbeddedFiles(false);loadOptions.setFlattenAllFields(true);settings.setLoadOptions(loadOptions);settings.setConvertOptions(newDocxConvertOptions());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;$AppSid="";// Get AppKey and AppSID from https://dashboard.groupdocs.cloud
$AppKey="";// Get AppKey and AppSID from https://dashboard.groupdocs.cloud
$configuration=newGroupDocs\Conversion\Configuration();$configuration->setAppSid($AppSid);$configuration->setAppKey($AppKey);$apiInstance=newGroupDocs\Conversion\ConvertApi($configuration);// Prepare convert settings
$settings=newModel\ConvertSettings();$settings->setFilePath("Pdf/sample.pdf");$settings->setFormat("docx");$loadOptions=newModel\PdfLoadOptions();$loadOptions->setPassword("");$loadOptions->setHidePdfAnnotations(true);$loadOptions->setRemoveEmbeddedFiles(false);$loadOptions->setFlattenAllFields(true);$settings->setLoadOptions($loadOptions);$settings->setConvertOptions(newModel\DocxConvertOptions());$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-ruby-samplesrequire'groupdocs_conversion_cloud'$app_sid="XXXX-XXXX-XXXX-XXXX"# Get AppKey and AppSID from https://dashboard.groupdocs.cloud$app_key="XXXXXXXXXXXXXXXX"# Get AppKey and AppSID from https://dashboard.groupdocs.cloud# Create necessary API instancesapiInstance=GroupDocsConversionCloud::ConvertApi.from_keys($app_sid,$app_key)# Prepare convert settingssettings=GroupDocsConversionCloud::ConvertSettings.newsettings.file_path="Pdf/sample.pdf"settings.format="docx"loadOptions=GroupDocsConversionCloud::PdfLoadOptions.newloadOptions.password=""loadOptions.hide_pdf_annotations=trueloadOptions.remove_embedded_files=falseloadOptions.flatten_all_fields=truesettings.load_options=loadOptionssettings.convert_options=GroupDocsConversionCloud::DocxConvertOptions.newsettings.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-node-samples
global.conversion_cloud=require("groupdocs-conversion-cloud");global.appSid="XXXX-XXXX-XXXX-XXXX";// Get AppKey and AppSID from https://dashboard.groupdocs.cloud
global.appKey="XXXXXXXXXXXXXXXX";// Get AppKey and AppSID from https://dashboard.groupdocs.cloud
global.convertApi=conversion_cloud.ConvertApi.fromKeys(appSid,appKey);letsettings=newconversion_cloud.ConvertSettings();settings.filePath="Pdf/sample.pdf";settings.format="docx";letloadOptions=newconversion_cloud.PdfLoadOptions();loadOptions.password="";loadOptions.hidePdfAnnotations=true;loadOptions.removeEmbeddedFiles=false;loadOptions.flattenAllFields=true;settings.loadOptions=loadOptions;settings.convertOptions=newconversion_cloud.DocxConvertOptions();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_cloudapp_sid="XXXX-XXXX-XXXX-XXXX"# Get AppKey and AppSID from https://dashboard.groupdocs.cloudapp_key="XXXXXXXXXXXXXXXX"# Get AppKey and AppSID from https://dashboard.groupdocs.cloud# Create necessary API instancesapiInstance=groupdocs_conversion_cloud.ConvertApi.from_keys(Common.app_sid,Common.app_key)# Prepare convert settingssettings=groupdocs_conversion_cloud.ConvertSettings()settings.file_path="Pdf/sample.pdf"settings.format="docx"loadOptions=groupdocs_conversion_cloud.PdfLoadOptions()loadOptions.password=""loadOptions.hide_pdf_annotations=TrueloadOptions.remove_embedded_files=FalseloadOptions.flatten_all_fields=Truesettings.load_options=loadOptionssettings.convert_options=groupdocs_conversion_cloud.DocxConvertOptions()settings.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-go-samples
packageconvertimport("fmt""github.com/groupdocs-conversion-cloud/groupdocs-conversion-cloud-go-samples/config""github.com/groupdocs-conversion-cloud/groupdocs-conversion-cloud-go/models")funcConvertToWordProcessing(){settings:=models.ConvertSettings{Format:"docx",FilePath:"Pdf/sample.pdf",OutputPath:"converted",LoadOptions:&models.PdfLoadOptions{HidePdfAnnotations:true,RemoveEmbeddedFiles:false,FlattenAllFields:true,},ConvertOptions:&models.WordProcessingConvertOptions{},}result,_,err:=config.Client.ConvertApi.ConvertDocument(config.Ctx,settings)iferr!=nil{fmt.Printf("ConvertToWordProcessing 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.