Hi,
We are facing issue in Linux while converting docx to PDF.
PrefillDemo_IntakeForm_v4.docx (60.8 KB) is docx file which we are trying to convert to PDF.
Actual.pdf (39.3 KB) we are getting this file as output but expectation is
Expected.pdf (119.2 KB) where Age word is getting expand to next line.
We are using below code,
string FilePath = Directory.GetCurrentDirectory() + "/PrefillDemo_IntakeForm_v4.docx";
using FileStream fs = File.OpenRead(FilePath);
Aspose.Words.Document document = new Aspose.Words.Document(fs);
using (var dstStream = new MemoryStream())
{
Aspose.Words.Fonts.FontSettings.DefaultInstance.SetFontsFolder("/usr/share/fonts", true);
document.Save(dstStream, Aspose.Words.SaveFormat.Pdf);
dstStream.Position = 0;
var b = new byte[dstStream.Length];
dstStream.Read(b, 0, b.Length);
dstStream.Position = 0;
DirectoryInfo info = new DirectoryInfo(Directory.GetCurrentDirectory());
string path = Path.Combine(Directory.GetCurrentDirectory(), "Converted.pdf");
using (FileStream outputFileStream = new FileStream(path, FileMode.Create))
{
dstStream.CopyTo(outputFileStream);
}
}
We are getting expected file on windows but on Linux, word break into next line.
Please let us know what need to do to fix this issue.