Questions tagged [documents4j]

documents4j is a library for converting documents into a different format using a pure Java API. Under the hood, it runs third-party applications to which it delegates the conversion. Currently, it ships with adapters for MS Word and MS Excel. The conversion can be executed locally or remotely via a REST service.

documents4j is a Java library for converting documents into another document format. This is achieved by delegating the conversion to any native application which understands the conversion of the given file into the desired target format. documents4j comes with adaptations for MS Word and MS Excel for Windows what allows for example for the conversion of a docx file into a pdf file without the usual distortions in the resulting document which are often observed for conversions that were conducted using non-Microsoft products.

58 questions
5
votes
1 answer

Convert html + css (print media) to msword in java

Here is my situation. I have an html/css (css contains print media properties such as @page, @bottom-center etc) resource which is converted to pdf via flying-saucer just fine. Now, I need to convert the same resource also to msword (doc or docx)…
pleft
  • 7,567
  • 2
  • 21
  • 45
5
votes
1 answer

How do I solve this below exception I get when converting docx to pdf using Documents4j library?

I am using the below code to convert docx to pdf. public static void main(String[] args) { File inputdocxfile = new File(System.getProperty("user.dir") + "/src/test/resources/files/output/"); File outputpdffile = new…
user2493028
3
votes
1 answer

How to manage LocalConverter and when invoke ShutDown() method?

I wrote some code using documents4j library to convert some documents from .docx to .pdf. I followed the examples in the documentation and the convertion works perfectly using MS-Word, but I notice that after all conversions complete and methods…
D. Pesc.
  • 196
  • 15
2
votes
2 answers

Convert docx to pdf using documents4j throw exception

I am trying to write a converter for docx to pdf using the documents4j library. Is there any missiong libraries ? could it be a limitation of the documents4j library ? This is the dependencies I am using :
H.abidi
  • 579
  • 1
  • 7
  • 16
2
votes
0 answers

IllegalStateException when converting from docx to pdf via documents4j

(SOLVED) I want to convert a docx-document into pdf. As the results with xdocreport weren't quite statisfactory, I tried out documents4j. Unfortunalty, I recieve the following IllegalStateException: java.lang.IllegalStateException: class…
Starjon
  • 21
  • 4
2
votes
1 answer

Apache tomcat error (no from eclipse or xampp tomcat)

I have a problem converting from .docx to .pdf with the Documents4j library, which only happens when I run the application from apache tomcat installation. However, if the application is executed with Eclipse or XAMPP apache tomcat works…
Carrega
  • 21
  • 2
2
votes
2 answers

How to convert .docx file to .pdf in Java

I'm looking for the best way to convert docx file to pdf in Java, this is what I've tried: File wordFile = new File("wordFile.docx"), target = new File("target.pdf"); IConverter converter; Future conversion =…
mohamed.bc
  • 47
  • 4
  • 10
2
votes
1 answer

Error when converting office files to pdf with documents4J: Class path contains multiple SLF4J bindings

I am trying to use documents4J to convert the office files and images to PDF, but am getting "Class path contains multiple SLF4J bindings". Here is my current code: package documentsForJ; import java.io.File; import…
Hans F
  • 21
  • 1
  • 3
2
votes
2 answers

FileSystemInteractionException: Could not access target file while using documents4j

I am using documents4j to convert word documents to pdf and some time I am getting below exception 2016-03-28 09:29:16.982 INFO 3660 --- [pool-1-thread-2] c.d.c.msoffice.MicrosoftWordBridge : Requested conversion from…
Ritesh Sangwan
  • 147
  • 2
  • 11
1
vote
0 answers

Converting xlsx to pdf using documents4j

I'm writing a small application to convert office documents to pdf. Now I found Documents4j and as of now it's my best choice for .docx documents. It works very good. Now I also want to use it for .xlsx -> .pdf conversions, but I'm having some…
Ricardo de Vries
  • 113
  • 3
  • 11
1
vote
1 answer

documents4j IllegalStateExeption: while converting a docx file to pdf in Java

I am trying to convert a docx file to pdf in Java, but I am getting this error: Exception in thread "main" java.lang.IllegalStateException: class com.documents4j.conversion.msoffice.MicrosoftWordBridge could not be created by a (File, long,…
1
vote
1 answer

Convert PDF to Word including links

I have built a PDF to Word converter using the document4j library but have a problem with the links. For example, in the PDF file you can click on a chapter name and it jumps there immediately, but after converting to a doc file it unfortunately…
serkan45
  • 11
  • 1
1
vote
1 answer

Converting Java code to C# httpClient POST custom request to a conversion server

I have an example working solution in Java but I need a solution in C# that can be called from a legacy database system. So basically create a request with custom headers, load a Word document, and send the request. The server will then convert the…
1
vote
2 answers

Client conversion fails when Standalone Server started with Administrator permissions

I am testing various ways to use Documents4j using the shaded jars on Windows 10. I use the following: SERVER: documents4j-server-standalone-1.1.5-shaded.jar Command Line: java -jar %~dp0documents4j-server-standalone-1.1.5-shaded.jar…
1
vote
1 answer

documents4j - docx to pdf generation problem

I use a simple java code to generate doxc to PDF. The library is used to conversation is documents4j. The same code is run in one machine, and not run in another. The other machine always get "com.documents4j.throwables.ConversionInputException:…
IFA
  • 11
  • 2
1
2 3 4