Aspose.word Get Doc.PageCount Error!


#1

Hi
The following code

m_doc = new Aspose.Words.Document(InputName);
m_nGetPageNumber = m_doc.PageCount;

The word files have On page 910, but m_nGetPageNumber = 19, version for Aspose.Words_18.11 only dll , 4.0 .Net


#2

@Liangsb,

Please ZIP and upload your input Word document (you are getting this problem with) here for testing. We will then investigate the issue on our end and provide you more information.


#3

源码安装–正常.zip (1.7 MB)

Word document ,Thanks


#4

Hi , i have problem ,when using Aspose.word converting word to image ,How to Compressed generate image size, but the resolution remains the same. Now Each page size 700 KB and I want to Compressed 100 KB .

Thanks .


#5

@Liangsb,

The problem occurs because you are using Aspose.Words for .NET in evaluation mode (without applying license on your end).

The licensed latest version (see the following code) of Aspose.Words for .NET i.e. 18.11 and MS Word 2016 both tell us that there are 914 pages in the document you provided.

Aspose.Words.License lic = new Aspose.Words.License();
// lic.SetLicense("Aspose.Words.NET.lic"); // Un-comment this line to get 914 pages

Document doc = new Document("D:\\Temp\\\\in.docx");
Console.WriteLine(doc.PageCount);

#6

@Liangsb,

You can try different options (such as JpegQuality, GraphicsQualityOptions, OptimizeOutput, TiffCompression and others) of the ImageSaveOptions Class to get the desired output.


#8

2 posts were split to a new topic: Compress image size