How can I export a single page to an SVG file?
Thanks for the quick answer. I have this working now. However, for some reason my saved file is placed in the parent folder, with a windows backslash in its name (!). For example, when I do this:
The resulting file is saved in the folder “/Users/marc” as “Desktop\test.svg”.
Seems like there is a hardcoded “” somewhere in your code, instead of File.separator???
I am not surprised you cannot reproduce this issue on Windows, since the backslash is valid path separator on Windows. We are on Mac and Linux, where the backslash gives problems.
Here is the code snippet:
// get the page from existing opened document:
final Page page = getPage(document, pageNumber);
// create a temporary Document object
final Document tmp = new Document();
// add the page to the Pages collection of new document object
// write the temporary document as svg:
final File tmpFile = new File("/Users/marc/Desktop/test.svg");
final SvgSaveOptions saveOptions = new SvgSaveOptions();
saveOptions.CompressOutputToZipArchive = false;
We use aspose-pdf-9.7.0-jdk16.jar on Java 7.
have logged and investigation ticket in our issue tracking system as PDFNEWJAVA-34649. We will investigate this
issue in details and will keep you updated on the status of a correction.
We apologize for your inconvenience.