Welcome to the SRP Forum! Please refer to the SRP Forum FAQ post if you have any questions regarding how the forum works.

OIPI Hyperlink for PDF

edited August 2022 in OpenInsight
I have a client that wants to include a Hyperlink in a PDF.

PDF output is generated in OIPI by:
Filename = 'e-OTPO Invoice':@FM: '' :@FM: 6 :@FM: 'APPDATA\PDF\I':InvFrom:'.pdf' Errmsg = Set_Printer("INIT", FileName, Title :@FM: PreviewTitle, Margins, PageSetup, PrintSetup, Port)

I can easily get a hyperlink with something like
HyperFont = "ARIAL" :@FM: 6 :@FM: "L" :@FM: 1 :@FM: 0 :@FM: 1 ErrMsg = Set_Printer("FONT",HyperFont) rv = Set_Printer("TEXTXY", "www.this_is_my_link.com", Dims, "", 0)

BUT

What they actually want is the text to say "Click Here to Pay" while pointing to the URL.

Is THAT possible?


Comments

  • rv = Set_Printer("TEXTXY", "Click here to pay-> www.this_is_my_link.com", Dims, "", 0) 😜
  • @BarryStevens



    Well, that IS pointing..
  • I don't think there is a direct Set_Printer message to do this because the OIPI itself does not support a hyperlink object the way that, for instance, Word does. You are getting a hyperlink in your PDF because either 1.) VSPDF.ocx or 2.) your PDF reader is recognizing the syntax of a URL and converting it to a clickable link automatically.

    Something you might try is to use the TEXTRTF message and pass in an RTF formatted link. I played around with this for a bit but could not get perfect results. I suspect this is a limitation in the OIPI's support for RTF. However, your mileage (or kilometers) may vary.
  • edited August 2022
    @DonBakke

    I see what you are saying about TEXTRTF. Same results here. Not quite right.

    BTW, Aren't you supposed to be enjoying some sunshine right now instead of bluelight?



  • Just got back yesterday!
  • @DonBakke.

    No rest for the wicked they say. You must have been very very bad in a past life!!!
    ;-)
  • @opto_will

    Does this work for you.

    HyperLink = '{\rtf1\ansi\ansicpg1252\deff0\nouicompat\deflang3081{\fonttbl{\f0\fnil\fcharset0 Calibri;}}' HyperLink :='{\colortbl ;\red0\green0\blue255;}' HyperLink :='{\*\generator Riched20 10.0.19041}\viewkind4\uc1 ' HyperLink :='\pard\sa200\sl276\slmult1 {\f0\fs22\lang9{\field{\*\fldinst{HYPERLINK www.this_is_my_link.com }}{\fldrslt{Click Here to Pay\ul0\cf0}}}}\f0\fs22\par}' rv = Set_Printer("TEXTRTF", HyperLink, Dims, "", 0)

    What are you using to view the pdf as I only see the text, not as a hyperlink.
    Are you doing anything special to create the PDF
  • Barry - I'm pretty sure that won't work. I had already tried text that is very similar to that with poor results.
  • @BarryStevens,

    @DonBakke is right.
    I couldnt get your code to behave like a hyperlink unless I quoted the URL. The moment I did that it displayed the whole thing, not just the intended display string but it was then a hyperlink!


    That is basically where I was stuck before. I can get the text, no link, or I can get the link with WAY too much text!

Sign In or Register to comment.