C#代码示例
1.Word转PDF
usingSystem;usingSpire.Cloud.Word.Sdk.Client;usingSpire.Cloud.Word.Sdk.Api;namespaceWordToPDF
{classProgram
{staticStringappId=”AppID”;staticStringappKey=”AppKey”;staticvoidMain(string[]args)
{//装备AppID和AppKeyConfigurationconfiguration=newConfiguration(appId,appKey);//初始化ConvertApi方针ConvertApiconvertApi=newConvertApi(configuration);stringname=”Sample.docx”;//源文档stringformat=”pdf”;//转化的方针文档格局stringpassword=null;//源文档stringfolder=”input”;//源文档所在文件夹,假如没有文件夹则为nullstringstorage=null;//运用冰蓝云装备的2G空间存贮文档,可设置为nullstringdestFilePath=”output/WordToPDF.pdf”;//成果文档途径(成果文档保存在output文件夹下)//调用办法将Word转为PDFconvertApi.ConvertDocument(name,format,password,folder,storage,destFilePath);

}
}
}
2.Word转XPS
usingSystem;usingSpire.Cloud.Word.Sdk.Api;usingSpire.Cloud.Word.Sdk.Client;namespaceWordToXPS
{classProgram
{staticStringappId=”AppID”;staticStringappKey=”APPKey”;staticvoidMain(string[]args)
{//装备AppID和AppKeyConfigurationconfiguration=newConfiguration(appId,appKey);//初始化ConvertApi方针ConvertApiconvertApi=newConvertApi(configuration);stringname=”Sample.docx”;//源文档stringformat=”xps”;//转化的方针文档格局stringpassword=null;//源文档暗码stringfolder=”input”;//源文档的文件夹,假如没有文件夹则为nullstringstorage=null;//运用冰蓝云装备的2G空间存贮文档,可设置为nullstringdestFilePath=”output/WordToXPS.xps”;//成果文档途径及称号(成果文档保存在output文件夹下)//调用办法将Word转为XPSconvertApi.ConvertDocument(name,format,password,folder,storage,destFilePath);
}
}
}
3.Word转Epub
usingSystem;usingSpire.Cloud.Word.Sdk.Api;usingSpire.Cloud.Word.Sdk.Client;namespaceWordToEpub
{classProgram
{staticStringappId=”AppID”;staticStringappKey=”AppKey”;staticvoidMain(string[]args)
{//装备AppID和AppKeyConfigurationconfiguration=newConfiguration(appId,appKey);//初始化ConvertApi方针ConvertApiconvertApi=newConvertApi(configuration);stringname=”Sample.docx”;//源文档stringformat=”epub”;//转化的方针文档格局stringpassword=null;//源文档暗码stringfolder=”input”;//源文档的文件夹,假如没有文件夹则为nullstringstorage=null;//运用冰蓝云装备的2G空间存贮文档,可设置为nullstringdestFilePath=”output/WordToEpub.epub”;//成果文档途径及称号(成果文档保存在output文件夹下)//调用办法将Word转为EpubconvertApi.ConvertDocument(name,format,password,folder,storage,destFilePath);
}
}
}
4.Word转RTF
usingSystem;usingSpire.Cloud.Word.Sdk.Client;usingSpire.Cloud.Word.Sdk.Api;namespaceWordToRTF
{classProgram
{staticStringappId=”AppID”;staticStringappKey=”AppKey”;staticvoidMain(string[]args)
{//装备AppID和AppKeyConfigurationconfiguration=newConfiguration(appId,appKey);//初始化ConvertApi方针ConvertApiconvertApi=newConvertApi(configuration);stringname=”Sample.docx”;//源文档stringformat=”rtf”;//转化的方针文档格局stringpassword=null;//源文档暗码stringfolder=”input”;//源文档的文件夹,假如没有文件夹则为nullstringstorage=null;//运用冰蓝云装备的2G空间存贮文档,可设置为nullstringdestFilePath=”output/WordToRTF.rtf”;//成果文档途径及称号(成果文档保存在output文件夹下)//调用办法将Word转为RTFconvertApi.ConvertDocument(name,format,password,folder,storage,destFilePath);
}
}
}
5.Docx转Doc
usingSystem;usingSpire.Cloud.Word.Sdk.Client;usingSpire.Cloud.Word.Sdk.Api;namespaceDocxToDoc
{classProgram
{staticStringappId=”AppID”;staticStringappKey=”APPKey”;staticvoidMain(string[]args)
{//装备AppID和AppKeyConfigurationconfiguration=newConfiguration(appId,appKey);//初始化ConvertApi方针ConvertApiconvertApi=newConvertApi(configuration);stringname=”Sample.docx”;//源文档stringformat=”doc”;//转化的方针文档格局stringpassword=null;//源文档暗码stringfolder=”input”;//源文档的文件夹,假如没有文件夹则为nullstringstorage=null;//运用冰蓝云装备的2G空间存贮文档,可设置为nullstringdestFilePath=”output/DocxToDoc.doc”;//成果文档途径及称号(成果文档保存在output文件夹下)//调用办法将Docx转为DocconvertApi.ConvertDocument(name,format,password,folder,storage,destFilePath);
}
}
}

1、IT大王遵守相关法律法规,由于本站资源全部来源于网络程序/投稿,故资源量太大无法一一准确核实资源侵权的真实性;
2、出于传递信息之目的,故IT大王可能会误刊发损害或影响您的合法权益,请您积极与我们联系处理(所有内容不代表本站观点与立场);
3、因时间、精力有限,我们无法一一核实每一条消息的真实性,但我们会在发布之前尽最大努力来核实这些信息;
4、无论出于何种目的要求本站删除内容,您均需要提供根据国家版权局发布的示范格式
《要求删除或断开链接侵权网络内容的通知》:https://itdw.cn/ziliao/sfgs.pdf,
国家知识产权局《要求删除或断开链接侵权网络内容的通知》填写说明: http://www.ncac.gov.cn/chinacopyright/contents/12227/342400.shtml
未按照国家知识产权局格式通知一律不予处理;请按照此通知格式填写发至本站的邮箱 wl6@163.com