I have been successfully creating PDF files from my VFP 7 reports using version 1.58 of the ActiveX control.
I now have the need to insert external hyperlinks into one of my reports. I first thought that I should use SetHyperlink to insert the hyperlinks but have been unsuccessful.
I suspect the problem is that I'm not passing the correct value in the first parameter (Printer.hDC) of the SetHyperlink() call. I have been unable to find how to determine what this value should be set to (from VFP, that is)
I also tried looking at the ExtractLinks utility but the docs were lacking in how to create external hyperlinks.
Any ideas or suggestions?
How do I insert hyperlinks into PDF created from VFP report.
How do I insert hyperlinks into PDF created from VFP report.
Later...
/-/ackman
/-/ackman
Hello,
The first parameter of SetHyperlink is HPrinter.DC or the PDF Printer name you declared and is using in your application.
Please check that you are adding Broadcast Messages to FileNameOptions if you are trying to add the hyperlinks while printing the report to pdf.
Version 1.58 of the driver is a little bit old, please check our site for available updates. You can download a free update to version 1.59 if you wish.
If you are still facing problems with calling SetHyperlinks, please send a snippet of your code to Support@amyuni.com to check it.
Merry Christmas!
The first parameter of SetHyperlink is HPrinter.DC or the PDF Printer name you declared and is using in your application.
Please check that you are adding Broadcast Messages to FileNameOptions if you are trying to add the hyperlinks while printing the report to pdf.
Version 1.58 of the driver is a little bit old, please check our site for available updates. You can download a free update to version 1.59 if you wish.
If you are still facing problems with calling SetHyperlinks, please send a snippet of your code to Support@amyuni.com to check it.
Merry Christmas!
Thanks for the reply, Joan. I have upgraded the driver to version 1.59B.
One of my original questions was what exactly is Printer.hDC and how and where is the Printer object created?
I did try supplying the PDF printer name as the first parameter to SetHyperlink() and got an "OLE error code 0x80020005: Type mismatch" error. Is there an alternate parameter format I should be using rather than SetHyperlink('print driver name', 'hyperlink text')?
I can send an email message to support but thought I'd respond back here first (and to help anyone else following this thread).
Any other suggestions (before I email support directly)?
One of my original questions was what exactly is Printer.hDC and how and where is the Printer object created?
I did try supplying the PDF printer name as the first parameter to SetHyperlink() and got an "OLE error code 0x80020005: Type mismatch" error. Is there an alternate parameter format I should be using rather than SetHyperlink('print driver name', 'hyperlink text')?
I can send an email message to support but thought I'd respond back here first (and to help anyone else following this thread).
Any other suggestions (before I email support directly)?
Thanks for the reply, Jose. However, the SetHyperlink() function IS in version 1.59B. It is listed as one of the available methods in Intellisense and I can call the function (albeit unsuccesfully).
What I do need to know is how to successfully call this function. Specifically, how, from VFP, do I place a call to SetHyperlink.
If I need to supply "printer.hDC" as the docs indicate, what exactly is the "printer" object and how exactly do I create it? This information is missing from the docs.
What I do need to know is how to successfully call this function. Specifically, how, from VFP, do I place a call to SetHyperlink.
If I need to supply "printer.hDC" as the docs indicate, what exactly is the "printer" object and how exactly do I create it? This information is missing from the docs.
Hello,
When using the SetHyperlink function it will create a hyperlink on the current printing text or image object. For the SetHyperlink() function to be successful it requires that two parameters be passed to it.
One, the handle to the printer object. In the case of VFP it is the handle that is returned from the PDF = DriverInit(printername) or PDF = PDFDriverInit(printername) calls.
Two, is the Hyperlink destination.
example:
SetHyperLink (PDF, "http://www.amyuni.com")
When using the SetHyperlink function it will create a hyperlink on the current printing text or image object. For the SetHyperlink() function to be successful it requires that two parameters be passed to it.
One, the handle to the printer object. In the case of VFP it is the handle that is returned from the PDF = DriverInit(printername) or PDF = PDFDriverInit(printername) calls.
Two, is the Hyperlink destination.
example:
SetHyperLink (PDF, "http://www.amyuni.com")