• Document thumbnails

  • 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.
 #44039  by greengold
 
I am trying to get document thumbnail out of openKm, but I'm failing to find any reference guide to this process.
SDK says:
Code: Select all
public InputStream getThumbnail(String docId, ThumbnailType type) throws PathNotFoundException, AccessDeniedException,
		ConversionException, AutomationException, RepositoryException, DatabaseException, IOException, UnknowException,
		WebserviceException;
		
so can you tell me waht is the meaning of each of three "ThumbnailType"s and in which format does the thumbnail come out?

Thanks!
 #44049  by jllort
 
There's a thumbnail in properties ( small one ) another in search view ( small one ) and when you click on a thumbnail is shown a big one ( full screen ), these are the three types.
 #44067  by greengold
 
thanks!
and what is the format of data that this outputs? I am saving this stream as png or jpg but viewer fails to open it as image
 #44087  by jllort
 
Should be a png. If you capture with firebug or similar the download url of the thumnail and you paste in the browser ( save and you'll see a png ). What are you doing with the input stream, might be the stream is closed before finishing to save the document. Share the piece of code what is doing it and we'll take a look.
 #44096  by greengold
 
so here's what I do: https://stackoverflow.com/questions/445 ... n-angular4
I have composed it as SO thread because I have rather extensive process and I'm not sure in which part it goes wrong.

However I was even unsuccessfull to save an image as .png after receiving it from java service (as you can read process in the post) and view it.
Doubt streams are closed too early.

Can you check on your side, please?

Thanks!
 #44113  by jllort
 
I think the problem is not the stream is closed early, the problem I think will be in the way is downloaded, take a look here:
https://docs.openkm.com/kcenter/view/sd ... getContent

From the server side ( inde middle between OpenKM and your user interface ) the problem usualy is:
Code: Select all
//response.setContentLength(is.available()); // Cause a bug, because at this point InputStream still has not its real size.
And you should use
Code: Select all
response.setContentLength(new Long(doc.getActualVersion().getSize()).intValue());
 #44229  by greengold
 
ok resolved. OKM is fine. The problem was with piping nodeJs response to the angular FE:
Code: Select all
let reply = request(options);
reply.pipe(res);

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.