0
votes

Liferay is not generating preview for PDF file only. It generates preview for all other types of files. I had linux server + liferay 6.2 GA3 + Imagemagick + Ghost + openoffice. I had running openoffice. Conversation from one file to other working fine, I have only problem for pdf file preview. Previously it was generating preview. The surprising thing is no log for PDF in machine but log for other files.

I am able to conver PDF to png whith help of convert command.

Below are logs while uploading PDF

tail -f /opt/trianz-portal/tomcat-7.0.42/logs/catalina.out 14:03:15,404 ERROR [ajp-bio-8009-exec-38][PollerServlet:63] No channel exists with user id 80601 14:03:15,428 ERROR [ajp-bio-8009-exec-38][status_jsp:752] No channel exists with user id 80601 14:03:18,868 ERROR [ajp-bio-8009-exec-40][PollerServlet:63] No channel exists with user id 80601 14:03:18,890 ERROR [ajp-bio-8009-exec-40][status_jsp:752] No channel exists with user id 80601 14:03:21,115 ERROR [ajp-bio-8009-exec-38][PollerServlet:63] No channel exists with user id 80601 14:03:21,138 ERROR [ajp-bio-8009-exec-38][status_jsp:752] No channel exists with user id 80601 14:03:34,851 ERROR [ajp-bio-8009-exec-33][PollerServlet:63] No channel exists with user id 50659 14:03:34,925 ERROR [ajp-bio-8009-exec-33][status_jsp:752] No channel exists with user id 50659 14:03:58,000 WARN [liferay/scheduler_dispatch-3][RestStorageService:221] Content-Length of data stream not set, will automatically determine data length in memory 14:04:36,238 WARN [ajp-bio-8009-exec-39][RestStorageService:221] Content-Length of data stream not set, will automatically determine data length in memory

Below logs for other files where preview genarate successfully for other files 14:07:19,844 WARN [ajp-bio-8009-exec-9][RestStorageService:221] Content-Length of data stream not set, will automatically determine data length in memory 14:07:21,668 INFO [liferay/document_library_pdf_processor-1][GhostscriptImpl:71] Excecuting command '/usr/local/bin/gs -dBATCH -dSAFER -dNOPAUSE -dNOPROMPT -sFONTPATH/usr/local/bin:/usr/bin:/usr/local/share/ghostscript/fonts -sDEVICE=png16m -sOutputFile=/opt/trianz-portal/tomcat-7.0.42/temp/liferay/document_preview/2662941.1.0-%d.png -dPDFFitPage -dTextAlphaBits=4 -dGraphicsAlphaBits=4 -r300 -dDEVICEWIDTH1000 /opt/trianz-portal/tomcat-7.0.42/temp/liferay/document_conversion/2662941.1.0.pdf ' 14:07:23,429 WARN [liferay/document_library_pdf_processor-1][RestStorageService:221] Content-Length of data stream not set, will automatically determine data length in memory 14:07:24,199 WARN [liferay/document_library_pdf_processor-1][RestStorageService:221] Content-Length of data stream not set, will automatically determine data length in memory 14:07:24,966 WARN [liferay/document_library_pdf_processor-1][RestStorageService:221] Content-Length of data stream not set, will automatically determine data length in memory 14:07:25,028 WARN [liferay/document_library_pdf_processor-1][RestStorageService:221] Content-Length of data stream not set, will automatically determine data length in memory 14:07:25,180 INFO [liferay/document_library_pdf_processor-1][PDFProcessorImpl:423] Ghostscript generated 4 preview pages for assign.doc in 3512 ms 14:07:25,194 INFO [liferay/document_library_pdf_processor-1][GhostscriptImpl:71] Excecuting command '/usr/local/bin/gs -dBATCH -dSAFER -dNOPAUSE -dNOPROMPT -sFONTPATH/usr/local/bin:/usr/bin:/usr/local/share/ghostscript/fonts -sDEVICE=png16m -sOutputFile=/opt/trianz-portal/tomcat-7.0.42/temp/liferay/document_thumbnail/2662941.1.0.png -dFirstPage=1 -dLastPage=1 -dPDFFitPage -dTextAlphaBits=4 -dGraphicsAlphaBits=4 -r300 -dDEVICEWIDTH1000 /opt/trianz-portal/tomcat-7.0.42/temp/liferay/document_conversion/2662941.1.0.pdf ' 14:07:26,360 WARN [liferay/document_library_pdf_processor-1][RestStorageService:221] Content-Length of data stream not set, will automatically determine data length in memory 14:07:26,392 INFO [liferay/document_library_pdf_processor-1][PDFProcessorImpl:438] Ghostscript generated a thumbnail for assign.doc in 1198 ms

enter image description here

1

1 Answers

0
votes

I suppose you are using community edition(not mentioned in question). As per the logs,the pdf file is not even read correctly,leave alone being uploaded,due to the channel errors.As per the given thread https://web.liferay.com/community/forums/-/message_boards/message/52746434 this is due to one of bugs LPS-51390. It should be fixed when you update with patch for this issue.

CE does not have patching tool available. You would need to manually do the patching by either looking for the changes for the given commit done for LPS-51390 on github or upgrade to CE GA4 Try below link for ref Liferay Upgrade