Maryna Brodina
Posts: 0
Joined: Thu Apr 05, 2012 7:27 am

Link to pdfs contained within the app

Thank you for sharing!

Jay6395558
Posts: 0
Joined: Thu Nov 07, 2013 8:17 pm

Link to pdfs contained within the app

Mike or Maryna,

Where would I put this command to allow pinch and zoom of PDFs within the app?

window.open('URL', '_blank', 'EnableViewPortScale=yes');

Serhii Kulibaba
Posts: 150
Joined: Tue Aug 27, 2013 1:47 pm

Link to pdfs contained within the app

Hi Jay,

Add it to any action. For example click on the button.
More information here: http://docs.appery.io/documentation/w...

Jay6395558
Posts: 0
Joined: Thu Nov 07, 2013 8:17 pm

Link to pdfs contained within the app

Sergiy,

Just so I understand properly. Right now, I have a tap event for a button that will navigate to the database and open a pdf. Do I put the script on the end of the link or is this an entirely new event that has to be added for opening the pdf? If it is a new event then what kind of event should it be?

Thanks.

Mike6580064
Posts: 0
Joined: Wed Jan 15, 2014 6:00 pm

Link to pdfs contained within the app

Jay,

I have a single "Click--Run JavaScript" event on my button where I entered the following:

window.open('URL', '_blank', 'EnableViewPortScale=yes');

where URL is the link to the PDF on your database.

Jay6395558
Posts: 0
Joined: Thu Nov 07, 2013 8:17 pm

Link to pdfs contained within the app

Mike,

Are you sure this is the exact script you used? I am getting all sorts of error messages.

  1. Expected ')' and instead saw ','

  2. Missing semicolon

  3. Unclosed string

  4. Unclosed string

  5. Missing semicolon

  6. Expected an assignment or function call and instead saw an expression

  7. Missing semicolon

    Here is the script I ran...

    window.open('https://api.appery.io/rest/1/db/files...');

    Am I leaving something out? Does this script have anything to do with a PhoneGap plugin? That could be the problem since I haven't used this.

Jay6395558
Posts: 0
Joined: Thu Nov 07, 2013 8:17 pm

Link to pdfs contained within the app

For some reason, copying and pasting scripts does not come through on this forum. Attached is a screenshot of the script.

Image

Kateryna Grynko
Posts: 0
Joined: Thu Nov 15, 2012 9:13 am

Link to pdfs contained within the app

Hi Jay,

You can use < pre and < code tags. Works for me on this forum.

Mike6580064
Posts: 0
Joined: Wed Jan 15, 2014 6:00 pm

Link to pdfs contained within the app

Jay,

Yes the script provided was correct.

In looking at your PDF file's URL, it looks like you're missing a space and apostrophe before _blank which is causing everything after the URL to mistakenly be included in the URL.

Image

Try this:

window.open('https://api.appery.io/rest/1/db/files...', '_blank', 'EnableViewPortScale=yes');

Jay6395558
Posts: 0
Joined: Thu Nov 07, 2013 8:17 pm

Link to pdfs contained within the app

That worked. Thanks.

Return to “Issues”