when we use aspose.cells,we have some problems:
License license = new License();
license.setLicense(“C:\Users\Lixp\Desktop\Aspose.Total.Java.lic”);
Workbook workbook = new Workbook(new FileInputStream(
“C:\Users\Lixp\Desktop\xlsx.xlsx”));
HtmlSaveOptions saveOptions = new HtmlSaveOptions();
saveOptions.setAttachedFilesDirectory(“test”);//doesn’t work
// saveOptions.setAttachedFilesDirectory(“C:\Users\Lixp\Desktop\test”);
saveOptions.setCreateDirectory(true);//doesn’t work too
saveOptions.setAttachedFilesUrlPrefix(“test”);///doesn’t work too
workbook.save(new FileOutputStream(“C:\Users\Lixp\Desktop\16.html”),saveOptions);
it cann’t generate attach files
it works well if only i save(“C:\Users\Lixp\Desktop\16.html”,saveOption),
but our api only supply OutputStream to Aspose Convertion client.
Hi,
We used Aspose.Cells for Java v8.1.0.We have purchased Aspose.Total for Java.Can we use the license in 8.2.2.1?
Maybe you didn’t know what i mean.I means that when we use save(String,SaveOptions),eg,save(“C:\Users\Lixp\Desktop\xlsx.html”,new HtmlSaveOptions()),we can generate xlsx.html and (xlsx_files folder and the files in it).But when we use save(OutputStream,SaveOptions),we get only xlsx.html. and We also want to control the xlsx_files’s folder name.How to do?
Hi,
License license = new License();
license.setLicense(“C:\Users\Lixp\Desktop\Aspose.Total.Java.lic”);
Workbook workbook = new Workbook(new FileInputStream(
“C:\Users\Lixp\Desktop\xlsx.xlsx”));
FileOutputStream fOutputStream = new FileOutputStream(
“C:\Users\Lixp\Desktop\xlsx.html”);
HtmlSaveOptions saveOptions = new HtmlSaveOptions();
final String resourceFolder = “C:\Users\Lixp\Desktop\xlsx_files”;
saveOptions.setAttachedFilesUrlPrefix(“test”);
saveOptions.setAttachedFilesDirectory(resourceFolder);
saveOptions.setExportActiveWorksheetOnly(false);
saveOptions.setStreamProvider(new IStreamProvider() {
@Override
public void initStream(StreamProviderOptions providerOptions)
throws Exception {
// providerOptions.getDefaultPath()//here null(resourceName),
String customPath = resourceFolder
+ providerOptions.getDefaultPath().replace(“null”, “”);
File customFile = new File(customPath);
if (!customFile.getParentFile().exists()) {
customFile.getParentFile().mkdirs();
}
providerOptions.setCustomPath(customFile.getCanonicalPath());
providerOptions.setStream(new FileOutputStream(customFile));
}
@Override
public void closeStream(StreamProviderOptions providerOptions)
throws Exception {
OutputStream outputStream = null;
try {
outputStream = providerOptions.getStream();
} catch (Exception e) {
e.printStackTrace();
} finally {
if (outputStream != null) {
outputStream.close();
}
}
}
});
workbook.save(fOutputStream, saveOptions);
html source code:
so we cann’t view it.we want to control resource uri,how to do? because we want to view them on webapplication.
and also we want to control all html conversion’s resource uri.we mean that we can control all resource uri by a parameter.
Hi,