Word Document Western Word Wrapping Problem

Does aspose support setting Word to allow Western word wrapping?1.png (34.6 KB)

@yinzi, Could you please elaborate what issue you are observing? If possible, please provide a sample code, input and output documents and a screenshot demonstrating the issue.

Regarding the Western word wrapping setting, Aspose Words provides all options from the Asian Typography tab of the Paragraph properties dialog:

  1. ParagraphFormat.FarEastLineBreakControl
  2. ParagraphFormat.WordWrap
  3. ParagraphFormat.HangingPunctuation

1 Like

aspose.words 支持java代码设置允许西文单词中间换行吗?1.png (34.6 KB)

Does aspose support setting Word to allow Western word wrapping?1.png (34.6 KB)

@yinzi, I have moved all your similar questions to this topic.

@denis.shvydkiy

Denis.shvydkiy, thank you for your technical support.

Scenario: I read a Word document, set it to allow line breaks between Western words, and then export it, but it doesn’t seem to take effect.

I use Office to open a document and operate on the interface. Words can wrap normally. What is the reason for this? Is there any problem with my grammar?

Specific examples are as follows:

94AC09D3@3ECF2D11.32C73264.png.png (64.5 KB)

68FFCC95@97B26A09.32C73264.png.png (55.7 KB)

@yinzi, Could you please provide the following for analysis:

  • the Word document (DOCX or DOC) that you are having the issue with
  • the output PDF that demonstates the issue
  • PDF or screenshot that demonstates the expected behavior

Here is a code sample that enabes the “Allow Latin text to wrap in the middle of a world” option for all paragraphs in a document:

Document doc = new Document("in.docx");

NodeCollection<Paragraph> paras = doc.getChildNodes(NodeType.PARAGRAPH, true);
for (Paragraph para : paras)
{
    para.getParagraphFormat().setWordWrap(false);
}
doc.save("out.docx");