与亚洲印刷术合作

亚洲排版是用亚洲语言编写的文档中的文本段落的一组选项。

Aspose.Words支持使用ParagraphFormat类及其某些属性的亚洲排版。

自动调整亚洲和拉丁文字或数字之间的空格

如果您正在设计一个同时包含东亚和拉丁文本的模板,并且希望通过控制这两种类型的文本之间的空格来增强表单模板的外观,则可以将表单模板配置为自动调整这两种类型的文本之间的空格。 要实现这一点,可以使用ParagraphFormat类的AddSpaceBetweenFarEastAndAlphaAddSpaceBetweenFarEastAndDigit属性。

下面的代码示例演示如何使用AddSpaceBetweenFarEastAndAlphaAddSpaceBetweenFarEastAndDigit属性:

For complete examples and data files, please go to https://github.com/aspose-words/Aspose.Words-for-C
System::SharedPtr<Document> doc = System::MakeObject<Document>();
System::SharedPtr<DocumentBuilder> builder = System::MakeObject<DocumentBuilder>(doc);
// Set paragraph formatting properties
System::SharedPtr<ParagraphFormat> paragraphFormat = builder->get_ParagraphFormat();
paragraphFormat->set_AddSpaceBetweenFarEastAndAlpha(true);
paragraphFormat->set_AddSpaceBetweenFarEastAndDigit(true);
builder->Writeln(u"Automatically adjust space between Asian and Latin text");
builder->Writeln(u"Automatically adjust space between Asian text and numbers");
System::String outputPath = outputDataDir + u"DocumentBuilderSetFormatting.SetSpacebetweenAsianandLatintext.doc";
doc->Save(outputPath);

设置换行选项

Microsoft Word中的"段落属性"对话框的"亚洲版式"选项卡具有换行符组。 该组的选项可以使用FarEastLineBreakControl, WordWrap, HangingPunctuation ParagraphFormat类的属性。

下面的代码示例演示如何使用这些属性:

For complete examples and data files, please go to https://github.com/aspose-words/Aspose.Words-for-C
System::SharedPtr<Document> doc = System::MakeObject<Document>(inputDataDir + u"Input.docx");
System::SharedPtr<ParagraphFormat> format = doc->get_FirstSection()->get_Body()->get_Paragraphs()->idx_get(0)->get_ParagraphFormat();
format->set_FarEastLineBreakControl(false);
format->set_WordWrap(true);
format->set_HangingPunctuation(false);
System::String outputPath = outputDataDir + u"DocumentBuilderSetFormatting.SetAsianTypographyLinebreakGroupProp.docx";
doc->Save(outputPath);