How can i get each sentences style(ex.font,bold,align center,etc) from document a,
and set style document b's each centences?
How can i get each sentences style(ex.font,bold,align center,etc) from document a,
and set style document b's each centences?
Hello,
You need to use two methods available in Premium licenses:
You can get get word styles using the getWordStyles method. This method returns information that can be iterated to get the needed styles.
New styles can be applied to the same DOCX or another DOCX using DOCXCustomizer.
Regards.
actually i tried use getwordstye and get array but i didnt get how im using it.
can you give me some examples?
what im trying to do is,
getwordcontent from document a, translate it, and create document b with translated text which is same style as document a.
Hello,
Please check the samples included in the package. All packages include samples of all methods.
On https://www.phpdocx.com/documentation/snippets/get-font-size-content you can find a detailed custom sample that illustrates how to get the font size. The same iteration can be used to get other styles.
You need to translate the style information from getWordStyles to the options supported in DOCXCustomizer.
Regards.