# How do you upload text from a PDF using FormFunction?

I can import text from a PDF using

text = Import[filename, "Plaintext"];


I'd like to do the same thing using FormFunction, but am unsure how. I've tried the following:

FormFunction[
"file" -> "PDF",
#file &,
"Text"
]


which seems to import an image of the PDF. I've also tried

FormFunction["file" -> "Text",
#file &,
"Text"
]


which doesn't allow PDFs to be entered. Any advice would be greatly appreciated.

• Does my answer fit your needs?> – Kuba Jan 2 at 13:24
• Yes, apologies for the delay. – aasantos Jan 7 at 13:23

If you want to import a specific element of a pdf you can use "Text" type and proceed with ImportString and elements spec:
FormFunction[