srve + embedded hyperlinks not rendering to PDF
Posted: Sun Feb 03, 2008 1:15 am
From the general lack of replies to my questions about hyperlinks here, I get the feeling that nobody else is working with them.
If you have a document open in SRVE that contains embedded hyperlinks, it does not appear that it will create them when rendering to PDF (I'm using llionPDF). Since rendering to PDF is analogous to printing on a sheet of paper, embedded hyperlinks don't make much sense. Yet, it is common to have embedded hyperlinks inside of PDF files. And in particular, you can create PDF files from Word and OpenOffice that contain embedded hyperlinks.
Explicit hyperlinks work fine with SRVE, but that's only because llionPDF will create them automatically itself.
This is example of embedded hyperlink: click here to open google This is where the text says one thing, and the associated hyperlink is totally different.
In the MakePDF demo, btnSavePDFClick calls MakePageMetafile, which calls srve.DrawPage, which eventually calls srve.PaintPage, which there calls PlayEnhMetaFile() a few times.
And that, as we say, is all she wrote.
What I can't figure out is where individual items are being written to the metafile. The only text being written in PaintPage is the page number. Perhaps it's this line:
FRichViewEdit.RVData.PaintTo(MetafileCanvas, RVRect, bStripTop, bStripBottom, True, Printing);
In the MakePDF demo, if I open an RTF file that contains embedded links (created in Word), and save as PDF, the words show up as blue letters with underscores, but they're not hyperlinks. There's nothing behind them.
And actually, in the MakePDF demo, they're not "live" either.
If I search through srve for "url", I find this:
property OnURLNeeded : TRVURLNeededEvent read FURLNeeded write FURLNeeded;
which is more or less "inherited" from RV/RVE (to reflect it).
But there's no code within SRVE that looks at it other than an assignment to copy it from an RVE to an embedded RVE.
So ... the question at hand is: what's the best way to render embedded hyperlinks that exist in an RVE/SRVE to a PDF file?
Right off-hand, I'd think to modify DrawMarker above to call that FURLNeeded handler, passing item.ID as the second param.
But, if you get back a URL, what would it do? Again, in the context given, it does not know it's writing output for a PDF file. It's just rendering a metafile.
Any suggestions?
-David
If you have a document open in SRVE that contains embedded hyperlinks, it does not appear that it will create them when rendering to PDF (I'm using llionPDF). Since rendering to PDF is analogous to printing on a sheet of paper, embedded hyperlinks don't make much sense. Yet, it is common to have embedded hyperlinks inside of PDF files. And in particular, you can create PDF files from Word and OpenOffice that contain embedded hyperlinks.
Explicit hyperlinks work fine with SRVE, but that's only because llionPDF will create them automatically itself.
This is example of embedded hyperlink: click here to open google This is where the text says one thing, and the associated hyperlink is totally different.
In the MakePDF demo, btnSavePDFClick calls MakePageMetafile, which calls srve.DrawPage, which eventually calls srve.PaintPage, which there calls PlayEnhMetaFile() a few times.
And that, as we say, is all she wrote.
What I can't figure out is where individual items are being written to the metafile. The only text being written in PaintPage is the page number. Perhaps it's this line:
FRichViewEdit.RVData.PaintTo(MetafileCanvas, RVRect, bStripTop, bStripBottom, True, Printing);
In the MakePDF demo, if I open an RTF file that contains embedded links (created in Word), and save as PDF, the words show up as blue letters with underscores, but they're not hyperlinks. There's nothing behind them.
And actually, in the MakePDF demo, they're not "live" either.
If I search through srve for "url", I find this:
property OnURLNeeded : TRVURLNeededEvent read FURLNeeded write FURLNeeded;
which is more or less "inherited" from RV/RVE (to reflect it).
But there's no code within SRVE that looks at it other than an assignment to copy it from an RVE to an embedded RVE.
So ... the question at hand is: what's the best way to render embedded hyperlinks that exist in an RVE/SRVE to a PDF file?
Right off-hand, I'd think to modify DrawMarker above to call that FURLNeeded handler, passing item.ID as the second param.
But, if you get back a URL, what would it do? Again, in the context given, it does not know it's writing output for a PDF file. It's just rendering a metafile.
Any suggestions?
-David