We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

The property of PageCount does not get updated in the word document

Thread ID:

Created:

Updated:

Platform:

Replies:

140902 Nov 13,2018 01:41 PM UTC Nov 14,2018 12:15 PM UTC UWP 1
loading
Tags: DocIO
Muhammad Mobeen
Asked On November 13, 2018 01:41 PM UTC

Hello,

The property of PageCount does not get updated in the word document. We initialize the document using a template and then populate the document with the data. The resulting document is almost always greater in the size than the template but the value of PageCount property does not update itself for the document. We cannot set it and there is no way to force an update to this count or get an actual count. This impacts our ability to place electronic signatures in the document at the proper place which hampers our sales efforts. Need a fix asap.



Thanks

Dilli Babu Nandha Gopal [Syncfusion]
Replied On November 14, 2018 12:15 PM UTC

Hi Muhammad, 

Thank you for contacting Syncfusion support. 

Regarding PageCount property not updated properly:
The Word document is a flow document in which contents will not be preserved page by page; instead the contents will be preserved sequentially section by section. 
 
Word viewer/editor renders the contents of the Word document page by page dynamically when opened for viewing or editing. This page wise rendered information will not be preserved in the saved file level.  
Essential DocIO is a non-UI component that provides a full-fledged document object model (logical structure as defined in the file level) to manipulate the Word document contents without converting page by page. So, DocIO returns the page count, stored in input file level (updated earlier by other Word viewer/editor applications) and doesn’t automatically update on adding or removing the contents (sections, paragraphs, etc.).


Regarding Page count in .NET Framework (Windows Forms, WPF, ASP.NET and ASP.NET MVC):
To get page count from the Word document, we suggest you to use
UpdateWordCount method of DocIO which internally uses Word to PDF conversion process to calculate the page count.

Please refer the below code snippet to get page count in .NET Framework: 
 
//Creates an empty WordDocument instance   
WordDocument document = new WordDocument();  
//opens an existing word document through Open method of WordDocument class   
document.Open(fileName);  
  
//To-Do some manipulation   
  
//Updates the page count, if perform layout sets to true.  
document.UpdateWordCount(true);  
//Gets the updated page count value.   
int count = document.BuiltinDocumentProperties.PageCount;  
//Saves the document in file system   
document.Save(outputFileName, FormatType.Docx);  
//Closes the document  
document.Close();  


Currently the
UpdateWordCount API is not supported in UWP platform and we have already logged this as a feature request in our database. We will implement this feature in any of our upcoming releases and we don’t have any immediate plans to implement this feature. We will update you when this feature has been implemented. We request you to visit our website periodically for feature related updates.  
Regarding “to place electronic signatures in the document at the proper place”:
For adding electronic signatures in the Word document, you can add a placeholder text and replace with electronic signature, instead of accessing page count. Could you please provide us more details about how you are adding electronic signatures to the Word document (along with an example Word document)? Based on these details, we will analyze and provide appropriate solution to achieve your end requirement at the earliest using DocIO.

Regards, 
Dilli babu. 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

or the page will be automatically redirected to sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;