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
I have a client that wants to include a Hyperlink in a PDF.
PDF output is generated in OIPI by:
I can easily get a hyperlink with something like
BUT
What they actually want is the text to say "Click Here to Pay" while pointing to the URL.
Is THAT possible?
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
Well, that IS pointing..
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.
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?
No rest for the wicked they say. You must have been very very bad in a past life!!!
;-)
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
@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!