Pdf class allows you to display a PDF hosted remotely or locally in the chatbot UI. This class either takes a URL of a PDF hosted online, or the path of a local PDF.
Since version 2.11.0, the PDF viewer uses a custom React-based renderer
with zoom, pagination, download, and print controls instead of the browser’s
built-in iframe viewer. The
pdfjs-dist worker is bundled locally — no
external CDN requests are made. If you relied on the previous iframe behavior
or applied custom CSS targeting the old viewer, you may need to update your
styles.Attributes
str
The name of the PDF to be displayed in the UI.
ElementDisplay
Determines how the PDF element should be displayed in the UI. Choices are
“side”, “inline”, or “page”.
str
The remote URL of the PDF file. Must provide url for a remote PDF (or either
path or content for a local PDF).
str
The local file path of the PDF. Must provide either path or content for a
local PDF (or url for a remote PDF).
bytes
The file content of the PDF in bytes format. Must provide either path or
content for a local PDF (or url for a remote PDF).
int
The default rendered page. Must be an integer greater than 0 and less than or
equal to the total number of pages in the PDF. The default value is 1.