• [solved] Download as pdf works but preview is not

  • OpenKM has many interesting features, but requires some configuration process to show its full potential.
OpenKM has many interesting features, but requires some configuration process to show its full potential.
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.
 #40463  by will
 
Hello,

I've got this strange problem and couldn't solve it.
version is 6.3.0 community

Let's say I've got a png image or word document, I click on the "Download document as pdf" button and it works fine. If I look in repository/cache/pdf directory, I can see that it contains the correct uuid.pdf file. Then I click on the Preview tab and I have a window with "Conversion: Error: Couldn't open file '' ". My first guess was that pdf2swf did not work, but then if I look in repository/cache/pdf, I can see that the uuid.pdf file is still there but has changed! It is now a 4075 bytes binary file whatever the original was, and it appears than this is not a "real" pdf file so pdf2swf fails. Note that if I try again the "Download document as pdf" button it now fails as it try to read the bad pdf file in the cache.

I have spend a lot of time trying to identify the origin of this problem, but I don't know where to look to debug it. catalina.log contains info when pdf2swf fails but not with the creation of this 4075 bytes file. Openoffice, convert and ghostscript configuration seems to be good as the "Download document as pdf" button works in first attempt.

Hope someone encounters the same problem and solved it, or can give me some clues to log and debug this problem.

Will

Edit : Problem solved. There was an extra space in system.swftools.pdf2swf before the -f
/opt/openkm/tomcat/bin/pdf2swf -f -T 9 -t -s storeallcharacters ${fileIn} -o ${fileOut}
 #40481  by jllort
 
Thanks for your information. Althought in source code we could try to do some optimization to convert two or more spaces in a single one I do not know if it's a good idea on all cases. Meanwhile is not clear will continue as is now.

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.