11-23-2021 07:57 AM
Hello,
How can I write a javascript which recreates the PDF preview of a document?
For thumbnails you can use the following tow commands for recreation:
document.createThumbnail("doclib", true);
document.save();
Reason ist, that I have sveral documents where the preview is not working. The reason for this problem was a transfomer issue combined with to few system resources. Using the above command I was able to recreate all thumbnails.
Thanks,
Florian
11-23-2021 11:34 AM
Try using:
document.createThumbnail("pdf", true); document.save();
11-24-2021 04:05 AM
Thank you for the information. Can this method also be used for images?
I have two examples:
One image where thumbnail (detail view) and preview (gallery view) is working, the image has two subnotes:
cm:doclib cm:imgpreview
On an image where thumbnail and preview does not work, this subnodes do not exists.
document.createThumbnail("doclib", true); document.createThumbnail("imgpreview", true); document.save();
Would this work, or how can I write a script which creates thes two subnodes?
And last question, is there a possibility to improve the "convert" process?
Thanks,
Florian
11-24-2021 04:24 AM
You can create missing renditions using rendition name.
document.createThumbnail("pdf", true); document.createThumbnail("doclib", true); document.createThumbnail("imgpreview", true); document.save();
Can you provide additional details on convert/transformation improvements?
11-24-2021 05:18 AM
Hi,
thank you for the clarification, this has helped a lot.
According to the convert performance:
Currently we are not using the T-Engine, this is a future project of us. We are using the jodconverter an image magick. This is the currentl configuration of alfresco-global.properties:
# # External locations #------------- jodconverter.officeHome=/usr/lib/libreoffice jodconverter.portNumbers=8101 jodconverter.enabled=true ### Jod converter file size settings ### content.transformer.JodConverter.extensions.docx.pdf.maxSourceSizeKBytes=15000 # # Image magick # img.root= img.exe=/usr/bin/convert
If I execute the script to create the different renditions, al lot of convert processes are started parallel. Is there a chance to set the max number of parallel convert processes?
Florian
11-24-2021 06:05 AM
You may try using an asynchronous action for that process, since this kind of elements are executed using a Thread Pool.
default.async.action.threadPriority=1 default.async.action.corePoolSize=8 default.async.action.maximumPoolSize=20
Explore our Alfresco products with the links below. Use labels to filter content by product module.