Bug 38619 - PRINTING: Picture of type WMF is not printed correctly on Windows.
Summary: PRINTING: Picture of type WMF is not printed correctly on Windows.
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
(earliest affected)
3.4.1 RC2
Hardware: Other Windows (All)
: highest major
Assignee: Radek Doulik
Depends on:
Blocks: mab4.1
  Show dependency treegraph
Reported: 2011-06-23 13:36 UTC by Regina Henschel
Modified: 2015-01-22 15:28 UTC (History)
7 users (show)

See Also:
Crash report or crash signature:

container with odt-file, linked picture and scan of the printer output (339.27 KB, application/x-zip-compressed)
2011-06-23 13:36 UTC, Regina Henschel
Logo on first page and embedded charts prints incorrect (181.89 KB, application/vnd.oasis.opendocument.text-template)
2011-07-13 04:22 UTC, Leif Lodahl
Text document with WMF cannot be printed (30.00 KB, application/msword)
2013-03-21 14:41 UTC, Timur
Print results using different LO versions (732.65 KB, application/x-7z-compressed)
2014-02-21 14:51 UTC, Mike Kaganski

Note You need to log in before you can comment on or make changes to this bug.
Description Regina Henschel 2011-06-23 13:36:36 UTC
Created attachment 48355 [details]
container with odt-file, linked picture and scan of the printer output

Open attached zip-file. It contains an odt-file with a linked picture, the picture itself and a scan of the printer output.
You can see, that the picture is not printed correctly.
The same document is printed correctly using OOo version DEV300m106.
I have got the printer "HP Color Laserjet 2605dn". I use Win XP and have tested it with LibO3.4.1 rc2.
Comment 1 Regina Henschel 2011-06-23 14:44:13 UTC
It prints correctly in LibO3.3.2.
Comment 2 Thorsten Behrens (allotropia) 2011-06-23 15:28:56 UTC
Radek, any chance to quickly look into this?
Comment 3 Leif Lodahl 2011-07-13 04:22:32 UTC
Created attachment 49034 [details]
Logo on first page and embedded charts prints incorrect
Comment 4 Leif Lodahl 2011-07-13 04:25:30 UTC
I can confirm with the attached file with embedded objects.
Happens only on Windows.

Logo on first page doesn't print at all.
Embedded charts (MS) doesn't print correctly and looks very similar to the other attachment from Regina Henschel.
Comment 5 Rainer Bielefeld Retired 2011-07-15 03:11:49 UTC
Any idea with what version that problem started in LibO?
Comment 6 Rainer Bielefeld Retired 2011-07-15 04:04:32 UTC
All Print-Tests with FreePDF printer.

Printing is ok with Regina's original sample and "LibreOffice Portable 3.3.0  - WIN7  Home Premium (64bit) German UI [OOO330m19 (Build:6 Tag]", so problem came into LibO some later.

[Reproducible] with Regina's original sample and "LibreOffice 3.4.1  - WIN7  Home Premium (64bit) German UI [OOO340m1 (Build:103)]", looks exactly as in Regina's scan.

PDF Esport is not affected.

