Importing drawings from draw.io to Writer

Discuss the word processor
Post Reply
DavideAndrea
Posts: 29
Joined: Thu Aug 23, 2018 1:35 am

Importing drawings from draw.io to Writer

Post by DavideAndrea »

I create drawings in draw.io, which I then need to insert in a Writer document.

Right now I take a screen shot, paste it in a mage editing application, crop it, copy it, paste it in Writer.
That's inconvenient, and converts a vector drawing to a low resolution pixel image.

If I copy a portion of a drawing from draw.io and try to paste it directly in Writer, it pastes the XML text, as plain text:

Code: Select all

%3CmxGraphModel%3E%3Croot%3E%3CmxCell%20id%3D%220%22%2F%3E%3CmxCell%20id%3D%221%22%20parent%3D%220%22%2F%3E%3CmxCell%20id%3D%222%22%20value%3D%2210%22%20style%3D%22text%3Bhtml%3D1%3Bresizable%3D0%3Bpoints%3D%5B%5D%3Bautosize%3D1%3Balign%3Dcenter%3BverticalAlign%3Dtop%3BspacingTop%3D-4%3BfontSize%3D16%3BfontColor%3D%23000000%3B%22%20vertex%3D%221%22%20parent%3D%221%22%3E%3CmxGeometry%20x%3D%227165%22%20y%3D%226547%22%20width%3D%2230%22%20height%3 ...
Which appears to be mxgraph format (https://jgraph.github.io/mxgraph/)

Is there a way to paste that in Writer and get the image, not the text?

draw.io can export to SVG, PDF, html, XML.
Is there a way to insert an image in any of these formats?
Last edited by DavideAndrea on Thu Oct 04, 2018 7:10 pm, edited 2 times in total.
OpenOffice 4.1.1 on Windows Vista
FJCC
Moderator
Posts: 9280
Joined: Sat Nov 08, 2008 8:08 pm
Location: Colorado, USA

Re: Importing drawings from draw.io to Writer

Post by FJCC »

Writer seems to handle the svg format. I used the menu Insert -> Picture -> From File and imported a small svg I pulled off the web.
OpenOffice 4.1 on Windows 10 and Linux Mint
If your question is answered, please go to your first post, select the Edit button, and add [Solved] to the beginning of the title.
DavideAndrea
Posts: 29
Joined: Thu Aug 23, 2018 1:35 am

Re: Importing drawings from draw.io to Writer

Post by DavideAndrea »

Well, that worked!

EDIT: "almost". The drawing is messed up; some elements are replaced by "Not supported by viewer"

I was confused by the fact that the list of supported formats includes SGV, which is not SVG. That confused me.

Thanks!
OpenOffice 4.1.1 on Windows Vista
musikai
Volunteer
Posts: 294
Joined: Wed Nov 11, 2015 12:19 am

Re: Importing drawings from draw.io to Writer

Post by musikai »

Seems that multiline texts are formatted using an xhtml extension.
These multi line texts show "Not supported by viewer" in Writer and even in Inkscape but work in a browser like Inkscape.

You can workaround by using multiple single line text objects.
Win7 Pro, Lubuntu 15.10, LO 4.4.7, OO 4.1.3
Free Project: LibreOffice Songbook Architect (LOSA)
http://struckkai.blogspot.de/2015/04/li ... itect.html
DavideAndrea
Posts: 29
Joined: Thu Aug 23, 2018 1:35 am

Re: Importing drawings from draw.io to Writer

Post by DavideAndrea »

Thanks, but I decided to paste 200% larger png images: guaranteed to work, even at the cost of lower resolution.
OpenOffice 4.1.1 on Windows Vista
John_Ha
Volunteer
Posts: 9584
Joined: Fri Sep 18, 2009 5:51 pm
Location: UK

Re: Importing drawings from draw.io to Writer

Post by John_Ha »

See [Tutorial] Some useful hints on using images for a discussion on how best to handle images in Writer.
LO 6.4.4.2, Windows 10 Home 64 bit

See the Writer Guide, the Writer FAQ, the Writer Tutorials and Writer for students.

Remember: Always save your Writer files as .odt files. - see here for the many reasons why.
Post Reply