Open Pdf on specific page

Special forum to share and discuss skins for Pano2VR and Object2VR
Post Reply
ggibbon
Posts: 120
Joined: Fri Aug 01, 2014 1:02 pm

Hi All

is there a way to get the new pdf feature to open on a specific page.

Thanks
Greg
User avatar
Tony
Posts: 1342
Joined: Mon Feb 15, 2010 6:54 am
Location: Adelaide, South Australia
Contact:

Hi Greg,
is there a way to get the new pdf feature to open on a specific page.
Short answer = yes!

Longer answer = yes but there are some issues.

I put together a test site that shows the issues. You can view it at https://p2vr.s3.ap-southeast-2.amazonaw ... index.html

At the top of the screen are two buttons, one for the V7 viewer and one for the native browser viewer (the pdf is loaded in a text box using an iFrame)

V7 Viewer

v7_viewer.jpg
v7_viewer.jpg (180.31 KiB) Viewed 1300 times

Native Viewer

native_viewer.jpg
native_viewer.jpg (167.67 KiB) Viewed 1300 times

On the bottom of the screen are three buttons. Open PDF uses just a normal action that sends a value to the player eg assets/Bio_2021.pdf

Open PDF Page 2 sends a modified value with a parameter added to the URL, "assets/Bio_2021.pdf#page=2" and Open PDF Page 3 sends "assets/Bio_2021.pdf#page=2"

Note: there are a number of parameters you can add to a pdf.

Here in lies the rub :( When Open PDF Page 2 or 3 are used in conjunction with the V7 player then we loose the menu bar from the PDF regardless of the page we open and no way to show it.

V7 Viewer open at Page 2 with no menu bar

v7_viewer_page2.jpg
v7_viewer_page2.jpg (231.71 KiB) Viewed 1300 times
Where as the native player shows the menu regardless of the parameters added to the URL

Native Viewer open at Page 2 with a menu bar

native_viewer_page2.jpg
native_viewer_page2.jpg (216.95 KiB) Viewed 1300 times
Note: Safari shows the menu bar of the V7 version if it's loaded without the parameters but the native version, in Safari doesn't show the menu bar regardless of the URL. It's a known bug since Safari moved to 64 bit versions.

Hope this helps.

Cheers,

Tony
Tony Redhead | Panoramic Photographer | mobile: +61438501002 | website: https://tonyredhead.com - https://redsquare.com | Pano2VR Tutorials: https://tonyredhead.com/pano2vr | instagram: https://www.instagram.com/tonyredhead/
User avatar
Hopki
Gnome
Posts: 13028
Joined: Thu Jan 10, 2008 3:16 pm
Location: Layer de la Haye, Essex UK
Contact:

Hi Greg,
This feature is already in Pano2VR 7.
Please see the attached project.

When setting a PDF Hotspot Popup, as you drag the PDF into the viewer you will see the Hotspots Target will also say, Start Page.
Enter the start page number here.

1.png
1.png (78.71 KiB) Viewed 1295 times


In the SKin Editor the PDF element has two parameters PDF File and Start Page

2.png
2.png (42.07 KiB) Viewed 1295 times


How to use:
In this example the PDF Point Hotspot image has three actions.

3.png
3.png (39.46 KiB) Viewed 1295 times


• The first Set Valve action looks for the File to open, using the $(hu), Hotspot URL placeholder. The Parameter is set to PDF File.

4.png
4.png (38.37 KiB) Viewed 1295 times


• The second is another set value action looking for the page number, this uses the Hotspot Target text box placeholder $(ht).
The Parameter is set to Start Page.

5.png
5.png (38.8 KiB) Viewed 1295 times


Note if you wanted you can use any location for the PDF file and Start page, for example, two User Data Custom properties or Hotspot Custom properties, just make sure you use the correct placeholders.
But by default, we use the Hotspots URL for the file and the hotspots target text box for the start page, leaving blank to start from the first page.

Regards,
Attachments
pdf_start_page.zip
(70.91 KiB) Downloaded 92 times
Garden Gnome Support
If you send an e-mail to support please send a link to the forum post for reference.
support@ggnome.com
https://ggnome.com/wiki/documentation/
User avatar
Tony
Posts: 1342
Joined: Mon Feb 15, 2010 6:54 am
Location: Adelaide, South Australia
Contact:

We’ll look at that, you learn something new every day. Too many things and too little time. :P

Disregard my previous post :D

Tony
Tony Redhead | Panoramic Photographer | mobile: +61438501002 | website: https://tonyredhead.com - https://redsquare.com | Pano2VR Tutorials: https://tonyredhead.com/pano2vr | instagram: https://www.instagram.com/tonyredhead/
ggibbon
Posts: 120
Joined: Fri Aug 01, 2014 1:02 pm

Thanks guys for all your amazing knowledge. Will have a play this week.

Thanks
Greg :D
Post Reply