jodconverter | JODConverter automates document conversions | Document Editor library
kandi X-RAY | jodconverter Summary
kandi X-RAY | jodconverter Summary
JODConverter (for Java OpenDocument Converter) automates document conversions using LibreOffice or OpenOffice.org.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Command line parser
- Converts the input file to the output format
- Gets the best process manager
- Build the office manager
- Converts the document into the output file
- Convert a Map of properties to an array of PropertyValues
- Loads a document from the input file
- Read json array
- Converts a JSON map to a Java map
- Handles a post request
- Sends a file to the response
- Sets the port numbers
- Wait until the condition is released
- Load properties from the given file
- Get document format by extension
- Sets the default pipe names to use
- Start the office process
- Find the process s pid
- Start all the managers
- Create default load properties
- Executes a task
- Stops the pool
- Gets the default office home
- Initializes the command line options
- Find the pid of a process
- Kills a process
jodconverter Key Features
jodconverter Examples and Code Snippets
Community Discussions
Trending Discussions on jodconverter
QUESTION
Can't solve the problem in Java Web Application. The application has been in production for several years now, I only add new functionality if necessary. For the last half of the year, all that had to be done was to update the libraries. But starting from December last year, it began to “freeze” for clients.
The functionality of the application is to work with documents of various formats: uploading to the server, deleting a document, creating previews, and downloading files. When uploaded to the server, the files are converted to .pdf format. So, the application is running on Windows Server 2016 Standart 10.0.14393 Build 14393 x64-based PC and LibreOffice 6.4.x.x is also installed, WildFly 20.0.0 Final on which the application is launched.
The task was to upgrade LibreOffice 6 to 7. I read the release notes and did not find anything that would prevent me from upgrading the LibreOffice version. We installed version 7.1 (just in December), then the problems started.
The problem is that when loading a file in the .docx/.doc format, the file is not loaded correctly, the preview is “broken”, and the “unkillable” soffice.bin/.exe processes remain on the server in the Task Manager.
As it turned out later, clients use barcodes in documents (but for 4+ years), and I also go to the “File” property in LibreOffice and choose “Properties…”, so I find the checkbox for embed fonts is enabled. If this checkbox is removed, then everything works correctly on any version of LibreOffice. But with it, starting from version 6.4 inclusive and higher - the program “freezes” for 2 minutes. This is the timeout limit in jodconverter per process.
However, if I do the same manipulations on my local machine where Windows 10 is installed, then everything works fine for me, as well as on other local machines. The problem is only on Windows Server 2016, which we have for tests, as well as for clients. What I tried on the server: I installed the old version of the Java application from 2020 year and LibreOffice 6.4 and 7.1 - it still doesn't work. I took the latest version of the Java application, but LibreOffice 6.0 - 6.3 (inclusive) - and everything works. I also installed font with barcodes from a file - Free 3 of 9, it also did not help for LibreOffice 6.4 and higher.
Installing LibreOffice 6.0 also installed Microsoft Visual C++ Redistributable 2015 x64, I thought that was the problem. But after trying different combinations, I was not successful in solving the problem. At the moment, Microsoft Visual C ++ Redistributable 2015-2022 x64 and Microsoft Visual C ++ Redistributable 2017 x86 are installed on the server. Guided by this article.
Regarding Microsoft Visual C ++ Redistributable, I read an article that earlier, when installing LibreOffice, this package was also installed in a parallel process, but Microsoft changed the license to use the software or something like that, and then The Document Foundation stopped inserting into the LibreOffice installation file Microsoft Visual C++ Redistributable.
I want to note that the problem is not in the specification of files or barcodes since I created a completely empty document on the server, through LibreOffice, in the .docx / .doc format and put the font checkbox - it also “freezes”, and all the symptoms that I described above appear.
I came to the conclusion that the involvement of the Java application itself, fonts, or the .docx / .doc format in the error is unlikely, although not excluded.
Can you tell me the solution or where to look for the problem?
...ANSWER
Answered 2022-Mar-22 at 11:53Perhaps someone will encounter it in the future, I solved the problem by switching from Windows Server 2016 to Windows Server 2019.
QUESTION
Trying to convert pdf to pdf/a using http://kapion.ru/convert-to-pdfa-with-jodconverter/ guide. after execution getting encoded pdf file. it looks like:
...ANSWER
Answered 2021-Sep-24 at 07:45OpenOffice does not support pdf reading. The way how it is could be possible to convert pdf using external libs into docx\html, then convert it into pdf/a using OpenOffice.
QUESTION
I am trying to convert excel file into PDF file in wicket 8 application by using these below APIs. But PDF file is not converting into excel file and I am getting that same excel file on the PDF download link instead of PDF file and there is no exception or error on convert() method.
...ANSWER
Answered 2021-Feb-09 at 20:31This above code worked for me after debugging deeper in the local system.
For that need to install OpenOffice3 or version 4 and can run below command to run the OpenOffice as a service in windows OS.
Go to CMD and navigate to OpenOffice program dir path: Example: "C:\OpenOffice.org 3\program" and below command in CMD to run the OpenOffice as a service to run the Jodconverter code for file conversion.
QUESTION
I have upgraded my application from Wicket 1.x to 8.x version.
I am facing an issue to convert Excel file into PDF format.
Using this below dependencies:
...ANSWER
Answered 2021-Jan-26 at 07:09According to https://search.maven.org/search?q=fc:com.sun.star.connection.NoConnectException you need to add org.libreoffice:libreoffice
(or the old org.libreoffice:ridl
) dependency to Maven's pom.xml.
I don't see net.sf.jodconverter at https://search.maven.org/search?q=jodconverter. You may try with a more recent version of it - probably any of the listed ones here: https://search.maven.org/search?q=g:org.jodconverter
QUESTION
I'm building a web application, that, among other things, performs conversion of files from doc
to pdf
format.
I've been using LibreOffice installed on the same server along with my web application. By shelling out and calling libreoffice
binary from the code of my web app I am able to successfully convert documents.
The problem: when my web application receives several HTTP requests for doc->pdf conversion during a very short period of time (e.g. milliseconds), calling libreoffice
fails to start multiple instances at once. This results in some files being converted successfully, while some are not.
The solution to this problem as I see it would be this:
- start
libreoffice
service once, make sure it accepts connections, - when processing HTTP requests in my web application, talk to a running
libreoffice
service asking it to perform file format conversion, - the "talking" part would be facilitated through shelling out to some CLI tool, or through some other means like sending
libreoffice
API requests to port or socket file).
After a bit of research, I found a CLI tool called jodconverter
. From it, I can use jodconverter-cli
to convert the files. The conversion works, but unfortunately jodconverter
will stop the libreoffice
server after conversion is performed (there's an open issue about that). I don't see a way to turn off this behavior.
Alternatively, I'm considering the following options:
in my web app, make sure all conversion requests are queued; this obviously defeats concurrency, e.g. my users will have to wait for their files to be converted,
research further and use something called UNO, however there's no binding for the language I am using (Elixir) and I cannot seem to see a way to construct a UNO payload manually.
How can I use libreoffice
as a service using UNO?
ANSWER
Answered 2020-Feb-03 at 12:28I ended up going with an advice for starting many libreoffice
instances in parallel. This works by adding a -env:UserInstallation=file:///tmp/...
command line variable:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install jodconverter
You can use jodconverter like any standard Java library. Please include the the jar files in your classpath. You can also use any IDE and you can run and debug the jodconverter component as you would do with any other Java program. Best practice is to use a build tool that supports dependency management such as Maven or Gradle. For Maven installation, please refer maven.apache.org. For Gradle installation, please refer gradle.org .
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page