I have a requirement where I need to create a new document/library or a new document library view associated with the page when I create a document library page using a custom page layout.
I'm using sharepoint 2010.
You need to create an event receiver to listen for when a page has been created. You attach the event receiver to the Pages library. You can use the server object model to create a document or library.
See these links:
Creating an event receiver:
Creating a document library using the Server OM: