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.

Tue May 07, 2019 6:21 am

Good day!

I was trying to convert a Wordpad file to image it consist of 4 pages, but while in the process of converting, the code only detects 1 page only.

The file is attached.


Here's my code:
for (int x = 0; x < document.BuiltinDocumentProperties.PageCount; x++)
{
Image imageDocument = document.SaveToImages(x, Spire.Doc.Documents.ImageType.Metafile);
imageDocument.Save(downloadPath + "_" + repFIleName + "_" + x + ".jpg", System.Drawing.Imaging.ImageFormat.Bmp);
}


Thank you in advance

tcballelos
 
Posts: 36
Joined: Wed Nov 28, 2018 5:35 am

Tue May 07, 2019 8:37 am

Hello,

Thanks for your inquiry.
According to your sample file, please use document.PageCount to replace document.BuiltinDocumentProperties.PageCount. Since the BuiltinDocumentProperties is a property of word document structure, it couldn't get the correct page count by document.BuiltinDocumentProperties.PageCount. If there is any question, welcome to write back.

Sincerely,
Lisa
E-iceblue support team
User avatar

Lisa.Li
 
Posts: 1261
Joined: Wed Apr 25, 2018 3:20 am

Thu May 09, 2019 12:50 am

Good day!

I've tested the code and it worked. Thank you!

tcballelos
 
Posts: 36
Joined: Wed Nov 28, 2018 5:35 am

Thu May 09, 2019 1:39 am

Hello,

Thanks for your valuable feedback.
If you encounter any issue related to our products in the future, just feel free to contact us. Wish you all the best!

Sincerely,
Lisa
E-iceblue support team
User avatar

Lisa.Li
 
Posts: 1261
Joined: Wed Apr 25, 2018 3:20 am

Return to Spire.Doc

cron