Description: Hi I define a full page background image in writer by 1. View->Styles 2. Click on page tab -> create styele and then on bitmap 3. Import bitmap and save with name 4. Apply as a custom size with dimensions of 21 cm x 30 cm This adds the image and I can export it as a pdf with the image When I save, close and reopen the docx file the image has disappeared and I have to re-create the style and import the image etc Steps to Reproduce: 1. View->Styles 2. Click on page tab -> create styele and then on bitmap 3. Import bitmap and save with name 4. Apply as a custom size with dimensions of 21 cm x 30 cm 5. save and close 6. reopen Actual Results: reopen the docx file the image has disappeared and I have to re-create the style and import the image etc Expected Results: ThHe image should still be there as a BG Reproducible: Always User Profile Reset: No Additional Info: Version: 6.3.0.2 (x64) Build ID: 728469fa359ba8c83d812146293a0b0aa53945ba CPU threads: 4; OS: Windows 10.0; UI render: default; VCL: win; Locale: en-GB (en_GB); UI-Language: en-GB Calc: threaded
I confirm it with Version: 6.4.0.0.alpha0+ (x64) Build ID: 8f98a7c4e5b1f0b249c026577805a378b8a533d5 CPU threads: 4; OS: Windows 10.0; UI render: GL; VCL: win; TinderBox: Win-x86_64@42, Branch:master, Time: 2019-07-23_00:30:19 Locale: de-DE (de_DE); UI-Language: en-US Calc: threaded Also happens with other sizes of the bitmap.
The background bitmap DOES remain when the doc is saved in .odt format but not in docx format, if that's any help. If that means that it's not a bug after all, then I'm very sorry!
This is DOCX bug that started with LO 3.3 in which export was added. Background of saved DOCX is not read in LO nor in MSO. DOC is better, background is fine read in MSO meaning that export is fine. If original was saved as Tiled, LO opens it as Stretched. That can be another fileopen bug.
Same with LO 7.1.3.2. Agreeing with the two last comments : background is lost when exporting to DOCX, but not to DOC.
I saw a related report by an openSUSE user. Their report does not require using a style, simply - right click - Page Style - Area - Bitmap and the same observations: completely lost with DOCX, stretched with DOC. (Cf. https://bugzilla.suse.com/show_bug.cgi?id=1133169 )
*** Bug 143885 has been marked as a duplicate of this bug. ***
Everyone can reproduce the bug directly with attachment 152249 [details].
I can confirm with Version: 7.3.4.2 / LibreOffice Community Build ID: 30(Build:2) CPU threads: 8; OS: Linux 5.15; UI render: default; VCL: kf5 (cairo+xcb) Locale: id-ID (id_ID.UTF-8); UI: id-ID Ubuntu package version: 1:7.3.4~rc2-0ubuntu0.20.04.1~lo1 Calc: threaded
(In reply to Robert Cabane from comment #4) > Same with LO 7.1.3.2. > Agreeing with the two last comments : background is lost when exporting to > DOCX, but not to DOC. I have tried also with DOC, and the issue persist (page background lost) Version: 7.3.4.2 / LibreOffice Community Build ID: 30(Build:2) CPU threads: 8; OS: Linux 5.15; UI render: default; VCL: kf5 (cairo+xcb) Locale: id-ID (id_ID.UTF-8); UI: id-ID Ubuntu package version: 1:7.3.4~rc2-0ubuntu0.20.04.1~lo1 Calc: threaded
Still here in Version: 7.5.0.0.alpha0+ (x64) / LibreOffice Community Build ID: 0d3dd0aa54ad792f91d0905f3d46c13df3512d89 CPU threads: 4; OS: Windows 10.0 Build 19043; UI render: Skia/Raster; VCL: win Locale: ru-RU (ru_RU); UI: en-US Calc: threaded and this is very annoying
And MS Word just doesn't support this feature So, I even don't know could we fix it with any way... Justin, could you say us your opinion here?
(In reply to Roman Kuznetsov from comment #11) > And MS Word just doesn't support this feature > I was wrongly here, MS Word support this Justin sorry for noise =(
From bug 135331 comment 6 If my memory is correct, DOCX only has a single place to store the page background. So LO takes the Default Page's background and uses that as the colour. In this multi-coloured page-styled example, the default page style is "none". [Indeed, this is what happens for both DOC and DOCX when I change the default page style (even though it is unused) to a blue background. The entire DOCX becomes blue.]
*** Bug 134822 has been marked as a duplicate of this bug. ***
Both fileopen and filesave have never worked in LO for docx or rtf. However, .doc can import(since 5.0) and export(already in 3.3). Unfortunately, no bibisect exists for 5.0. The xml looks like this <w:background w:color="FFFFFF"> <v:background id="_x0000_s1025" o:bwmode="white"> <v:fill r:id="rId3" o:title="wasta-offline" recolor="t" type="frame"/> </v:background> </w:background> For plain color, LO gained DOCX import and export in LO 4.2 commit 992da0d5cf04497bad55637f6a6ebfcdaec03e16 Author: Miklos Vajna on Mon May 27 17:49:12 2013 +0200 bnc#817956 DOCX import of document background color commit 515701a1ff18d04ede235bef862c465adf41062f Author: Adam Co on Mon Jun 3 09:59:33 2013 +0200 fdo#65257 : DOCX not exporting background color
v:background can have fillcolor,
v:background can have id, fillcolor, filled (overridden by fill child), o:bwmode, o:bwnormal o:bwpure, o:targetscreensize. It can have a fill child: a vml shape that can be gradients, etc. bug 78749 (which dealt with image fill on textboxes) looks like the perfect code to copy for importing the fill child. (export already worked at that point)
Created attachment 192326 [details] pageStyleBitmap2010.docx: minimal document with image fill for background
Created attachment 192532 [details] pageStyleNoBitmap.docx: here is one to throw you for a loop - shouldn't show bitmap
Note that page backgrounds are a bit strange in MSO, very much dependent on display DPI. Using comment 18 as an example, when I open in MSO2003 I see about 25% of the logo, but on a different computer I see 75%.Increasing the zoom level to 200% shows 90% of the logo. Exporting to PDF shows MANY tiles of the logo. So far all my printing (to PDF) tests have printed no logo at all. So "the same background" in MSO and LO is basically impossible (and undesirable) to achieve. Duplicate bug 134822's example document is a nice example of this. The screenshot shows only clouds, but if you zoom to 500% the background changes to show many tiles of the entire image, including lots of green ground and mountains.
*** Bug 152536 has been marked as a duplicate of this bug. ***
Justin Luth committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/c14574e7ad2d3ec2ada40808be3332fac71e9767 tdf#126533 docx import: page background vml fill It will be available in 24.8.0. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Justin Luth committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/ed91971c9312e4b8a33c03c28d339bff6c5accc7 tdf#126533 docx export: page background vml fill: basic image It will be available in 24.8.0. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Justin Luth committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/d7cd7dff0e8f71b3d83b4c91b574f39248a25e2f tdf#126533 docx export: page background vml fill: tiles/patterns It will be available in 24.8.0. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Justin Luth committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/396ece804b3a31e4eddf56de4e557f3755331d8c related tdf#126533 vml import: fix gradient color swapping It will be available in 24.8.0. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Justin Luth committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/f3efd1dc397e2801a30e705120a21a4e384596ec tdf#126533 DOCX: export page vml fill gradient It will be available in 24.8.0. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Justin Luth committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/1a4639dd8024484971859bcce31470584bc6b973 related tdf#126533 DOCX: vml export gradientRadial instead of gradient It will be available in 24.8.0. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Justin Luth committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/b8071eef3b40c9fb2b161901aba9d9105317441f related tdf#126533 vml export: fix axial colors It will be available in 24.8.0. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Justin Luth committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/6dd6891a3deed8718bf2b0fcf564f229f676f8ba related tdf#126533 tdf#159824 VML: don't export: negative angles It will be available in 24.8.0. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Created attachment 192743 [details] Visual comparison: original ODT left, exported DOCX right Thank you, Justin, quite some improvements1 I tested this with today's dev build Version: 24.8.0.0.alpha0+ (X86_64) / LibreOffice Community Build ID: ef57aeb9ed190e18ebc034b9a45e190aea3f8f1d CPU threads: 12; OS: Linux 6.7; UI render: default; VCL: gtk3 Locale: en-US (en_US.UTF-8); UI: en-US and can confirm that saving as DOCX no longer loses a background image. I did note, however, that the background starts a little lower and the tiling aligns differently - see screenshot. Is this unavoidable?
Created attachment 192744 [details] Image used as background in previous example
Justin Luth committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/fe84ced08668ef0030fbd37bea52424fd86c8e7a tdf#126533 rtf import: page background fill It will be available in 24.8.0. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
(In reply to Gerald Pfeifer from comment #30) > I did note, however, that the background starts a little lower and the > tiling aligns differently - see screenshot. Is this unavoidable? Did you see comment 20? I tried our DOC implementation. It too seems to save only in automatic mode (stretched), with no support at all for custom position/size. So far I have been using MSO 2003 for my reference. Today I verified that MSO 2019 still has a super-minimal background UI - where only the picture can be chosen but no options whatsoever. Note that page background is defined using the old VML markup language. All other fills are defined using the more capable and modern DML. Reusing existing code (from textboxes) would seem to require extraordinary effort because our VML expects an SdrObject, but I didn't see any way to get an SdrObject out of our XGraphic. So, I think it is mostly unavoidable, but I'm not that familiar with the capabilities of VML to describe graphics.
Justin Luth committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/589ac948c0650a16c734db7337c6c31b950be151 related tdf#126533 doc export: don't lose "tiled" aspect of image fill. It will be available in 24.8.0. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Justin Luth committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/38083e4c0b5638d69162593c3fbf599da6cd499f related tdf#126533 dml/vml import: import radials as radials It will be available in 24.8.0. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
I consider this bug report as solved (with many caveats). The basic document background (using images, gradients, textures, or patterns) can be imported and exported to the DOCX format, and many supporting VML pattern and gradient fixes were achieved. The main caveat is related to images. For the reasons described in comment 20, there should be no expectation that the background picture in LO will look the same in MSO (unless the image is pre-sized for the intended environment). The main purpose then is just that LO is able to use the DOCX format to retain the selected document background fill for its own use. I did not have time to do any advanced investigation into if it is possible to successfully round-trip any custom image position/size. Therefore the image needs to be pre-sized correctly so that it looks good in automatic (“stretched”) or tiled mode. The MSO UI has no options (in image or texture) for configuring how it will look anyway, so MSO has no expectation of "fancy settings". Textures are just tiled images. These should work great and look identical to MSO. Patterns should also work nicely because they are turned into textures. Gradients should work as well as they work for shapes/textboxes (with the caveat that page background is VML-coded, while shapes and textboxes show DML-coded gradients, so unseen VML bugs may surface). Hatches are unsupported by VML and MSO, and so continue to be turned into a solid color approximation. Supporting hatches would require turning them into a full-page-sized image. See https://gerrit.libreoffice.org/c/core/+/163471 for code pointers, and regression bug 153761 for the failure to do this for shapes/textboxes as well. RTF has very poor support for background fill in general – with basically only gradient import working, so I didn’t worry about that format (although import is wired up so that any improvements should come automatically).
(In reply to Justin L from comment #36) > RTF has very poor support for background fill in general – with basically > only gradient import working, so I didn’t worry about that format (although > import is wired up so that any improvements should come automatically). This should have an explanation in release notes.
(In reply to Justin L from comment #20) > Using comment 18 as an example, when I open in MSO2003 I see about 25% of > the logo, but on a different computer I see 75% That is because the different computer is using display scaling of 150%. [Screen resolution has no effect, so not as bad as I first thought.] For DOCX, MSO always tiles the background. However, for DOC formats it does honour a "stretch" round-trip. However, even is MSO2010 round-trips DOC->DOCX the background imports as tiled. I considered doing the same with https://gerrit.libreoffice.org/c/core/+/165398. However, it looks like a MSO bug to me (since DOC can handle it). So I decided to abandon it.