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)
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)
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.
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.
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.