I gave up trying to make it work. I just leave a link to my S3 object and the link opens up a pdf viewer for the content.
def main():
st.info('If the user manual is not being displayed properly here, you may view file at [this link](https://storage.googleapis.com/xxx.pdf)')
st.markdown("""
<embed src="https://storage.googleapis.com/xxx.pdf" width="100%" height="1000">
""", unsafe_allow_html=True)