Create a PDF version of a Google Doc, move it into a new folder, remove its parents so it only exists in the new folder (typically also exists in My Drive) and then trash the Doc.
Source: The Gift of Script: Convert Doc to PDF and move into a new folder

I use Google Apps Script to support staff and students in my job. I enjoy dabbling with creating tools to help with automation and I freely share my learning experiences on my blog, where I also have a number of useful Google Add-ons: www.pbainbridge.co.uk