Foros de discusión

preview Generation

intern web, modificado hace 10 años.

preview Generation

New Member Mensajes: 7 Fecha de incorporación: 27/02/13 Mensajes recientes
I am trying to preview PPT files in Documents and Media . I intigrated OpenOffice into Liferay but the preview generated had the text Garbled. As suggested by liferay I set ImageMagic and Ghostscript . Enabled ImageMagic from Portal Admin> External Scripts. But no preview is being generated or any thumbnails. Even for PDF files. there was no error in console and yet no thumbnail is being generated.

checked path with the following commands..

which convert
which ghostscript


both are located in

/usr/bin

set the path to .

/usr/bin:/usr/share/ghostscript/fonts:/usr/share/fonts/urw-fonts

Found that the path for the fonts did not contain anything...
but googling i discovered that people had same problem yet there configuration without fonts were working.
Also tried using only
/usr/bin/

but had no help.


As there were no errors being displayed i set log level for com.liferay to all.

then on opening Documents and Media from control panel I could still see the default pdf icon istead of the generated thumbnail for my pdf file and same for ppt.
probably because PPT are suppose to be converted into PDF by openOffice which goes fine.

from the console i found the following warning.....


09:11:30,002 WARN [liferay/document_library_pdf_processor-1][PDFProcessorMessageListener:40] Unable to generate images for file version 12403
com.liferay.portal.kernel.process.ProcessException: Subprocess terminated with exit code 1
at com.liferay.portal.kernel.process.ProcessExecutor.execute(ProcessExecutor.java:68)
at com.liferay.portlet.documentlibrary.util.PDFProcessorImpl._generateImagesIM(PDFProcessorImpl.java:512)
at com.liferay.portlet.documentlibrary.util.PDFProcessorImpl._generateImagesIM(PDFProcessorImpl.java:458)
at com.liferay.portlet.documentlibrary.util.PDFProcessorImpl._generateImages(PDFProcessorImpl.java:406)
at com.liferay.portlet.documentlibrary.util.PDFProcessorImpl._generateImages(PDFProcessorImpl.java:369)
at com.liferay.portlet.documentlibrary.util.PDFProcessorImpl.generateImages(PDFProcessorImpl.java:91)
at com.liferay.portlet.documentlibrary.util.PDFProcessorUtil.generateImages(PDFProcessorUtil.java:32)
at com.liferay.portlet.documentlibrary.messaging.PDFProcessorMessageListener.doReceive(PDFProcessorMessageListener.java:36)
at com.liferay.portal.kernel.messaging.BaseMessageListener.receive(BaseMessageListener.java:25)
at com.liferay.portal.kernel.messaging.InvokerMessageListener.receive(InvokerMessageListener.java:63)
at com.liferay.portal.kernel.messaging.SerialDestination$1.run(SerialDestination.java:110)
at com.liferay.portal.kernel.concurrent.ThreadPoolExecutor$WorkerTask._runTask(ThreadPoolExecutor.java:671)
at com.liferay.portal.kernel.concurrent.ThreadPoolExecutor$WorkerTask.run(ThreadPoolExecutor.java:582)
at java.lang.Thread.run(Thread.java:722)


also when i click on the PDF file i found a huge list ..



09:12:26,091 WARN [http-bio-8080-exec-10][FreeMarkerEngineImpl:259] java.io.FileNotFoundException: Template com/liferay/portlet/dynamicdatamapping/dependencies/readonly/text.ftl not found.
java.io.FileNotFoundException: Template com/liferay/portlet/dynamicdatamapping/dependencies/readonly/text.ftl not found.
at freemarker.template.Configuration.getTemplate(Configuration.java:495)
at freemarker.template.Configuration.getTemplate(Configuration.java:458)
at com.liferay.portal.freemarker.FreeMarkerEngineImpl.resourceExists(FreeMarkerEngineImpl.java:248)
at com.liferay.portal.kernel.freemarker.FreeMarkerEngineUtil.resourceExists(FreeMarkerEngineUtil.java:77)
at com.liferay.portlet.dynamicdatamapping.util.DDMXSDImpl.processFTL(DDMXSDImpl.java:398)
at com.liferay.portlet.dynamicdatamapping.util.DDMXSDImpl.getHTML(DDMXSDImpl.java:174)
at com.liferay.portlet.dynamicdatamapping.util.DDMXSDImpl.getHTML(DDMXSDImpl.java:220)
at com.liferay.portlet.dynamicdatamapping.util.DDMXSDImpl.getHTML(DDMXSDImpl.java:201)
at com.liferay.portlet.dynamicdatamapping.util.DDMXSDUtil.getHTML(DDMXSDUtil.java:72)
at org.apache.jsp.html.portlet.document_005flibrary.view_005ffile_005fentry_jsp._jspService(view_005ffile_005fentry_jsp.java:2493)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:432)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:390)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:334)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
...................
...................

