PDF Preview I have a Deck View with the File

PDF Preview

I have a Deck View with the Files uploaded. Now I would like to have a Preview of the PDF File as the Main Image. Is this possible?

1 Like

I’m afraid that’s not possible unless you take a printscreen from that pdf and then use it as a main image.

Okay thank you. I thought I read about a workaround from Jarrod, but I could not find the Post anymore.

@Aleksi Do you know any update on this? Perhaps I could use the SNAPSHOT() expression? But how would be the DeepLink to the PDF file?

2 Likes

Unfortunately I haven’t seen or found a way how you could achieve this kind of PDF preview.

1 Like

If you are handy with PHP, you could try using this - https://github.com/spatie/pdf-to-image and saving the image to Gdrive

Thank you @Bellave_Jayaram. Sadly the only thing I know about PHP is how to spell it

1 Like

There seems to be a workaround from @tsuji_koichi

[Problem Capturing Screenshots in PDF Reports](https://community.appsheet.com/t/problem-capturing-screenshots-in-pdf-reports/16615/8) Questions

Rather than using snapshot expression which is currently manage to display the snapshot for chart type view, why dont you seek alternative? See my previous post I placed with category for Tips and Tricks. https://community.appsheet.com/t/do-you-want-to-display-thumbnail-or-image-for-the-web-site/17450 In this post, I introduced a solution to display the snapshot for webpage. However, just twist the technique a bit, it could be possible to show the PDF file saved online as thumbnail and image …

1 Like

You don’t need to write any script just construct URL. Super easy.

Let me know if it worked out for you.

I couldn’t get this to work, but could really use this functionality within most of my apps. I have everything setup like you described, and am getting back a “Now Capturing” image.

I’ve been able to grab a thumbnail dynamically using a google apps script on my source spreadsheet to extract the thumbnail via Drive API. I’ve added a trigger that runs the function every time a new row is added.

You’d need to adapt this script (and this is still a work in progress), but hope it helps!

function getThumbnailLink() {
  var sheet = SpreadsheetApp.getActive().getSheetByName("Content Resources");
  var urlColumn = sheet.getRange("UrlColumn").getColumn();
  var newRow = sheet.getLastRow();
  var url = sheet.getRange(newRow, urlColumn).getValue();
  var fileId = url.match(/[-\w]{25,}/);
  
  if (fileId) {
    var thumb = Drive.Files.get(fileId);
    var thumbColumn = sheet.getRange("ThumbnailColumn").getColumn();
    var thumbCell = sheet.getRange(newRow, thumbColumn);
    thumbCell.setValue(thumb.thumbnailLink);
  }
  
}
6 Likes

Mark, I can’t thank you enough for reaching out to me with a solution. Very eager to try this out, and will report back once I get time to mess around with it. Thanks again

1 Like

This would be a great feature Idea

1 Like

A PDF viewer is on my list, though I can’t give you a timeline.

6 Likes

Thanks!

There is a workaround for Card View.

https://www.googlecloudcommunity.com/gc/Tips-Tricks/Show-PDF-Thumbnails-when-using-Folder-as-a-Table/m-p/358556

2 Likes

Thanks

1 Like