Conversion error in preview

We tried to make OpenKM as intuitive as possible, but an advice is always welcome.
Forum rules
Please, before asking something see the documentation wiki or use the search feature of the forum. And remember we don't have a crystal ball or mental readers, so if you post about an issue tell us which OpenKM are you using and also the browser and operating system version. For more info read How to Report Bugs Effectively.
MKochS
Senior Boarder
Senior Boarder
Posts: 59
Joined: Wed Nov 13, 2013 10:40 am
Location: Hessen, Germany

Conversion error in preview

Post by MKochS » Sun Jun 09, 2019 3:00 pm

While viewing the preview of a document (TIF format), I'm getting this error (see attachment).

Code: Select all

Conversion: IO exception executing command: /usr/local/bin/pdf2swf -f -T 9 -t -s storeallcharacters /opt/openkm-6.3.0-community/tomcat/repository/cache/pdf/68082305-fc50-4eb0-a003-a47e5986bd36.pdf -o /opt/openkm-6.3.0-community/tomcat/repository/cache/swf/68082305-fc50-4eb0-a003-a47e5986bd36.swf
2019-06-09_OKM_Err_schreenshot.png
2019-06-09_OKM_Err_schreenshot.png (9.23 KiB) Viewed 2282 times
The progress on the right side shows 100% but the document never loads.

Otherwise the document seems to be fine, I can download and view it.

Is this OpenKM related at all?

Don't get confused by the path, the Version is OpenKM 6.3.7.

Matthias

MKochS
Senior Boarder
Senior Boarder
Posts: 59
Joined: Wed Nov 13, 2013 10:40 am
Location: Hessen, Germany

Re: Conversion error in preview

Post by MKochS » Mon Jun 10, 2019 1:03 pm

...and more error messages, this time after uploading a zipped archive of four otherwise fine tiff documents:

Code: Select all

Conversion: convert: Bad code word at line 3506 of strip 0 (x 2130). `Fax4Decode' @ error/tiff.c/TIFFErrors/564. convert: Premature EOL at line 3506 of strip 0 (got 2130, expected 2480). `Fax4Decode' @ warning/tiff.c/TIFFWarnings/912. convert: Bad code word at line 3506 of strip 0 (x 227). `Fax4Decode' @ error/tiff.c/TIFFErrors/564. convert: Premature EOL at line 3506 of strip 0 (got 227, expected 2480). `Fax4Decode' @ warning/tiff.c/TIFFWarnings/912. convert: Premature EOL at line 3506 of strip 0 (got 2133, expected 2480). `Fax4Decode' @ warning/tiff.c/TIFFWarnings/912. convert: Premature EOL at line 3506 of strip 0 (got 2275, expected 2480). `Fax4Decode' @ warning/tiff.c/TIFFWarnings/912. 
Edit: apparently not connected to the OpenKM version, the same problem occurs in 6.3.2 and 6.3.3. Just tried different snapshots. I've had it with four documents in a row, though, and that's remarkable.

The documents are typically multi-page scanned documents in TIFF format.

MKochS
Senior Boarder
Senior Boarder
Posts: 59
Joined: Wed Nov 13, 2013 10:40 am
Location: Hessen, Germany

Re: Conversion error in preview

Post by MKochS » Mon Jun 10, 2019 3:27 pm

It might be issues with helper applications.

On the old system, I used to have pdf2swf in /usr/local/bin. pdf2swf is supposed to come with the swftools-package. It is installed, but pdf2swf isn't there. Copied it from /opt/openkm-6.3.0-community/tomcat/bin to /usr/local/bin and now I'm getting this with the same file as above:

Code: Select all

Conversion: Error: May not be a PDF file (continuing anyway) Error: PDF file is damaged - attempting to reconstruct xref table... Error: Couldn't find trailer dictionary Error: Couldn't read xref table 
Am I missing some applications?

This section from catalina.out might be of interest:

Code: Select all

