Auto place fence and print macro

Does anyone know how to write a macro that will automatically place a fence around the border of the drawing and print a specific drawing size to pdf? I'm not very code savvy and I didn't see anything already covering this. Thanks.