Convert PDF to DOCX, fonts substitution issue in Java

@Tirumala_Reddy,

This could be because the font that the source document has is not available/installed in VM but installed in your local environment.
But the good thing is API provides default font and font substitution feature.
Set font path:

String fontsPath = projectPath + "/Fonts/" ;

Setup configuration:

ConversionConfig conversionConfig = new ConversionConfig();
conversionConfig.getFontDirectories().add(fontsPath);

You can either install the font(s) that is missing in your VM or load them to the API by following the above steps.
Let us know if this resolves your issue.

What kind of Font config we need to add in /Fonts/ Directory. Do you have any config which has all Fonts related info, we can use that.

We basically want it to work on any server, Please let me know the font config that I need to put in Font Directory.

@Tirumala_Reddy,

You have to put/copy the font (if not available, download it) in the directory manually and then pass that path to the config (as code shared in previous reply).

We are further investigating this scenario. Your investigation ticket ID is CONVERSIONJAVA-735. As we have any further information, you’ll be notified.

Its better if you guys can provide us all the font related info, which we can put in some directory and load it. That would solve everyones problem, we have no idea, what exactly we have to download.

1 Like

@Tirumala_Reddy,

This is still under investigation, we’ll notify you as there’s any update.

Hi Tahir,

By when I can expect update, we are going live soon with pdf to docx conversion. We need this as soon as possible.

Regards,
Tirumala Reddy

@Tirumala_Reddy,

API doesn’t provide such feature. However, in order to avoid any such issue, you can use default font feature. We are still investigating this, you’ll be notified as we have further update.

What do you mean by default font feature ?

@Tirumala_Reddy,

In default font feature you actually add or specify some particular font in place of the missing one.
How this is helpful?
Let me further elaborate, if your document is using a font that is not installed on the server. In that case, to avoid any issue you can specify a default font that is available on server and it will be used in place of missing one.

WordsLoadOptions loadOption = new WordsLoadOptions(); 
loadOption.setDefaultFont("Arial");

You can see what is the most common font(s) that is easily available on any server and specify that as default font. Please use this code in your project and see if you get rid of the error.

Hi Tahir,

What is the guarantee that this default is available on any server ? Its better if you guys can give us fonts data, which we can load before conversion and also set one of these as default.

Please let us know the ETA, we have complete license for JAVA conversion platform, and have to go live with pdf to docx conversion soon.

Regards,
Tirumala Reddy

@Tirumala_Reddy,

We are looking into this scenario. Please note that we investigate the issues at first come first served basis. Therefor, we cannot share any ETA at the moment.
However, you can also avail priority support in order to expedite the issue .

Thank you posted there.

1 Like

@Tirumala_Reddy,

You’re welcome.

correction . .

@Tirumala_Reddy,

Alright.

Hi Tahir,

Can we use same ConverisonConfig object for all conversions ? Or do we need to instantiate a new conversionconfig object everytime before conversion ?

Regards,
Tirumala Reddy

1 Like

@Tirumala_Reddy,

Yes.

Thank you Tahir.

@Tirumala_Reddy,

You are welcome.