Recording a journal of exporting to dxf and pdf is a good first step. You can then modify the code that was returned from the journal recorder to do exactly what you want.
If you have an author license, you can compile to .exe to run it in batch mode; or you can use the run_journal utility to run your journal code in batch mode.
There is an example posted on the Solution Center that addresses the first half of your question:
If that link doesn't work, just search for "nx_api4970".
There are also examples out there that demonstrate how to export to DXF.