Maximum Allowed Number of Styles in Word Document 4094 - Too Many Styles Found in Glossary Document - Java

@oraspose,

Please spare us some time for the investigation of this issue. We will keep you posted on any further updates and let you know when this issue will be resolved in future. We apologize for any inconvenience.

@oraspose,

Upon further investigation, we have found that yes indeed calling the Cleanup() removes unused styles. Regarding styles with identifiers “E92C0304A7484F17A803167DC838F21D2” and “FC8ECB2DD8254D52BE6CEA25FF2104ED”, in fact they are used in the glossary document “word\glossary\document.xml”:

<w:docPartBody>
    <w:p w:rsidR="00DE68AE" w:rsidRDefault="00D02D11" w:rsidP="002C0D9C">
        <w:pPr>
            <w:pStyle w:val="E92C0304A7484F17A803167DC838F21D2"/>
        </w:pPr>
        <w:r>
            <w:rPr>
                    <w:rFonts w:eastAsia="Calibri"/>
                    <w:kern w:val="16"/>
            </w:rPr>
            <w:t>Other</w:t>
        </w:r>
    </w:p>
</w:docPartBody>

<w:docPartBody>
    <w:p w:rsidR="00DE68AE" w:rsidRDefault="00D02D11" w:rsidP="009408E9">
        <w:pPr>
            <w:pStyle w:val="FC8ECB2DD8254D52BE6CEA25FF2104ED"/>
        </w:pPr>
        <w:r w:rsidRPr="00F87513">
            <w:rPr>
                <w:rStyle w:val="PlaceholderText"/>
            </w:rPr>
            <w:t>Click here to enter text.</w:t>
        </w:r>
    </w:p>
</w:docPartBody>

So, mentioned styles are used in glossary document and this is the reason why Aspose.Words does not clean them up.

Hi,

I am not seeing these styles <“E92C0304A7484F17A803167DC838F21D2” and “FC8ECB2DD8254D52BE6CEA25FF2104ED”> being used anymore in the cleaned document “Doc_9_cleaned.docx”.

I shared two documents in the zip folder “Doc_9.docx” and “Doc_9_cleaned.docx”. Basically, I loaded “Doc_9.docx” and called cleanup() API on it and then saved it as “Doc_9_cleaned.docx”. Hence, “Doc_9_cleaned.docx” is a cleaned document that should not have any unused styles.

The shared style ids are used in the glossary document of “Doc_9.docx” (hence, it makes sense for them to be present as the glossary styles) but they are not used in the glossary document of “Doc_9_cleaned.docx” (still present as glossary style).

Please let me know if you need more information.

Thanks
Manisha

@oraspose,

Thanks for the additional information. We have logged these details in our issue tracking system and will keep you posted on any further updates.

Hi,

Do we have any update on this?

Thanks
Manisha

@oraspose,

I am afraid, there is no further news about this issue. We will inform you via this thread as soon as this issue will be resolved or any further update will be available. Sorry for the inconvenience.

Hi,

Do we have any update on this?

Thanks
Manisha

@oraspose,

I am afraid, there is no further news about this issue and please spare us some time for the investigation of this issue. We will be sure to keep you posted on any further updates and apologize for the inconvenience.

Hi Hafeez,
I have checked the junk/spam folder as well as any other folders. The last email we have from Aspose is from 6/27/2019. Besides the forum notifications, we are also not receiving the Aspose monthly newsletter and new release notifications. As you can imagine, it would be very helpful to be notified by email. Is there any way we can get some help in trying to troubleshoot the issue?
Thanks

@oraspose,

We used the following simple scenario:

Document doc = new Document("E:\\Temp\\ASPOSE DOCS\\Doc_9.docx");
doc.cleanup();
doc.save("E:\\Temp\\ASPOSE DOCS\\java-20.1.docx");

and get result completely different than attached by you previously. Please see attached.

Problematic style E92C0304A7484F17A803167DC838F21D2 is still in use in glossary document and therefore not removed from glossary style collection. Can you please summarize your ‘full scenario’ (usecase) here for our reference? Thanks for your cooperation.

Hi,

We had a look at the document shared by you and yes it is very different from the document provided by us. We ran the below code using Aspose latest version 20.01 and still seeing many unused in the cleaned document.

Document doc = new Document("Doc_9.docx");
doc.cleanup();
doc.save("Doc_9_cleaned_20.1.docx");

“Doc_9_cleaned_20.01” has 377 styles defined in the glossary but only 72 styles are used in the glossary document. There are 305 unused styles that should not be there after cleanup.

ISSUE: We have a requirement to merge several documents where most of the documents have a large number of styles present in glossary document and Aspose append() API throws “java.lang.RuntimeException: java.lang.IllegalStateException: There are too many styles in the document.”

I have attached the documents for your reference.Aspose docs Feb 2.zip (52.7 KB)

Please find the environment details below:
OS: Oracle Linux Server release 6.6
JAVA VERSION:
java version “1.8.0_231”
Java™ SE Runtime Environment (build 1.8.0_231-b11)
Java HotSpot™ 64-Bit Server VM (build 25.231-b11, mixed mode)

Thanks
Manisha

@oraspose,

Thanks for the additional information. We have logged these details in our issue tracking system and will keep you posted on any further updates.

Hi,

Could you please take this forward on Enterprise Support?

Thanks
Manisha

@oraspose,

By using your ‘Enterprise Support’ account, please create a new thread in our Paid Support Helpdesk to be able to raise the priority of this issue to Enterprise Support level.

The issues you have found earlier have been fixed in this Aspose.Words for .NET 20.12 update and this Aspose.Words for Java 20.12 update.