Open chiyan171 opened 5 years ago
@chiyan171, Please try using below code snippet in your environment and then share your kind feedback with us.
Document doc = new Document(path); DocSaveOptions saveOptions = new DocSaveOptions(); saveOptions.setFormat(SaveFormat.Doc); doc.save("sd卡路径 + "/aspose_output.doc");
In case the problem persists then share your sample file with us so that we may investigate further to help you out.
PS: I work with Aspose as Developer Evangelist.
您好,非常感谢贵方给予及时的回复;但是目前仍然存在问题:
开发环境:Android Studio;aspose-pdf-18.6-android.via.java.jar;Aspose.Pdf.lic; 执行Code:
String inputPath = (String) event.getEvent();
InputStream inputStream = null;
try {
inputStream = getContext().getAssets().open("Aspose.Pdf.lic");
License license = new License();
license.setLicense(inputStream);
if (Document.isLicensed()) {
Document doc = new Document(inputPath);
DocSaveOptions saveOptions = new DocSaveOptions();
saveOptions.setFormat(SaveFormat.DocX);
File outFile = new File(PathManager.getInstance().getSDCardPathByEnvironment(), "aspose_output.docx");
doc.save(outFile.getAbsolutePath());
}
} catch (Exception e) {
e.printStackTrace();
} finally {
CloseUtils.closeIO(inputStream);
}
目前只测试了PDF-> DOC,DOCX的两种格式转换,结果成功并输出目标文档到制定目录; 但是生成的文档,不兼容Microsoft doc,打开的文档内容全部乱码;
希望贵方能解决予以回复;或者可以提供贵方邮箱,我把测试文档&结果文档已邮件的方式发送给贵方;谢谢
我们很高兴知道您能够转换文件。 请将源文件和生成的文件发送至farhan.raza@aspose.com,以便我们进一步帮助您。
但是实际在转档的过程中,错误提示不支持: class com.aspose.pdf.internal.ms.System.ArgumentException: Save a document to a doc format is not supported.
核心code:
jar版本信息: aspose-pdf-18.6-android.via.java.jar
希望贵方能确认,并尽快回复。 是否Android支持贵方列出来的所有格式。 邮箱联系方式:1627524135@qq.com