Unwanted border around images

Although this and some related topics are very old:

I still see the unwanted border when exporting to PDF.

Disabling the text boundary colour and object colour gives expected results on screen.
Setting the object boundary colour to the background colour (which was not white when I noticed it) showed up OK on screen.

But whatever setting I used, when exporting to PDF gave a grey border.

Super annoying, to be honest.

(Also, why is the default setting for exporting to PDF not “range all” but “selection”? So many times I exported only the image that had focus, or just the background. Also very annoying.)

Using Xubuntu 24.04 and LibreOffice Version: 7.3.7.2 / LibreOffice Community, Build ID: 30(Build:2)
CPU threads: 4; OS: Linux 5.15; UI render: default; VCL: gtk3
Locale: sv-SE (en_GB.UTF-8); UI: en-GB
Ubuntu package version: 1:7.3.7-0ubuntu0.22.04.6
Calc: threaded

Attached: PDF with just redacted image and text, everything is the same otherwise.
export-test.pdf (587.8 KB)
export-test.odt (128.7 KB)

What are the properties of your image? (type of graphics, format, …)
Does the format support transparent background? Otherwise what is the colour of image background? If this background does not match exactly your page background, you get a visible artefact on the edges.
Has the image frame in Writer a border? If so, disable it.

For best analysis, extract a single-page sample file with the problematic image and attach it to your question.

Because you use an outdated version. A “fix” for tdf#54908, that made that checked by default, was reverted in 7.5.6 (tdf#139164).

The image is a JPG file so no transparency. The image is a photo in a circle with everything around the photo the same colour as the background of the area on the page. That is why the border is so very obvious (and ugly). The image does not have a border (I don’t see anything named frame). I even tried setting a border in the same colour as the background but the PDF still has the grey border.

I updated my question and added a PDF, exported from LibreOffice.
If needed I can also attach the ODT file.

Only the .odt allows to diagnose the issue.

ODT added as well. Hope this helps! Thanks for helping out!

According to GIMP, background colour in the image is 0xacd788; your margin shape has colour 0xacd688.

Your colours differ slightly in the green component. This is why you seen the limits between both “backgrounds”.

PS: why don’t you use character styles for text variations within a paragraph? Word-educated?

Oh that is interesting, I was sure I copy/pasted the value (in this case from Writer to Gimp). Oh! The XCF has acd688 but the JPG has acd788. Damn JPG… Or Gimp when exporting, of course. No matter how I export (JPG 100%) the colour becomes acd788.

So I changed the margin shape colour to acd788 and I still see the box. Screenshot from a PDF viewer:
image

Erm, never even thought of that, to be honest.

I don’t think I can call any of my experience based on something Microsoft did, I just don’t use word processing software much. I have been a software developer for 30 years, any word processing knowledge started with WordPerfect 4.2 I think. I have never really liked any WYSIWYG editors. Most things I write (documentation or music reviews for my website) is done in extended Markdown, and in a text-only editor.

For my and my wife’s CV I needed something like this but I am thinking of doing it in HTML next time. I have tried before but the export to PDF was hard from a browser when you want to use the whole A4 (as in, covering the margins).

I do get the “Transparency removed” warning every time I export to PDF. The JPG is the only image. Not sure why I get that warning.

Erm… Why is the PDF one single image and not a proper PDF with text that you can select?
Is that a setting somewhere?

Are you sure you really set the correct colour?
I am under Fedora 40, KDE Plasma desktop. Here is what I get when exporting to PDF:
export-test-ajl.pdf (57.0 KB)

Even at 800% magnification I don’t see any edge around the image. And I have no “Transparency removed” warning.

XUbuntu has Xfce desktop. Perhaps the PDF exporter (if not internal to LO) is different from KDE. Do you File>Export As>Export as PDF or File>Print to a PDF file? This could make a difference as the PDF converter is then indeed different.

XUbuntu has Xfce desktop. Perhaps the PDF exporter (if not internal to LO) is different from KDE. Do you File>Export As>Export as PDF or File>Print to a PDF file? This could make a difference as the PDF converter is then indeed different.

I used Export as Pdf but I will try the Print now. Lo and behold, no borders! :smiley:
I do get other weird things though, that the font Bitter Thin I am using for the main header looks very different in the PDF. I will find a font that works, that is not a big problem.

Another big change is that the PDF now actually is a proper PDF and not one big image! What is going on there, I am wondering…

This is not a “standard” font. You installed it specially on your computer. You should then embed it in your PDF; otherwise it gets substituted when rendering.

PDF is “frozen” display format. Since the only goal is to make it look as originally intended, there are many ways to implement WYSIWYG:

  • you can “snapshot” it the same as a scanner would do (full graphics, no font problem)
  • you send character strings with coordinates in the page + original graphics material (probably smaller in size but needs font embedding to guarantee exact rendering)
  • other mixed strategy

There is no “proper” PDF. It is a matter of choice by the converter developer.

I did not get the option to embed the fonts when exporting. The options did gave me the impression a common (OK, not proper, but let 's say common) PDF would be made. I have never seen and never needed a PDF where all text was rendered into a single image unless I asked it to. The internal converter is of no use to me then, even if the border around images was fixed.

The print to file is of course depending on my system. The current one does not give me the option to embed fonts. I guess that is fixable by trying to find another “print to PDF” driver.

But using the print to file option gave me at least the best results. Thanks for the time you put into explaining, it is much appreciated. It will make me keep on using LibreOffice. I tried doing this in OnlyOffice but although the PDF turned out as I expected, the layout is so MS and there is a severe lack of options there, so happy I can keep using LibreOffice! :slight_smile:

Thanks!