Free Support Forum - groupdocs.com

Docx to PDF conversion appears to be wrong in Java

i’m trying to chase down some rendering issues for our customers. in doing so, i created a simple document in word as a .docx format. i then created pdf’s the following ways:

  1. export to pdf from MS Word
  2. export to pdf from LibreOffice
  3. export to pdf from GroupDocs

the MS Word and LibreOffice pdfs where very, very close to each other. the GroupDocs pdf rendered each character significantly larger which changed the lines of the document. see attachments.

now_time-calibri-dv-groupdocs.pdf (16.2 KB)
now_time-calibri-libre.pdf (16.2 KB)
now_time-calibri-ms.pdf (159.4 KB)
now_time.zip (186.8 KB)

@bkirkby,

Thank you for your inquiry. We reproduced this issue at our end as well using 17.12 version of the API. Hence, its been logged in our internal issue tracking system with ID:CONVERSIONJAVA-500 and we are working on it. As we have any update on this issue, we shall notify you.

I want to convert docx to pdf using groupdocs-conversion-17.12 but not able to do so. can you help me with that. The reason why i am not able to do so is i think i am unable to understand the Utilities.java

@riazahmed450,

In order to avoid any confusion, we moved and answered your issue here.

Should we use https://doc2pdf.io/ to convert doc files to pdf if I’m not familiar with Utilities.java?

@harryjosh,

You can simply run this project and do document conversion across a lot of supported file formats. Aside this we’d recommend you to go through this thread.
Below is the most simplified code to do document conversion:

String storagePath = "C:/Storage";
String outputPath = "C:/ConvertedStorage";
 
// Setup Conversion configuration
ConversionConfig conversionConfig = new ConversionConfig();
conversionConfig.setStoragePath(storagePath);
conversionConfig.setOutputPath(outputPath);
 
// Instantiating the conversion handler
ConversionHandler conversionHandler = new ConversionHandler(conversionConfig);
PdfSaveOptions saveOption = new PdfSaveOptions(); 
// Set absolute path to file
String guid = "C:/Storage/DOCXsample.docx";
ConvertedDocument convertedDocumentPath = conversionHandler.<String> convert(guid, saveOption);
convertedDocumentPath.save(fileName + "." + convertedDocumentPath.getFileType());
System.out.print("Converted file path is: " + convertedDocumentPath);
1 Like

internal issue id: RD-4657

@bkirkby,

We are still investigating the issue.

1 Like