PDF Viewer widget - how to enable interaction?
keith.clarke at me.com
Thu Dec 9 04:15:24 EST 2021
I should have been more explicit in that I’d tried that technique to handle the linkClicked message - none of the links in my test PDFs (that work in Preview and Adobe) fire it.
Assuming I’ve not missed any widget properties, it looks like there’s a problem with the underlying PDFium library not finding ‘clickables’ in the PDF documents - or the LC wrapping has a bug...
If navigation is under script control the documentation suggests that every ‘clickable’ that works in any PDF viewer would need to be extracted into either the documentBookmarks or documentNamedDestinations arrays to be accessible for scripting - and both are empty for my ‘link-rich’ test PDFs.
Maybe the premium subscription for this widget means that it’s not been accessible for beta-testing by the user community, as I see nothing in the QA centre.
> On 9 Dec 2021, at 02:43, Monte Goulding via use-livecode <use-livecode at lists.runrev.com> wrote:
> Hi Keith
> I think you want the `linkClicked` message. Navigation via links is under script control so possibly what you want is:
> on linkClicked pAction
> if pAction[“type”] is “goto” then
> set the currentDestination of me to pAction
> end if
> end linkClicked
>> On 9 Dec 2021, at 2:01 am, Keith Clarke via use-livecode <use-livecode at lists.runrev.com> wrote:
>> Hi folks,
>> Can anyone share any experiences with the PDF Viewer widget that’s available via the old Business Edition or Pro Pack subscription?
>> I’m testing this on LC 9.6.5 with a Pro subscription on Mac 11.6. Following the PDF guide https://livecode.com/resources/guide/ I’ve been able to load various PDF documents into the viewer widget and view, paginate, scroll, etc. I can select text, as per the example code in the guide and this ability to select toggles with the autoHighlight property on the widget - as expected. However, I’m struggling to get much else.
>> The widget seems to be rendering the PDF documents in a passive ‘preview’ mode, in that they seem to lack any of the interactive behaviour available when opened in Preview or Adobe reader. There are no hovers or navigation on obvious links or bookmarks. Furthermore, other than documentPages and documentMetadata, all of the arrays that should handle these navigation elements are empty - documentBookmarks, documentNamedDestination, linkStyles.
>> Maybe I’ve missed another property that needs to be set to enable interaction? I don’t see any obvious setting to change in the dictionary, the LC guide doc, LC forums or online sources of documentation.
>> Any clues gratefully received...
>> use-livecode mailing list
>> use-livecode at lists.runrev.com
>> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
More information about the use-livecode