Page 1 of 1

Popup window with PDF display

Posted: Thu Mar 07, 2019 9:39 pm
by alex4orly
I have in some cases a PDF document loaded into a Popup window
http://communitylifestyleaccommodation.org.au/ - check out under the Home menu - Our Brochure for an example

It works fine on my Windows computer, but :
On an iPAD, it just loads into another tab in the Safari browser
On an Android Galaxy Tablet or Mobile - it prompts me to download the PDF to the device, Not what I want

Can that be handled somehow?

Cheers

Re: Popup window with PDF display

Posted: Fri Mar 08, 2019 1:53 am
by BaconFries
It works fine on my Windows computer, but :
Probably because you have Adobe Reader installed on your PC!. So to be able to read PDF files on mobile devices the same will apply. You may also just find that it is a browser restriction that its unable to display and that the PDF will need to be downloaded first then open with the appropriate app for the mobile device. One other way to display or try is using Google Docs to display the said PDF's to the user for download or just simply provide a download.

Re: Popup window with PDF display

Posted: Fri Mar 08, 2019 5:21 am
by alex4orly
Hello,

I am using a js function to center the popup on screen, this way it works fine:

PopupCenter ('http://communitylifestyleaccommodation. ... ership.pdf', 'Membership', '800','600');

But when I try to implement Google Docs, as per the below line, it does nothing...

PopupCenter(‘https://docs.google.com/gview?url=http: ... edded=true’, 'Membership', '800','600');

I also tried this (removed te embed directive), also not working
PopupCenter(‘https://docs.google.com/gview?url=http: ... ership.pdf’, 'Membership', '800','600');

Thanks

Re: Popup window with PDF display

Posted: Fri Mar 08, 2019 6:22 am
by BaconFries
The first url doesn't open as per the other two but forces a download. The second and third show as the following screenshots below so it seems to be working. As previously mentioned on Cell/Mobiles the user(s) must have a PDF reader installed this could be either Adobe or Googles PDF reader or something similar to be able to view and print/download as required. Also remember the implementation on how it will display will be different across the browsers eg Mobile/Desktop.

Image

Image

Re: Popup window with PDF display

Posted: Fri Mar 08, 2019 7:29 am
by alex4orly
Hello again,
You are missing the point here, you are clicking on the URL itself and that of course works.
I am using an onevent trigger - onclick with a call to the JS function called PopupCenter();
It works with the first URL, when I get Gogle Docs "Involved", it does nothing....

Thanks again for always trying to help

Cheers

Re: Popup window with PDF display

Posted: Fri Mar 08, 2019 7:55 am
by Pablo
The behavior of PDF links is controlled by the browser, this is a user preference over which you have no control.
Some browsers treat the PDF as a HTML page (and use a built-in PDF reader), while other browsers may launch a separate PDF viewer.

Re: Popup window with PDF display

Posted: Fri Mar 08, 2019 8:02 am
by alex4orly
Yes, I understand this...
Just thought there maybe a trick for Android to avoit this

Thanks

Re: Popup window with PDF display

Posted: Fri Mar 08, 2019 8:06 am
by BaconFries
Alex sorry but I do get the point. As Pablos reply about it being down to the browser I have mentioned this twice to you that it there may be a browser restriction. Just because it works in desktop doesn't guarantee it will work in mobile... Thank you Pablo for also pointing this out....

Re: Popup window with PDF display

Posted: Fri Mar 08, 2019 8:26 am
by alex4orly
I understand and appreciate always your input, I truely do

I found this article:
https://stackoverflow.com/questions/743 ... ding-first
But obviously it conflicts with being part of my PopUpCenter() function

Thanks again

Re: Popup window with PDF display

Posted: Sun Mar 10, 2019 6:41 am
by alex4orly
Hello again, still on the topic

Please check the URL : http://communitylifestyleaccommodation.org.au/
On my mobile phone - Samsung Galaxy S7, same phone, same browser :

The menu option Home->Brochure shows up on a new window - OK
The menu option Get Involved -> Become a member, prompts me to download the PDF, NOT OK

If you check those options on a PC, they both come up in a Pop-Up window

So, why - one works, the other does not....

The explanation that each browser on each OS behaves another way, doesn't work here...

Any idea?

Thanks again

Re: Popup window with PDF display

Posted: Sun Mar 10, 2019 8:04 am
by Pablo
The explanation that each browser on each OS behaves another way, doesn't work here...
Why not?

The behavior of PDF links is controlled by the browser, this is a user preference over which you have no control.
Some browsers treat the PDF as a HTML page (and use a built-in PDF reader), while other browsers may launch a separate PDF viewer.

Re: Popup window with PDF display

Posted: Sun Mar 10, 2019 8:10 am
by alex4orly
But, I am talking here

1) The same browser, same phone
2) The same website
3) The same Popup method