and this goes on recursively for a few seconds after which i see the the screen for "generating preveiw it will take few minutes".

i see no such statement like..

Executing command..
"Convert .. alpha=none ... size=128x246.... filepath in liferay.... another filepath..."

But if I open the terminal and execute the command..

convert /root/Downloads/test.pdf /root/Downloads/test.jpg

I get Test.jpg files in the same directoery , it means that ImageMagick is working correctly on the system but not on liferay, I cant find out why.

I have no idea what I should do next.

my configurations are..

>>RHEL 5
>>Liferay 6.1.1 CE GA2
>> ImageMagick 6.8.5-7 2013-05-24 Q16
>>GPL Ghostscript 8.70
>>OpenOffice.Org 3.4.1




Also found that doing the same thing with RHEL 6.1 works smoothly


please suggest some solution.
thumbnail
Amit Doshi, modificado hace 10 años.

RE: preview Generation

Liferay Master Mensajes: 550 Fecha de incorporación: 29/12/10 Mensajes recientes
Hi intern web,

I am currently facing this issue on the Image Magick.

As already some one has created the ticket for the same.

Let me know if required more details.

Thanks & Regards,
Amit Doshi
thumbnail
Erick Rosales, modificado hace 9 años.

RE: preview Generation

New Member Mensajes: 4 Fecha de incorporación: 27/06/14 Mensajes recientes
Amit Doshi:
Hi intern web,

I am currently facing this issue on the Image Magick.

As already some one has created the ticket for the same.

Let me know if required more details.

Thanks & Regards,
Amit Doshi



Hi. I'm facing a problem...
java.io.FileNotFoundException: Unable to find Ghostscript command.

I've got a Win 2008 Server (x64). I don't know if Liferay is prepared to use GScript 64 or 32 bits. I've already installed Ghostscript.
thumbnail
Erick Rosales, modificado hace 9 años.

RE: preview Generation

New Member Mensajes: 4 Fecha de incorporación: 27/06/14 Mensajes recientes
OK...

I've fixed it! (I guess)

Install ImageMagik
+ Download from ImageMagick Download
+ Install as a common application, making shure of install in C:\Program Files\ImageMagick

Install Ghostscript (In my case x64).
+ Download from Ghostscript Download
+ Install as a common application, making shure of install in C:\Program Files\gs

Install OpenOffice
+ Download form OpenOffice Download
+ Once installed add the follow path -- C:\Program Files (x86)\OpenOffice 4\program -- to the PATH variable environment.
+ Activate OpenOffice as a Service
Type in a CMD Window (Administrative Rights)
soffice -headless -accept="socket,host=127.0.0.1,port=8100;urp;"
(Take care of comas and semicolon)

Activate in Liferay
As Administrator enter to Control Panel an go to:
> Configuration > Server Admin > External Services
+ Enable ImageMagick and add the following path:
C:\Program Files\gs\gs9.14\bin;C:\Program Files\gs;C:\Program Files\gs\gs9.14;C:\Program Files\ImageMagick
+ Enable OpenOffice
+ Enable Xuggler (Install it first, in the same page it says how to do it)

!!!RESTART SERVER!!!

Remember thar rendering the preview takes time, so be pacient!

Well, that is how I get to work the preview.
thumbnail
Rahul Saraswat, modificado hace 8 años.

RE: preview Generation

Junior Member Mensajes: 62 Fecha de incorporación: 26/02/13 Mensajes recientes
Hi,

I have installed imagemagick, ghostscript and open office in my system. I have also configured it. But still the text is garbled in the preview of some pdf files.
Please guide.

