Background image for Writer heading not working

My objective:

I’m applying background image to both Heading 1 and Heading 2 in a Writer document.

My problem:

The behaviour of the background image for Heading 2 is inconsistent with that of Heading 1. Heading 2 appears to left align unlike Heading 1, which correctly left aligns.

Both background images are 2250px x 250px. The only difference is graphical in that the width of the coloured area (grey) of Heading 2 is 250px less wide:

image description

What I’ve tried:

I’ve created a test image for Heading 2 in which the coloured area (grey) is not 250px less wide. The result is that the background image is correctly right aligning:

For comparison, these are the three images I’m using:

image description

My question:

Why is this inconsistency occurring and how do I fix it?

I have attached the three images if anyone wishes to test on their end.

heading1.png
heading2-indented.png
heading2-not-indented.png

I get your “incorrect” layout if I set a wide right margin. Have you checked your Heading 2 margins viz. those in Heading 1?

@ajlittoz If I apply the Heading 2 graphic to Heading 1, the same issue persists, therefore, a margin differential isn’t the issue.

It seems to me that the background/area of paragraphs is not consistent (LibreOffice 6.0.2.1). If you have saved the style and try to modify again the default values are shown. If the style’s option is Custom/Scaled the result is okay, as you may see in the screenshot.
.
As a work-around you may try out my “solution”.

In your screenshot, Position is CenterLeft instead of TopRight as in OP; Does it matter?

I could not see any difference.

By the way: In OpenOffice it is pretty easier to manage the background/area of the headers. Only use “area” instead of “position”. You have to alter the style of the heading again after having saved on LibreOffice. But after that OpenOffice and LibreOffice show the same (correct) result.

I have not tested another format of background like jpg. Will the results/behavior of OO/LO change then?

Your solution worked with the exception that the scaling distorts the graphics,

For whatever reason, the default width and height percentages were 176%. If I set the values to 100% before checking the scale checkbox, the style changed to “Original” instead of “Custom” thereby inactivating the scale checkbox. As a workaround,I had to check the scale checkbox first before resetting the height and width values.

I can confirm that the background settings are not preserved.

Unfortunately backgrounds of frames are not stable as shown in a recent thread, too (LO 5.4 and 6.0). OpenOffice can do better/stabler but has got less possibilities for working. Hopefully LibreOffice will improve in future.

As mentioned, the scaling distorted the graphic. I.e. The right diagonal edge of the graphic was no longer forming the 45 degree angle as originally drawn.

I found a workaround by measuring the heading areas to determine the aspect ratio of each. I then recreated my heading graphics to conform to each respective aspect ratio.

Combining the redrawn graphics with your scale solution, I have fulfilled my original objective.

Screen-shot of successful outcome: Libre Office: Background image for Writer heading not working. - Album on Imgur

Thanks!

Final nuances incorporating Heading 3 and Heading 4 to achieve a satisfyingly visually obvious content structure: https://i.imgur.com/ObtsxHo.png