Error when using exportgraphics function to save large vector graphics with transparency
When I tried to save a large vector graphic with transparency information using the exportgraphics function on my PC, an error occurred.
MATLAB version: 9.12.0.2529717 (R2022a) Update 8
Operating system: Microsoft Windows 10 Pro Version 10.0 (Build 19045)
Java version: Java 1.8.0_202-b08 with Oracle Corporation Java HotSpot(TM) 64-Bit Server VM mixed mode
After plotting a large 3D vector graphic with complex perspectives and transparency relationships in a figure, I attempted to run the following code to save the figure:
exportgraphics(gca, ‘picture1.emf’, ‘BackgroundColor’, ‘none’, ‘ContentType’, ‘vector’)
However, the program threw an error.
The error message was:
Problem while processing in an OutputHelper. java.nio.file.NoSuchFileException:
C:Usersroom250AppDataLocalTempemf6382030724281275533.tmp
com.mathworks.hg.util.OutputHelperProcessingException: Problem while processing in an
OutputHelper. java.nio.file.NoSuchFileException:
C:Usersroom250AppDataLocalTempemf6382030724281275533.tmp
at com.mathworks.hg.util.HGVectorOutputHelper.close(HGVectorOutputHelper.java:245)
Caused by: com.mathworks.hg.print.OutputProcessingException: java.nio.file.NoSuchFileException:
C:Usersroom250AppDataLocalTempemf6382030724281275533.tmp
at com.mathworks.hg.print.MWEMFVectorStrategy.endJob(MWEMFVectorStrategy.java:144)
at com.mathworks.hg.util.HGVectorOutputHelper.close(HGVectorOutputHelper.java:241)
Caused by: java.nio.file.NoSuchFileException:
C:Usersroom250AppDataLocalTempemf6382030724281275533.tmp
at sun.nio.fs.WindowsException.translateToIOException(WindowsException.java:79)
at sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:97)
at sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:102)
at sun.nio.fs.WindowsFileSystemProvider.newByteChannel(WindowsFileSystemProvider.java:230)
at java.nio.file.Files.newByteChannel(Files.java:361)
at java.nio.file.Files.newByteChannel(Files.java:407)
at java.nio.file.spi.FileSystemProvider.newInputStream(FileSystemProvider.java:384)
at java.nio.file.Files.newInputStream(Files.java:152)
at java.nio.file.Files.copy(Files.java:3068)
at com.mathworks.hg.print.MWEMFVectorStrategy.endJob(MWEMFVectorStrategy.java:142)
… 1 more
I tried running MATLAB as an administrator and on a PC with higher memory, but the error persisted, and the error message remained the same. In addition, I checked the available storage space on my computer, and I have at least 390 GB of free space.
When I saved the same figure without transparency information as an image (using exportgraphics(gca, ‘picture1.emf’, ‘BackgroundColor’, ‘none’, ‘ContentType’, ‘image’)), the exportgraphics function worked correctly.
Furthermore, I plotted a smaller image and tried again to save it using exportgraphics(gca, ‘picture1.emf’, ‘BackgroundColor’, ‘none’, ‘ContentType’, ‘vector’), and the result was correct.
So, it seems that the exportgraphics function may not support saving larger images, or is there another reason?When I tried to save a large vector graphic with transparency information using the exportgraphics function on my PC, an error occurred.
MATLAB version: 9.12.0.2529717 (R2022a) Update 8
Operating system: Microsoft Windows 10 Pro Version 10.0 (Build 19045)
Java version: Java 1.8.0_202-b08 with Oracle Corporation Java HotSpot(TM) 64-Bit Server VM mixed mode
After plotting a large 3D vector graphic with complex perspectives and transparency relationships in a figure, I attempted to run the following code to save the figure:
exportgraphics(gca, ‘picture1.emf’, ‘BackgroundColor’, ‘none’, ‘ContentType’, ‘vector’)
However, the program threw an error.
The error message was:
Problem while processing in an OutputHelper. java.nio.file.NoSuchFileException:
C:Usersroom250AppDataLocalTempemf6382030724281275533.tmp
com.mathworks.hg.util.OutputHelperProcessingException: Problem while processing in an
OutputHelper. java.nio.file.NoSuchFileException:
C:Usersroom250AppDataLocalTempemf6382030724281275533.tmp
at com.mathworks.hg.util.HGVectorOutputHelper.close(HGVectorOutputHelper.java:245)
Caused by: com.mathworks.hg.print.OutputProcessingException: java.nio.file.NoSuchFileException:
C:Usersroom250AppDataLocalTempemf6382030724281275533.tmp
at com.mathworks.hg.print.MWEMFVectorStrategy.endJob(MWEMFVectorStrategy.java:144)
at com.mathworks.hg.util.HGVectorOutputHelper.close(HGVectorOutputHelper.java:241)
Caused by: java.nio.file.NoSuchFileException:
C:Usersroom250AppDataLocalTempemf6382030724281275533.tmp
at sun.nio.fs.WindowsException.translateToIOException(WindowsException.java:79)
at sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:97)
at sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:102)
at sun.nio.fs.WindowsFileSystemProvider.newByteChannel(WindowsFileSystemProvider.java:230)
at java.nio.file.Files.newByteChannel(Files.java:361)
at java.nio.file.Files.newByteChannel(Files.java:407)
at java.nio.file.spi.FileSystemProvider.newInputStream(FileSystemProvider.java:384)
at java.nio.file.Files.newInputStream(Files.java:152)
at java.nio.file.Files.copy(Files.java:3068)
at com.mathworks.hg.print.MWEMFVectorStrategy.endJob(MWEMFVectorStrategy.java:142)
… 1 more
I tried running MATLAB as an administrator and on a PC with higher memory, but the error persisted, and the error message remained the same. In addition, I checked the available storage space on my computer, and I have at least 390 GB of free space.
When I saved the same figure without transparency information as an image (using exportgraphics(gca, ‘picture1.emf’, ‘BackgroundColor’, ‘none’, ‘ContentType’, ‘image’)), the exportgraphics function worked correctly.
Furthermore, I plotted a smaller image and tried again to save it using exportgraphics(gca, ‘picture1.emf’, ‘BackgroundColor’, ‘none’, ‘ContentType’, ‘vector’), and the result was correct.
So, it seems that the exportgraphics function may not support saving larger images, or is there another reason? When I tried to save a large vector graphic with transparency information using the exportgraphics function on my PC, an error occurred.
MATLAB version: 9.12.0.2529717 (R2022a) Update 8
Operating system: Microsoft Windows 10 Pro Version 10.0 (Build 19045)
Java version: Java 1.8.0_202-b08 with Oracle Corporation Java HotSpot(TM) 64-Bit Server VM mixed mode
After plotting a large 3D vector graphic with complex perspectives and transparency relationships in a figure, I attempted to run the following code to save the figure:
exportgraphics(gca, ‘picture1.emf’, ‘BackgroundColor’, ‘none’, ‘ContentType’, ‘vector’)
However, the program threw an error.
The error message was:
Problem while processing in an OutputHelper. java.nio.file.NoSuchFileException:
C:Usersroom250AppDataLocalTempemf6382030724281275533.tmp
com.mathworks.hg.util.OutputHelperProcessingException: Problem while processing in an
OutputHelper. java.nio.file.NoSuchFileException:
C:Usersroom250AppDataLocalTempemf6382030724281275533.tmp
at com.mathworks.hg.util.HGVectorOutputHelper.close(HGVectorOutputHelper.java:245)
Caused by: com.mathworks.hg.print.OutputProcessingException: java.nio.file.NoSuchFileException:
C:Usersroom250AppDataLocalTempemf6382030724281275533.tmp
at com.mathworks.hg.print.MWEMFVectorStrategy.endJob(MWEMFVectorStrategy.java:144)
at com.mathworks.hg.util.HGVectorOutputHelper.close(HGVectorOutputHelper.java:241)
Caused by: java.nio.file.NoSuchFileException:
C:Usersroom250AppDataLocalTempemf6382030724281275533.tmp
at sun.nio.fs.WindowsException.translateToIOException(WindowsException.java:79)
at sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:97)
at sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:102)
at sun.nio.fs.WindowsFileSystemProvider.newByteChannel(WindowsFileSystemProvider.java:230)
at java.nio.file.Files.newByteChannel(Files.java:361)
at java.nio.file.Files.newByteChannel(Files.java:407)
at java.nio.file.spi.FileSystemProvider.newInputStream(FileSystemProvider.java:384)
at java.nio.file.Files.newInputStream(Files.java:152)
at java.nio.file.Files.copy(Files.java:3068)
at com.mathworks.hg.print.MWEMFVectorStrategy.endJob(MWEMFVectorStrategy.java:142)
… 1 more
I tried running MATLAB as an administrator and on a PC with higher memory, but the error persisted, and the error message remained the same. In addition, I checked the available storage space on my computer, and I have at least 390 GB of free space.
When I saved the same figure without transparency information as an image (using exportgraphics(gca, ‘picture1.emf’, ‘BackgroundColor’, ‘none’, ‘ContentType’, ‘image’)), the exportgraphics function worked correctly.
Furthermore, I plotted a smaller image and tried again to save it using exportgraphics(gca, ‘picture1.emf’, ‘BackgroundColor’, ‘none’, ‘ContentType’, ‘vector’), and the result was correct.
So, it seems that the exportgraphics function may not support saving larger images, or is there another reason? exportgraphics, error MATLAB Answers — New Questions