cancel
Showing results for 
Search instead for 
Did you mean: 

Content Transformer Configuration

chris_0815
Champ in-the-making
Champ in-the-making
Hi,

finally I was able to set up a transformer(worker) to use MS Word for converting doc to pdf. Therefore I used the source mimetype application/word and set this mimetype manually to a document.

I read about reliablility parameters for transformers and alfresco chooses the one which fits best. If I change the source mimetype to application/msword, then the openoffice transformer is used… I could just override the bean, but then I will loose ALL openoffice transformers.

Could somebody tell me, how to configure alfresco to use "my" msword->pdf transformer instead of the openoffice one?
Furthermore: If it is possible…. If my conversion fails for some reason, maybe the openoffice one should be available for fallback?

Best regards,
Chris
3 REPLIES 3

d_garry
Champ in-the-making
Champ in-the-making
Hello, Chris! Have you found the solution for your issue?
I have similar problem with wkhtmltopdf (HTML->PDF converter).

There is a workflow that produces .html document, and then i need preview for it. Alfresco Share uses HTML->PDF->SWF chain to do that, but the default HTML->PDF conversion leverages OpenOffice, and i couldn't make it understand CSS styles correctly (with wkhtmltopdf, styles are interpreted perfectly). So i've created new Complex transformation (as described on Alfresco Wiki and here - http://www.abstractive.ca/home/blog/~/blog/mike.priest/alfresco_html_to_pdf) (HTML to PDF using wkhtmltopdf, and then PDF to SWF). And now when i try to preview my .html files, Share can make preview using sometimes html->pdf(using OOoDirect)->swf, and sometimes html->wkhtmltopdf->swf.

And i don't know yet:
1) how does it make a decision which transformer to use (seems it's some kind of round-robin, i didn't find a way to configure it)
2) how to disable internal HTML->PDF transformation

Regards,
Igor

mike_priest1
Champ in-the-making
Champ in-the-making
Hey guys,

From what i understand alfresco does a couple of checks when it goes to do a transformation with two registered mime type conversions of the same type i.e. html-pdf. Alfresco will pick up both and basically weight them on estimated time to produce and output, it uses which ever is fastest.

If you get a answer to this let me know. Ive been digging through alfrescos default content transformations which are located in "<configRoot>/alfresco/content-services-context.xml" but the only thing registered there is htmlParser. From what im getting i think there is no real way to disable the out-of-the-box HTML-PDF transformer. It used PDFBox and open office but there doesnt seem to be a "logical" way to disable it or to tell alfresco to use a specific transformer when it finds two.

The only thing i can think of is to create a new mime-type of .htmls or something silly and that way when it goes to transform there will only be one associated transformer for HTMLS->PDF it will then use that. Im not a big fan of that, and if at all possible will try and find other means. If the mime type doesnt bother you…there is a solution.

Cheers,

Mike P

mike_priest1
Champ in-the-making
Champ in-the-making
Here is the fix we found:

I tracked down where openoffice is configured to transform files with a mimetype of 'text/html'. I found in the file "\alfresco\WEB-INF\classes\alfresco\mimetype\openoffice-document-formats.xml" In that file there is comment that states "Note: (X)HTML formats are here for completeness but they are currently unsupported" so if comment out the XML in the file that configures openoffice for text/html. Once this was done Alfresco always uses the custom transformer using wkhtmltopdf for HTML->PDF conversions.

Credits to Chris penning