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.

Thu Dec 13, 2018 10:48 am

I have a 60 pages word document. When i get the total pages of this document, it show me 57 pageCount. When i convert it into image. It come out with 57 images only. What I found out is that some pages contents has been "squeeze" into one page. For example: content in page 4 is just few line text, when convert it into image, the content will "squeeze" to page 3. So how am i suppose to do so that I can get the exactly same amount of pages as the original file when get the page count and images.

This is my code:

//to get total pages
using (Spire.Doc.Document document = new Spire.Doc.Document())
{
document.LoadFromFile(source, Spire.Doc.FileFormat.Auto);
pageNumber = document.PageCount;
}

//convert to images
using (Spire.Doc.Document document = new Spire.Doc.Document())
{
document.LoadFromFileInReadMode(file, Spire.Doc.FileFormat.Docx);
Image[] images = document.SaveToImages(fromPage, toPage, Spire.Doc.Documents.ImageType.Bitmap);

int i = 1;
foreach (Image img in images)
{

var target = path + Path.DirectorySeparatorChar + "Page_" + i.ToString();
var pngTarget = Path.ChangeExtension(target, "png");
img.Save(pngTarget, System.Drawing.Imaging.ImageFormat.Png);
imageList.Add(pngTarget);
i++;
}
}

xiao0207
 
Posts: 43
Joined: Thu Dec 13, 2018 9:50 am

Thu Dec 13, 2018 1:43 pm

Hi, I'm too having the same issue where some content of the page is missing or shifted from one page to another page after converting to images and then resulting in total page is lesser than the actual total pages count.

Currently using the latest spire office.net as I am also using together with other spire library

Tested also with the latest spire doc (Version 6.12.1), still having the same issue.

Here attached the part of the docx file and also the output after converted to image for your comparison

vernon1111
 
Posts: 44
Joined: Fri Mar 02, 2018 4:34 am

Fri Dec 14, 2018 3:40 am

Dear xiao,

Thank you for your inquiry.
To help us look into the issue, could you please send your sample Word document to us?
For the privacy, you could send it to us via email(Jane.Bai@e-iceblue.com).

Sincerely,
Jane
E-iceblue support team
User avatar

Jane.Bai
 
Posts: 1156
Joined: Tue Nov 29, 2016 1:47 am

Fri Dec 14, 2018 3:50 am

Dear vernon,

Thank you for contacting us.
I have reproduced the issue and logged it in our bug tracking system.
Once it is fixed, I will let you know.
Sorry for the inconvenience caused!

Sincerely,
Jane
E-iceblue support team
User avatar

Jane.Bai
 
Posts: 1156
Joined: Tue Nov 29, 2016 1:47 am

Tue Dec 18, 2018 8:38 am

Hi,

Thanks for the info.

Hope to hear for you soon

vernon1111
 
Posts: 44
Joined: Fri Mar 02, 2018 4:34 am

Tue Dec 18, 2018 9:24 am

Hi vernon,

Thank you for your response.
Our dev team is going to start the investigation. Once there's an update, I will let you know.

Sincerely,
Jane
E-iceblue support team
User avatar

Jane.Bai
 
Posts: 1156
Joined: Tue Nov 29, 2016 1:47 am

Thu Dec 27, 2018 3:22 am

Hi Jane,

Is there any update on this issue?

Best regards,
Vernon

vernon1111
 
Posts: 44
Joined: Fri Mar 02, 2018 4:34 am

Thu Dec 27, 2018 6:16 am

Hi Vernon,

Thank you for contacting us.
Sorry to tell that there's no significant progress so far due to the complexity of the issue. Our dev team would keep looking for solutions.
Will keep you informed about the update.

Sincerely,
Jane
E-iceblue support team
User avatar

Jane.Bai
 
Posts: 1156
Joined: Tue Nov 29, 2016 1:47 am

Mon Jan 14, 2019 6:15 am

Hi,

Is there any update on this issue?

Best regards,
Vernon

vernon1111
 
Posts: 44
Joined: Fri Mar 02, 2018 4:34 am

Mon Jan 14, 2019 8:17 am

Hi vernon,

Thank you for your letter.
There's significant progress on your issue. Once the hotfix is available, I will let you know.

Sincerely,
jane
E-iceblue support team
User avatar

Jane.Bai
 
Posts: 1156
Joined: Tue Nov 29, 2016 1:47 am

Wed Jan 23, 2019 5:29 am

Hi,

Any update on this issue?

Best Regards,
Vernon

vernon1111
 
Posts: 44
Joined: Fri Mar 02, 2018 4:34 am

Wed Jan 23, 2019 9:02 am

Hi Vernon,

Thanks for your information.
Sorry there is still a little issue at present. Our Dev team are stepping up fixing the issue. We will inform you once there is any good news.
Apologize for the inconvenience caused.

Sincerely,
Betsy
E-iceblue support team
User avatar

Betsy.jiang
 
Posts: 3099
Joined: Tue Sep 06, 2016 8:30 am

Sat Mar 16, 2019 3:01 am

Hi,

Any update on this issue?

Best regards,
Vernon

vernon1111
 
Posts: 44
Joined: Fri Mar 02, 2018 4:34 am

Mon Mar 18, 2019 10:05 am

Hi Vernon,

Thanks for your information.
Your issue is under testing phase now. If it passes the test, we will provide a hotfix for you.

Sincerely,
Betsy
E-iceblue support team
User avatar

Betsy.jiang
 
Posts: 3099
Joined: Tue Sep 06, 2016 8:30 am

Thu Apr 04, 2019 10:50 am

Hi,

Thanks for your patient waiting.
The issue has been fixed, please download the hotfix from the following link and use the code below.
Website link: Spire.Office Platinum (DLL Only) Version:4.4.0
Nuget link: https://www.nuget.org/packages/Spire.Office/4.4.0
Code: Select all
Document doc = new Document();
doc.LoadFromFile(filepath);
Image[] bitSource = doc.SaveToImages(ImageType.Bitmap);
int index = 1;
foreach (Image img in bitSource)
{
    img.Save(String.Format("out_{0}.png", index), System.Drawing.Imaging.ImageFormat.Png);
    img.Dispose();
    index++;
}

Sincerely,
Nina
E-iceblue support team
User avatar

Nina.Tang
 
Posts: 1187
Joined: Tue Sep 27, 2016 1:06 am

Return to Spire.Doc