Wrong presentation of SVGs in Writer on one of two devices

Hi,
I wann use a very simple SVG file as background in Writer. If i paste the file it’s shown in a wrong way on my PC (see left boarder on the left screenshot). On my notebook everything look fine (right screenshot). I used the exact same SVG file and ODT file on both machines. I am using Ubuntu 20.04 and did a fresh reinstall of LO (I also deleted all the config files before) and Inkscape without success. It’s a small issue, but it looks really annoying on my PC. What could cause this? Thanks in advance.

The question was once answered in the German branch of this ask website:

@gernophil Please avoid multi postings and if not set links at least.

For readers of this post, the difference is a slight thickening at left of the upper line, as if a new segment with a different angle was added to the drawing.

@gernophil: are you 100% sure the files are identical on both machines?
Attach the sample file for careful examination. Mention LO versions on both machines.

1 Like

Ok, sorry for the duplicate. I thought this is the more effective way to ask in both languages. I will continue here. I will keep this in mind for future posts :). Here are the answers to your questions (also from the German post):

When exporting to PDF (and when printing it), it is CORRECT on both machines. SO it seems to be an visual issue in LO.

The SVG is just pasted via drag and drop. No further actions taken since the difference on both machines.

I have not tried to make the SVG with LO from scratch, since it’s made from a template (due to correct angles)

I am running Ubuntu 20.04 on both machines and I try to keep both machines in sync with all tools I use. So both a running Ubuntu 20.04, LO 7.3.2.2 (from PPA: ppa:libreoffice/ppa), Inkscape 1.1.2 (from snapcraft.io)

I uploaded the ODT-file (cannot upload the SVG file)

Thank you for your help :slight_smile:

Test.odt (43.1 KB)

Document displays correctly in my LO 7.2.6.2 under Fedora 35 KDE Plasma desktop.

Since image is not a link, it ends up embedded in the document. Don’t try to draw it directly in Writer if you expect to get an SVG. Writer will not save it as SVG but as a set of internal shapes.

Your image is anchored As character in a “foreground” paragraph. It will not repeat as background of every page. To insert an image as background, you should insert it in the header or footer and anchor it To paragraph. Once done, you can right-click on it and select Properties. The Type tab allows then to position it anywhere in the page. Don’t anchor To page as this will associate the image to a single page of the document.

Perhaps, as a workaround, you could design your drawing (if it is as simple as the sample, i.e. a set of connected lines with precise angles) in Draw. Draw has a feature called connectors where these curves become glued together, so that when you move one, it remains connected to the others. This greatly simplifies drawing of trees, charts or diagrams. Vertical and horizontal lines may remain ordinary lines but slanted lines must be drawn as connectors otherwise they will not connect to their ends (all lines are contained in a bounding rectangle and glue points are located on this bounding rectangle).

The problem seems to be that the (Inkscape) exported SVG file is a complete triangle but cut on 2 edges which remain as parts of the curve entity - but the cut edges are not displayed. It seems that there is the difference between the Inkscape and the LibreOffice SVG machine.

LibreOffice Draw obviously is not able to restore the original triangle (after break or convert the graphic object), but Inkscape.

As I told you in my German reply, there may be a difference between Inkscape and LibreOffice and this manifests in your displayed different results on screen.

The results as a PDF format are without artefacts.

Note: If you edit the PDF file on LibreOffice Draw and on Inkscape you will find different results as well - LibreOffice shows the complete triangle, Inkscape shows the triangle with two cut edges.

So my advice is similar to my former (German) and to @ajlittoz ': Use LibreOffice as a source of generating SVGs. - Cheers


Additum: I extracted your odt file (Pictures directory) and checked the SVG file from there.

Thanks for you comments.

As I already said, I have not taken any further actions with the image within LO, but I will do this. So thank you @ajlittoz. However, this does not explain the different behaviors on my machines.

The Original SVG is indeed a complete triangle. However, your theory also does not explain, why LO on my laptop shows it correctly, but not on my PC. If this would have anything to do with any kind of incompatibility between LO and Inkscape, I should see this issue on both my machines (and you should see it too).

I realized that if I open the original SVG with the default Ubuntu picture viewer, I see the same behavior (my PC shows the artifact, my notebook shows the correct image). So, this has nothing to do with either LO or Inkscape. There seems to be a bug somewhere deeper in some engine for vectorgraphics. Looks like I have to dig a little bit deeper here. Any guesses are welcome even though this is not an LO related topic anymore.

EDIT: It looks like the bug is within the NVIDIA driver. Normally, I use intel graphics on my notebook. So, I switched to nvidia for testing and I got the exact same artifact on my notebook as well. Everything is fine with LO an Inkscape and I think, I am not able to fix this issue. However, since it is just visible on screen and not on paper, I think I can life with it :).

There may be differences in graphics libs and drivers. On the LibreOffice side most notably skia, but even screen resolution is an issue. If you zoom in, does the wrong display stay or vanish?

I guess the only place where you can “do” anything is switching skia on or off - and I don’t know, if this helps. If it is one of the drivers for graphics cards, a bug report is all wich could lead to a solution, if there are no newer/alternative drivers available.

Further to @Wanderer comments about Skia possibly being the issue you could also try

  1. Updating the graphics drivers for both cards
  2. If Skia is enabled, try Force Skis to render graphics , it has fixed some minor rendering issues for me.