PDF Embed: Custom JS is supported now

We are beyond thrilled to announce that the Custom JS option has been added to our PDF Embed :rocket:

With the Custom JS option, you can add extra features to the widget by writing your own script. You don’t need to reach out to our devs, as you have the freedom to customize it yourself.

Important: Custom JS operates only upon widget installation, but not in preview mode.

You can find this option on the Appearance tab:

image image

Custom JS Editor has a Validate button, which allows you to check the code validity.


Reminder: the code entered is the body of the function that will be executed when the widget loads on the page. Do not include any <script> tags.

Guys, if any questions come up, don’t shy away to ask them in this thread :slightly_smiling_face:

1 Like

What would be some examples of these extra features we could add to our PDF embeds? I would love to hear some use cases please. Thanks!

1 Like

Hey there @ivanb :wave:

Apologies for the delayed reply!

With the Custom JS option, you can set the specific behavior of your widget or add some additional functionalities. For example:

  1. Sort files in the list in random order
  2. Open a file when you click on a third-party element of the site (for example, custom button)

If you have any further questions, we are always here for you :slightly_smiling_face:

Thanks

2 Likes