JODConverter 2.2.2 was released in April, and by default it now supports MS Office 2007 file formats (docx, xlsx, pptx, etc.) This is a request to update the default code and mimetypes to use jodconverter-2.2.2 as the binary and to incorporate the new Mimetypes for conversion. The correct Mimetypes appear to be in the MIME registry so that's a good thing - this is just a small bit of coding/converting. If nobody else gets around to it I might roll patches for this over the weekend as I would like to add the support for the new formats.

I'm not sure what the desired process is for patches. I can either edit the code and upload the .module files or do a diff and upload the diff. Whatever is easier. Unless you (the authors) are planning to do this on your own.

Thanks for all of your work so far - this is a very useful module.

Comments

miglius’s picture

The preferable way is to attach patches. This would speed up the process.

rjbrown99’s picture

StatusFileSize
new4.79 KB
new487 bytes

Thanks. Here's what I did so far.

1) Edited fileframework/contrib/restriction/file_restriction.module to add docx, xlsx, and pptx to supported file types. Diff against the latest dev release is attached. I'm not sure if this is only read upon module install as I still had to manually add those types to my existing fileframework module.

2) Edited fileframework/formats/document/file_document.module to add mime types and support for the docx files. I also changed it to jodconverter-2.2.2 as this is where the support for docx,xlsx,pptx was added per their update.

Notes / Findings:
- Catdoc does not work for docx files, however jodconverter does. I used that for the conversion command.
- I included a statement to convert from docx to doc, which is something I believe many people will want to do. This works at the command line, but not in the UI. I don't know why yet.
- I can't yet tell why, but after upload the node shows it as 'unrecognized file type' instead of 'Word document'.
- Everything except docx->doc worked. This includes SWF preview, text conversion, image conversion, PDF conversion, ZIP, opendoc, etc.
- I only started with docx, no xlsx or pptx. That will come soon.

I'll work on this more tomorrow, but I'd really like to know where I can go to fix the 'unrecognized file type' problem. Any ideas?

Thanks for your work on the module. I have loads of feature requests in mind... UI setting for jodconverter would be high on the list. It would also be cool to have some kind of a UI to 'mix and match' mimetypes and conversion commands. It would have made this process a lot easier and would not have required code changes.

rjbrown99’s picture

Title: Update code for jodconverter 2.2.2 and MS Office 2007 formats » Completed - Update code for jodconverter 2.2.2 and MS Office 2007 formats
StatusFileSize
new2.94 KB
new3.89 KB
new4.24 KB
new491 bytes
new124 bytes

OK, I have updated this. The enclosed diffs are against the -dev release on 5/15.

fileframework/file.mime.inc
* Add the following: 'aac' => 'audio/aac',
* Modify the following: 'mp4' => 'video/mp4' change to 'mp4|mp4v|mpg4|m4v' => 'video/mp4'

fileframework/contrib/restriction/file_restriction.module
* Edit define line near the top - add docx, xlsx, pptx, aac

fileframework/formats/document/file_document.module
* Add mime type to file_document_mime_types
* Add conversion strings from docx to text/plain, application/msword, and application/pdf

fileframework/formats/spreadsheet/file_spreadsheet.module
* Add mime type to file_document_mime_types
* Add conversion strings from xlsx to application/vnd.ms-excel and application/pdf

fileframework/formats/slideshow/file_slideshow.module
* Add mime type to file_document_mime_types
* Add conversion strings from pptx to application/vnd.ms-excel and application/pdf

If you need the full modules or diffs/patches in a different format, just let me know.

rjbrown99’s picture

Assigned: Unassigned » rjbrown99
Status: Active » Needs review
rjbrown99’s picture

Assigned: rjbrown99 » Unassigned
miglius’s picture

Issue tags: +conversion

Could you please upload patches in the unified format using a -u key (diff -u ...)?

Thanks

rjbrown99’s picture

Sure, here goes. Thanks for considering the updates.

rjbrown99’s picture

I goofed up and ran the above diffs in the wrong order. OK here's the final FINAL version!

miglius’s picture

Assigned: Unassigned » miglius
Status: Needs review » Fixed

I have committed the diffs with a small changes:

- I have removed the version string from the jodconverter utility. This means that the version will not be hardcoded any more, but the site administrator will have to create a symlink pointing to the latest version.

- I have not changed the file.mime.inc file. The changes you propose can be added at the mime configuration page, 'admin/settings/file/mime' under the "Custom MIME types". The only reason I'm using a file_drupal_mime_types() function is because I cannot reuse the drupal's file_get_mimetype() function as it does not return the mapping array. If the file_get_mimetype() in the future will return a mapping array, I will use it instead of file_drupal_mime_types() to reduce the code. Now file_drupal_mime_types() is almost identical to the file_get_mimetype() function.

Status: Fixed » Closed (fixed)
Issue tags: -conversion

Automatically closed -- issue fixed for 2 weeks with no activity.