Libre Office Conversion

Hi Team,

I have been exploring libroffice for quite a bit of time and recently we have upgraded it to 7.6.7.2 and then we started to face some issues related to conversion of docx files to pdf. We are trying to convert it using the gradle sdk and spring boot application.

When converting a docx file to a pdf(which is a text overlayed kind of pdf) using the version 7.6.7.2 it’s conversion is not accurate when compared to 7.4.1.2. Do we still need to tweak any settings or like which would fix this issue. Please let me know your thoughts. I am attaching sample code we use to convert using the java sdk

XDesktop xDesktop = LibreOfficeXDesktopSingleton.getInstance(libreOfficeHome);
      XComponentLoader xCompLoader =
          UnoRuntime.queryInterface(com.sun.star.frame.XComponentLoader.class, xDesktop);

      String sUrl = String.join("", "file:///", filePath, fileName);

      PropertyValue[] propertyValues;

      propertyValues = new PropertyValue[1];
      propertyValues[0] = new PropertyValue();
      propertyValues[0].Name = "Hidden";
      propertyValues[0].Value = Boolean.TRUE;

      XComponent xComp = null;

      xComp = xCompLoader.loadComponentFromURL(sUrl, "_blank", 0, propertyValues);

      XStorable xStorable = UnoRuntime.queryInterface(XStorable.class, xComp);
      propertyValues = new PropertyValue[2];
      propertyValues[0] = new PropertyValue();
      propertyValues[0].Name = "Overwrite";
      propertyValues[0].Value = Boolean.TRUE;
      propertyValues[1] = new PropertyValue();
      propertyValues[1].Name = "FilterName";
      propertyValues[1].Value = "writer_pdf_Export";
      String pdfFileName = fileName.substring(0, fileName.lastIndexOf(".") + 1) + PDF;
      String outputFilePath = filePath + pdfFileName;
      xStorable.storeToURL("file:///" + outputFilePath, propertyValues);

      xComp.dispose();

I have also attached the screen shots for the same where the date in both the pdfs are distorted. Since the pdfs are sensitive couldn’t share the entire pdf here appoligies for that.


if you can spend a bit of time narrowing down the “regression”, that would definitely help fixing it, or finding a WKA : QA/Bibisect - The Document Foundation Wiki

you may also try 24.8 – who knows …
ReleaseNotes/24.2 - The Document Foundation Wiki

Looks like a style issue, but I’m not aware of any specific change between versions that would have contributed.

I have upgraded to latest version of libre office 24.8.0.3 and it worked