user3458553
user3458553

Reputation: 9

How to addd an 'close' button to a pdf loaded from within an app by uiwebview

We can use UIWEBVIEW to create a loading mechanism for viewing a pdf file when called in our app and we have successfully put in a 'close' or 'done' button that allows us to exit the pdf and return to the app. Our app is a website compiled using Xcode 5.1.

PROBLEM: Our 'close' / 'done' button appears on every page of our website app rather than only when the pdf is loaded. What we want is for the button to only appear when the pdf is loaded and when pressed, we can return to the app and the button disappears.

Any help very very much appreciated.

Upvotes: -1

Views: 657

Answers (2)

user3458434
user3458434

Reputation: 1

If YOu Use PHONEGAP, you must use AppInBrowser

you can code like this

    a href="javascript:void(0)" onclick="open_pdf('your.pdf');"

function open_pdf(url) 
 {  var ref = window.open(url, '_blank', 'location=no'); }

Follow docs.

Upvotes: 0

Gajendra Rawat
Gajendra Rawat

Reputation: 3663

You can hide close and done button in other view like this

[closeBtn setHidden:YES];

[doneBtn setHidden:YES];

Make sure your other class able to access these buttons

Upvotes: 0

Related Questions