Spire.Doc is a professional Word .NET library specifically designed for developers to create, read, write, convert and print Word document files. Get free and professional technical support for Spire.Doc for .NET, Java, Android, C++, Python.

Wed Apr 08, 2020 11:15 am

i used
Code: Select all
new Document(docFullPath).getPageCount();
to get a doc page;but it reminds me
Code: Select all
 Cannot found font installed on the system
。if i only need get filePages without fonts ,how could i do?

hanjunjun
 
Posts: 3
Joined: Thu May 09, 2019 2:08 pm

Wed Apr 08, 2020 11:16 am

i used
spire.doc.free-2.0.0

hanjunjun
 
Posts: 3
Joined: Thu May 09, 2019 2:08 pm

Thu Apr 09, 2020 3:14 am

Hi,

Thanks for your inquiry.
When executing document.getPageCount(), we need to read the font information used by the text from the system if the required fonts are not embedded into document, and then we calculate the height of the content through the font information and then compare it with the page height to do the paging, so as to get the page count. So fonts are essential.
As for your case, please make sure the required fonts are installed into your system, or you embed the required fonts into your document.

Sincerely,
Amy
E-iceblue support team
User avatar

amy.zhao
 
Posts: 2771
Joined: Wed Jun 27, 2012 8:50 am

Tue May 07, 2024 6:03 am

Hi,
Document document = new Document();
for (int i = 0; i < wordFiles.Length; i++)
{
string pdfPath = Path.Combine(path, $"{Guid.NewGuid()}merged_document.pdf");
files.Add(pdfPath);
document.LoadFromFile(wordFiles[i]);
document.SaveToFile(pdfPath, FileFormat.PDF);
}
I use Spire.Doc , but I am getting error. My word font is Times New Roman. How can I solve this problem?

Vusala_Zeynalova
 
Posts: 2
Joined: Tue May 07, 2024 6:00 am

Tue May 07, 2024 7:24 am

Vusala_Zeynalova wrote:Hi,
Document document = new Document();
for (int i = 0; i < wordFiles.Length; i++)
{
string pdfPath = Path.Combine(path, $"{Guid.NewGuid()}merged_document.pdf");
files.Add(pdfPath);
document.LoadFromFile(wordFiles[i]);
document.SaveToFile(pdfPath, FileFormat.PDF);
}
I use Spire.Doc , but I am getting error. My word font is Times New Roman. How can I solve this problem?


Hi,

Thank you for your message.
Are you using our latest version? If not, we recommend to test again with our latest version of Spire.Doc(12.4.7).
Also, if the error is related to fonts, please make sure that the fonts used in Word document are installed on your system environment.
If it doesn't work, please let us know the specific error you're experiencing and provide a test file for us to test. Thanks in advance for your collaboration.

Sincerely,
Doris
E-iceblue support team
User avatar

Doris.Liu
 
Posts: 194
Joined: Mon Nov 07, 2022 8:10 am

Tue May 07, 2024 7:50 am

I use FreeSpire.Doc

Vusala_Zeynalova
 
Posts: 2
Joined: Tue May 07, 2024 6:00 am

Tue May 07, 2024 8:08 am

Hi,

Please first make sure that the fonts used in Word document are installed on your system environment.

Sincerely,
Doris
E-iceblue support team
User avatar

Doris.Liu
 
Posts: 194
Joined: Mon Nov 07, 2022 8:10 am

Return to Spire.Doc