This would be a pretty large task for somebody on here to do for you. I believe you could get started with a few examples though.
Components on Layers - this shows how to navigate an assembly and get each component
From there, you could get the component location using 2015 SOLIDWORKS API Help - GetPathName Method (IModelDoc2)
Finally, you could check and see if changing the .sldprt/.sldasm to .dxf or .pdf exists. If so, copy to your desired location.
Edit: I know this is a really short explanation but I hope it at least points you in the right direction.