Hyperlinks and export to HTML

  • I'm experiencing some trouble with the hyperlinks in the RTF text, the problem is the combination with WPTools and the TExtraDevices HTML export tool from Waler.

    The hyperlinks are exporting to the HTML page, but since the used RTF tags are not supported by the TExtraDevice component they will not be converted to the desired HTML tag and thus not shown.

    Is there a function present in your code to detect/replace the tag or could you help me out with some pointers how to reprogram the native export so your links can be exported using the export routine we are already using?

    Also: The links are printed to screen, RTF, JPG etc. with "<" ">" tags, since we try to deliver a wysiwyg environment I would like to be able to remove/hide these?

    Thanks in advance!

    I'm using:

    - Delphi 7
    - Report Builder 10.04
    - WPTools 5.0
    - TExtraDevices 3.00

    • Offizieller Beitrag

    Hi,

    I don't know ho to help here. In case you need PDF export you can use our wPDF - it will export working PDF hyperlinks.

    I don't know how the HTML expoirt of ExtraDevices works. If it uses the RTF text to create the HTML code I would expect that it can handle the hyperlinks, WPTools uses the standard RTF tags which are used for hyperlinks. (Fields)

    Julian

  • Zitat von wpsupport

    Hi,

    I don't know ho to help here. In case you need PDF export you can use our wPDF - it will export working PDF hyperlinks.

    I don't know how the HTML expoirt of ExtraDevices works. If it uses the RTF text to create the HTML code I would expect that it can handle the hyperlinks, WPTools uses the standard RTF tags which are used for hyperlinks. (Fields)

    Julian

    Ok thanks for the answer, I'll report it to the programmer of TExtraDevices so he can fix it (I might as well start fixing it myself right away, his support is terrible...)

  • I've got another question concerning this problem:

    For the time being it's enough for us to disable the real hyperlinks and replace them by the simulated hyperlinks (like in the PlainTextLinks demo). The only problem is that it's still possible to copy-paste a link (from Word for example) so we would have the same problem again when users do that (and they will for sure).

    I would like to know if it's possible to "catch" the pasted hyperlink and remove the RTF tags before it's inserted in the richedit? This should also be possible when the RTF is read from an external file.

    Thanks in advance!

  • Until the Office reopens (it's closed until the 21st), and gives you the real answer....

    try the WPRichText1BeforePasteText procedure to see if that helps you solve the problem. While it has a number of parameters, there are two passed in the call that may be of specific interest to you: RTFData, of type TWPRTFDataCollection, and par, of type TParagraph.

    I hope that helps!

    Regards,
    richard diamond

  • Zitat von wpsupport2

    Until the Office reopens (it's closed until the 21st), and gives you the real answer....

    try the WPRichText1BeforePasteText procedure to see if that helps you solve the problem. While it has a number of parameters, there are two passed in the call that may be of specific interest to you: RTFData, of type TWPRTFDataCollection, and par, of type TParagraph.

    I hope that helps!

    Regards,
    richard diamond

    Thanks for the answer, I managed to disable the pasted links now but I already ran into the next problem :|

    Is it possible to reformat the hyperlinks style without changing the actual (RTF) markup? What I want to accomplish is to show that part of a text is a hyperlink (everything starting with "www.", "ftp.", "http://" etc) but I want to do this without changing the markup of the content.

    ps.
    I know how to detect the links, the only problem is the formatting!

  • Zitat von wpsupport

    Hi,

    you mean an online formatting like it is done by some e-mail clients in ANSI mode.

    You can abuse a "special" character style for this: afsProtected. This style can be displayed in a defined mode and when you export this as RTF only custom tags are created, no fields as for hyperlinks.

    Julian

    That's exactly what I meant, the links now behave the way I wanted them to!

    Thanks for the help! (Both Julian and Richard)

  • Zitat von MidnightMotion

    That's exactly what I meant, the links now behave the way I wanted them to!

    Thanks for the help! (Both Julian and Richard)

    Sorry to bother you again but I think I found a bug (or I can't find the appropriate option?):
    When a hyperlink is pasted from i.e. MsWord and subsequently removed from the text (by pressing the backspace key from behind the link) the style the text has ('Hyperlink') remains in the RTF code but isn't accesible from the WPobjects (Style = nil, StyleName = ''). The result is a piece of text of which I can't change the markup! Hope you can solve this, if you need any more info just ask!

    (I tested this with both version 5.20 and 5.21.1)

  • Zitat von wpsupport

    Hi,

    not a WPTools bug here :-)

    Word has applied a blue text color + underline to the text, that attribute is not automatically removed. WPTools will not apply this fixed attributes for text with hyperlink symbols as Word does.

    Julian

    Is there a workaround for this non-bug? :-)