Aspose.Words - There are too many styles in the document

Hello,

we rolled out a solution using removeUnusedResources lately which seemed to do the trick. Unfortunately we are facing some problems. It seems that the method is removing some needed styles. The resulting document / it’s renderer (e.g. MS Word) than has to fallback to a specific basic style which is occassionally wrong. In my opinion the call to removeUnusedResources shouldn’t alter the visual appearance of a document.

However we are facing a second problem. In this case the document looks fine but after just reopening and saving it with Aspose.Words the header on the second page shows Courier New for the PageNum-field and the “/” which is not correct.

I have attached both documents before (34117K.rtf) and after (34117Kn.rtf) saving them with Aspose.Words 13.8.0.

Hopefully you can shed some light on this issue. We would really like to use this function but we can’t with this behaviour. Our already mentioned custom hashcode implementation for styles and fonts hits some boundaries we cannot come across.

Best regards
Klemens Schrage

Hi Klemens,

Thanks for your inquiry.

Klemens:
we rolled out a solution using removeUnusedResources lately which seemed to do the trick. Unfortunately we are facing some problems. It seems that the method is removing some needed styles. The resulting document / it’s renderer (e.g. MS Word) than has to fallback to a specific basic style which is occassionally wrong. In my opinion the call to removeUnusedResources shouldn’t alter the visual appearance of a document.

I am afraid, I could not see this issue with your output document, could you please clarify where the issue is? Please name the style names which are incorrectly being removed from the output document. Also, create screenshot showing the undesired behavior and attach it here for our reference. Please also test this scenario with Aspose.Words 13.10.0 and let us know how it goes on your side. I hope, this helps.

*Klemens:
However we are facing a second problem. In this case the document looks fine but after just reopening and saving it with Aspose.Words the header on the second page shows Courier New for the PageNum-field and the “/” which is not correct.

I have attached both documents before (34117K.rtf) and after (34117Kn.rtf) saving them with Aspose.Words 13.8.0.*

While using the latest version of Aspose.Words i.e. 13.10.0, I managed to reproduce this issue on my side. I have logged this issue in our bug tracking system. The ID of this issue is WORDSNET-9314. Your request has also been linked to this issue and you will be notified as soon as it is resolved. Sorry for the inconvenience.

Best regards,

Hello,

actually I just can tell my overall experience with the function. Sadly the first issue isn’t visible in my attached documents. I’ll try to post a document along with screenshots.

However I have one additional thing to mention. It seems that the resulting count of the StyleCollection object differs from the frequency we call RemoveUnsusedResources. We once called it, when the count exceeded 500. Later on we started at 250. I can’t tell the actual numbers right now but the resulting count was different.

Best regards
Klemens Schrage

Hi Klemens,

Thanks for your inquiry. Sure, we will wait for your input. Secondly, I tested your .rtf documents with Aspose.Words for Java 13.10.0; the count of styles in style collection was 333 before calling removeUnusedResources method and 127 after calling removeUnusedResources method. This appears to be an expected behavior. Please let me know if I can be of any further assistance.

Best regards,

Hi There,

Please consider this scenario. I have two docs sourceDoc and destinationDoc. There is a font size difference in Heading1 style of destinationDoc.
I want to keep source formatting but I don’t want to loose the differing Heading1 style of destinationDoc.

I need that if the souceDoc and destinationDoc have similar style then the newStyle_0 in merged doc should not be created (just one is enough). But if there is a difference in any of the style in destination style say in Heading1 then in merged doc it should appear as two different styles Heading1 and Heading1_0 and the source style should be retained.

Please suggest any way for that.

Thanks.

Hi Praneeth,

Thanks for your inquiry. Sure, we will add an option in ImportFormatMode which will make a copy of the style only when the styles are actually different. For example if both Heading 1 styles have the same formatting then no new style is created and all paragraphs in the source document using the Heading 1 style remain using that style when imported. WORDSNET-4173 addresses this problem and we will notify you as soon as this option is available.

Best regards,

Ok Thanks. Looking to hear from you soon.

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

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

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

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

A post was split to a new topic: Import Different Styles Only

A post was merged into an existing topic: Import Different Styles Only