DOCX to PDF conversion in PHP with Aspose.Words REST API changes the text style/format

Hi Aspose Support,

We just noticed changes in the produced PDF documents that we generate using the word templates. The changes are at the level of text formatting and text typing, as you can see the text style of the attached template in comparison with the produced PDF file. This issue started to take place since a month or so.

Have you done any changes at your side that would result in this? Could you advise how we can maintain the same style as the template?

Output Leaso test.pdf (79.3 KB)
WORD.pdf (84.0 KB)
AskedFiles.zip (270.8 KB)

We are using the “words-sdk-php” version: 18.2.


This Topic is created by sohail.aspose using the Email to Topic plugin.

@Softwareselskabet

Thank you for contacting Aspose Support.

We are able to reproduce the issue on our end. We have logged the issue (WORDSCLOUD-563) in our internal tracking software and we are trying to fix it at the earliest. We will keep you updated on the progress.

We are sorry for the inconvenience caused.

1 Like

@Softwareselskabet

The problem occurred because the font used in the document (Template.docx) is not available on the server. The font name is Century Gothic.

In order to fix the issue, you need to upload the missing fonts to the Cloud Storage as shown below:

then specify the fonts path in the API:

https://api.aspose.cloud/v1.1/words/Template.docx/saveAs?fontsLocation=Fonts

fontsLocation parameter is used to specify the path of custom fonts.

You may download the Century Gothic font from here Dropbox - 11528.ttf - Simplify your life

1 Like

@sohail.aspose Thanks for suggesting this fix we just tried it and it’s working fine now. BTW, in case we have other fonts that may not to be at your server. Can we just upload them or should the file be named in certain way, such as Century Gothic case as: 11528 ?

On the other hand, we are facing another issue with the layout of the produced PDF file versus the original template. If you check the attached case you will notice a spaces between the lines for example.

Could you check it and update us in case we should specify any option with the API request ?

Thanks.

Style Changes Issues.zip (59.0 KB)

@Softwareselskabet

BTW, in case we have other fonts that may not to be at your server. Can we just upload them or should the file be named in certain way, such as Century Gothic case as: 11528 ?

You can name fonts as you like. There is no particular pattern to follow.

1 Like

@Softwareselskabet

On the other hand, we are facing another issue with the layout of the produced PDF file versus the original template. If you check the attached case you will notice a spaces between the lines for example.

Just to ensure we are on the same page, you are saying that there is more space between lines in a PDF document than in a Word Document, as shown below:

@sohail.aspose Yes, that’s what I’m referring to.

@Softwareselskabet

We have logged the issue in our internal tracking software (WORDSCLOUD-594) and we will keep you updated with the progress on the issue.

1 Like

@Softwareselskabet

In order to fix the issue of more space between lines in a PDF document, please upload Helvetica Neue font to the Cloud Storage.

But this time we cannot provide you with a font, because we do not know the exact version you are using.

1 Like