The Community Commons module in the Marketplace has a Java Action called StoreURLToFileDocument that you can use to download a file from a URL and store it as a Mendix FileDocument.
I hope this helps.
I believe you can use the Java action CommunityCommons.StringToFile and then generate PDF action and download the file using download file activity in a m/f
I found some more info in this post as well
Hope this helps!