2019-06-10 17:39:40,911 [http-bio-127.0.0.1-8080-exec-6] WARN  com.openkm.util.ExecutionUtils- Abnormal program termination: 1
2019-06-10 17:39:40,911 [http-bio-127.0.0.1-8080-exec-6] WARN  com.openkm.util.ExecutionUtils- CommandLine: [/usr/local/bin/pdf2swf, -f, -T, 9, -t, -s, storeallcharacters, /opt/openkm-6.3.0-community/tomcat/repository/cache/pdf/3a4aef3b-a0b8-468f-b10b-8f5e99e542fb.pdf, -o, /opt/openkm-6.3.0-community/tomcat/repository/cache/swf/3a4aef3b-a0b8-468f-b10b-8f5e99e542fb.swf]
2019-06-10 17:39:40,912 [http-bio-127.0.0.1-8080-exec-6] WARN  com.openkm.util.ExecutionUtils- STDERR: Error: May not be a PDF file (continuing anyway)
Error: PDF file is damaged - attempting to reconstruct xref table...
Error: Couldn't find trailer dictionary
Error: Couldn't read xref table

2019-06-10 17:39:40,913 [http-bio-127.0.0.1-8080-exec-6] ERROR com.openkm.servlet.frontend.ConverterServlet- Error: May not be a PDF file (continuing anyway)
Error: PDF file is damaged - attempting to reconstruct xref table...
Error: Couldn't find trailer dictionary
Error: Couldn't read xref table

com.openkm.core.ConversionException: Error: May not be a PDF file (continuing anyway)
Error: PDF file is damaged - attempting to reconstruct xref table...
Error: Couldn't find trailer dictionary
Error: Couldn't read xref table
A pdf2swf problem maybe?

Code: Select all

# /opt/openkm-6.3.0-community/tomcat/bin/pdf2swf -V
pdf2swf - part of swftools 0.9.0
The swftools package from the distro is Version: 0.9.2+git20130725-4.1, but this doesn't contain pdf2swf, so I used the one that came with OpenKM.

The file in question isn't a pdf but a tiff file.

jllort
Moderator
Moderator
Posts: 10911
Joined: Fri Dec 21, 2007 11:23 am
Location: Sineu - ( Illes Balears ) - Spain
Contact:

Re: Conversion error in preview

Post by jllort » Thu Jun 13, 2019 5:59 pm

In the latest OpenKM versions we are not using pdf2swf consider as a deprecated feature. I suggest upgrading. In latest version might be issues with ImageMagick or Ghostscript library, but will raise other kind of messages ( not usual but sometime might happens )

MKochS
Senior Boarder
Senior Boarder
Posts: 59
Joined: Wed Nov 13, 2013 10:40 am
Location: Hessen, Germany

Re: Conversion error in preview

Post by MKochS » Fri Jun 14, 2019 6:03 am

Currently my configuration contains

Code: Select all

system.swftools.pdf2swf	String 	/usr/local/bin/pdf2swf -f -T 9 -t -s storeallcharacters ${fileIn} -o ${fileOut} 
What would be the preferred application then? Pdf2swf apparently isn't shipped with up-to-date distributions anymore, the most recent version is 0.9.2. I've downloaded and compiled swftools and have been using both 0.9.0 (used to work with OpenKM 6.3.1 Debian Wheezy) and 0.9.2. Neither of them works with Devuan Ascii and OpenKM 6.3.8.

jllort
Moderator
Moderator
Posts: 10911
Joined: Fri Dec 21, 2007 11:23 am
Location: Sineu - ( Illes Balears ) - Spain
Contact:

Re: Conversion error in preview

Post by jllort » Sun Jun 16, 2019 7:00 pm

In the latest version, we have introduced the use of PDF.js previewer. In case PDF files I think pdf2swf is no longer used. Here still we have some work to definitively remove flexpaper and set by default PDF.js

MKochS
Senior Boarder
Senior Boarder
Posts: 59
Joined: Wed Nov 13, 2013 10:40 am
Location: Hessen, Germany

Re: Conversion error in preview

Post by MKochS » Sun Jun 16, 2019 8:58 pm

What would the proper configuration look like then? Currently I have this section in my OpenKM.cfg:

Code: Select all

