Don't adjust space between Latin and Asian text

Hi,

Is there a way to find out if a style has the following attribute: “Don’t adjust space between Latin and Asian text” ?

We have a problem :

When merging 2 documents together we check if the styles used in the document to import is exactly the same as the style used in the destination document.
If so, we do not add the style to the destination document again (we don’t create for example Default_1).
If not, we do create a new style like Default_1, default_2 etc. (We use this as a work-around for the problem where we reach the max amount of styles allowed in a document.)

But I can’t find and therefore compare a property that encapsulates “Don’t adjust space between Latin and Asian text” from word.

Is there any way I can find out if a style has this attribute?

Thanks in advance,

KrisG

Hi
Kris,

Thanks for your inquiry. As per my understanding, you want to set value of ‘Automatically adjust space between Asian and Latin text’. Please check the attached screenshot of paragraph formatting. Please share some more detail about your requirements.

It would be great if you please share a sample input document along with expected output document here for our reference. We will then provide you more information.

Hi,

That is indeed the style property we want to find in the style object from aspose.

Example documents are attached.

Basically we have multiple documents we have to merge together.
When merging Aspose gives us the choice to either: merge the styles, take the styles from the to be imported document or take the styles from the destination document.

What we want to do is merge the styles.
So if destination document has a style that the to be imported document doesn’t know it will copy it over to the destination document and vice versa.

That way if we have a 2 documents that use different styles the styles will be kept intact.

HOWEVER… when using this solution aspose will always copy the style over from the to be imported document to the destination.
Even if the destination document has the exact same style with the same name, same font, same size, same everything.
Aspose will create the style again in the new document and give it a number for example _1.
This is fine when merging a few documents but when merging a ton it will crash because word has a limit to how much styles it can have.

So our solution is use loop over the nodes of the to be imported document, check if the style is known in the destination document
If the style is known and the styles are 100% identical (we do this by checking almost every property available in the style) we won’t do anything.
If the style is different we will import the style into the destination document and give it “_1” or increase the number. Then we set the names of the style equal to each other so that in the to be imported document it will also be called “_1”
If the style is not known in the destination document we create the style in the destination document.

After all the styles have been set in the destination document we import the to be imported document with the option “Aspose.Words.ImportFormatMode.UseDestinationStyles” because we just made sure all the styles in the to be imported document are known and equal to the styles in the destination document.

That way our documents get merged without hitting the max amount of styles in word in case all the styles are exactly the same and some aren’t.

BUT…. Now we have a problem where the styles are different but our code can’t see it.
It checks for everything, font type, size, spacing everything.
But we didn’t check for the Asian property because I can’t see it anywhere in code.

This is a problem. Because it will not see the difference. And in the end when we merge the documents using the destination styles it will not be able to set the correct style because that style will not be the same and it will just give up and lose its formatting.

This solution has always worked for us until now. Because its pretty rare for us to get Asian styles in our documents.

Kind regards,

KrisG

Hi
Kris,

Thanks for sharing the detail. We are working over your query and will update you asap.

Hi
Kris,

Thanks for your patience. I have logged a feature request as WORDSNET-12529 to set/get ‘Asian Character Spacing’. You will be notified via this forum thread once this feature is available.

We apologize for your inconvenience.

The issues you have found earlier (filed as ) have been fixed in this update. This message was posted using BugNotificationTool from Downloads module by MuzammilKhan

The issues you have found earlier (filed as WORDSNET-12529) have been fixed in this Aspose.Words for .NET 21.6 update and this Aspose.Words for Java 21.6 update.