We just updated to the latest version of Apose.Words. and now we have a client complaining about carriage returns in documents.
Thanks for your request. Could you please attach your template and sample code that will allow to reproduce the problem? We will check the issue and provide you more information.
I think that you can simply disable RemoveEmptyParagraphs option if it is enabled:
Not to be difficult about this, but I do not have access template file directly.
I have attached a rar file with examples and the source document.
I’m not the one who wrote our code for handling this, but I did speak with that developer, and he says we need that property set to true for other reasons. Without any other alternatives, we’re going to have to tell 100+ clients that if they notice formatting errors, then they’ll have to edit the source document.
Thank you for additional information. You can easily suppress this behavior by inserting a single white space in the paragraphs with TableStart and TableEnd merge fields. I suppose you can do this programmatically.
We can do this programatically, however, it won’t fit with our current logic.
Thank you for additional information. Please let us know if you need more assistance, we are always glad to help you.
I work for the same company as Darren. This is really a big problem. Is there any way we can avoid having customers change all their documents? We are talking about 10,000 documents overall. We do require RemoveEmptyParagraphs=true, but many customers have built documents expecting that a TableStart_ mergefield will produce a blank line in the document.
By programmatically inserting a single space, do you mean setting our TableStart_ and Tableend_ values to ' ' rather than '' when we produce the data set? If so, we tried that and it didn't seem to make a difference.
Or (after thinking about it more) did you just mean that when the template document has only a TableEnd or TableStart field and a carriage return, programatically add a space to that line?
That works, but we'd either have to do it when we process the files, or provide a utility program that could update users' template files.
10.0pt;font-family:“Courier New”;color:blue;mso-no-proof:yes”>foreach<span style=“font-size:10.0pt;font-family:“Courier New”;mso-no-proof:yes”> (Paragraph para in
para.AppendChild(new Run(doc, " "));
else if (para.Range.Text.Contains("TableEnd"))
para.PrependChild(new Run(doc, " "));
Instead of doing this in the code, can we just change our queries for the data source to use ' ' instead of ''? This is currently what we are doing for our TableStart_ and TableEnd_ columns:
SELECT TableStart_Aliases = '',
Could we simply do this:
SELECT TableStart_Aliases = ' ',
Thanks for your request. Yes you can do it. Actually Alexey already mentioned you about this:
“You can easily suppress this behavior by inserting a single white space in the paragraphs with TableStart and TableEnd merge fields.”
Actually, we couldn't get this to work, but we were able to add a simple space to the document on the same line as the TableStart tab with only that and a carraige return. It's only ok to add a space on a line where there is no other content anyway or else we could disrupt the layout in other ways.
We resolved to build a utility to process existing templates and where there are lines that consist of just a tablestart or tableend tab and a carraige return, add a space. We will provide this to any customers that request it after they receive the application update.
Thank you for your help with this one; I think we know how to proceed now.