Bug 39355 - PDF A/1-a export broken in 64 bit builds
Summary: PDF A/1-a export broken in 64 bit builds
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Printing and PDF export (show other bugs)
Version:
(earliest affected)
3.4.1 release
Hardware: x86-64 (AMD64) All
: medium critical
Assignee: Fridrich Strba
URL:
Whiteboard: target:3.4.4
Keywords: regression
: 38347 (view as bug list)
Depends on:
Blocks:
 
Reported: 2011-07-18 13:47 UTC by Stefan Knorr (astron)
Modified: 2012-09-05 11:20 UTC (History)
7 users (show)

See Also:
Crash report or crash signature:


Attachments
Broken PDF A/1 (16.41 KB, application/x-unknown)
2011-07-18 13:47 UTC, Stefan Knorr (astron)
Details
Original LibreOffice writer and calc files, with faulty A/1-a PDF (56.83 KB, application/zip)
2011-09-01 04:15 UTC, Guillaume Majeau-Bettez
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Stefan Knorr (astron) 2011-07-18 13:47:13 UTC
Created attachment 49274 [details]
Broken PDF A/1

To reproduce:
* Write something in your document (or don't)
* Click "File" > "Export as PDF..."
* Check "PDF A/1-a" on the first tab
* Click "Export"
* Try opening with Adobe Reader (I'm using version 9).
* Let Reader tell you your document has an "invalid color space"

This bug can be very embarrassing, I, for instance, mostly use Evince which shows the document fine, but sent this document to someone using Adobe Reader which of course wouldn't open it.
This seems to happen in all LibreOffice application.
Comment 1 Stefan Knorr (astron) 2011-07-18 15:18:50 UTC
* Not reproducible under Windows (32-bit) with any LibreOffice version
* Not reproducible under Ubuntu (64-bit) with LibreOffice 3.3.3
* Reproducible under Ubuntu (64-bit) with LibreOffice 3.4.1

Can anyone with Mac OS or 32-bit Linux please check?
Comment 2 gleppert 2011-07-19 15:07:24 UTC
Not reproducible on Ubuntu 11.04, LibreOffice 3.3.3 OOO330m19 (Build:301), German UI, Intel 32-bit
Comment 3 gleppert 2011-08-03 04:57:09 UTC
Testing again with 3.4.2rc2 on Ubuntu, 32-bit. Here, I cannot confirm this bug when following Aaron's description. As this seems to be 64-bit related, can anyone test this bug with a 64-bit Linux and LibreOffice 3.4.x? Thanks.
Comment 4 Michael 2011-08-03 14:21:37 UTC
I can reproduce this bug on LibreOffice 3.4.2 / Gentoo 64bit
Comment 5 spam4sven 2011-08-15 04:25:03 UTC
I can reproduce it too, Kubuntu 11.04, 64-Bit. I´m not using the LO-Version shipped with Kubuntu. I removed this and downloaded the DEB-installation files. 

The PDF fails to open only in Acrobat Reader - Okular, e.g., works fine. I receive the error message "Falscher Farbraum" what means wrong color space.
Comment 6 Carlo Strata 2011-09-01 01:08:46 UTC
Hi Everyone,

may be this issue is related to this old one
https://bugzilla.novell.com/show_bug.cgi?id=467181

whose title was "PDF/A export broken - Adobe Acrobat reports Invalid ColorSpace" and the fix would be the same because it's a new regression?

Hope that help,

Carlo
Comment 7 Carlo Strata 2011-09-01 01:51:49 UTC
I have just tested on:

- linux updated OpenSuse 11.2, kernel 2.6.38.6, x86-64;
- LibreOffice, vanilla, 3.4.3 (rc2/final), rpm, x86-64;
- export an odt file to pdf/A-1a;
- well opened on Evince 2.30.3, document viewer, use poppler/cairo (0.12.3);
- not opened with "Invalid color space" on Adobe Acrobat Reader 10.1.0, win32, ita guied, on Windows Vista, ita guied, SP2, 64 bit (x86-64).

Have a nice day,

Carlo
Comment 8 Rainer Bielefeld Retired 2011-09-01 04:01:51 UTC
NOT reproducible with own sample and "LibreOffice 3.4.3 RC2 - WIN7 Home Premium (64bit) German UI [OOO340m1 (Build:302)]". My samples open fine with AR X.
Seems to be Linux (64bit) specific.

I can confirm the effect with reporter's PDF sample, but without source document it's useless.

Indeed, might be <https://bugzilla.novell.com/show_bug.cgi?id=467181> has come back, but that's not sure.

I believe eit's CONFIRMED by several users

@Aaron Strontsman:
Please contribute complete information concerning your PDF settings and
contribute a text kit (all files zipped into it ) with
- source.odt (as simple as possible)
- exportresult.PDF

That might ease debugging very much.

Do you also see the problem for exports from CALC and DRAW?
Comment 9 Guillaume Majeau-Bettez 2011-09-01 04:15:41 UTC
Created attachment 50803 [details]
Original LibreOffice writer and calc files, with faulty A/1-a PDF

File saved in LibreOffice 3.4.2
OOO340m1 (Build:203)
Ubuntu linux 64 bit 11.04
Comment 10 Rainer Bielefeld Retired 2011-09-01 04:52:32 UTC
Thank you, that was quick.
<http://www.pdf-tools.com> rated LibreOffice3_4_2_340_203_UbuntuLinux64bitmy.pdf as ok, but I can't tell whether it's reliable.

For the one woh needs A/1 this really is a blocker, but I believe only very few users need that option, so only "Major". I do not see this one blocking Bug 35673
Comment 11 Rainer Bielefeld Retired 2011-09-01 05:05:09 UTC
@Lubos:
Please feel free to reassign (or reset Assignee to default) if it’s not your area or if provided information is not sufficient. Please set Status to ASSIGNED if you accept this Bug.
Comment 12 Stefan Knorr (astron) 2011-09-01 08:36:00 UTC
@Rainer:
* you're (most probably) using 32-bit LibO (on a 64-bit OS) -- so you don't see the bug
* the minimal test case is an empty document (@Guillaume: thanks)
* it happens after deleting LibO profile in vanilla LibO

@Carlos:
Thanks a lot.
Comment 13 Rainer Bielefeld Retired 2011-09-01 08:54:19 UTC
Aaron Strontsman:
Arghh, yes! We still do not have a convention that we WIN users using "Builds off the peg" understand. It would be great if you could leave a hint on <http://wiki.documentfoundation.org/QA-FAQ#Bugzilla_HowTos> how to mark "LibO 64 bit builds" unitary and different from "64bit-OS". May be "64bit-build" in the subject line or similar?
Comment 14 Lionel Elie Mamane 2011-09-02 02:29:06 UTC
(In reply to comment #6)

> may be this issue is related to this old one
> https://bugzilla.novell.com/show_bug.cgi?id=467181

> whose title was "PDF/A export broken - Adobe Acrobat reports Invalid
> ColorSpace" and the fix would be the same because it's a new regression?

This seems spot on; most of the patch introduced as part of the resolution of the bug you link to is inactivated (detected as trailing garbage by patch), because a new hunk was inserted incorrectly (stealing this hunk's "  ***************" marker), in

 commit cf6aa9b361479a482898d0728f6849953f25c6be
 Author: Tor Lillqvist <tlillqvist@novell.com> 
 Date:   Mon Jan 24 01:19:29 2011 +0200

     Use MSVC settings not just on x86

(in core)

I'm working on it, will commit shortly (after test).
Comment 15 rk601 2011-09-02 04:38:27 UTC
On 2011-07-18 15:18:50 PDT Aaron Strontsman asked:

"Can anyone with Mac OS or 32-bit Linux please check?"

ANSWER: Not reproducible under Mac OSX 10.6.8 with LibO-dev 3.5.0 
Build ID: eefb4c7-f2188a3-4eb4f62-09af278 and Acrobat Pro 9.4.5
Comment 16 Lionel Elie Mamane 2011-09-02 06:30:45 UTC
Fixed (again) in master branch (to become 3.5); backport of fix to 3.4 (to be included in 3.4.4) requested.
Comment 17 Carlo Strata 2011-09-02 08:21:39 UTC
Great work! Thank you very much!

Carlo
Comment 18 Lionel Elie Mamane 2011-09-02 09:01:19 UTC
The fix is now also committed to 3.4 branch; the fix will be in 3.4.4
Comment 19 rpr 2011-11-11 07:06:05 UTC
*** Bug 38347 has been marked as a duplicate of this bug. ***
Comment 20 Lionel Elie Mamane 2011-11-24 08:06:18 UTC
As 3.4.4 is releasing, closing this bug
Comment 21 Lionel Elie Mamane 2011-11-24 08:06:39 UTC
As 3.4.4 is released, closing this bug.
Comment 22 albertozugno 2012-09-01 22:32:12 UTC
Bug opened again.

On Linux Mint 13 KDE 64 bit and LibreOffice from PPA, version 3.6.0.2

Broken PDF A/1

To reproduce:
* Create a document in Writer
* Click "File" > "Export as PDF..."
* Check "PDF A/1-a" on the first tab
* Click "Export"
* Try opening with Adobe Reader (I'm using version 9).
* Using any validating tool (as http://www.validatepdfa.com/en/online.htm ) you will get an "invalid color profile" error.
Comment 23 Lionel Elie Mamane 2012-09-02 04:24:24 UTC
@Fridrich: this bug was corrected by the "use typedefs and endianess from sal" patch hunk from icc/SampleICC-1.3.2.patch

Since you removed that file, I'm going to blindly reassign to you. Please take a look.

See commits:
 3b32204d9f900130cd1877675d8b51281b81f90d
 9e635f111dad04be717913100cdaf2de4112a245

and

 https://bugzilla.novell.com/show_bug.cgi?id=467181
Comment 24 Fridrich Strba 2012-09-05 08:52:22 UTC
My main problem is that I am unable to reproduce the problem on my 64-bit system with LO master build or 3.6.1 release :(

The change in which I removed the icc module was just removing a duplicate functinality. Some modules of LibreOffice use liblcms2 for colour management and the library can generate just fine a sRGB profile. I generate it using that library (which has no know endianess issues) and push it byte by byte into the PDF file.

I tried to follow with the above mentioned steps, but for me acrobat reader 9.5.1 on Linux opens the file just fine and indicates to the user that it is viewed in PDF/A mode.

I don't mind to fix the issue if other people have it, but I would really need some help in determining where the problem actually lies.
Comment 25 Lionel Elie Mamane 2012-09-05 11:20:46 UTC
(In reply to comment #24)

> My main problem is that I am unable to reproduce the problem on my 64-bit
> system with LO master build or 3.6.1 release :(

> I tried to follow with the above mentioned steps, but for me acrobat reader
> 9.5.1 on Linux opens the file just fine and indicates to the user that it is
> viewed in PDF/A mode.

Indeed, Adobe Acrobat Reader does not complain, but it does not validate the file any more than it needs to display it. Validators *do* complain.

The new problem is different than the one in this bug, and probably not 64bit-specific. Opened bug 54546 to track the new problem, and closing this one again.