Embed perfect draw.io Diagrams within Google Docs



Embed perfect diagrams from draw.io into Google docs


Embedding perfect quality diagrams can be that trivial but annoying thing. draw.io is a popular tool to make all sorts of diagrams, including UML.

This blog focuses on how you can embed perfect quality diagrams within Google Doc without breaking a sweat. Before I get into the solution, I'd like to introduce you to some possible pain points and wrong ways of doing it.


Typical Problems


  1. Exporting and Importing images to SVG, PNG, JPEG: It turns out Google Docs is lousy at inserting images; and diagram quality dramatically goes down as you import.
  2. Multi Page diagrams: If your diagram spans multiple pages vertically or horizontally, the import resizes the image to fit available are, this causes image sheering. For diagrams this is an absolute disaster as text gets blurry and the lines look unprofessional.


Steps to ensure a great import

  1. Ensure page size matches: Assuming my destination document is an A4; to reduce width incompatibility issues ensure draw.io; knows the page size as well. This may not be absolutely necessary but is recommended.

    Note: If your diagram is wider and does not fit on the draw.io single page; then Try to make it Landscape mode.
  2. Add the draw.io plugin Add-On:

  3. Ensure the diagram vertically fits the page: If there are multiple diagrams on the same draw.io page; it's recommended you break them up across the draw.io canvas TABs and top align them best you can. For a single diagram that vertically extends you should be ok. This is because the plugin imports the diagram page (TAB) wise ; and has no way to access sub-pages within a draw.io TAB.
  4. Export the diagram from draw.io: Simple press "Save" on your draw.io diagram and it will save in the default XML format. Upload this to a google drive.
  5. Import diagram page-by-page into Google Doc: Finally, you can use the draw.io Add-On to import each TAB (indexed 1 left most and sequentially increasing towards the right). This process has to be done TAB (Page) by TAB. Its also a bit slow so be patient.

Comments