Aspose::Words::Saving::TxtSaveOptions::get_MaxCharactersPerLine method

TxtSaveOptions::get_MaxCharactersPerLine method

Gets or sets an integer value that specifies the maximum number of characters per one line. The default value is 0, that means no limit.

int32_t Aspose::Words::Saving::TxtSaveOptions::get_MaxCharactersPerLine() const

Examples

Shows how to set maximum number of characters per line.

auto doc = MakeObject<Document>();
auto builder = MakeObject<DocumentBuilder>(doc);

builder->Write(String(u"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. ") +
               u"Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.");

// Set 30 characters as maximum allowed per one line.
auto saveOptions = MakeObject<TxtSaveOptions>();
saveOptions->set_MaxCharactersPerLine(30);

doc->Save(ArtifactsDir + u"TxtSaveOptions.MaxCharactersPerLine.txt", saveOptions);

See Also