Bookmarks spanning multiple paragraphs?

General TRichView support forum. Please post your questions here
Post Reply
whisper1980
Posts: 8
Joined: Sun May 25, 2025 6:41 pm

Bookmarks spanning multiple paragraphs?

Post by whisper1980 »

I'm in the process of evaluating TRichView for use with a mobile (Android and iOS) companion data collection app. With WPTools (not mobile app compatible), it allows me to have a bookmark span multiple paragraphs which we use to link bookmarked text for use in a report summary and looks like this in RTF:

Code: Select all

{\*\bkmkstart $linked:Monitor}
\f0\cf0 line one\par
\plain\f0\fs20\cf0 line two\par
\plain\f0\fs20\cf0 line three
{\*\bkmkend $linked:Monitor}
However, when importing this RTF into a TRichViewEdit, two things occur:
- the bookmark name is modified (not a big deal)
- the bookmark start tag seems to auto generate the end tag and ignores the actual end tag

Code: Select all

{\*\bkmkstart bmk_linked_Monitor}{\*\bkmkend bmk_linked_Monitor}
line one
\par line two
\par line three
Having a bookmark span multiple paragraphs might be unusual, but is it possible to allow for this? Or is there something I could use in TRichView where I basically could pre-convert the source RTF so that it will allow for the same functionality? I would convert the RTF when sending data to our mobile companion app (replacing the bookmark with something else), and then convert it back to bookmarks when receiving the RTF back to our Windows app that uses WPTools. (way way way too late to convert our Windows app from WPTools to TRichView unfortunately). FWIW, not a fan of WPTools and TRichView looks perfect for my needs after experimenting with it for just a couple of days.
jonjon
Posts: 478
Joined: Sat Aug 27, 2005 4:19 pm

Re: Bookmarks spanning multiple paragraphs?

Post by jonjon »

Sorry to hijack this thread but it looks kind of similar to DIVs or fragments which were requested before: viewtopic.php?p=37388#p37388
I would love such a feature which would open so many use cases!
Sergey Tkachenko
Site Admin
Posts: 17839
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Re: Bookmarks spanning multiple paragraphs?

Post by Sergey Tkachenko »

In TRichView, a bookmark" does not have lengths, it marks a single place in a document.
I plan to implement lengths for bookmarks (most probably, by grouping them in pairs of starting and ending marks), but not in the near future, sorry.

The same for changes discussed in the referred topic.
whisper1980
Posts: 8
Joined: Sun May 25, 2025 6:41 pm

Re: Bookmarks spanning multiple paragraphs?

Post by whisper1980 »

Would it be easy to allow the "Ignore bookmarks" in the RTFReadProperties to truly ignore them and instead of removing them, just leave them as-is? In my case, user's aren't going to be adding bookmarks on mobile. I just want them to stay there so when the rtf is sent back to my Windows app from mobile they are retained. Also note that my BM usage can be include in the middle of a paragraph, not just the beginning of one since I use BM's for linking text to be used elsewhere in a generated report. I also use BM's in the normal sense, for use with table of contents for example.

I was thinking maybe I could somehow use stylesheets to "mark" what is bookmarked text so I can convert back and forth.
whisper1980
Posts: 8
Joined: Sun May 25, 2025 6:41 pm

Re: Bookmarks spanning multiple paragraphs?

Post by whisper1980 »

jonjon wrote: Tue May 27, 2025 7:34 am Sorry to hijack this thread but it looks kind of similar to DIVs or fragments which were requested before: viewtopic.php?p=37388#p37388
I would love such a feature which would open so many use cases!
Yes... that would be perfect. BTW, for some reason I can't read that topic, says I am unauthorized to view it. :(
Sergey Tkachenko
Site Admin
Posts: 17839
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Re: Bookmarks spanning multiple paragraphs?

Post by Sergey Tkachenko »

That topic is on the protected forum, accessible for registered TRichView users.
whisper1980
Posts: 8
Joined: Sun May 25, 2025 6:41 pm

Re: Bookmarks spanning multiple paragraphs?

Post by whisper1980 »

FWIW, my solution for now was to convert my bkmkstart and bkmkend tags into regular hidden text when sending over to mobile that will use TRichViewEdit. Then when sending back to Windows app that uses WPTools, I convert that hidden text back into the standard bookmark tags. Seems to work for my needs in controlled very limited testing under Windows.
Post Reply