Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open Office template types are missing from the documentformat.json #24

Closed
benelot opened this issue Sep 8, 2017 · 5 comments
Closed

Comments

@benelot
Copy link

benelot commented Sep 8, 2017

Since the conversion can also start from the template types of open office, the types should also be included. I added at least the OTT in my local version of your code.

@sbraconnier
Copy link
Member

Thank you so much for your feedback. Since you seem to have spent some time to search for the filter that represents a template as source document, could you please hint me on what should be added to this file.

Note: About the supported formats (conversions), you don't need to "extend" this project. You can specify a custom document format registry.

Here's an (untested) example:

JsonDocumentFormatRegistry customRegistry = JsonDocumentFormatRegistry.create(some file or input stream containing the document formats you want to support);

final File inputFile = ...
final File outputFile = ...

LocalConverter
  .builder()
  .formatRegistry(customRegistry)
  .build()
  .convert(inputFile)
  .to(outputFile)
  .execute();

@sbraconnier
Copy link
Member

I've merged your PR after changing it a bit to use the proper storage template filter types.

I also added the ability to disable OpenGL for LibreOffice (don't know why but once in a while, when converting a template... boom... LO crashes. Apache Open Office does not).

Let me know if everything still works fine on your side, so that this issue could be closed.

@benelot
Copy link
Author

benelot commented Sep 14, 2017 via email

@sbraconnier
Copy link
Member

OpenGL was not properly disabled prior to this commit I made this morning, so you may have to update your fork with my latest changes. Disabling OpenGL solved the problems I had with ott files. But I still have some troubles with otp files. Not sure if you just need to convert ott files.

Note that changing the OpenGL setting requires a LibreOffice restart (which JODConverter takes care of).

Another thing you could try is to set the templateProfileDir to a path of a (copy of a) user directory you would have configured with the best settings for your conversions. If you disable OpenGL this way (the option is in the Tools / Options / LibreOffice -> View menu item), it won't require a LibreOffice restart.

Here on my Windows, after settings LibreOffice to suit my needs, I copied the directory C:\Users\myUser\AppData\Roaming\LibreOffice\4 elsewhere (to act as a template profile directory that won't change) set the templateProfileDir to this copy.

It works without any crash, even for otp files!

@benelot
Copy link
Author

benelot commented Sep 20, 2017

I am thinking about using template user settings anyway, since we have problems with using the user settings that come with a fresh libreoffice portable on different machines. So your hint might give us a much better experience.

@benelot benelot closed this as completed Oct 3, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants