Opening PDFs with revBrowser

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
montymay
Posts: 145
Joined: Thu Jul 18, 2013 5:23 am

Opening PDFs with revBrowser

Post by montymay » Tue Apr 12, 2016 4:11 am

My application is essentially an interface whereby users can search for, find, and open any one of thousands of PDFs into the revBrowser, so the revBrowser functionality is central to my program. Of late I have encountered a behavior that I have not seen before. My script will open some PDFs but not others. I have checked the script time and again for any errors and cannot find one. It is as though something is different about some PDFs that the prevents the browser from opening them. The native PDF reader (Adobe Acrobat Pro XI, in my case) opens them normally.

Here is example of a script that opens some but not all PDFs:

Code: Select all

global gBrowserID
on opencard
   resetCard
   put the short name of this cd into tEO
   put revBrowserOpenCEF(the WindowID of this stack) into gBrowserID
   revBrowserSet gBrowserID, "rect", the rect of grc "rectRevBrowser"
   revBrowserSet gBrowserID, "url", "file:///eo/"&tEO&".pdf"
   end opencard

on resetCard
   repeat for each item gBrowserID in revBrowserInstances()
      revBrowserClose gBrowserID
   end repeat
end resetCard
Has anyone seen this behavior? Thanks for your replies.

Monty

[-hh]
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 2262
Joined: Thu Feb 28, 2013 11:52 pm

Re: Opening PDFs with revBrowser

Post by [-hh] » Tue Apr 12, 2016 4:44 am

In short (because it's late for me):
1. revBrowserOpenCEF was and will never be able to open *local* pdfs (on Mac).
2. revBrowserOpenCEF (=Chromium) is no longer supported, see last release notes.

You could use revBrowserOpen (=Webkit), which supports the usual Adobe plugin.
shiftLock happens

montymay
Posts: 145
Joined: Thu Jul 18, 2013 5:23 am

Re: Opening PDFs with revBrowser

Post by montymay » Wed Apr 13, 2016 2:01 am

Solution found! Before submitting my post i simplified my script and omitted a line that gets a piece of data that identifies the PDF to be opened in the revBrowser.

Code: Select all

   put the last word of fld "eodate" into tYr
The PDF would not open because that field was empty. Apologies to all who read my post.

Monty

Post Reply