Create a visualforce page with page attribute renderas = “pdf” (sample code below)
Add a Quick Action “Generate PDF” for required object ( Action Type: Visualforce; Visualforce Page: GeneratePDF. page)
Go to Lightning App builder to add the action to detail view of Object.