# PDF on iPhone

**URL:** https://community.glideapps.com/t/pdf-on-iphone/14366
**Category:** Ask for Help
**Created:** [August 21, 2020, 9:29pm UTC](https://community.glideapps.com/t/pdf-on-iphone/14366 "2020-08-21T21:29:56Z")
**Posts on this page:** 12
**Page:** 1

<div class="post-metadata">

### Author: ![SuperMerabh](https://avatars.discourse-cdn.com/v4/letter/s/8491ac/32.png) [@SuperMerabh](https://community.glideapps.com/u/SuperMerabh)
#### Post date: [August 21, 2020, 9:29pm UTC](https://community.glideapps.com/t/pdf-on-iphone/14366/1 "2020-08-21T21:29:56Z")

</div>

I’m using webview to display PDF’s on my app. It looks great on the preview but on the app itself on my actual iPhone, it doesn’t display the PDF properly, it just shows one image from the PDF. Any idea?

---

<div class="post-metadata">

### Author: ![ThinhDinh](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/thinhdinh/32/49_2.png) [@ThinhDinh](https://community.glideapps.com/u/ThinhDinh)
#### Post date: [August 22, 2020, 9:52am UTC](https://community.glideapps.com/t/pdf-on-iphone/14366/2 "2020-08-22T09:52:24Z")

</div>

Do you store that file on Glide’s storage or somewhere else?

---

<div class="post-metadata">

### Author: ![SuperMerabh](https://avatars.discourse-cdn.com/v4/letter/s/8491ac/32.png) [@SuperMerabh](https://community.glideapps.com/u/SuperMerabh)
#### Post date: [August 22, 2020, 11:24am UTC](https://community.glideapps.com/t/pdf-on-iphone/14366/3 "2020-08-22T11:24:13Z")

</div>

I store it on my own server. Does it matter?

---

<div class="post-metadata">

### Author: ![ThinhDinh](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/thinhdinh/32/49_2.png) [@ThinhDinh](https://community.glideapps.com/u/ThinhDinh)
#### Post date: [August 22, 2020, 11:52am UTC](https://community.glideapps.com/t/pdf-on-iphone/14366/4 "2020-08-22T11:52:30Z")

</div>

I haven’t tested this case but does that link work with an image component?

---

<div class="post-metadata">

### Author: ![SuperMerabh](https://avatars.discourse-cdn.com/v4/letter/s/8491ac/32.png) [@SuperMerabh](https://community.glideapps.com/u/SuperMerabh)
#### Post date: [August 22, 2020, 4:23pm UTC](https://community.glideapps.com/t/pdf-on-iphone/14366/5 "2020-08-22T16:23:25Z")

</div>

Hello, when I attach it as an image, it shows just the first image of the PDF but not the PDF itself. It looks like a bug. Any idea?

---

<div class="post-metadata">

### Author: ![Deena](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/deena/32/9877_2.png) [@Deena](https://community.glideapps.com/u/Deena)
#### Post date: [August 22, 2020, 8:38pm UTC](https://community.glideapps.com/t/pdf-on-iphone/14366/6 "2020-08-22T20:38:40Z")

</div>

Okay, you and I are on the same page today @SuperMerabh! I am trying to display PDF for the first time today. Read all the threads I could find and have tried webview and image components and it’s not working. For me, I upload via file picker and I see the resultant url link in the sheet but webview is blank on GDE and scrolls up/down and sideways in phone, but still only one page. Image displays only first page - no scroll. Did you happen to figure it out or anyone else have any ideas what is going wrong? I do not want to try cloudinary yet. May get there but trying to use native Glide capabilities first.

---

<div class="post-metadata">

### Author: ![SuperMerabh](https://avatars.discourse-cdn.com/v4/letter/s/8491ac/32.png) [@SuperMerabh](https://community.glideapps.com/u/SuperMerabh)
#### Post date: [August 22, 2020, 9:09pm UTC](https://community.glideapps.com/t/pdf-on-iphone/14366/7 "2020-08-22T21:09:49Z")

</div>

Yes we are @deena, I am very new to this app so I’m not familiar with all the other options. I just used a direct URL to the PDFs. Worked great on the preview but not on iphone. I eventually gave up and just put a button linking to the PDF.

---

<div class="post-metadata">

### Author: ![Ktunduwani](https://avatars.discourse-cdn.com/v4/letter/k/90ced4/32.png) [@Ktunduwani](https://community.glideapps.com/u/Ktunduwani)
#### Post date: [August 19, 2021, 5:03pm UTC](https://community.glideapps.com/t/pdf-on-iphone/14366/8 "2021-08-19T17:03:23Z")

</div>

Try this

> <https://stackoverflow.com/questions/44164367/how-to-embed-google-drive-document-pdf-in-blogger-post>

---

<div class="post-metadata">

### Author: ![ThinhDinh](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/thinhdinh/32/49_2.png) [@ThinhDinh](https://community.glideapps.com/u/ThinhDinh)
#### Post date: [August 19, 2021, 11:33pm UTC](https://community.glideapps.com/t/pdf-on-iphone/14366/9 "2021-08-19T23:33:59Z")

</div>

Just adding to this, this works well if you use Google Drive as the source. If you try this kind of embed with a PDF outside of Drive it will likely hit some hourly limits and not displaying to your users.

---

<div class="post-metadata">

### Author: ![Darren\_Murphy](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/darren_murphy/32/47326_2.png) [@Darren\_Murphy](https://community.glideapps.com/u/Darren_Murphy)
#### Post date: [August 20, 2021, 3:08am UTC](https://community.glideapps.com/t/pdf-on-iphone/14366/10 "2021-08-20T03:08:24Z")

</div>

One downside with displaying a PDF using an image component is that the “Tap to Enlarge” action doesn’t work with PDF files. To work around this, I generate a png image of all my PDF’s using [ConvertAPI](https://www.convertapi.com/a).

So if a user views a PDF in the app, they actually see an image, which is zoomable.  
But if they choose to download the file or have it emailed to them, then they get a PDF\* file.

_\* they actually get a password protected PDF, but that’s another story 😉_

---

<div class="post-metadata">

### Author: ![Eric\_Penn](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/eric_penn/32/73888_2.png) [@Eric\_Penn](https://community.glideapps.com/u/Eric_Penn)
#### Post date: [August 20, 2021, 2:10pm UTC](https://community.glideapps.com/t/pdf-on-iphone/14366/11 "2021-08-20T14:10:20Z")

</div>

Could you please share how you password protect the downloaded/ email file?

I’d like to apply it to .csv’s which I imagine would be the same.

---

<div class="post-metadata">

### Author: ![Darren\_Murphy](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/darren_murphy/32/47326_2.png) [@Darren\_Murphy](https://community.glideapps.com/u/Darren_Murphy)
#### Post date: [August 20, 2021, 3:46pm UTC](https://community.glideapps.com/t/pdf-on-iphone/14366/12 "2021-08-20T15:46:23Z")

</div>

I use the same API I mentioned in my previous post - [https://www.convertapi.com](https://www.convertapi.com)

```auto
function password_protect_pdf(file_id, folder_id, password) {
  var file = DriveApp.getFileById(file_id);
  var blob = file.getBlob();
  var file_string = Utilities.base64Encode(blob.getBytes());
  var url = CONVERT_API;
  var obj = {
    "Parameters": [
      {
        "Name": "File",
        "FileValue": {
          "Name": file_id + '.pdf',
          "Data": file_string
        }
      },
      {
        "Name": "UserPassword",
        "Value": password
      },
    ]
  };

  var json = JSON.stringify(obj);
  var payload = json;
  var options = {
    method: 'POST',
    payload: payload,
    contentType: "application/json; charset=utf-8",
  };
  var response = UrlFetchApp.fetch(url, options);
  var json = response.getContentText();
  var data = JSON.parse(json);
  var text = data.Files[0].FileData;
  var protected_file_id = decode_and_save_pdf(text, file_id, folder_id);
  return protected_file_id;
}

```
