Document Content Attributes: Remove Sections
Document Content Attributes: Remove Sections
This feature was designed to remove cover pages from the HTML extracted within a Word document. However, using the instructions below, it could be used to remove any content that should not render on the web version of the document.
This feature only manipulates the extracted HTML inserted into the attribute and does not alter the source document.
There is no automated means to identify whether or not a Word document contains a cover page, so the following instructions must be followed to use this feature and achieve desirable results.
Console Instructions
- Module Properties > Document Content Attributes: Remove Sections? Go to this location within the desired module. Set the radio-button to Yes and save the module properties.
- Module Configuration Go to this location within the desired module. Add a custom attribute with a System Name of: CpAsposeWordsDocumentSectionsToRemove. This should be a CpTextBox attribute and expects a comma separated list of integers. Determine whether or not there should be a default value. Remember, there is no guarantee a Word document has sections or the content expected to be removed within the identified sections.
- The XML below demonstrates the attribute needed for the module configuration XML file noted in the previous list-item. This example has a default value of 1, 2 for records in this module. It will remove the first two sections within each record containing a Word document unless that specific record is manually adjusted afterwards.
<property id="CpAsposeWordsDocumentSectionsToRemove">
<value>1, 2</value>
<attribute name="Word Document Sections To Remove">
<headerText>If these sections exist, they will be removed from the HTML extracted from the Word Document.</headerText>
<control id="CpTextBox" type="Centralpoint.Web.UI.Controls.CpTextBox" />
</attribute>
</property>
Word Instructions
Aspose is the vendor that provides development components used in Centralpoint to read and manipulate various file types including MS Word.
There is no means within Aspose to identify specific pages within a Word document without the use of Section Breaks within the word document.
- Read Microsoft's documentation on how-to insert section breaks.
- Read Microsoft's documentation on how-to view existing section breaks.
For example, by inserting a Next Page Section Break after the cover page, this feature may now accurately identify the cover page.
The CpAsposeWordsDocumentSectionsToRemove attribute within the record would contain a value of 1 in this case.
Console Trace
If issues are reported that unexpected content is being removed or expected content is not being removed, please view the console trace while saving a problem record.
There will be lines beginning with WordDocumentRemoveSections which provide information on the sections within the word document and the sections targeted for removal within the CpAsposeWordsDocumentSectionsToRemove attribute .