没有找到合适的产品?
联系客服协助选型:023-68661681
提供3000多款全球软件/控件产品
针对软件研发的各个阶段提供专业培训与技术咨询
根据客户需求提供定制化的软件开发服务
全球知名设计软件,显著提升设计质量
打造以经营为中心,实现生产过程透明化管理
帮助企业合理产能分配,提高资源利用率
快速打造数字化生产线,实现全流程追溯
生产过程精准追溯,满足企业合规要求
以六西格玛为理论基础,实现产品质量全数字化管理
通过大屏电子看板,实现车间透明化管理
对设备进行全生命周期管理,提高设备综合利用率
实现设备数据的实时采集与监控
利用数字化技术提升油气勘探的效率和成功率
钻井计划优化、实时监控和风险评估
提供业务洞察与决策支持实现数据驱动决策
原创|使用教程|编辑:李显亮|2020-12-24 11:05:13.657|阅读 1124 次
概述:Spire系列文档处理API是国产开发工具中功能可媲美Aspose的强大控件,帮助开发者轻松将文档功能集成到应用程序中。年终福利,小编为您倾情献上Spire.DOC在Java中格式转换的示例教程,记得收藏哦!
# 界面/图表报表/文档/IDE等千款热门软控件火热销售中 >>
将文档从一种格式转换为另一种格式是Spire.DOC的主要功能之一。这种转换只不过是加载和保存操作的组合。因此,使用Spire.DOC可以将文档从任何受支持的加载格式转换为任何受支持的保存格式。
本文整理了包括在Java中以下文件格式的转换指南,希望对您有所帮助:
>>你可以点击这里下载Spire.DOC for Java测试体验。
//create a Document object Document doc = new Document(); //load a Word file doc.loadFromFile("C:\\Users\\Administrator\\Desktop\\sample.docx"); //loop through the pages for (int i = 0; i < doc.getPageCount(); i++) { //save the specific page to a BufferedImage BufferedImage image= doc.saveToImages(i, ImageType.Bitmap); //write the image data to a .png file File file = new File( "output/" + String.format(("Img-%d.png"), i)); ImageIO.write(image, "PNG", file); }
import com.spire.doc.Document; import com.spire.doc.FileFormat; import com.spire.doc.ToPdfParameterList; public class WordToPDF { public static void main(String[] args) { //Create Document object Document doc = new Document(); //Load the file from disk. doc.loadFromFile("Sample.docx"); //create an instance of ToPdfParameterList. ToPdfParameterList ppl=new ToPdfParameterList(); //embeds full fonts by default when IsEmbeddedAllFonts is set to true. ppl.isEmbeddedAllFonts(true); //set setDisableLink to true to remove the hyperlink effect for the result PDF page. //set setDisableLink to false to preserve the hyperlink effect for the result PDF page. ppl.setDisableLink(true); //Set the output image quality as 40% of the original image. 80% is the default setting. doc.setJPEGQuality(40); //Save to file. doc.saveToFile("output/ToPDF.pdf",FileFormat.PDF); } }
import com.spire.doc.*; import com.spire.doc.documents.XHTMLValidationType; public class htmlFileToWord { public static void main(String[] args) throws Exception { // Load the sample HTML file Document document = new Document(); document.loadFromFile("InputHtmlFile.html", FileFormat.Html, XHTMLValidationType.None); //Save to file document.saveToFile("Result.pdf",FileFormat.PDF); } }如果您有任何疑问或需求,请随时,我们很高兴为您提供查询和咨询。
本站文章除注明转载外,均为本站原创或翻译。欢迎任何形式的转载,但请务必注明出处、不得修改原文相关链接,如果存在内容上的异议请邮件反馈至chenjj@atlvshi.cn
本文介绍了在使用 IntelliJ IDEA 进行 Java 数据库开发时,提升效率的 9 种实用技巧,包括自动创建数据源、测试 JPA 查询、可视化数据库结构、优化查询性能、数据库迁移及 AI 助手等功能,助力开发者提高工作效率。
Compose Multiplatform没有 Web 视图组件, JxBrowser 8.0.0是 Compose Multiplatform 的第一个适用于所有桌面平台的 Web 视图组件。
在当今的数字环境中,将 PDF 转换为 EPUB 至关重要。在这篇博文中,我们将探讨如何在 C# 中将 PDF 转换为 EPUB。
Aspose.Words 推出了一项新功能来提高文档质量:人工智能语法检查。通过集成OpenAI生成模型,用户现在可以轻松识别和纠正文档中的语法错误。
Spire.Doc for Java是Java Word组件,具有生成、读取、转换Word文档等功能
服务电话
重庆/ 023-68661681
华东/ 13452821722
华南/ 18100878085
华北/ 17347785263
客户支持
技术支持咨询服务
服务热线:400-700-1020
邮箱:sales@atlvshi.cn
关注我们
地址 : 重庆市九龙坡区火炬大道69号6幢