Page 1 of 2

Conversion error in preview

Posted: Sun Jun 09, 2019 3:00 pm
by MKochS
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 2082 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

Re: Conversion error in preview

Posted: Mon Jun 10, 2019 1:03 pm
by MKochS
...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.

Re: Conversion error in preview

Posted: Mon Jun 10, 2019 3:27 pm
by MKochS
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.

Re: Conversion error in preview

Posted: Thu Jun 13, 2019 5:59 pm
by jllort
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 )

Re: Conversion error in preview

Posted: Fri Jun 14, 2019 6:03 am
by MKochS
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.

Re: Conversion error in preview

Posted: Sun Jun 16, 2019 7:00 pm
by jllort
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

Re: Conversion error in preview

Posted: Sun Jun 16, 2019 8:58 pm
by MKochS
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}

Re: Conversion error in preview

Posted: Wed Jun 19, 2019 1:46 pm
by jllort
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

Re: Conversion error in preview

Posted: Thu Jun 20, 2019 9:01 am
by MKochS
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

Re: Conversion error in preview

Posted: Thu Jun 20, 2019 10:52 am
by jllort
pdf2swf is not into your $TOMCAT_HOME/bin folder

Re: Conversion error in preview

Posted: Thu Jun 20, 2019 10:59 am
by MKochS
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?

Re: Conversion error in preview

Posted: Sat Jun 29, 2019 10:13 am
by jllort
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 )

Re: Conversion error in preview

Posted: Thu Jul 04, 2019 2:31 pm
by MKochS
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 1878 times

Re: Conversion error in preview

Posted: Sun Jul 07, 2019 10:45 am
by jllort
And is not working with this previewer?

Re: Conversion error in preview

Posted: Mon Jul 08, 2019 7:55 am
by MKochS
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.