Forums de discussion

PDF preview not generated, ImageMagick, GhostScript

Shruti Mishra, modifié il y a 8 années.

PDF preview not generated, ImageMagick, GhostScript

New Member Publications: 22 Date d'inscription: 24/04/15 Publications récentes
Hello,

I am using:
LR 6.2 CE GA-2

I have installed ImageMagick-6.9.1-7-Q16 and Ghostscript 9.16.
Included following properties in portal-ext.properties:

imagemagick.enabled=true
imagemagick.global.search.path=C:\\Program Files\\gs\\bin;C:\\Program Files\\ImageMagick
dl.file.entry.preview.enabled=true
dl.file.entry.thumbnail.enabled=true


Restarted the server.
Then I have added a pdf file in document and media.
The preview of the file is not generated.
This is a fresh Liferay Instance.

Kindly guide if I missed anything.

Thanks
thumbnail
Ramalingaiah Dudidmetle, modifié il y a 8 années.

RE: PDF preview not generated, ImageMagick, GhostScript

Expert Publications: 486 Date d'inscription: 16/08/14 Publications récentes
Hi Shruti Mishra,


please see the attached files

then u can integrated openoffice and enable
Shruti Mishra, modifié il y a 8 années.

RE: PDF preview not generated, ImageMagick, GhostScript

New Member Publications: 22 Date d'inscription: 24/04/15 Publications récentes
Thanks for taking time to reply.

I have already done all these settings in control panel.
But preview is not generated.
thumbnail
Ramalingaiah Dudidmetle, modifié il y a 8 années.

RE: PDF preview not generated, ImageMagick, GhostScript

Expert Publications: 486 Date d'inscription: 16/08/14 Publications récentes
Hi Shruti Mishra,


u can go path (C:\Program Files (x86)\OpenOffice 4\program)

than open CMD


past code this

soffice -headless -accept="socket,host=127.0.0.1,port=8100;urp;" -nofirststartwizard

Refresh server and go for the document and media open file right side showing PDF


Regrades
Ram
Shruti Mishra, modifié il y a 8 années.

RE: PDF preview not generated, ImageMagick, GhostScript

New Member Publications: 22 Date d'inscription: 24/04/15 Publications récentes
Hi Ram,

I want to preview only PDF files. ImageMagick is needed for that.

I dont have any requirement for other document types.

Thanks
thumbnail
Krzysztof Gołębiowski, modifié il y a 8 années.

RE: PDF preview not generated, ImageMagick, GhostScript

Liferay Master Publications: 549 Date d'inscription: 25/06/11 Publications récentes
Hello Shruti,
ImageMagick+Ghostsctipt configuration is really easy, should work without any problems. I guess it is some simple issue, check that you have proper path to GS binaries.

Did you see any errors in logs? You could try to debugging PDF processing mechanism by adding com.liferay.portlet.documentlibrary.util.PDFProcessorImpl category on DEBUG level in Log Levels section of Server Administration.

Btw, I recommend downloading the newest version of Liferay (GA4). GA2 is an early 6.2 release and has lost of bugs.

Regards,
KG
Shruti Mishra, modifié il y a 8 années.

RE: PDF preview not generated, ImageMagick, GhostScript

New Member Publications: 22 Date d'inscription: 24/04/15 Publications récentes
Hi KG,

I did tried on LR_6.2_GA4 as suggested by you , but still No preview.
I have checked the path for ghostScript and imageMagick as well.
No error logs are there.

Not able to understand the problem.

Thanks,
Shruti
thumbnail
Patrick Wolf, modifié il y a 8 années.

RE: PDF preview not generated, ImageMagick, GhostScript

Regular Member Publications: 127 Date d'inscription: 15/09/10 Publications récentes
This is one of the pitfalls of Liferay. The PDF preview functionality appears to work by random. I managed to get it working once in version 6.1 and then, with same settings, it stopped working all of a sudden on latest version 6.2. I have searched a solution through message boards, and the answers were the same but still no luck. I finally gave up to focus on more important things.
However this is an interesting blog post on the subject. This may give you some clues but it requires some more effort than filling out a form in control panel, which should be the normal and easiest way to do it, should it work.
If you manage to preview PDF documents, I am interested.
Shruti Mishra, modifié il y a 8 années.

RE: PDF preview not generated, ImageMagick, GhostScript

New Member Publications: 22 Date d'inscription: 24/04/15 Publications récentes
Hi Patrick,

Thanks for the link.

But, I opted for PDF preview through Angular js, as we are using angular js as UI framework.

