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

Free Support Forum - aspose.com

Parallel processing of vsd to vsdx conversion results in corrupted files

I tried to convert vsd to vsdx in parallel processing.

However, if in parallel processing, any converted file cannot be open by the visio.
※ when open that with the visio, it displays a error message.
※ 133.vsd.vsdx and 135.vsd.vsdx in sample datas that are attached this topic cannot be open.

In sequential processing, all files are converted into vsdx files these can be opened by the visio.

Is it possible to convert normally even in parallel processing?

public void sample() throws Exception {

    Path input = Paths.get("C:\\test\\input");
    Path output = Paths.get("C:\\test\\output");
    List<String> fileNames = Arrays.asList("133.vsd", "134.vsd", "135.vsd", "136.vsd", "144.vsd");

    fileNames.stream()
            .parallel()
            .forEach(x -> {

                try (InputStream stream = Files.newInputStream(input.resolve(x));
                        OutputStream outputStream = Files.newOutputStream(output.resolve(x + ".vsdx"))) {
                    Diagram diagram = new Diagram(stream);
                    diagram.save(outputStream, SaveFileFormat.VSDX);
                } catch (Exception e) {
                    System.out.println(x + ": converting failed.");
                }

            });
}

Using version:Aspose.Diagram for Java 22.4
sample data:sample.zip (1.4 MB)

@yudai_yamaguchi

We need to investigate the feasibility of the parallel processing of VSDX files. For the purpose, an investigation ticket as DIAGRAMJAVA-50934 has been logged in our issue tracking system. We will further look into its details and keep you posted with the status of ticket resolution. Please be patient and spare us some time.

The issues you have found earlier (filed as DIAGRAMJAVA-50934) have been fixed in this update. This message was posted using Bugs notification tool by philip.zhou