it would be nice if you could create PDFs of parts of a page. But as far as I know this is still not possible.
You could however resize the page. Then create the pdf and resize to previous size again.
p.resize(CoordinateSpaces.INNER_COORDINATES, AnchorPoint.TOP_RIGHT_ANCHOR,ResizeMethods.MULTIPLYING_CURRENT_DIMENSIONS_BY, [0.5,1]);