You need to be a bit more specific why it is not working. Some common mistakes: working with filedocument directly instead with an inheritence object.
Did you create a document template to create the PDF? Try otherwise to set a breakpoint and double check that the inherited filedocument has the hascontents boolean set on true. Otherwise the document is empty.
For mobile this indeed does not work. But there is a widget in the appstore for that: https://appstore.home.mendix.com/link/app/114252/ITvisors/Native-file-documents But indeed this should be not made so difficult in Mendix.