Print looks fine again with Regina's original sample and Master "LibO-dev 3.4.5  – WIN7  Home Premium  (64bit) English UI 
[(Build ID:d337f79-a24c961-2865670-9752b71-7f8fd43

Due to Regina's Comment 2 it Seems to be something in the 3.4 Branch

May be "WIN only" might interest Tor?
Comment 7 Rainer Bielefeld Retired 2011-07-15 04:11:26 UTC
Leif's sample: same results! Print problems with 3.4.1, looks perfect in print from Master.
Comment 8 Regina Henschel 2011-07-15 04:47:14 UTC
I have just tested LO3.4.2rc1. Now wmf-pictures print fine for me. Leif, can
you please test it too with LO3.4.2rc1 and then close the bug in case it works
for you too.
Comment 9 Björn Michaelsen 2011-12-23 13:25:00 UTC
Since all new unconfirmed bugs start in state UNCONFIRMED now and old unconfirmed bugs were moved to NEEDINFO with a explanatory comment, all bugs promoted above those bug states to NEW and later are automatically confirmed making the CONFIRMED whiteboard status redundant. Thus it will be removed.
Comment 10 Cor Nouws 2012-12-16 11:50:02 UTC
comments show it's solved a long time - no Windows available to test here..
Comment 11 Timur 2013-03-06 15:28:23 UTC
I had a similar problem, I couldn't print a .doc with a picture in it, probably WMF because Save Graphics offers WMF, so I stumbled upon this bug. 
I tested Printtest in LibreOffice on Ubuntu and LO in Ubuntu prints fine. 
I tested Printtest in LibreOffice and on Windows 7 and while Export as PDF exports correctly, Print to PDF (with PDF Creator and PDFill) DOESN'T print correctly.
Comment 12 Timur 2013-03-11 10:46:44 UTC
If there are no other findings, I change NEEDINFO to NEW.
Comment 13 Michael Meeks 2013-03-16 17:54:46 UTC
Radek did a chunk of EMF/WMF fixing recently on master / back-ported to 4.0.2, I wonder if that helped this issue; testing of a recent master snapshot appreciated.
Comment 14 Regina Henschel 2013-03-16 19:01:30 UTC
The error is still there in
Version (Build ID: 2c9d3817429b1537ea31521cb263a52ce9c7968)
in Windows 7.
Comment 15 Timur 2013-03-18 15:03:22 UTC
I confirm the problem with libreoffice-4-0~2013-03-18_07.00.22_LibO-Dev_4.0.3.0_Win_x86. 
While I wrote that Export as PDF exports correctly, for some other file it doesn't. Print to PDF (with PDF Creator and PDFill) and Print to printer don't print correctly.
Comment 16 Rainer Bielefeld Retired 2013-03-21 14:15:06 UTC
Can it be that there are additional conditions for appearance of the "missing parts of .wmf in print?
I checked with  "LibreOffice " German UI/ German Locale [Build-ID: 5b93205] {pull date 2013-01-18} on German WIN7 Home Premium (64bit), print showed both (blue and red) graphs in chart printed to FreePDF and Laser Printer Samsung CLX-3185FN

I do not think that this one is related to 61913, because this one 
* appeared much more early
* only parts of .wmf missing instead of complete .wmf

So I delete relation for now.
Comment 17 Timur 2013-03-21 14:41:13 UTC
Created attachment 76865 [details]
Text document with WMF cannot be printed

This text document (.doc or .odt not important) with WMF cannot be printed.
Opening of Print dialog very slow. Print preview icon in Print dialog wrong. Prints only part of WMF.
Comment 18 Timur 2013-03-21 14:42:50 UTC
I add Bug 39256 - Deficiencies in WMF importer implementation at See also.
Comment 19 Michael Meeks 2013-03-26 18:30:32 UTC
Looks like we've had several regressions here - I can no longer load Regina's document and see the embedded WMF at all with 4.0.2rc1 or master as of ~now - I get a broken-image box: apparently we used to do better.

Timur's document loads beautifully, but then Export -> PDF [ which is nicer to test than platform-specific printing I guess ], shows some horrible scaling issue - the entire document has become massive there.
Comment 20 Fridrich Strba 2013-03-26 22:15:30 UTC
(In reply to comment #19)
> Looks like we've had several regressions here - I can no longer load
> Regina's document and see the embedded WMF at all with 4.0.2rc1 or master as
> of ~now - I get a broken-image box: apparently we used to do better.

The document assumes that the WMF is in the same directory as the document. It is linked, not embedded. It loads under this condition here just fine in master and 4-0 branch builds. We fixed a load of issues concerning WMF files in 4-0-2 branch.
Comment 21 Michael Meeks 2013-03-26 22:28:07 UTC
> The document assumes that the WMF is in the same directory as the document.

Wow I'm a dofus :-) sorry for not checking that.
Comment 22 Timur 2013-03-27 09:20:56 UTC
I change back the title from "Various wmf import problems" to "PRINTING: Picture of type WMF is not printed correctly".
Comment 23 Michael Meeks 2013-03-27 11:04:38 UTC
Soo - after the thrash; I'm confused - importing Regina's WMF into LibreOffice 4.1 BuildId: 2c0c17a6e4bee0ee28131ea4bdc47edc700d659 - not only works perfectly (thanks Fridrich), but also prints beautifully for me on Linux / CUPS in colour as expected, and converts to PDF just fine.

I suggest that we focus this bug back on this single problem: adding many other issues to the originally clean and well-specified issue (thanks Regina) does no favours to anyone.

Leif - your log on page 1 prints fine for me on Linux. However page 9 - with the charts fails to print - it seems to suffer from some hideous scaling / mapping problem similar to the one that I see in Timur's document. Since both of those reproduce easily on Linux and with the export -> PDF - I have re-file those rather similar problems as bug#62806 separately; lets consider them closed here.

Timur - thanks for fixing the title, I added the windows-specific nature there, it rather important it seems for Regina's bug.
Comment 24 Regina Henschel 2013-03-27 14:20:01 UTC
It is likely a Windows only problem. I get the correct graphic, when I print on the same printer with LO3.5 on OpenSuse using Postscript. On Windows the printer language is PCL5e.
Comment 25 Michael Meeks 2013-04-19 13:31:13 UTC
Tor might have some insight / input ...
Comment 26 Timur 2013-06-13 09:27:20 UTC
Due to https://bugs.freedesktop.org/show_bug.cgi?id=62719#c11 I tested with master~2013-06-12_17.44.21_LibreOfficeDev_4.2.0.0.alpha0_Win_x86 but no change, the problem still exist.
Comment 27 tommy27 2013-08-08 10:58:11 UTC
tested on Win7 64bit and LibO 4.0.4 and 4.1.0 final releases.

I'm on vacation with no printer available.

I tried to print with a virtual PDF printer (Bullzip PDF) and I see that most of the image is lost in the pdf output. direct PDF export seems broken as well with loss of part of the image.

both versions have the same issues. as a side note, the print dialog was very slow to show up.

I move this to mab4.0 since 3.6.x is EOL.
Comment 28 Björn Michaelsen 2014-01-17 09:58:47 UTC
(This is an automated message.)

Setting priority to highest as this is a 4.0 MAB. This is part of an effort to make the importance of MAB reflected in priority too.
Comment 29 Stéphane Guillou (stragu) 2014-02-12 08:01:53 UTC
Moving to mab4.1 (Bug 60270) because:
- 4.0 reached EOL (End Of Life)
- bug confirmed in later version
Comment 30 Mike Kaganski 2014-02-21 14:51:34 UTC
Created attachment 94515 [details]
Print results using different LO versions

Here are results of printing of Regina Henschel's Printtest.odt from comment 0 under Win7x64 using 42 different versions of LO from up to All were created on one computer, server installations, using identical procedures. A virtual printer PDFill was used (like in Timur's comment 11 and comment 15), set to producing PNGs.
As the pictures show, there were actually two runs of the OP problem: versions 3.4.0-3.4.1 and versions 4.0.0- All other versions were (and are) unaffected.

So, observations reported in comment 0, comment 1, comment 6, comment 7, comment 15, comment 16, and partially comment 11 (regarding could be confirmed. But I cannot confirm comment 14, comment 27, as well as that part of comment 11 saying about problem in

I only tested the original doc, and didn't test other attached documents.

Possibly there are still many different problems, as Michael Meeks noted. I suppose that this old MAB should be closed as WORKSFORME, and separate bugs should be filed if necessary, for their own test documents. Or better, if the specific commit could be found, that fixed this, a unit test could be produced to stop the bug from reappearing.
Comment 31 Michael Meeks 2014-02-21 17:09:41 UTC
Hi Mike - wow that is an amazing bit of detective / QA work you did there; the images are amazingly helpful. Really glad that we fixed that a while back, and managed to get it deployed in the leaf nodes there.

We have had a number of WMF and particularly EMF+ fixes in 4.2; and fdo#39256 makes a great tracker for those; so I'd recommend closing this for now.

Thanks again Mike for poking it & doing the hard work there !
Comment 32 Timur 2014-02-27 10:21:38 UTC
Attachment https://bugs.freedesktop.org/attachment.cgi?id=76865 from https://bugs.freedesktop.org/show_bug.cgi?id=38619#c17 still not printed correctly. 
If this bug is closed, that needs to be filed separately.
Comment 33 Mike Kaganski 2014-02-27 11:51:46 UTC
(In reply to comment #32)
1. I confirm that this attachment does have problems printing.
2. But the document is .doc, not .odt (unlike the original one).
3. And the original image format in this .doc is EMF, not WMF (tested by converting it to docx and unzipping, and by using shareware Office Image Extraction Wizard).

As the original document is printed fine, this is definitely another problem, that should be tracked separately. Please file another issue for it, and I'll confirm it as soon as you drop me a note.

Thank you!
Comment 34 Timur 2014-02-27 13:39:24 UTC
Added https://bugs.freedesktop.org/show_bug.cgi?id=75574. 
I close this one. Thank you.
Comment 35 Mike Kaganski 2014-02-28 01:10:14 UTC
WORKSFORME, as the specific commit is unknown.