Build a Google Script to break a google doc to smaller sections based on headers

Job ID: 34384581

Budget: $10 – $30 USD

i have a Google doc with many headers, each header has images and paragraphs under it, I need a script to copy each header and its content to another google doc with the header as a name.
Related categories: JavaScript Scripting Google Docs Automation