How to send pdf file with caption #50
ivanwebdevs
started this conversation in
General
Replies: 2 comments 6 replies
-
const id = 'abcd@s.whatsapp.net' // the WhatsApp ID
// send a document pdf! from url
const documentUrl= {
document: {
url: "https://github.com/pedrazadixon/sample-files/raw/main/sample_pdf.pdf"
},
caption: "Text caption",
mimetype: "application/pdf"
}
await sock.sendMessage(id, documentUrl)
// send a document pdf! from local file
const documentFile = {
document: fs.readFileSync("sample_pdf.pdf"),
caption: "Text caption",
mimetype: "application/pdf"
}
await sock.sendMessage(id, documentFile)
// send a document pdf! from local file with path
const documentFilePath = {
document: {
url: "./sample_pdf.pdf"
},
caption: "Text caption",
mimetype: "application/pdf"
}
await sock.sendMessage(id, documentFilePath)
|
Beta Was this translation helpful? Give feedback.
6 replies
-
const documentFilePath = {
}, |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
can someone help me to give example code to send pdf file from link please
Beta Was this translation helpful? Give feedback.
All reactions