PDF is misaligned if we use Textboxes in the Word Document (.docx)

When we use Text Boxes in a Docx file . Generated PDF is totally misaligned. See the attached documents for reference

TestDocument.docx (30.5 KB)

TestDocument.pdf (26.6 KB)

@akashkrishnan

Could you please provide more details about the specific misalignment issues you are experiencing with the generated PDF from the Word document?

Hello @akashkrishnan ,

To help us investigate and resolve this issue more efficiently, could you please provide additional information about your use of GroupDocs.Conversion for Java?

Specifically, we’d appreciate it if you could confirm:
– the version of the product you’re using,
– the operating system on which the conversion is being performed,
– and the complete code sample you’re using to perform the conversion.

We’ll be waiting for your response with these details.

  • Version of product is 25.3.1 Group Docs
  • OS.: Linux , JDK 17

Sample Code:

import com.groupdocs.conversion.Converter;
import com.groupdocs.conversion.contracts.FontSubstitute;
import com.groupdocs.conversion.options.convert.PdfConvertOptions;
import com.groupdocs.conversion.options.load.WordProcessingLoadOptions;

import java.util.ArrayList;
import java.util.List;

public class ConvertDocxToPdf {
public static void main(String[] args) {
String sourceFilePath = “path/to/your/testSEFE03.docx”;
String outputFilePath = “path/to/output/testSEFE03.pdf”;

    // Create load options with font substitution
    WordProcessingLoadOptions loadOptions = new WordProcessingLoadOptions();
    loadOptions.setAutoFontSubstitution(false);
    loadOptions.setDefaultFont("Arial"); // Set a default font if needed

    List<FontSubstitute> fontSubstitutes = new ArrayList<>();
    fontSubstitutes.add(FontSubstitute.create("Arial MT", "Arial")); // Map Arial MT to Arial
    fontSubstitutes.add(FontSubstitute.create("Times New Roman", "Times New Roman")); // Ensure Times New Roman is used

    loadOptions.setFontSubstitutes(fontSubstitutes);

    // Initialize the converter
    try (Converter converter = new Converter(sourceFilePath, () -> loadOptions)) {
        PdfConvertOptions options = new PdfConvertOptions();
        converter.convert(outputFilePath, options);
        System.out.println("Conversion completed successfully.");
    } catch (Exception e) {
        e.printStackTrace();
    }
}

}

Hello @akashkrishnan ,

Thank you for sharing your usage example — it significantly helped us speed up our investigation.
We’ve confirmed that this is a bug and have logged it in our internal tracking system under the ID: CONVERSIONJAVA-2914. We’ll notify you as soon as the issue is resolved.

We sincerely apologize for the inconvenience caused.

hi @evgen.efimov

It would be really great if you share us a timeline for this bug fix

Hello @akashkrishnan ,

We are very sorry, but at this moment we do not have a specific timeframe for resolving this issue.
As soon as we have any updates or are able to provide a more accurate estimate, we will definitely reach out to you.

@evgen.efimov Any update on this issue fix?

Hello @akashkrishnan ,

We apologize for the delay in resolving this issue. Since it was related to a third-party library, we were unable to provide an exact timeframe for the fix. We have now learned that the correction will be available this month. As soon as we obtain and verify the updated version of the library, we will promptly include it in our current release of GroupDocs.Conversion for Java. We appreciate your patience and apologize again for the inconvenience.