Home

Line thickness of SVG changes by exporting docx as PDF

%3CLINGO-SUB%20id%3D%22lingo-sub-324352%22%20slang%3D%22en-US%22%3ELine%20thickness%20of%20SVG%20changes%20by%20exporting%20docx%20as%20PDF%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-324352%22%20slang%3D%22en-US%22%3E%3CP%3EDear%20Community%2C%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20observed%20that%20the%20line%20thicknesses%20of%20SVG%20pictures%20in%20a%20docx%20document%20get%20thicker%20when%20exported%20to%20PDF.%20I%20got%20the%20impression%20that%20Office%20365%20(Version%201812)%20changes%20the%20line%20thickness%20while%20exporting%20to%20a%20minimal%20value.%20Is%20there%20any%20way%20to%20keep%20the%20original%20line%20thickness%20of%20the%20SVG%20when%20exporting%20the%20docx%20file%20to%20PDF%3F%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EAs%20a%20demonstration%20for%20the%20issue%2C%20I%20created%20via%20InkScape%20a%20file%20with%20different%20line%20thicknesses%20(5mm%20to%200.01%20mm)%20and%20exported%20it%20as%20600-dpi%20PNG%20and%20SVG.%20Both%20pictures%20got%20imported%20in%20a%20docx%20file%20and%20exported%20as%20PDF%20via%20%22save%20as%22%20(see%20attached).%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EIt%20can%20be%20clearly%20seen%20that%20by%20exporting%20to%20PDF%20all%20thin%20lines%20of%20the%20SVG%20below%20a%20certain%20threshold%20became%20thicker.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EWhat%20can%20be%20done%20to%20maintain%20the%20original%20line%20thickness%20of%20the%20SVG%20while%20exporting%3F%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThanks%20for%20your%20support!%3C%2FP%3E%3CP%3EWith%20best%20regards%2C%3C%2FP%3E%3CP%3ENorbert%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-324352%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EOffice%20365%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-324417%22%20slang%3D%22en-US%22%3ERe%3A%20Line%20thickness%20of%20SVG%20changes%20by%20exporting%20docx%20as%20PDF%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-324417%22%20slang%3D%22en-US%22%3E%3CP%3EHello%20Norbert%2C%20I%20know%20that%20Word%20stuff%20also%20%3B)%3C%2Fimg%3E%26nbsp%3B%20And%20i%20think%20you%20should%20get%20a%20shareware%20version%20with%20adobe%20illustrator%2C%20only%20to%20demonstrate%20if%20your%20task%20is%20working%20with%20it.%20I%20believe%20it%20works.%20Greets%2C%20Eva.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-324391%22%20slang%3D%22en-US%22%3ERe%3A%20Line%20thickness%20of%20SVG%20changes%20by%20exporting%20docx%20as%20PDF%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-324391%22%20slang%3D%22en-US%22%3E%3CP%3EThanks%20for%20your%20response.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20would%20appreciate%20to%20find%20a%20solution%20with%20Word%20as%20it%20is%20the%20standard%20software%20used%20in%20our%20group%20(I%20am%20sure%20that%20other%20software%20like%20Ai%20or%20Latex%20could%20do%20the%20job%20as%20well.%20The%20aim%20is%20to%20combine%20the%20advantage%20of%20word%20and%20SVG)%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EExporting%20the%20docx%20via%20PDFcreator%2C%20PDF24%2C%20or%20Adobe%20PDF%20results%20in%20converting%20the%20SVG%20to%20a%20image%20format%20(like%20PNG)%20and%20losing%20the%20vector%20properties.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-324374%22%20slang%3D%22en-US%22%3ERe%3A%20Line%20thickness%20of%20SVG%20changes%20by%20exporting%20docx%20as%20PDF%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-324374%22%20slang%3D%22en-US%22%3E%3CP%3EHello%20%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F270593%22%20target%3D%22_blank%22%3E%40Norbert86%3C%2FA%3E!%20First%20idea%3A%20Try%20it%20with%20adobe%20illustrator.%20Did%20you%20also%20tried%20that%20converting%20from%20SVG%20to%20another%20ps%20like%20xps%20or%20the%20PDF%20creator%3F%20I%20guess%2C%20SVG%20and%20PDF%20don%60t%20work%20together%20so%20smoothly...(%3F)%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EGreets%2C%20Eva.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-899840%22%20slang%3D%22en-US%22%3ERe%3A%20Line%20thickness%20of%20SVG%20changes%20by%20exporting%20docx%20as%20PDF%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-899840%22%20slang%3D%22en-US%22%3E%3CP%3EI%20have%20been%20having%20much%20difficulties%20with%20this%20problem%20as%20well.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EMy%20Word%20document%20has%20an%20SVG%20map%20with%20outlined%20labeling%20however%20when%20exported%20to%20PDF%20the%20line%20thicknesses%20change%20causing%20them%20to%20looked%20%22blobbed%22.%20The%20line%20width%20in%20Word%20appears%20to%20be%20ignored.%3C%2FP%3E%3CH1%20id%3D%22toc-hId-1961245793%22%20id%3D%22toc-hId-1961245793%22%20id%3D%22toc-hId-1961245793%22%20id%3D%22toc-hId-1961245793%22%20id%3D%22toc-hId-1961245793%22%20id%3D%22toc-hId-1961245793%22%20id%3D%22toc-hId-1961245793%22%20id%3D%22toc-hId-1961245793%22%20id%3D%22toc-hId-1961245793%22%20id%3D%22toc-hId-1961245793%22%3E%3CU%3EMicrosoft%20Word%20view%20(300%25)%3C%2FU%3E%3C%2FH1%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20360px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F135879iAA4C62842B503DFE%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%22Word.png%22%20title%3D%22Word.png%22%20%2F%3E%3CSPAN%20class%3D%22lia-inline-image-caption%22%20onclick%3D%22event.preventDefault()%3B%22%3EMicrosoft%20Word%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CH1%20id%3D%22toc-hId--590911168%22%20id%3D%22toc-hId--590911168%22%20id%3D%22toc-hId--590911168%22%20id%3D%22toc-hId--590911168%22%20id%3D%22toc-hId--590911168%22%20id%3D%22toc-hId--590911168%22%20id%3D%22toc-hId--590911168%22%20id%3D%22toc-hId--590911168%22%20id%3D%22toc-hId--590911168%22%20id%3D%22toc-hId--590911168%22%3E%3CU%3EExport%20PDF%20view%20(300%25)%3C%2FU%3E%3C%2FH1%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20456px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F135878i9C2463748E197EFF%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%22Acrobat.png%22%20title%3D%22Acrobat.png%22%20%2F%3E%3CSPAN%20class%3D%22lia-inline-image-caption%22%20onclick%3D%22event.preventDefault()%3B%22%3EExported%20PDF%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EApplications%3A%3C%2FP%3E%3CUL%3E%3CLI%3EWindows%2010%20Pro%20(Version%201903%2C%20OS%20Build%2018362.356)%3C%2FLI%3E%3CLI%3EMicrosoft%20Office%20365%20Business%20(Version%201908%2C%20Build%2011929.20300)%3C%2FLI%3E%3CLI%3EAdobe%20Acrobat%20Reader%20DC%20(Version%202019.012.20040)%3C%2FLI%3E%3C%2FUL%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-900425%22%20slang%3D%22en-US%22%3ERe%3A%20Line%20thickness%20of%20SVG%20changes%20by%20exporting%20docx%20as%20PDF%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-900425%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F233564%22%20target%3D%22_blank%22%3E%40Jason%20Morse%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EHello%20Jason%2C%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20could%20solve%20the%20issue%20in%20my%20case%20the%20following%20way%3A%3C%2FP%3E%3CP%3EI%20create%20my%20SVG%20figures%20via%20Ink-Scape%20(freeware).%20But%2C%20before%20I%20want%20to%20place%20a%20SVG%20file%20into%20word%2C%20I%20use%20the%20option%20%22Object%20to%20Path%22%20and%20save%20it%20afterwards%20as%20SVG.%20Like%20that%2C%20i.e.%2C%20the%20letter%20%22H%22%20is%20not%20anylonger%20stored%20as%20a%20letter%2C%20but%20by%20three%20individual%20lines.%20When%20I%20place%20this%20%22converted%22%20SVG%20file%20into%20a%20word%20file%20and%20export%20it%20as%20PDF%20it%20keeps%20its%20properties.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20hope%20this%20helps%20you!%3C%2FP%3E%3CP%3EWith%20best%20regards%2C%3C%2FP%3E%3CP%3ENorbert%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-900442%22%20slang%3D%22en-US%22%3ERe%3A%20Line%20thickness%20of%20SVG%20changes%20by%20exporting%20docx%20as%20PDF%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-900442%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F270593%22%20target%3D%22_blank%22%3E%40Norbert86%3C%2FA%3E%2C%3C%2FP%3E%3CP%3EThank%20you%20for%20the%20comment.%26nbsp%3BThis%20SVG%20was%20already%20converted%20to%20paths%20to%20deal%20with%20specialized%20embedded%20fonts%20from%20ESRI%20ArcGIS%20Pro.%20You%20will%20notice%20that%26nbsp%3B%3CEM%3Eall%3C%2FEM%3E%20lines%20in%20my%20previous%20example%20above%20exhibits%20increased%20line%20thicknesses%20-%20not%20just%20the%20path'd%20fonts.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-961027%22%20slang%3D%22en-US%22%3ERe%3A%20Line%20thickness%20of%20SVG%20changes%20by%20exporting%20docx%20as%20PDF%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-961027%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F233564%22%20target%3D%22_blank%22%3E%40Jason%20Morse%3C%2FA%3E%2C%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI've%20found%20a%20workaround%20to%20solve%20the%20problem.%20First%20convert%20all%20object%20to%20path%20(you've%20done%20that).%20After%20you%20place%20the%20svg%20in%20word%2C%20right%20click%20and%20try%20%3CSTRONG%3Econvert%20to%20shape%3C%2FSTRONG%3E.%20It%20works%20perfectly%20at%20my%20end.%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-961413%22%20slang%3D%22en-US%22%3ERe%3A%20Line%20thickness%20of%20SVG%20changes%20by%20exporting%20docx%20as%20PDF%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-961413%22%20slang%3D%22en-US%22%3E%3CP%3EI%20exported%20the%20same%20docx%20to%20pdf%20on%20windows%2010%20and%20MacOS.%20Only%20windows%2010%20(for%20me%20it's%201903)%20caused%20the%20problem.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1024480%22%20slang%3D%22en-US%22%3ERe%3A%20Line%20thickness%20of%20SVG%20changes%20by%20exporting%20docx%20as%20PDF%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1024480%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F139365%22%20target%3D%22_blank%22%3E%40Chuanxin%20LIU%3C%2FA%3Efor%20me%20your%20workaround%20only%20works%20to%2050%25.%20It%20indeed%20solves%20the%20problem%20with%20the%20broadened%20lines%2C%20but%20when%20making%20the%20%22conversion%20to%20form%22%20in%20word365%20several%20things%20happen%2C%20like%20for%20example%20the%20arrows%20of%20my%20inkscape%20vector%20graphic%20also%20lose%20their%20heads.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EEdit%3A%20So%20for%20arrows%20it%20is%20also%20needed%20to%20additionally%20apply%20%22stroke%20to%20path%22%20in%20inkscape%20on%20all%20arrows.%20Then%20that%20also%20works%20fine.%20But%20still%20a%20lot%20of%20other%20problems%20occur%20and%20parts%20of%20the%20vector%20graphic%20are%20missing%20in%20the%20final%20pdf%2C%20although%20they%20are%20visible%20in%20the%20word%20file%20after%20conversion%20to%20form.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1024541%22%20slang%3D%22en-US%22%3ERe%3A%20Line%20thickness%20of%20SVG%20changes%20by%20exporting%20docx%20as%20PDF%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1024541%22%20slang%3D%22en-US%22%3E%3CP%3EThanks%20for%20your%20reply%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F139365%22%20target%3D%22_blank%22%3E%40Chuanxin%20LIU%3C%2FA%3E.%20Similar%20to%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F464651%22%20target%3D%22_blank%22%3E%40Zyme86%3C%2FA%3E%26nbsp%3Byour%20workaround%20has%20not%20been%20successful%20for%20me.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EConverting%20my%20SVG%20to%20a%20shape%20often%20destroys%20it%20or%20changes%20many%20of%20the%20shapes%20to%20%22fat%22%20mode%20within%20Word%20that%20I%20cannot%20change%20to%20the%20expected%20pen%20width.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThe%20only%20workaround%20I%20have%20found%20so%20far%20is%20generating%20a%20PDF%2C%20converting%20it%20to%20SVG%20using%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fgithub.com%2Fdawbarton%2Fpdf2svg%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fgithub.com%2Fdawbarton%2Fpdf2svg%3C%2FA%3E%26nbsp%3Band%20then%20importing%20to%20Word.%20It%20looks%20as%20expected%20in%20Word%20and%20the%20resulting%20exported%20PDF.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ERidiculously%20complicated%20for%20a%20feature%20that%20I%20would%20expect%20to%20work%20out%20of%20the%20box.%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E
Norbert86
New Contributor