Liferay version : Liferay Portal Community Edition 6.2 CE GA4

Thanks in advance.
Rahul Saraswat
thumbnail
Arun Das, modificado hace 8 años.

RE: preview Generation

Regular Member Mensajes: 166 Fecha de incorporación: 23/07/12 Mensajes recientes
Hi,
Check ghostscript and imagemagick path. Please check this

Arun
thumbnail
Rahul Saraswat, modificado hace 8 años.

RE: preview Generation

Junior Member Mensajes: 62 Fecha de incorporación: 26/02/13 Mensajes recientes
Arun Das:
Hi,
Check ghostscript and imagemagick path. Please check this

Arun


Hi Arun Das,

I have checked the ghostscript and image magick path.
They are fine.
But I get an error "Unable to find the Ghostscript command. Please verify the path specified in the Server Administration control panel at: http://<server>/group/control_panel/manage/-/server/external-services".

The path in the server administration is "/usr/local/bin:/usr/share/ghostscript/fonts:/usr/local/share/fonts/urw-fonts:/usr/bin/mogrify".

Please suggest.

Thanks
Rahul Saraswat
thumbnail
Arun Das, modificado hace 8 años.

RE: preview Generation

Regular Member Mensajes: 166 Fecha de incorporación: 23/07/12 Mensajes recientes
Hi,
Are you sure of the path? Try /usr/bin:/usr/share/fonts/default/ghostscript:/usr/share/fonts instead of the default one. And make sure these location exist as the error says it couldn't find ghostscript.

HTH
Arun
thumbnail
Rahul Saraswat, modificado hace 8 años.

RE: preview Generation

Junior Member Mensajes: 62 Fecha de incorporación: 26/02/13 Mensajes recientes
Arun Das:
Hi,
Are you sure of the path? Try /usr/bin:/usr/share/fonts/default/ghostscript:/usr/share/fonts instead of the default one. And make sure these location exist as the error says it couldn't find ghostscript.

HTH
Arun



The paths are correct. I have checked them.
The main problem which I was experiencing was that for some pdf's the preview generated has garbled text.
thumbnail
Arun Das, modificado hace 8 años.

RE: preview Generation

Regular Member Mensajes: 166 Fecha de incorporación: 23/07/12 Mensajes recientes
Hi,
If its pdf, then no need of Imagemagick or ghostscript. As I believe Liferay ships with PDFBox which is good enough for previewing pdf.
Also try to reset the preview and thumbnail for documents and media portlet.

Arun
thumbnail
Rahul Saraswat, modificado hace 8 años.

RE: preview Generation

Junior Member Mensajes: 62 Fecha de incorporación: 26/02/13 Mensajes recientes
Arun Das:
Hi,
If its pdf, then no need of Imagemagick or ghostscript. As I believe Liferay ships with PDFBox which is good enough for previewing pdf.
Also try to reset the preview and thumbnail for documents and media portlet.

Arun



Hi Arun,

I have tried resetting the preview but still the preview is generated with garbled text.

Thanks
Rahul Saraswat
thumbnail
Arun Das, modificado hace 8 años.

RE: preview Generation

Regular Member Mensajes: 166 Fecha de incorporación: 23/07/12 Mensajes recientes
Hi,
Did you disable Imagemagick and ghostscript before resetting? And is there any error after you disable it and reset the preview and thumbnails?

Arun
Lisa Rossi, modificado hace 4 años.

RE: preview Generation

New Member Mensajes: 22 Fecha de incorporación: 5/03/20 Mensajes recientes
Rahul Saraswat:

Arun Das:
Hi,
If its pdf, then no need of Imagemagick or ghostscript. As I believe Liferay ships with PDFBox which is good enough for previewing pdf.
Also try to reset the preview and thumbnail for documents and media portlet.

Arun



Hi Arun,

I have tried resetting the preview but still the preview is generated with garbled text.

Thanks
Rahul Saraswat
Hi Raul, 
I have the same problem, can you help me?
Aleix Casagolda, modificado hace 10 años.

RE: preview Generation

New Member Mensajes: 9 Fecha de incorporación: 14/06/13 Mensajes recientes
Hi,

I'm having the same issue. Have you found a solution? I guess that the second error (the recursive strack traces saying that a .ftl file is not found) is not related to the preview problem.