Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Method to convert line breaks into markup #7

Open
becdetat opened this issue Dec 5, 2012 · 0 comments
Open

Method to convert line breaks into markup #7

becdetat opened this issue Dec 5, 2012 · 0 comments

Comments

@becdetat
Copy link
Member

becdetat commented Dec 5, 2012

So "line 1\r\nline 2\r\nline 3" is converted to Word-compatible markup. This would be used like:

_engine.Process("in.docx", "out.docx", new {
    Address = _engine.ConvertLineBreaks("line 1\r\nline 2\r\nline 3")
});

It looks like

public string ConvertLineBreaks(string in) { return in.Replace(Environment.NewLine, "</w:t></w:r><w:r><w:br/><w:t>"); }

will work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant