After checking there's definately an RTF code, the same one that's supported by Word for keeping lines of text together - {\keep} - but for some reason WPTools seems not to acknowledge the presence of this tag and manages to split a small paragraph marked with this tag across 2 pages. Why? Is this a bug? How can I achieve this?
Keep Lines Together (RTF)
-
-
- Offizieller Beitrag
Hi,
also I reserve the right to NOT implement everything what is in MSWord ;-) there is Keep and KeepN support in WPTools. But it can be deactivated in FormatOptions: wpfIgnoreKeep, wpfIgnoreKeepN.
Julian
-
I have both of those options set to false but yet still my paragraph gets split.. why?! It looks really silly ending in Yours Sincerely on one page and having a whole page with just the name at the top on the next.
-
Richard,
If I can jump in here, from your first entry it sounds like you want keepn, not keep.
You mentioned "Yours sincerely" and the name being split across two pages. From that I infer there's two separate paragraphs involved. And that that suggests to me you want keep paragraphs together (keepn), rather than paragraph (keep).
Sound like a possibility?
diamond
-
- Offizieller Beitrag
Hi,
for 'Yours sincerely' I recommend to NOT use KeepN - that's overkill. Simply use keep and split the lines which soft line breaks (Shift + CR)
InputString('Yours sincerely' + # 10 + #10 + 'Julian Ziersch');
ActiveParagraph.ASet(WPAT_ParKeep, 1); -
Julian,
You're (of course) right, that's cleaner.
I was thinking of it from the perspective of a user running a WPTools-based application, where they'd select the paragraphs they'd want to be kept together, then select a "Keep Paragraphs Together" menu option. And hooked up to that menu option would be an executed par.ASet(WPAT_ParKeepN, 1).
However, if this is done in code, then yes, absolutely, your approach definitely is better..:)
As always, watching and learning from you,
diamond -
I can't hardcode the Keep/KeepN using the ASet function unless I somehow parse through and process the RTF manually. Its not a source coded document but a series of many RTF templates (edited and saved by non-developers using MS Word) that are populated with custom data (similar to mailmerge) and then converted to PDF on-the-fly for saving onto an extranet. Is there any way keep paragraphs together can be done using RTF codes so that it also works in wPDF?
-
- Offizieller Beitrag
Hi,
If the Keep, KeepN flags are already in the document WPTools should use them. (Version 5 will not use them inside and with tables)
Make sure the 'Keep' handling is not switched off in property FormatOptions.
Julian