To create a “Generate Documents” button for a record’s details page layout go to Setup -> Object Manager -> Selected Object -> Buttons, Links and Actions -> New Button or Link.

Next, populate the fields with the following values:

FIELD NAMEVALUE
LABELAny name, e.g. Generate Documents. This will be the name of the button displayed in the app.
NAMEAny name used by the API and managed packages, e.g. “Generate_Documents”.
DESCRIPTIONProvide your description of the button.
DISPLAY TYPESelect “Detail Page Button”.
BEHAVIOURSelect “Display in existing window with sidebar”.
CONTENT SOURCESelect “Visualforce Page”.
CONTENTSelect Visualforce page created specifically for that object.

Next, add the button to the object’s page layout. While still on the Object Manager page of the selected object, go to “Page Layout” and open the selected page layout. Under the “Mobile & Lightning Actions” section click the “Generate Documents” tile and drag it down onto the layout under the “Salesforce Mobile and Lightning Experience Actions” section. Save Changes.