Comments (10)
Hi! I've had the same problem in the past and fixed it with configuration changes.
I've now shared my changes with the commits 41e98dc and a8c3694.
Maybe @sbraconnier can merge it to master so that other developers don't face the same problem in the future. Meanwhile, you can apply the patches manually.
from jodconverter.
Hi Michel, thanks,
Was able to continue and build jodconverter-core.
But when I try to run a test conversion I get the following:
C:\TMP>java -jar jodconverter.jar test.xls test.pdf
no main manifest attribute, in jodconverter-core.jar
Any idea?
from jodconverter.
Thanks a lot @michelole ! I've merged your changes. Your Help is really appreciated.
@vdveldel, try using the cli module instead if you plan to use jodconverter on command line.
You have to run this command to build cli module executable:
gradlew clean build -x test -x integTest distZip
Or you can use the latest release available.
from jodconverter.
Hi Simon,
Thanks a lot.
I downloaded the new master and tried to build.
Sadly it failed again, this is what I got:
C:\jodconverter-master>gradlew clean build -x test -x integTest -PuseOpenOffice
:clean UP-TO-DATE
:jodconverter-cli:clean
:jodconverter-core:clean
:jodconverter-sample-webapp:clean
:jodconverter-spring:clean
:jodconverter-spring-boot-starter:clean
:assemble UP-TO-DATE
:check UP-TO-DATE
:build UP-TO-DATE
:jodconverter-core:compileJava
warning: [options] bootstrap class path not set in conjunction with -source 1.7
1 warning
:jodconverter-core:processResources
:jodconverter-core:classes
:jodconverter-core:jar
:jodconverter-cli:compileJava
warning: [options] bootstrap class path not set in conjunction with -source 1.7
1 warning
:jodconverter-cli:processResources NO-SOURCE
:jodconverter-cli:classes
:jodconverter-cli:jar
:jodconverter-cli:startScripts
:jodconverter-cli:distTar
:jodconverter-cli:distZip
:jodconverter-core:javadoc
:jodconverter-cli:javadoc
:jodconverter-cli:javadocJar
:jodconverter-cli:sourcesJar
:jodconverter-cli:assemble
:jodconverter-cli:compileTestJava NO-SOURCE
:jodconverter-cli:processTestResources
:jodconverter-cli:testClasses
:jodconverter-cli:compileIntegTestJava
warning: [options] bootstrap class path not set in conjunction with -source 1.7
1 warning
:jodconverter-cli:processIntegTestResources
:jodconverter-cli:integTestClasses
:jodconverter-cli:checkstyleIntegTest
:jodconverter-cli:checkstyleMain
:jodconverter-cli:checkstyleTest NO-SOURCE
:jodconverter-cli:jacocoTestReport SKIPPED
:jodconverter-cli:pmdIntegTest
:jodconverter-cli:pmdMain
:jodconverter-cli:pmdTest NO-SOURCE
:jodconverter-cli:spotlessJava FAILED
FAILURE: Build failed with an exception.
- What went wrong:
Execution failed for task ':jodconverter-cli:spotlessJava'.
The following files had format violations:
jodconverter-cli\src\integTest\java\org\jodconverter\cli\ConvertTest.java
@@ -1,74 +1,74 @@
-/*\n
- * Copyright 2004 - 2012 Mirko Nasato and contributors\n
- * 2016 - 2017 Simon Braconnier and contributors\n
- *\n
- * This file is part of JODConverter - Java OpenDocument Converter.\n
- *\n
- * Licensed under the Apache License, Version 2.0 (the "License");\n
- * you may not use this file except in compliance with the License.\n
- * You may obtain a copy of the License at\n
- *\n
- * http://www.apache.org/licenses/LICENSE-2.0\n
- *\n
- * Unless required by applicable law or agreed to in writing, software
n
- * distributed under the License is distributed on an "AS IS" BASIS,\n
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or impl
ied.\n
- * See the License for the specific language governing permissions and
n
- * limitations under the License.\n
- */\n
-\n
-package org.jodconverter.cli;\n
-\n
-import static org.junit.Assert.assertTrue;\n
-\n
-import java.io.File;\n
-\n
-import org.junit.Test;\n
-\n
-public class ConvertTest {\n
-\n
- private static final String CONFIG_DIR = "src/integTest/resources/con
fig/";\n
- private static final String SOURCE_FILE = "src/test/resources/documen
ts/test.doc";\n
- private static final String OUTPUT_DIR = "test-output/" + ConvertTest
.class.getSimpleName();\n
-\n
- @test\n
- public void convert() throws Exception {\n
-\n
- final File inputFile = new File(SOURCE_FILE);\n
- final File outputFile = new File(OUTPUT_DIR, "convert.pdf");\n
-\n
- Convert.main(new String[] {"-k", inputFile.getPath(), outputFile.ge
tPath()});\n
-\n
- assertTrue(outputFile.isFile() && outputFile.length() > 0);\n
- }\n
-\n
- @test\n
- public void convertWithMultipleFilters() throws Exception {\n
-\n
- final File filterChainFile = new File(CONFIG_DIR + "applicationCont
ext_multipleFilters.xml");\n
... (100 more lines that didn't fit)
Violations also present in:
jodconverter-cli\src\main\java\org\jodconverter\cli\CliConverter.java
jodconverter-cli\src\main\java\org\jodconverter\cli\Convert.java
Run 'gradlew spotlessApply' to fix these violations.
- Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug
option to get more log output.
BUILD FAILED
Total time: 11.449 secs
from jodconverter.
Hmmm. This is the spotless plugin failing on line endinds.
Although with \r\n eol, This is not the first time this behavior is reported, but I thought It was fixed with commit cc1de6f
Could you please tell me the OS on which you are experiencing this issue ? In the meantime, you can simply run:
gradlew splotlessApply
before building the project. That should do the trick.
from jodconverter.
Oh! I got it. You have downloaded the project, not cloned it! So the .gitattributes haven't been applied. Then you can just use the trick from my previous post (gradlew spotlessApply),
OR if you have a git client installation, just clone the project using the command:
git clone https://github.com/sbraconnier/jodconverter.git
from jodconverter.
Hi Simon,
Cloned the project as described in your last posting.
Was able to build the project using: gradlew clean build -x test -x integTest distZip
When I run this on my Windows 7 32b system I get this:
C:\TMP>java -jar jodconverter-cli.jar test.xls test.pdf
no main manifest attribute, in jodconverter-cli.jar
C:\TMP>
from jodconverter.
Forgot to mention.
The reason why I'm looking into this is that I would like to integrate this in my "Mirth Connect" engine.
Any suggestions about this would be most appreciated.
from jodconverter.
Hi!
When you use the cli module, you must use the batch file that comes with the distributions. Look the output of the gradle "distZip" task. It creates a zip file with all the required stuff to use JODConverter as a command line tool. The zip file can be found (after the distZip task execution) in the build/distributions directory of the jodconverter-cli module.
Note that this distribution zip is provided here for the version 4.0.0.
The batch file to run in order to use the cli module is located in the bin directory (jodconverter-cli.bat or the other one if you are not running on Windows).
Suppose you put your test.xls at the root of the cli tool (where are the bin, conf and lib directories), your command will look like this:
bin\jodconverter-cli test.xls test.pdf
You cannot use java -jar directly without telling the command about your classpath and the main class to use (which is done in the bin/jodconverter-cli batch file).
As for Mirth Connect, I created this fork to do exactly that! We use JODConverter with Mirth Connect at work and it works very well. I cannot publish anything here since it is proprietary information, but you have many options here according to how much time you have to complete your goal and how much experience you have in Mirth Connect plugins development.
If you don't have much time and no experience in Mirth Connect plugins development, you will want to use the cli module and call the batch file from a Transformer Step. Just know that this solution will start an office process each time the batch file is called. So it may not be the perfect solution if it is done in a Channel with heavy traffic, but it should work just fine if you adjust your timeouts (TCP Listener/Sender?) accordingly.
If you are a pro in Mirth Connect plugins development, you can integrate JODConverter to Mirth through a plugin that will start with Mirth Connect and could support running more that 1 office process.
Gook luck!
from jodconverter.
No news good news ! :)
I'm closing this one.
from jodconverter.
Related Issues (20)
- 4.4.2word导出pdf,偶尔出现org.jodconverter.core.office.OfficeException: Task did not complete: LocalConversionTask{source=SourceDocumentSpecsFromInputStream{file=null, for mat=null}, loadProperties=null, target=TargetDocumentSpecsFromOutputStream{file=null, format=pdf}, storeProperties=null} HOT 9
- Getting error: Unsupported URL "type detection failed" HOT 2
- Unable to connect to external liberoffice when deploying springboot applications using Docker HOT 2
- LibreOffice not starting when run from Systemd / tomcat user HOT 2
- Feature Request - Send multiple documents to JodConverter and receive a merged document? HOT 1
- Use of plug-ins HOT 1
- hwp file cannot be opened HOT 2
- OfficeManager could not be found HOT 2
- Unwanted SSL is triggered HOT 2
- An error is reported after the office manager Temporary folder is deleted HOT 1
- Converting spreadsheetML (XML Spreadsheet 2003) to XLSX (Excel Workbook) results in timeout HOT 5
- Cannot find a valid unoloader.jar path. HOT 2
- While Excel to pdf convertion reference cell values not reflected in other sheet excel . HOT 1
- use jodconverter remote cant start project HOT 4
- How do I convert a particular page of ppt/excel/text file to PNG using Java Uno API's HOT 1
- In jodconverter and its API does pagination (converting a certain page of docx/ppt/excel) to PNG uses MSOffice API internally? HOT 7
- Error: This office manager is not running. HOT 2
- there are a blank column in my pdf HOT 1
- Concurrency convertion not happen HOT 4
- When converting DOCX to PDF the style is confused and many pages are lost HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from jodconverter.