Code Monkey home page Code Monkey logo

Comments (10)

michelole avatar michelole commented on May 12, 2024 2

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.

vdveldel avatar vdveldel commented on May 12, 2024

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.

sbraconnier avatar sbraconnier commented on May 12, 2024

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.

vdveldel avatar vdveldel commented on May 12, 2024

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.

sbraconnier avatar sbraconnier commented on May 12, 2024

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.

sbraconnier avatar sbraconnier commented on May 12, 2024

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.

vdveldel avatar vdveldel commented on May 12, 2024

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.

vdveldel avatar vdveldel commented on May 12, 2024

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.

sbraconnier avatar sbraconnier commented on May 12, 2024

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.

sbraconnier avatar sbraconnier commented on May 12, 2024

No news good news ! :)

I'm closing this one.

from jodconverter.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.