I have created a simple SVG file that has a high-resolution JPEG background and some text on top:
Now I would like to export it as PDF (keeping the text as-is, not converting it to an image).
I know I can do that with:
inkscape --export-type=pdf test.svg
The output file, however, is too large. So there is a DPI parameter that should, as I understand, set the resolution of the exported raster images.
However, no matters what value I use, it seems it has no effect on the exported file, which seems to have always the same size and the same background image resolution:
inkscape --export-type=pdf --export-dpi=96 test.svg
How can I export to PDF while reducing the exported resolution of the background (raster) image and keeping the text as-text?
Looking for a command line (automated) way, since I have many SVG files I would like to export. :-D
According to the documentation (https://inkscape.org/doc/inkscape-man.html#d-DPI---export-dpi-DPI), the dpi value is not used for embedded images, but only for rasterization of filters. You can make a feature request if you want any changes: https://inkscape.org/report.
You could make a bitmap copy to reduce the resolution. Settings for bitmap copy resolution can be given in a preferences file that is handed to Inkscape on the command line.
Thanks! gitlab.com/inkscape/inbox/-/issues/3720 ^^ Would you mind elaborating a bit more on the bitmap copy process?
Select object, and if going via menu: Edit > Make a bitmap copy. I don't know the verb / action name offhand, but you can look it up in the verb list / action list. Find the settings for the Bitmap copy dpi in Edit > Preferences > Imported Images.
Ahhhh, ok. I was looking for an automated way though (command line), since I would need to perform the operation on many images... Doing that manually is not really an option. :-P
I explained how to find the way to do it via command line ... The man page is here: inkscape.org/doc/inkscape-man.html , and the verb-list and action-list will contain the commands that you need .
You can also provide a custom preferences file to Inkscape from the command line ...