Dear Community,

 

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,

Norbert

10 Replies

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...(?)

 

Greets, Eva.

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.

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.

Highlighted

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.

Microsoft Word view (300%)

Word.pngMicrosoft Word

 

Export PDF view (300%)

Acrobat.pngExported PDF

 

Applications:

  • Windows 10 Pro (Version 1903, OS Build 18362.356)
  • Microsoft Office 365 Business (Version 1908, Build 11929.20300)
  • Adobe Acrobat Reader DC (Version 2019.012.20040)

@Jason Morse 

 

Hello Jason,

 

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,

Norbert

@Norbert86,

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.

@Jason Morse,

 

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. 

I exported the same docx to pdf on windows 10 and MacOS. Only windows 10 (for me it's 1903) caused the problem.

@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.

Thanks for your reply @Chuanxin LIU. Similar to @Zyme86 your workaround has not been successful for me.

 

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. 

Related Conversations
Tabs and Dark Mode
cjc2112 in Discussions on
46 Replies
Extentions Synchronization
Deleted in Discussions on
3 Replies
Stable version of Edge insider browser
HotCakeX in Discussions on
35 Replies
How to Prevent Teams from Auto-Launch
chenrylee in Microsoft Teams on
29 Replies
Security Community Webinars
Valon_Kolica in Security, Privacy & Compliance on
13 Replies