When copying geometry from Inkscape for pasting into a word processor, how or where is the rasterisation done and where is the resolution set?
-
there should be no rasterisation done.– joojaaCommented Oct 25, 2022 at 14:20
-
I'd love if that were to be the case, however it is rasterised. Try it– J CollinsCommented Oct 25, 2022 at 14:52
-
1Vectors have no resolution. Copy and pasting is likely the problem. Instead try exporting from Inkscape as EMF (Enhanced Metafile) - and then import that into Word. That is Microsoft's own vector format.– Billy KerrCommented Oct 25, 2022 at 15:30
-
Also, LibreOffice Writer actually supports importing SVG files. Not sure if MS Word does (since I haven't used it for a long time).– Billy KerrCommented Oct 25, 2022 at 15:34
-
I am totally familiar with exporting to PNG, and even discovered Make Bitmap Copy now and how to set its resolution (annoyingly an application-wide setting). I am asking about the workflow of copy and paste, something is doing a rasterisation process and I suspect it is Inkscape.– J CollinsCommented Oct 25, 2022 at 15:37
2 Answers
This is an excellent question. I can only partially answer it.
The rasterization is done in the target application. In case you are referring to MS Word the rasterization is done in Word itself when pasting. But one interesting thing is that the SVG is still inside the Docx file.
Not many people know that MS office documents are compressed folders. It can be unzipped.
Inside there is a folder called media with a PNG and the SVG file.
I originally prepared the circle of 100x100px. And I opened the SVG inside the Word file and it still has 100x100px. But the PNG file measures 400x400px.
But it happens that the rasterization is only for preview purposes. If you pull the handlers and resize the image inside, you will see that the circle pixelated for an instant and then you can see it again sharp.
The result of copy-pasting the SVG element from Inkscape to Word produces in my case the same result as importing the SVG directly from the disc.
For some other applications, the result could be different.
Some notes.
On modern versions of MS Word, do not use WMF or EMF. SVG files are ok.
Copy and pasting from the clipboard could be not the best method, because the info carried on the clipboard is more complex than needed. Sometimes the result can embed data from the parent application, indicating for example that the content must be edited on the parent application.
In Libre Office Writer, using the same method of unzipping the file, it only contains a PNG version of the pasted object inside a Pictures folder, and it is 100x100px, so the rasterization is taking the pixel size inside the SVG to define the pixel size.
In this case, the proper way is to import the SVG file from the disc, not using copy-paste. That way you maintain the vector file inside Writer.
As you can see, when copy-pasting, the one that is making the rasterization is the target application, and they use different methods to do it.
-
Stunningly well answered. I'm surprised the Word and Writer methods are as similar as they are..! Commented Oct 25, 2022 at 21:42
Copying and pasting is likely the problem here, since your operating system's clipboard is not passing the vector data to the software you are pasting it into. There seems to be no control over this process.
As to why it doesn't paste as vector into Word/Writer, I've no idea. The clipboard obviously can handle vectors, or you wouldn't be able to copy and paste vectors in Inkscape, or copy and paste vectors from Illustrator into Inkscape and vice versa, but you can.
Also worthwhile noting that I can't actually copy and paste vectors from Illustrator into Writer either (haven't tested it with Word). It just pastes raster images. Of course neither Word nor Writer are graphic design software, so they may just not have this capability. It may just be too much to expect.
Anyway, here are some methods to export images from Inkscape for use in Microsoft Word or LibreOffice writer, or other software. Note also that vector formats don't have a resolution - they are vectors, and are not made of pixels.
For MS Word, export from Inkscape as EMF (Enhanced Metafile). This is Microsoft's own native vector file format. It works best with simple vectors (paths, strokes, and fills). Any fancy effects added in Inkscape will not work. It may be possible to import SVGs too, but I don't currently use MS Word so I can't check if it works.
For LibreOffice Writer, export as Plain SVG from Inkscape. You can then import the file into Writer. LibreOffice software might also be able to import EMF files.
For raster formats, such as PNG, you can increase the resolution of a raster image using Inkscape's export panel. Set a larger size in pixels. The resolution of a raster image is the number of pixels it contains.
-
Word mangles pastes sometimes you get a much stabler paste if you can bother to paste via powerpoint.– joojaaCommented Oct 25, 2022 at 16:30