system.imagemagick.convert=/usr/bin/convert
system.openoffice.path=/usr/lib/libreoffice
system.swftools.pdf2swf=/opt/openkm/bin/pdf2swf -f -T 9 -t -s storeallcharacters ${fileIn} -o ${fileOut}

jllort
Moderator
Moderator
Posts: 10911
Joined: Fri Dec 21, 2007 11:23 am
Location: Sineu - ( Illes Balears ) - Spain
Contact:

Re: Conversion error in preview

Post by jllort » Wed Jun 19, 2019 1:46 pm

Current configuration really is shown in Administration / Configuration parameters. The OpenKM.cfg file only helps on the initial setting, but after the first startup is only used the database data

MKochS
Senior Boarder
Senior Boarder
Posts: 59
Joined: Wed Nov 13, 2013 10:40 am
Location: Hessen, Germany

Re: Conversion error in preview

Post by MKochS » Thu Jun 20, 2019 9:01 am

It's the same setting there.
Auswahl_010.png
So, in order to use your recommended setting, what would it have to be like?

Matthias

jllort
Moderator
Moderator
Posts: 10911
Joined: Fri Dec 21, 2007 11:23 am
Location: Sineu - ( Illes Balears ) - Spain
Contact:

Re: Conversion error in preview

Post by jllort » Thu Jun 20, 2019 10:52 am

pdf2swf is not into your $TOMCAT_HOME/bin folder

MKochS
Senior Boarder
Senior Boarder
Posts: 59
Joined: Wed Nov 13, 2013 10:40 am
Location: Hessen, Germany

Re: Conversion error in preview

Post by MKochS » Thu Jun 20, 2019 10:59 am

It isn't, but would that make a difference? It used to be like that on the old Debian Wheezy installation and worked fine.

Edit: changed the path to the pdf2swf file in $TOMCAT_HOME/bin, but it makes no difference, and as you said, pdf2swf is deprecated anyway.

What would the suggested setting be?

jllort
Moderator
Moderator
Posts: 10911
Joined: Fri Dec 21, 2007 11:23 am
Location: Sineu - ( Illes Balears ) - Spain
Contact:

Re: Conversion error in preview

Post by jllort » Sat Jun 29, 2019 10:13 am

Try to enable Acrobat plugin preview option in the profiles. Anyway I have revised the source code and in version 6.3.7 all the PDF documents and convertible to PDF should use PDF.js ( ensure you have cleaned browser cache, might be you still have old html and js files from the previous OpenKM version )

MKochS
Senior Boarder
Senior Boarder
Posts: 59
Joined: Wed Nov 13, 2013 10:40 am
Location: Hessen, Germany

Re: Conversion error in preview

Post by MKochS » Thu Jul 04, 2019 2:31 pm

jllort wrote:
Sat Jun 29, 2019 10:13 am
Try to enable Acrobat plugin preview option in the profiles.
It has always been enabled in all profiles.
Auswahl_011.png
Auswahl_011.png (1.67 KiB) Viewed 2078 times

jllort
Moderator
Moderator
Posts: 10911
Joined: Fri Dec 21, 2007 11:23 am
Location: Sineu - ( Illes Balears ) - Spain
Contact:

Re: Conversion error in preview

Post by jllort » Sun Jul 07, 2019 10:45 am

And is not working with this previewer?

MKochS
Senior Boarder
Senior Boarder
Posts: 59
Joined: Wed Nov 13, 2013 10:40 am
Location: Hessen, Germany

Re: Conversion error in preview

Post by MKochS » Mon Jul 08, 2019 7:55 am

This is what I'm getting:
Auswahl_013.png
The error message complains about the file not being a PDF (that's right, it isn't a PDF but a TIFF). The progress disc to the right is rotating at 100% and never stops.

That's not happening with all TIFFs, only with some (but an increasing number it appears). I haven't found a pattern yet. The only workaround is to download the file and convert it into a PDF (online conversion isn't working as well). That's very unsatisfactory because we deliberately wanted to avoid proprietory formats.

All other formats (PNG, PDF, various office suite formats) work fine.

Post Reply