Spire.PDF is a professional PDF library applied to creating, writing, editing, handling and reading PDF files without any external dependencies. Get free and professional technical support for Spire.PDF for .NET, Java, Android, C++, Python.

Thu Jan 22, 2026 3:10 pm

Hello,
I need to convert a Word document to PDF. First, I need to open the Word document, edit it, and then convert it to PDF.
When I do this, the bold, all caps, and Arial font lose their formatting, and the letter "S" is larger than the rest. The PDF becomes misaligned.
I'm sending the original Word document, the resulting PDF, and the code.

string newName = string.Format(@"{0}_{1}.{2}", "fileResult", new Random().Next(1, 100), FileFormat.Docx.ToString());
string TargetLocalPath = @"D:\temp";

string fullPath = Path.Combine(TargetLocalPath, newName);



byte[] bytes = File.ReadAllBytes(@"D:\Temp\fileSource.docx");
MemoryStream msSource = new MemoryStream(bytes);
MemoryStream msResult = new MemoryStream();

Spire.Doc.Document _documentFile = new Document(msSource);

//Convert to pdf
_documentFile.SaveToStream(msResult, Spire.Doc.FileFormat.PDF);


//Save to Word
_documentFile.SaveToFile(fullPath);

//Save to PDF
newName = newName.Replace(FileFormat.Docx.ToString(), FileFormat.pdf.ToString());
fullPath = Path.Combine(TargetLocalPath, newName);
msResult.Position = 0;
using (FileStream fileResult = new FileStream(fullPath, FileMode.Create, System.IO.FileAccess.Write))
msResult.CopyTo(fileResult);

msResult.Close();
msSource.Close();
_documentFile.Close();


Can you please help me? We just updated our version of Spire.Office, and this didn't happen with the previous version.

[img]
Imagen%20Result.png
[/img]

Thank you very much,

LauraNM
 
Posts: 92
Joined: Tue Feb 19, 2019 1:23 pm

Fri Jan 23, 2026 2:49 am

Hello,

Thank you for your inquiry.
I have tested with the latest versions of Spire.Office (10.12.0) and Spire.Doc (14.1.12) but was unable to reproduce the issue. I am attaching my test project for your reference. To help us investigate further, could you please share the environment details where the problem occurs, such as your system environment (e.g., Windows 11, 64-bit) and project framework (e.g., .NET 8.0)? If possible, providing a runnable project that reproduces the issue would be very helpful. Thanks in advance.
Sincerely,
Talia
E-iceblue support team
User avatar

talia.liu
 
Posts: 331
Joined: Mon Apr 14, 2025 3:33 am

Return to Spire.PDF