I am calling from 2 menu options, a popup function, each time with a different PDF

So, what is different?

Re: Popup window with PDF display

Posted: Sun Mar 10, 2019 8:15 am
by Pablo
It looks like you are using a different method to show the popup for the second link, a standard popup instead of your own script.

Re: Popup window with PDF display

Posted: Sun Mar 10, 2019 11:02 am
by alex4orly
I looked in tye project again, in both cases I have the following JS call

PopupCenter ('http://communitylifestyleaccommodation. ... ochure.pdf', 'Brochure', '800','600');
PopupCenter ('http://communitylifestyleaccommodation. ... ership.pdf', 'Membership', '800','600');

Just a different PDF

Anything else you can think of?

Thanks

Re: Popup window with PDF display

Posted: Sun Mar 10, 2019 11:18 am
by Pablo
For me, the link "Get Involved -> Become a member" does not use the PopupCenter script.

Re: Popup window with PDF display

Posted: Sun Mar 10, 2019 12:07 pm
by BaconFries
Alex...For me visiting the following URL : http://communitylifestyleaccommodation.org.au/ On my mobile phone and clicking on either of the links Home->Brochure or Get Involved->Become a member forces a download....

Re: Popup window with PDF display

Posted: Sun Mar 10, 2019 7:32 pm
by alex4orly
Hi Baconfries,

Well, if the behaviour in both cases is consistant, then it is the matter for the browser. What I fail to understand is how in my case - Samsung Galaxy S7, it is NOT... It may remain forever a mistery... I copied the page code as it is from the home page below to show that both items are coded the same according to the following code extract.

Thaks again for your feedback

<li><a role="menuitem" href="./objective.html">Our&nbsp;Objectives</a></li>
<li><a role="menuitem" href="./board.html">The&nbsp;Board</a></li>
<li><a role="menuitem" href="http://" onclick="PopupCenter ('http://communitylifestyleaccommodation. ... ochure.pdf', 'Brochure', '800','600');return false;">Our&nbsp;Brochure</a></li>
</ul>
</li>
<li>
<label for="ResponsiveMenu1-submenu-1" class="toggle"><i class="fa fa-address-book-o fa-2x">&nbsp;</i>Carer&nbsp;Support<b class="arrow-down"></b></label>
<a role="menuitem" href="#"><i class="fa fa-address-book-o fa-2x">&nbsp;</i><br>Carer&nbsp;Support<b class="arrow-down"></b></a>
<input type="checkbox" id="ResponsiveMenu1-submenu-1">
<ul role="menu">
<li><a role="menuitem" href="http://communitylifestyleaccommodation. ... pport.html" target="InlineFrame1">Support&nbsp;&amp;&nbsp;Advocacy</a></li>
<li><a role="menuitem" href="javascript:popupwnd('http://communitylifestyleaccommodation. ... '800','600')" target="_self">All&nbsp;Abilities&nbsp;Activities</a></li>
</ul>
</li>
<li>
<label for="ResponsiveMenu1-submenu-2" class="toggle"><i class="fa fa-child fa-2x">&nbsp;</i>Get&nbsp;Involved<b class="arrow-down"></b></label>
<a role="menuitem" href="#"><i class="fa fa-child fa-2x">&nbsp;</i><br>Get&nbsp;Involved<b class="arrow-down"></b></a>
<input type="checkbox" id="ResponsiveMenu1-submenu-2">
<ul role="menu">
<li><a role="menuitem" href="./volunteering.html">Volunteering</a></li>
<li><a role="menuitem" href="http://" onclick="PopupCenter ('http://communitylifestyleaccommodation. ... ership.pdf', 'Membership', '800','600');return false;">Become&nbsp;a&nbsp;member</a></li>
<li><a role="menuitem" href="./donations_env.html">Donations</a></li>