We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Convert Word to PDF: spaces in ser ted ra ndo mly

We have a Word document that is used as a template. We insert data in it with Aspose.Word. Works great. Then we convert it to PDF. Aspose.Pdf adds some spaces in one line of the PDF document.

WEIRD, and irritating.

ZIP file attached with the Word document, the PDF document, and the C# code used for the conversion.

The Word document says “Looking for a job in” and Aspose.Pdf generates “Lo oki ng for a jo b in”.


Thank you for considering Aspose.

I have noticed that you are using an older version of Aspose.Words and Aspose.Pdf. I have tested the document with Aspose.Words v and Aspose.Pdf v and did not get the error. So please use the latest version. Also another problem came up, that the placement of the sentence was not correct. This was caused by wrong indentation setting in the word file. Fixing this produced correct output. Please consult attached word document for detailed explanation.


Adeel Ahmad
Support Developer
Aspose Changsha Team

The issue is still not fixed. I do the following with the latest Aspose.Words amd Aspose.Pdf components for now:

var document = new Aspose.Pdf.Document(pdfPath);
var saveOptions = new Aspose.Pdf.DocSaveOptions
Mode = DocSaveOptions.RecognitionMode.Flow,
RelativeHorizontalProximity = 2.5f,
RecognizeBullets = true
document.Save(docPath, saveOptions);

and also see that words in resulting DOC file are spaced randomly. I tried to change RelativeHorizontalProximity, but this did not help - gaps are still there.

How to get words without randomly inserted spaces into them in resulting DOC file?

Hi Dmitry,

Thanks for using our products.

The above code snippet converts PDF document into DOC format and in order to accomplish this requirement, you only need Aspose.Pdf for .NET to complete the job. Now concerning to the extra spaces in resulting DOC file, can you please share the source PDF document so that we can test the scenario at our end. We are sorry for your inconvenience.

PS, If you need to convert MS Word file into PDF format, you can simply try using Aspose.Words for .NET to complete the job. You may visit the following link for information on How to Convert a Document to PDF

Please use this one. Thanks!

Hi Dmitry,<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

Thank you for sharing the template PDF file with us.

I am able to generate your mentioned issue after an initial test regarding PDF to Doc conversion. I have registered the issue in our issue tracking system with issue id: PDFNEWNET-33757. You will be notified via this forum thread regarding any updates against your reported issue.

Sorry for the inconvenience,

The issues you have found earlier (filed as PDFNEWNET-33757) have been fixed in Aspose.Pdf for .NET 9.4.0.

This message was posted using Notification2Forum from Downloads module by Aspose Notifier.