1

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: The input file seems to be corrupt" error.

VB script occurs the problem: if i delete the "dummy-password-to-avoid-lock" string, it works fine. Occurs error: Set wordDocument = wordApplication.Documents.Open(inputFile, False, True, False, "dummy-password-to-avoid-lock")

Generate PDF fine: Set wordDocument = wordApplication.Documents.Open(inputFile, False, True, False)

Is there any possibility to change VBSscript from java code?

Example the converter? IConverter converter = LocalConverter.builder().setVBScript().build(); ?

IFA
  • 11
  • 2

1 Answers1

0

This seems to be a problem introduced in documents4j version 1.1.3. Try the previous version 1.1.2. I might need to undo this change since older Word versions do not seem to accept the password workaround.

Rafael Winterhalter
  • 42,759
  • 13
  • 108
  • 192
  • Thanks your reply. I' useing Office 2016 -> Word 16.5005.1000 32 bit version. – IFA Jun 19 '20 at 19:48
  • 1.1.2 drop the same exception. Another information: If i set the jars manually, and replace the VBScript, and run, the output is a little bit different, like the good machine. Example headers blurred. – IFA Jun 21 '20 at 08:46
  • You can set a VBScript location in 1.1.3 using a system property: https://github.com/documents4j/documents4j/blob/master/documents4j-transformer-msoffice/documents4j-transformer-msoffice-word/src/main/java/com/documents4j/conversion/msoffice/MicrosoftWordScript.java#L51 – Rafael Winterhalter Jun 22 '20 at 07:32