Laura, Michael and I have been banging our heads against this one for a few hours: The webpreview in Alfresco 4.1.2 Enterprise Share wasn't working, giving us an annoying error that read, "The preview could not be loaded from the server." On top of that, there were no exceptions in the Tomcat log.

preview

When I enabled the following:

log4j.logger.org.alfresco.util.exec.RuntimeExec=DEBUG log4j.logger.org.alfresco.repo.content.transform.TransformerDebug=DEBUG

I saw this:

2013-01-22 15:59:23,558 DEBUG [content.transform.TransformerDebug] [http-8080-8] 0 txt swf test.txt 5 bytes ContentService.transform(...) 2013-01-22 15:59:23,559 DEBUG [content.transform.TransformerDebug] [http-8080-8] 0 **a) transformer.complex.JodConverter.Pdf2swf<<Complex>> < 5 MB 0 ms 2013-01-22 15:59:23,559 DEBUG [content.transform.TransformerDebug] [http-8080-8] 0.1 txt swf test.txt 5 bytes transformer.complex.JodConverter.Pdf2swf<<Complex>> 2013-01-22 15:59:23,560 DEBUG [content.transform.TransformerDebug] [http-8080-8] 0.1.1 txt pdf test.txt 5 bytes transformer.JodConverter<<Proxy>> 2013-01-22 15:59:25,135 DEBUG [content.transform.TransformerDebug] [http-8080-8] 0.1.2 pdf swf <<TemporaryFile>> 8.9 KB transformer.Pdf2swf<<Proxy>> 2013-01-22 15:59:25,487 DEBUG [util.exec.RuntimeExec] [http-8080-8] Execution result: os: Mac OS X command: [/usr/local/bin/pdf2swf, -T, 9, -s, poly2bitmap, -s, subpixels=72, /tomcat/bin/../temp/Alfresco/RuntimeExecutableContentTransformerWorker_source_1413729690069630799.pdf, -o, /tomcat/bin/../temp/Alfresco/RuntimeExecutableContentTransformerWorker_target_5661172345804626259.swf, -s, languagedir=.] succeeded: true exit code: 139 out: NOTICE Adding . to language pack directories ERROR Could not open ./add-to-xpdfrc err: 2013-01-22 15:59:25,488 DEBUG [content.transform.TransformerDebug] [http-8080-8] 0 Finished in 1,932 ms 2013-01-22 15:59:58,287 DEBUG [content.transform.TransformerDebug] [DefaultScheduler_Worker-8] 1 swf txt webpreview 0 bytes ADMLuceneIndexer NO transformers 2013-01-22 15:59:58,288 DEBUG [content.transform.TransformerDebug] [DefaultScheduler_Worker-8] 1 Finished in 2 ms Transformer NOT called

Clearly, there was an issue with the webpreview generation as it was 0b in size. When I attempted the "pdf2swf" command manually, I saw this:

$ pdf2swf -T 9 -s poly2bitmap -s subpixels=72 $TOMCAT_HOME/temp/Alfresco/RuntimeExecutableContentTransformerWorker_source_1413729690069630799.pdf -o $TOMCAT_HOME/temp/Alfresco/RuntimeExecutableContentTransformerWorker_target_5661172345804626259.swf Segmentation fault: 11

Looking at the usage guidelines, I noted that the "-s" option requires a "param=value" argument. I decided to drop the "-s poly2bitmap" from the command and -- voila! -- it worked! I'm still not sure why this is the case and will continue to look into that, but for the time being it appears that the temporary fix is to modify alfresco-global.properties and add the following:

swf.encoder.params=-s subpixels=72

I'll add more later once I've figured out the cause of this, but I wanted to get this out there in case anyone else is having the same problem.

Note this is using SWFTools version 0.9.2.


Loading Conversation