Skip to content

Commit d44324b

Browse files
committed
fix Pdf class casing
1 parent 69e62a3 commit d44324b

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

api-reference/elements/pdf.mdx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
title: "PDF viewer"
33
---
44

5-
The `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.
5+
The `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.
66

77
### Attributes
88

@@ -35,7 +35,7 @@ import chainlit as cl
3535

3636
# Sending a pdf with the local file path
3737
elements = [
38-
cl.PDF(name="pdf1", display="inline", path="./pdf1.pdf")
38+
cl.Pdf(name="pdf1", display="inline", path="./pdf1.pdf")
3939
]
4040

4141
cl.Message(content="Look at this local pdf!", elements=elements).send()
@@ -47,12 +47,12 @@ cl.Message(content="Look at this local pdf!", elements=elements).send()
4747
import chainlit as cl
4848

4949
# Sending a pdf with the remote url
50-
pdf1 = cl.PDF(name="pdf1", display="inline", url="https://example.com/example.pdf")
50+
pdf1 = cl.Pdf(name="pdf1", display="inline", url="https://example.com/example.pdf")
5151
pdf1.send()
5252

5353
# Sending a pdf with file content as bytes
5454
with open("./pdf2.pdf", "rb") as f:
5555
pdf_content = f.read()
56-
pdf2 = cl.PDF(name="pdf2", display="inline", content=pdf_content)
56+
pdf2 = cl.Pdf(name="pdf2", display="inline", content=pdf_content)
5757
pdf2.send()
5858
```

0 commit comments

Comments
 (0)