Closed ytdai closed 4 years ago
Can you include an example?
Many thanks for your quick response, I just upload a SVG file and the link is: https://github.com/ytdai/test_files/blob/master/figure.g4.svg
This SVG file is about 61Mb, and rsvg can't convert this file to pdf format.
Code:
download.file('https://raw.githubusercontent.com/ytdai/test_files/master/figure.g4.svg', 'test.svg')
out <- rsvg::rsvg_raw('test.svg', width = 600, height = 600)
Looks like this is indeed a limitation of librsvg....
Yes, I think so. Now I use rsvg to transfer svg file to pdf with file size less than 10M. And when the size is over 10M, I use inkscape. inkscape --without-gui --export-pdf=test.pdf test.svg
The latest version of librsvg is giving a more helpful error:
Failed to parse svg: XML parse error: cannot load more than 200000 XML elements
There really isn't anything I can do about this, it's a limitation of the c library.
The error is: rsvg_pdf("output_all_sample_kmer.1311.svg", file = "output_all_sample_kmer.1311.pdf") Error in rsvg_format(svg, file, width, height, 2L) : Failed to parse svg: Error domain 1 code 1 on line 2309513 column 1 of data: internal error: Huge input lookup.