How to pass the input file for convert. officeToPdf method instead of a path with python

Hi there, I’m a beginner, I try to pass the input file for convert. officeToPdf method instead of a path with python. I see an example here Is that possible to pass input file for conversion as InputStream in Java but it’s java and c# but I’m doing it with python. Could you help me with an example with python?
My flow:

  1. User upload an file Docx from web to server that build with flask API
  2. Get file from request
  3. Save it into disk server
  4. Convert this file to pdf by pass it’s path to convert. officeToPdf

My expectation:
Don’t need to save file to disk server, pass a file object to convert. officeToPdf

Thanks

Hello, I’m Ron, an automated tech support bot :robot:

While you wait for one of our customer support representatives to get back to you, please check out some of these documentation pages:

Guides:Forums:

I am unclear as to what you are trying to achieve.

Perhaps these posts can assist:

https://community.pdftron.com/t/is-that-possible-to-pass-input-file-for-conversion-as-inputstream-in-java/2881

https://www.pdftron.com/documentation/samples/py/PDFDocMemoryTest

Note: The python bindings are generated from the C++ bindings

Sorry, my post is not clear, I try to pass the input file for convert. officeToPdf method instead of a path with python. I see an example here Is that possible to pass input file for conversion as InputStream in Java but it’s java and c# but I’m doing it with python. Could you help me with an example with python?