Free Support Forum - aspose.com

Out put removes spaces

Hi there,

We have a word document that we are converting to a pdf using Aspose.Word and then Aspose.PDF to turn it back into a pdf. Something weird is going on with some of the text though when we do this some of the words have the spaces inbetween them removed. Deleting and retyping the words seems to fix it. Are you able to tell me why this is occurring and if there is any way to prevent it from occurring? I have attached a sample word doc with two words that this is happening with in it.

Regards,
Kyle

Hi,

Thanks for your request.

If I understand you correctly you are having issues with converting the attached document to PDF. I tried to do it on my side using Aspose.Words.NET v9.0 and didn't find any issue with spacing between words in the output PDF document. I used SaveToPdf method for converting to PDF.
Could you convert the document you are having issue with using SaveToPdf method (www.aspose.com/documentation/.net-components/aspose.words-for-.net-and-java/aspose.words.document.savetopdf_overload_1.html). If the issue is still reproducible then please attach the output PDF document.

Thanks,

Hi,
thanks for the reply I was doing it in a more roundabout way


// wordDocument.SaveOptions.PdfExportImagesFolder = Path.GetDirectoryName(docFileName);
// wordDocument.Save(xmlFileName, SaveFormat.AsposePdf);
//
// var pdf = new Pdf { IsImagesInXmlDeleteNeeded = true };
// pdf.BindXML(xmlFileName, null);
// pdf.IsTruetypeFontMapCached = false;
// pdf.Save(pdfFileName);

doing it your way seems to have resolved the problem.

Thank you