aspose转换xlsx and doc and docx to pdf去水印无页数限制

Aspose实现word、excel、ppt转pdf 1. 工具类 AsposeUtil public class AsposeUtil { private static final String[] WORD = {"doc", "docx", "wps", "wpt", "txt"}; private static final String[] EXCEL = {"xls", "xlsx", "et", "xlsm"}; private static final String[] PPT = {"ppt", "pptx"}; 阅读详情

aspose转换xlsx and doc and docx and ppt to pdf去水印无页数限制

所需jar包在百度网盘以及蓝奏云 最下边

java转换代码

//pom文件引入
<dependency>
	<groupId>com.aspose</groupId>
	<artifactId>aspose-cells</artifactId>
	<version>21.11</version>
	<scope>system</scope>
	<systemPath>${project.basedir}/src/main/resources/lib/aspose-cells.jar</systemPath>
</dependency>

<dependency>
	<groupId>com.aspose</groupId>
	<artifactId>aspose-words</artifactId>
	<version>21.1.0</version>
	<scope>system</scope>
	<systemPath>${project.basedir}/src/main/resources/lib/aspose-words.jar</systemPath><!-- jar包路径 -->
</dependency>
<dependency>
	<groupId>com.aspose</groupId>
	<artifactId>aspose-slides</artifactId>
	<version>21.10</version>
	<scope>system</scope>
	<systemPath>${project.basedir}/src/main/resources/lib/aspose-slides.jar</systemPath>
</dependency>

导入包
import com.aspose.cells.License;
import com.aspose.cells.PdfSaveOptions;
import com.aspose.cells.Workbook;
import com.aspose.slides.*;
import com.aspose.words.Document;
import com.aspose.words.SaveFormat;
import org.springframework.core.io.support.PathMatchingResourcePatternResolver;
import org.springframework.core.io.support.ResourcePatternResolver;
import org.springframework.util.StringUtils;
import org.springframework.web.multipart.MultipartFile;

import java.io.*;
import java.util.Date;

Java代码

/*
*去水印
*/
public static boolean getLicense() {
	boolean result = false;
	try {
			//ExcelToPdf是工具类名
		InputStream is = ExcelToPdf.class.getClassLoader().getResourceAsStream("license.xml"); //  license.xml应放在..\WebRoot\WEB-INF\classes路径下

		License aposeLic = new License();
		aposeLic.setLicense(is);
		result = true;
	} catch (Exception e) {
		e.printStackTrace();
	}
	return result;
}
/**
 *  xlsx to pdf
 */
public static boolean xlsxToPdf(String excelPath, String pdfPath) {
	try {
		getLicense();
		long old = System.currentTimeMillis();
		Workbook wb = new Workbook(excelPath);
		FileOutputStream fileOS = new FileOutputStream(new File(pdfPath));
		wb.save(fileOS, SaveFormat.PDF);
		fileOS.close();
		long now = System.currentTimeMillis();
		System.out.println("Conversion time: " + ((now - old) / 1000.0) + " seconds");
		return true;
	} catch (Exception e) {
		String errorMessage =  e.getMessage();
		throw new RuntimeException(errorMessage);
	}

}

/**
 * xlsx to pdf
 */
public static String xlsxToPdf(MultipartFile file, String pdfPath) {
	getLicense();
	if (file == null || file.isEmpty()) {
		throw new RuntimeException("Excel文件不能为空");
	}
	try {
		// 创建工作簿以加载Excel文件
		Workbook workbook = new Workbook(file.getInputStream());

		// 创建PDF选项
		PdfSaveOptions options = new PdfSaveOptions();
		options.setOnePagePerSheet(true);


		// 将文档保存为PDF格式
		workbook.save(pdfPath, options);
	} catch (Exception e) {
		e.printStackTrace();
	}

	return pdfPath;
}


/**
 * @param wordPath 需要被转换的word全路径带文件名
 * @param pdfPath 转换之后pdf的全路径带文件名
 */
public static boolean docTopdf(String wordPath, String pdfPath) {
	try {
		getLicense();

			long old = System.currentTimeMillis();
			File file = new File(pdfPath); //新建一个pdf文档
			FileOutputStream os = new FileOutputStream(file);
			Document doc = new Document(wordPath); //Address是将要被转化的word文档
			doc.save(os, SaveFormat.PDF);//全面支持DOC, DOCX, OOXML, RTF HTML, OpenDocument, PDF, EPUB, XPS, SWF 相互转换
			long now = System.currentTimeMillis();
			os.close();
			System.out.println("共耗时:" + ((now - old) / 1000.0) + "秒"); //转化用时
			return true;


	} catch (Exception e) {
		String errorMessage =  e.getMessage();
		throw new RuntimeException(errorMessage);
	}

}

/**
 * doc and docx to pdf
 */
public static String docxToPdf(MultipartFile file, String pdfDir) {
	getLicense();
	if (file == null || file.isEmpty()) {
		throw new RuntimeException("Word文档不能为空");
	}
	if (StringUtils.isEmpty(pdfDir)) {
		throw new RuntimeException("PDF目录不能为空");
	}

	String pdfPath = pdfDir;
	try {
		// 加载Word文档
		Document doc = new Document(file.getInputStream());

		// 将文档保存为PDF格式
		doc.save(pdfPath, SaveFormat.PDF);
	} catch (Exception e) {
		e.printStackTrace();
	}

	return pdfPath;
}


public static boolean getLicensePPT() {
	boolean result = false;
	InputStream is = null;
	try {
		ResourcePatternResolver resolver = new PathMatchingResourcePatternResolver();
		org.springframework.core.io.Resource[] resources = resolver.getResources("classpath:license.xml");
		is = resources[0].getInputStream();
		com.aspose.slides.License aposeLic = new com.aspose.slides.License();
		aposeLic.setLicense(is);
		result = true;
	} catch (Exception e) {
		e.printStackTrace();
	} finally {
		if (is != null) {
			try {
				is.close();
			} catch (IOException e) {
				e.printStackTrace();
			}
		}
	}
	return result;
}

/**
 *ppt路径 to pdf路径
 */
public static boolean ppt2Pdf(String inPath,String outPath){
	try {
		// 验证License 去除水印
		if (!getLicensePPT()) {
			return false;
		}
		long start = new Date().getTime();

		FileInputStream fileInput = new FileInputStream(inPath);
		Presentation pres = new Presentation(fileInput);
		FileOutputStream out = new FileOutputStream(new File(outPath));
		pres.save(out, com.aspose.slides.SaveFormat.Pdf);
		out.close();
		long end = new Date().getTime();
		System.out.println("pdf转换成功,共耗时:" + ((end - start) / 1000.0) + "秒"); // 转化用时
		return true;
	} catch (Exception e) {
		String errorMessage =  e.getMessage();
		throw new RuntimeException(errorMessage);
	}
}
/**
 *ppt路径 to pdf路径
 */
public static boolean ppt2Pdf(MultipartFile inFile, String outPath) {
	try {
		// 验证License 去除水印
		if (!getLicensePPT()) {
			return false;
		}
		long start = new Date().getTime();

		InputStream fileInput = inFile.getInputStream();
		Presentation pres = new Presentation(fileInput);
		FileOutputStream out = new FileOutputStream(new File(outPath));
		pres.save(out, com.aspose.slides.SaveFormat.Pdf);
		out.close();
		long end = new Date().getTime();
		System.out.println("pdf转换成功,共耗时:" + ((end - start) / 1000.0) + "秒"); // 转化用时
		return true;
	} catch (Exception e) {
		String errorMessage = e.getMessage();
		throw new RuntimeException(errorMessage);
	}
}

相关jar包

有什么不了解的可以私信或者评论
**

如果时间过长比较着急可以添加vx获取

**
在这里插入图片描述

aspose-cells-20.7.jar 去除水印及次数限制 复制一个 aspose-cells-20.7.jar 改名为 aspose-cells-20.7-crack.zip 然后解压。防止文件指纹校验,我们需要删除掉源代码解压包中的 META_INF 文件夹。把刚才生成的 License.class 文件 替换到解压的源代码中。启动类中创建一个静态方法 crackAspose。在 main 方法中执行 crackAspose。pom 文件中引用 javassist。压缩源代码(注意要是 zip 格式) 阅读详情

相关推荐

C# Aspose 去除水印 亲测有效!!!(有效测试时间:20220806)

C# Aspose 去除水印 亲测有效

qtwitter的博客 7750

Aspose for Java 去除水印和数量限制

Aspose for Java 去除水印和数量限制

qq_40965901的博客 9527

java aspose文件转化-去水印(保证可用)

1.支持word,txt等文件转化成pdf 2.消除转化pdf水印

Springboot ppt转pdf——aspose方式

Springboot ppt转pdf——aspose方式。

qq_42900469的博客 1323

aspose-cells-8.5.2.jar excel转pdf(无水印)

实现excel转pdf(无水印、无乱码) 提供使用示例

分享aspose 将PDF转WOR for java 去限制页码数量限制与水印版

aspose 交流学习用,请购买正版使用 aspose 将PDF转WOR for java 去限制页码数量限制与水印版

wold,excel,ppt转pdf(Aspose 实现方式)

此处我用到的删除方法为,使用360压缩打开jar包,找到对应的两个文件,右键删除(其他压缩软件未测试,自行尝试即可。运行mian函数,在指定的保存位置会生成目标i文件,并且对应的目录下会出现对应的class文件。进入生成的目标文件所在的文件夹,注意是com文件夹所i在的位置,不是class文件所在的位置。在jar下载完毕后,根据配置的maven仓库的位置寻找对应jar包的绝对路径,用上述命令替换jar包中的文件,注意将jar包的路径替换为自己jar包所在路径。删除jar包中的 如下两个文件。

LXD_CSDN的博客 1567

Aspose破解版excel+word完美转换成pdf

破解版Aspose,excel转pdf没水印,word水印没法去除 ,技术文档+jar包资源都压缩在一起,亲测可用,欢迎下载

aspose for android 水印去除,以及aspose的excel导出pdf中文乱码问题解决

移除android版本的aspose的水印

weixin_47491668的博客 2001

aspose 实现 excle 转换为 pdf 并去水印

aspose.cells-8.5.2.jar + license.xml

【若依(ruoyi)】BootstrapTable列宽定制实战:突破width属性限制的两种方案

本文针对若依(RuoYi)框架中BootstrapTable组件列宽设置失效的常见问题,提供了两种实战解决方案。通过CSS样式覆盖法强制定义列宽,或利用formatter函数进行动态HTML包裹,有效突破width属性限制,实现精准的表格列宽定制。

weixin_29013129的博客 178

PDF转word并去除水印以及处理的页数限制【pdf转word可编辑 百分百还原文件 亲测可用】

PDF转word并去除水印以及处理的页数限制。本次教程操作aspose-pdf-22.10-jdk16.jar的包,对其重编译修改校验权限 使用javassist 重编译(学习测试使用,aspose所有的包都可以用该教程。亲自测试过的

qq_44753710的博客 2524

深入解析BlueZ5与D-Bus:Linux蓝牙开发实战指南

本文深入解析BlueZ5与D-Bus在Linux蓝牙开发中的核心应用,提供从环境搭建到实战开发的完整指南。通过详细代码示例和调试技巧,帮助开发者掌握蓝牙协议栈与D-Bus接口的交互方法,实现高效蓝牙设备管理与GATT服务开发。

weixin_28292761的博客 460

用ASPOSE将PDF转为word(解除页数限制和去水印)

用ASPOSE将PDF转为word(解除页数限制和去水印)

qq_33570164的博客 2237

QDMA工程搭建/windows驱动编译与性能测试

请注意,根据您的目标操作系统,您可能需要在windows启动配置中启用测试签名的驱动程序,以便启用此驱动程序的安装。右键单击设备,选择更新驱动程序软件,然后选择构建的QDMA驱动程序的文件夹(通常为。创建一个新工程,在IP Catalog中搜索QDMA,双击创建qdma ip核。驱动程序安装安装驱动程序最简单的方法是通过Windows的“设备管理器”。如果系统提示未经验证的驱动程序发布者,请选择无论如何安装此驱动程序软件。本节主要介绍QDMA驱动在Windows系统的源文件、编译和安装过程。

qq_28455081的博客 2295

利用GPAC生成MP4文件

GPAC主要针对学生和内容创作者,代表了一个跨平台的多媒体框架,开发人员可以使用它在 LGPL 许可下制作开源媒体。GPAC多媒体框架兼容范围广泛的流行文件类型,从常见格式(如 AVI、MPEG 和 MOV)到复杂格式(如 MPEG-4 系统或 VRML/X3D)和 360 电影。

深之JohnChen的专栏 1777

使用Aspose.Words将word转PDF并且去水印。

使用Java实现Word转PDF。

是江迪呀 的博客 1万+

微信聊天记录数据库解密实战:从WCDB到sqlcipher4的关键步骤解析

本文详细解析了微信桌面版聊天记录数据库的解密实战过程。通过逆向分析,定位了微信从WCDB框架到sqlcipher4加密的关键步骤,并成功提取了数据库密钥。文章重点介绍了如何通过动态调试、字符串定位等方法,追踪并验证sqlcipher4的加密密钥,最终实现对加密数据库文件的解密操作,为安全研究和数据恢复提供了技术参考。

weixin_29322553的博客 1084

aspose-words、itextpdf完美解决java将word、excel、ppt、图片转换为pdf文件

面对日常开发过程中,将各种文件转换为pdf文件的问题,总是让人头疼,这次终于完美解决了!最好的效果无非就是在不限制文件大小、保持文件格式的情况下将文件转换为pdf格式文件,而且转换完成的文件不带水印,这样的效果应该可以满足很多需求了,下面将方法展示给大家供参考。

在路上 7461

nsight-system教程

参考nsight-compute使用教程-CSDN博客。

youzjuer的博客 1897

maya权重拷贝一对一,一对多

是不是有时候盔甲很多很碎头很大,用代理一个个拷贝很麻烦吧 用下面代码直接运行进行一对多或者一对一拷贝 第一个先选择参考物体,加选其他一堆有的没的有权重或没权重的物体执行一键拷贝,就可以啦 以下是源码送上,带走吧 ------------------------ #! -*- coding:utf -8 -*- #author:liubingdong #date:20...

weixin_30852367的博客 1539

ASPOSE 代码分析,去水印,没有限制,无需修改文件

aspose 注册工具类

xie_cc的专栏 8256

高效与灵活相结合:Verilog编写的跨时钟域循环缓冲控制器解析

循环缓冲区,也被称作循环队列、环形缓冲区,是一种数据结构,其主要特性是使用一个固定大小的缓冲区作为数据的存储空间,这个缓冲区在逻辑上被视作是首尾相接的。虽然Verilog是一种常用的硬件描述语言,被广泛应用在FPGA和ASIC设计中,但是在描述循环缓冲区时,它并没有提供一种直接且灵活的方式来指定循环缓冲区的参数,如字长、缓冲区深度、缓冲区数量等。这给硬件设计带来了一定的不便。同时,该控制器的设计也充分考虑了硬件资源的利用率,通过优化的算法和数据结构,使得在实现高性能的同时,也能够有效地节省硬件资源。

qq_38334677的博客 1223

Aspose将doc,ppt转成pdf

将windows系统下的字体目录下所有的字体文件 C:\Windows\Fonts\。3.centos7系统下,需要拷贝字体文件到指定目录。2.license.xml文件。1.需要引入的jar包。

卷土的博客 959

文档:亲测可用解决vnc灰屏,黑屏,鼠标大黑叉情况

主要解决vnc-viewer灰屏,黑屏,鼠标大黑叉等现象,详细见文档。

Devexpress16.2.6破解工具

Devexpress16.2.6破解工具Devexpress16.2.6破解工具Devexpress16.2.6破解工具Devexpress16.2.6破解工具

上一篇: liunx通过tomcat部署war项目,win使用tomcat启动war,idea通过tomcat启动
下一篇: java使用aspose在ppt生成table表格
李某海
博客等级 码龄6年 130粉丝 11原创
评论 26
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

李某海

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值