pgGotoURL() and PDF

Help for using specific functions

pgGotoURL() and PDF

Postby Kataleena » Sun Feb 22, 2015 9:39 pm

Hi

I'm using pgGotoURL() to open a PDF file inside a ToolBook field object. It works in chrome and Mozilla perfectly but not in IE, nothing appears not even a loading error message.

Any help would be great,
Kat
Kataleena
 
Posts: 49
Joined: Sun Feb 23, 2014 10:05 pm

Re: pgGotoURL() and PDF

Postby Clifton » Mon Feb 23, 2015 5:42 am

Have you confirmed the problem by running the content from a web server?
Sometimes IE will block certain requests when content is run from a local hard drive due to security reasons.
Clifton
Site Admin
 
Posts: 732
Joined: Tue Jan 14, 2014 1:04 am

Re: pgGotoURL() and PDF

Postby Kataleena » Mon Feb 23, 2015 5:48 pm

I'm using IIS and running it from my localhost on my computer, which is how the application will be ran on my clients system. I have uploaded it to my webserver to test and still having the same issue. Any ideas?
Kataleena
 
Posts: 49
Joined: Sun Feb 23, 2014 10:05 pm

Re: pgGotoURL() and PDF

Postby Clifton » Mon Feb 23, 2015 8:14 pm

Hi Kataleena,

Seems this a rendering bug in IE. I working on a patch for pgGotoURL() which applies a workaround to this problem.

If your situation is urgent you can apply a type of fix as follows:

  1. Create a field on the page and name it "exec"
  2. Enter the following JavaScript into the field:
    var rtn = tbfunction_pgGotoURL( "My PDF", "../dialog/iframe.html");
    setTimeout( function() { rtn.src = "../media/myfile.pdf"; }, 500);
  3. In the above code, replace "My PDF" with the name of the field into which you are trying to load the PDF. Also replace the path and file name "../media/myfile.pdf" with the one you are trying to load.
  4. Create a single action that executes this code to load the PDF that uses the function exeJavascriptDirect() and executes the code in our "exec" field.
    Image 1.png
    Execute field code
    Image 1.png (102.96 KiB) Viewed 1189 times
What does this do?
IE has a rendering bug which will not render PDF files immediately in an iframe. So what this code does is load a blank page in the field first and then after 500ms, it will change the iframe source to the pdf file you want to load.

Is this cross-browser?
YES.
Clifton
Site Admin
 
Posts: 732
Joined: Tue Jan 14, 2014 1:04 am

Re: pgGotoURL() and PDF

Postby Kataleena » Mon Feb 23, 2015 10:28 pm

Hi,

Thank you so much, my situation is urgent and your fix work well.

Thanks again for your fast reply and helpful advice.

Cheers,
Kat
Kataleena
 
Posts: 49
Joined: Sun Feb 23, 2014 10:05 pm

Re: pgGotoURL() and PDF

Postby Clifton » Mon Feb 23, 2015 11:14 pm

You can download the new beta here. It contains a modified fix which accomplishes what is outlined in this thread.
Clifton
Site Admin
 
Posts: 732
Joined: Tue Jan 14, 2014 1:04 am


Return to Function Help

Who is online

Users browsing this forum: No registered users and 1 guest

cron