We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

PageCount problem

Hi,

I’m testing PageCount property.

With the attached document (22 pages in MS Word), PageCount property return 31 with Aspose.Word 9.1.0.

I save this document as image, and there are some problems (blanck page, paragraph in wrong page).

code :

License licence = new License();
licence.SetLicense(@"F:\Travail\venayre-m\Aspose.Total.lic");
Aspose.Words.Document doc = new Aspose.Words.Document(@"F:\Travail\venayre-m\test2.doc");
doc.UpdateTableLayout();
doc.UpdatePageLayout();
Console.WriteLine("a:" + doc.PageCount.ToString());
for (int i = 0; i < doc.PageCount; i++)
    if (i < 10)
        doc.SaveToImage(i, 1, string.Format(@"F:\Travail\venayre-m\out_0{0}.jpg", i), null);
    else
        doc.SaveToImage(i, 1, string.Format(@"F:\Travail\venayre-m\out_{0}.jpg", i), null);

Word document and produced images are attached.

Do you reproduce the problem ?

Thanks

Hi

Thanks for your inquiry. I managed to reproduce the problem on my side. Your request has been linked to the appropriate issue. You will be notified as soon as it is fixed.

The problem occurs because you are using floating tables in your document. Currently, Aspose.Words does not support floating table positioning during rendering. As a workaround, you can set “Text wrapping” of your table to “None”.

Best regards,

Hi,

I tried do modify my document. It seems to be better, but there is still blanck pages inserted.

Could you please help me to modifiy this document to avoid blanck pages ? Is there something else not supported ?

I attached a shorter document. (3 pages in MS word, PageCount=5, 2 blanck pages in images).

Thanks

Hi

Thank you for additional information. I send the modified document to your e-mail. I use the latest version of Aspose.Words 9.1.0 for testing.

Best regards,

Hi,

I tried again with this modified document, but there are still some problems :

  • Table with merged cells (column span) are not rendering correctly

  • PageCount is equal to 4 instead of 3

  • SaveAsImage generate a blanck page at the end

  • floating box in wrong place, but I’ll modifiy my template for that problem.

I used the same code. I attached images generated. I’m testing with Aspose.word 9.1.0.

Do you reproduce these problems ? What code do you use for testing ?

Thanks

Hi

Thank you for additional information. I use the following code for testing:

// Open source document.
Document doc = new Document(@"Test\test3.doc");

doc.SaveToImage(0, doc.PageCount, @"Test\out.tif", null);

I send the input and the output document to your e-mail.

  • Table with merged cells (column span) are not rendering correctly – could you please create screenshot which shows me the problem.
  • PageCount is equal to 4 instead of 3 – cannot reproduce this problem.
  • SaveAsImage generate a black page at the end – cannot reproduce this problem.

Best regards,

Hi,

It seems that these problems occurs only when I use UpdateTableLayout() before SaveToImage.

Aspose.Words.Document doc = new Aspose.Words.Document(@"F:\Travail\venayre-m\testaspose.doc");
doc.UpdateTableLayout();
Console.WriteLine("a:" + doc.PageCount.ToString());
doc.SaveToImage(0, doc.PageCount, @"Test\out.tif", null);

=> generate a white page at the end, pageCount=4 instead of 3, column-spanned cells nok

Aspose.Words.Document doc = new Aspose.Words.Document(@"F:\Travail\venayre-m\testaspose.doc");
Console.WriteLine("a:" + doc.PageCount.ToString());
doc.SaveToImage(0, doc.PageCount, @"Test\out.tif", null);

=> ok

Is this a bug on UpdateTableLayout() method? When have I to use this method ?

I attached the .tif file generated with an without UpdateTableLayout().

Thanks

Hi

Thank you for additional information. You do not normally need to call this method as cell and table widths are maintained automatically. You might need to call this method before exporting to PDF, only in rare cases where a table appears incorrectly laid out in PDF output.

Best regards,

Ok, Thanks for your help and quick replies

The issues you have found earlier (filed as WORDSNET-1940) have been fixed in this .NET update and in this Java update.


This message was posted using Notification2Forum from Downloads module by aspose.notifier.
(75)