PDF Preview Mode

It would be great to have an option to select when a PDF DOCUMENT link is selected it will open in Preview mode instead of being downloaded.

Hi! Welcome to the community :wave:

If you double click on the Print PDF component you’ll see an option to change it from print or download. Print opens it up to print/preview.

What about a DOWNLOAD Link in a table whereby a user has uploaded a file - it downloads the file - it would be great to set it to PDF Preview.

This can be done with a list component using the HTML option.

After creating your PDF open one of them and take note of the URL. For example

https://tutorials.tadabase.io/app/APP_ID/pages/TABLE_ID-RECORD_ID.pdf

Next, take out the record id and replace it with {!!id!!}

https://tutorials.tadabase.io/app/APP_ID/pages/TABLE_ID-{!!id!!}.pdf

Now that we have that, add ?mode=Download at the end of the link and paste it into a list components HTML option.
https://tutorials.tadabase.io/app/APP_ID/pages/TABLE_ID-{!!id!!}.pdf?mode=Download

You now have a 1 click option to download a PDF from a parent page! Do let me know if you have any questions :slight_smile:

2 Likes

It is also possible to do this with a Table component but it requires a few extra steps.

  1. Create a text field called “id” and set a table rule to set this field to the Record Id

  2. Create an Equation field with the following equation.
    Make sure you replace APP_ID and TABLE_ID with the app and table id from your PDF’s link (see the post above this one for more info)

CONCAT('<a',CHAR(32),'href="https://tutorials.tadabase.io/app/APP_ID/pages/TABLE_ID-',{id},'.pdf?mode=Download"',CHAR(32),'class="btn',CHAR(32),'btn-block',CHAR(32),'btn-primary',CHAR(32),'td-data-link">Download',CHAR(32),'PDF</a>')

  1. The equation field will now act as a download button for your PDF! Add the equation to your table and you’re done. :slight_smile:
1 Like