Uploaded pdf not parsing (Returns blank output) through llama in streamlit

Hi.
As it was working with direct upload of file into the model and I came across this streamlit_link about creating temporary files and tried below code but still getting blank results. Do you think anything else can be tried as well or any modification to this step can help?

from tempfile import NamedTemporaryFile

if st.session_state.uploaded_file:

    with NamedTemporaryFile(suffix=".pdf") as temp:
        temp.write(st.session_state.uploaded_file.getvalue())
        temp.seek(0)
        st.write(temp.name)

        st.session_state.doc_parsed = LlamaParse(result_type="markdown",api_key=key_input
                                    ).load_data(temp.name)
        st.write("step completed")
        st.write(st.session_state.doc_parsed)

Output

C:\Users\vin\AppData\Local\Temp\tmpffwd7k9o.pdf

step completed

[]

Appreciate any sort of help!!