• Conversion error in preview

  • We tried to make OpenKM as intuitive as possible, but an advice is always welcome.
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.
 #48155  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 6406 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
 #48161  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.
 #48164  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.
 #48181  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 )
 #48187  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.
 #48215  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
 #48216  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}
 #48227  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
 #48234  by MKochS
 
It's the same setting there.
Auswahl_010.png
Auswahl_010.png (13.19 KiB) Viewed 6293 times
So, in order to use your recommended setting, what would it have to be like?

Matthias
 #48239  by jllort
 
pdf2swf is not into your $TOMCAT_HOME/bin folder
 #48240  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?
 #48301  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 )
 #48335  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 6202 times
 #48342  by jllort
 
And is not working with this previewer?
 #48349  by MKochS
 
This is what I'm getting:
Auswahl_013.png
Auswahl_013.png (26.55 KiB) Viewed 6139 times
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.

About Us

OpenKM is part of the management software. A management software is a program that facilitates the accomplishment of administrative tasks. OpenKM is a document management system that allows you to manage business content and workflow in a more efficient way. Document managers guarantee data protection by establishing information security for business content.