Jan 23 2019 07:11 AM
Jan 23 2019 07:11 AM
I observed that the line thicknesses of SVG pictures in a docx document get thicker when exported to PDF. I got the impression that Office 365 (Version 1812) changes the line thickness while exporting to a minimal value. Is there any way to keep the original line thickness of the SVG when exporting the docx file to PDF?
As a demonstration for the issue, I created via InkScape a file with different line thicknesses (5mm to 0.01 mm) and exported it as 600-dpi PNG and SVG. Both pictures got imported in a docx file and exported as PDF via "save as" (see attached).
It can be clearly seen that by exporting to PDF all thin lines of the SVG below a certain threshold became thicker.
What can be done to maintain the original line thickness of the SVG while exporting?
Thanks for your support!
With best regards,
Jan 23 2019 07:35 AM
Hello @Norbert86! First idea: Try it with adobe illustrator. Did you also tried that converting from SVG to another ps like xps or the PDF creator? I guess, SVG and PDF don`t work together so smoothly...(?)
Jan 23 2019 07:49 AM
Thanks for your response.
I would appreciate to find a solution with Word as it is the standard software used in our group (I am sure that other software like Ai or Latex could do the job as well. The aim is to combine the advantage of word and SVG)
Exporting the docx via PDFcreator, PDF24, or Adobe PDF results in converting the SVG to a image format (like PNG) and losing the vector properties.
Jan 23 2019 08:23 AM
Hello Norbert, I know that Word stuff also ;) And i think you should get a shareware version with adobe illustrator, only to demonstrate if your task is working with it. I believe it works. Greets, Eva.
Oct 08 2019 08:36 AM
I have been having much difficulties with this problem as well.
My Word document has an SVG map with outlined labeling however when exported to PDF the line thicknesses change causing them to looked "blobbed". The line width in Word appears to be ignored.
Oct 08 2019 12:55 PM
I could solve the issue in my case the following way:
I create my SVG figures via Ink-Scape (freeware). But, before I want to place a SVG file into word, I use the option "Object to Path" and save it afterwards as SVG. Like that, i.e., the letter "H" is not anylonger stored as a letter, but by three individual lines. When I place this "converted" SVG file into a word file and export it as PDF it keeps its properties.
I hope this helps you!
With best regards,
Oct 08 2019 01:00 PM
Thank you for the comment. This SVG was already converted to paths to deal with specialized embedded fonts from ESRI ArcGIS Pro. You will notice that all lines in my previous example above exhibits increased line thicknesses - not just the path'd fonts.
Oct 28 2019 04:19 PM
I've found a workaround to solve the problem. First convert all object to path (you've done that). After you place the svg in word, right click and try convert to shape. It works perfectly at my end.
Oct 29 2019 12:12 AM
I exported the same docx to pdf on windows 10 and MacOS. Only windows 10 (for me it's 1903) caused the problem.
Nov 21 2019 08:34 AM - edited Nov 21 2019 08:52 AM
@Chuanxin LIUfor me your workaround only works to 50%. It indeed solves the problem with the broadened lines, but when making the "conversion to form" in word365 several things happen, like for example the arrows of my inkscape vector graphic also lose their heads.
Edit: So for arrows it is also needed to additionally apply "stroke to path" in inkscape on all arrows. Then that also works fine. But still a lot of other problems occur and parts of the vector graphic are missing in the final pdf, although they are visible in the word file after conversion to form.
Nov 21 2019 09:34 AM
Converting my SVG to a shape often destroys it or changes many of the shapes to "fat" mode within Word that I cannot change to the expected pen width.
The only workaround I have found so far is generating a PDF, converting it to SVG using https://github.com/dawbarton/pdf2svg and then importing to Word. It looks as expected in Word and the resulting exported PDF.
Ridiculously complicated for a feature that I would expect to work out of the box.
Jun 04 2020 04:54 AM
@Norbert86 – I had the same issue. I seem to have found a workaround that's not too painful.
I've played around with the problem, and to me it seems like Word's PDF export imposes a minimum line thickness of 1px at 96dpi relative to the original image dimensions on imported SVG images. So if the image is set to 100% height and width "relative to original picture size" in Word, lines in that image will have a minimum thickness of 1"/96dpi ≈ 0.01" ≈ 0.26mm in the exported PDF.
Luckily, this minimum thickness is set relative to the original image dimensions – so if the "original picture size" becomes larger, the minimum thickness becomes relatively less.
Obviously, I had made my illustrations (...in Inkscape, too, by the way) the exact size I wanted them to be in my Word document. But after figuring out the above, I scaled them up by a goodly amount (1000% is a nice number and safely pushes my intended minimum line thickness above the magical 0.26mm threshold) and then back down in Word. Now everything looks like I want it to, at the expense of having to explicitly set the image's height and width in Word.
Workaround for the "minimum line thickness" issue:
Using Inkscape to scale up the original image's dimensions works well, of course, but I've found that scaling up the dimensions of an SVG image is actually even easier and faster to do in a simple text editor than a visual editor.
If you'd like to go that route, do this:
For example, this:
viewBox="0 0 150 400"
viewBox="0 0 150 400"
That's it – no other change needed.
After that change, when you import the SVG file in Word (or Inkscape), it'll appear 10x its original size. In Word, right-click > "Size and Position..." > "Size" > "Scale" > set "Height" and "Width" both to "10%", and you're set.
Feb 26 2021 03:00 PM
@michael-buschbeck-ms: Thanks! This solution worked perfectly for me.
After going to the trouble of converting a bunch of nasty raster images to scalable vector format in a rather large document, I was so disappointed to find upon converting to pdf that some lines had thickened to the point that some of the graphics were no longer legible.
Your solution to scale the original images and the further tip to do so relatively painlessly in a text editor saved the day. Thanks for the detailed explanation and instructions.