I used this.

Thanks,
Shruti
thumbnail
Patrick Wolf, modifié il y a 8 années.

RE: PDF preview not generated, ImageMagick, GhostScript

Regular Member Publications: 127 Date d'inscription: 15/09/10 Publications récentes
Oh! I did not know that you used Angular for PDF preview as you do not mention it in your question. I thought you used the Imagemagick library. This preview functionality looks simple in theory but is actually a nightmare when you want to use default Liferay functionalities and not add overhead.
I wish you can get it working.
Shruti Mishra, modifié il y a 8 années.

RE: PDF preview not generated, ImageMagick, GhostScript

New Member Publications: 22 Date d'inscription: 24/04/15 Publications récentes
I wanted to use Liferay functionality first, that is why I installed ImageMagick.

But, when it was not working for unknown reason then I opted for Angular js.

Thanks for your suggestions.
thumbnail
Krzysztof Gołębiowski, modifié il y a 8 années.

RE: PDF preview not generated, ImageMagick, GhostScript

Liferay Master Publications: 549 Date d'inscription: 25/06/11 Publications récentes
I configured InageMagick+GS preview generation several times in Liferay and I've never had any problems with it. Did you try to configure it on fresh Liferay installation? Maybe there is something wrong with your environment (you could try to run in on other server)?

Regards,
KG
Shruti Mishra, modifié il y a 8 années.

RE: PDF preview not generated, ImageMagick, GhostScript

New Member Publications: 22 Date d'inscription: 24/04/15 Publications récentes
Yes, I have tried on fresh instance as well, but No Luck.

I then tried on a different system, ImageMagick was working but it was taking too much time to generate preview.

I uploaded a pdf of 523kb and it took 16mins to generate its preview.


Strange!
thumbnail
Krzysztof Gołębiowski, modifié il y a 8 années.

RE: PDF preview not generated, ImageMagick, GhostScript

Liferay Master Publications: 549 Date d'inscription: 25/06/11 Publications récentes
16 minutes seems longer that it usually takes for file of this size (but it depends on content as well). Remember that previews are generated asynchronically - after adding the document do DL, an event is sent on messagebus and after some time, appriopriate listener wakes up to process the PDF.

Did you turn on debugging for com.liferay.portlet.documentlibrary.util.PDFProcessorImpl category? When you do, it will print real times of preview generation and you will see when it actually happens. Can you attach the PDF here, I would check how it works in my environment?

Regards,
KG
thumbnail
Arun Das, modifié il y a 8 années.

RE: PDF preview not generated, ImageMagick, GhostScript

Regular Member Publications: 166 Date d'inscription: 23/07/12 Publications récentes
Hi,
I believe Liferay comes with PDFBox. You really don't need ImageMagick or Ghostscript for PDF previews until unless you need quality preview.
Please try to disable the ImageMagick and Ghostsript and reset the preview and thumbnails.

Arun
Shruti Mishra, modifié il y a 8 années.

RE: PDF preview not generated, ImageMagick, GhostScript

New Member Publications: 22 Date d'inscription: 24/04/15 Publications récentes
Hi KG,

Sorry I can't share that pdf as it contains some important information.

But, I tested with some other pdf's as well.

One of which I am attaching here.

I will turn on debugging for com.liferay.portlet.documentlibrary.util.PDFProcessorImpl category and check exact time for this.

Thanks
thumbnail
Krzysztof Gołębiowski, modifié il y a 8 années.

RE: PDF preview not generated, ImageMagick, GhostScript

Liferay Master Publications: 549 Date d'inscription: 25/06/11 Publications récentes
I uploaded your attachment on one of my Liferay installations and it took around 20 seconds to generate thumbnails and previews. The following messages has been printed to logs:

07:09:57,312 INFO  [liferay/document_library_pdf_processor-1][PDFProcessorImpl:423] Ghostscript generated 12 preview pages for Liferay-DL-MongoDB-Store-Guide.pdf in 16270 ms
07:10:08,324 INFO  [liferay/document_library_pdf_processor-1][PDFProcessorImpl:438] Ghostscript generated a thumbnail for Liferay-DL-MongoDB-Store-Guide.pdf in 11012 ms

Server is 2 cores with Xmx set to 1 GB, running Liferay 6.2 CE GA4 on Centos (IM+GS installed from Centos repository, no OpenOffice integration).

Did you check your logs? Did you try to run vanilla Liferay on some Linux VM, maybe there is some problem with IM+GS running on Windows?

Regards,
KG