The pdf file does not match the word after conversion

For word files using custom margins, after converting to pdf the file content is shifted.
I using:

docspire.SaveToFile(saveFileNamePdf, Spire.Doc.FileFormat.PDF);

@minhnv49 Could you please attach your input and output documents here for testing? We will check the issue and provide you more information.

This is the word file I changed the margin when editing.
And after converting the pdf file, the data on line 30 has been moved to another page.
How can I keep the margins of the pdf file the same as the original word file?
thanks

@minhnv49 Could you please attach your actual documents here for testing? Unfortunately screenshots does not allow analyzing the issue.

1.docx (12.6 KB)

2.pdf (16.0 KB)

please see attack file
this is my code:

public void ConvertWordToPdf(JsonAttachFileCls file)
{
    string saveFileNamePdf = "C:\\folder\\" + "\\" + System.Guid.NewGuid().ToString() + ".pdf";
    Aspose.Words.Document doc = new Aspose.Words.Document();
    string base64 = file.AttachContentBase64;
    using (MemoryStream ms = new MemoryStream(Convert.FromBase64String(base64)))
    {
        doc = new Aspose.Words.Document(ms);
        doc.Save(saveFileNamePdf);
    }
}

@minhnv49 As I can see there is no problem in the attached PDF document. PDF document produced on my side matches PDF produced by MS Word:
Aspose.Words: out.pdf (16.9 KB)
MS Word 2019: ms.pdf (42.7 KB)

As I can see you are using a quite old version of Aspose.Words 18.7. I would suggest you to use the latest 24.5 version.

The above mentioned problem might occur because the fonts used in your input document are not available on the machine where document is converted to PDF. The fonts are required to build document layout. If Aspose.Words cannot find the font used in the document, the font is substituted . This might lead into fonts mismatch and document layout differences due to the different fonts metrics. You can implement IWarningCallback to get notifications when font substitution is performed.
Please see our documentation to learn where Aspose.Words looks for fonts:
https://docs.aspose.com/words/net/specifying-truetype-fonts-location/