The desktop app uses exp.draw.io to generate the PDF, so wget could be used to script that, or, for public files from URLs, exp.draw.io can be used to generate images or PDFs as follows: https://exp.draw.io/ImageExport4/export?format=[png|pdf]&url=encoded_url_of_filePlease do not use these servers for large scale automated exports. Contact sup...@draw.io to run your own instance instead.
Yes, there is Java code that uses PhantomJS for rendering the PDF (or PNG).