We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

This code works on my computer, but nothing happens on the server

public static void main(String[] args) throws Exception {
        log.info("准备处理...");
        String inputFileName = Paths.get("").toString();
        final Document document = new Document(inputFileName);
        log.info("读取文件完毕...");
        final com.aspose.words.ImageSaveOptions options = new com.aspose.words.ImageSaveOptions(
                com.aspose.words.SaveFormat.JPEG);
        options.setImageBrightness(0.7f);
        options.setImageContrast(0.7f);
        log.info("document size:"+document.getPageCount());
        for (int i = 0; i < document.getPageCount(); i++) {
            options.setPageSet(new PageSet(i));
            final Instant now = Instant.now();
            document.save("aaa.jpg",options);
        }
    }

ppt, pdf, excel to pictures all work very well, but the words are not good, I am very abnormal, the code seems to be no problem, and it runs normally on my computer, but it just doesn’t work on the server. Doument (“srcPath”) is stuck here, I don’t know why.
https://tezign-assets.oss-cn-beijing.aliyuncs.com/2988f54467f157da19357608407bb746.doc
[image]

@zyx

Please try the latest version of Aspose.Words for Java 21.6. Hope this helps you.

Please note that Aspose.Words requires TrueType fonts when rendering document to fixed-page formats (JPEG, PNG, JPEG or PDF). You need to install fonts that are used in your document on the machine where you are converting documents to PDF. Please refer to the following articles:
Using TrueType Fonts
Manipulating and Substitution TrueType Fonts

If you still face problem, please share your working environment detail e.g. operating system, Java version etc. where you are facing this issue. We will investigation the issue and provide you more information on it.

It’s weird, just change the version. I used 21.5 words before. I don’t know why, but it feels like it was not read when the file stream was read.

@zyx

Please share the requested detail for testing.