Printable templates for Custom Modules

Printable templates for Custom Modules

Hi, 

I have a requirement to setup customized printable for few Custom Modules to let the record owner print  the details of the currently opened record, similar to Invoice Template or Sales Order Template. 

Use Case:
 - Record Owner opens a record from Custom Module
 - A custom button Print Record will appear when a record is opened 
 - On clicking the Print Record button, a PDF document with data of the opened record must be generated  based on a template (similar to Invoice template) and either
      - Download the generated PDF record owner's local drive 
      - Send the generated PDF to a specific email address 

Is there a way to setup Invoice Templates for Custom modules? It can be achieved with Mail Merge but I need outcome as PDF document and with Mail Merge doing that would require several clicks. I need the PDF to be generated on a single button click.

Also, can the aforementioned use case be automated? Automatically generate a pdf based on a template periodically and send it by email without the user having to navigate the record and print the pdf manually?

I would appreciate any guidance on this use case.