Glad I got some few minutes to update my blog after 2 months hence was in a busy schedule. J Please refer the below code for you to create a Publishing page on Sharepoint 2010 based on a page layout which is available in your site.
PublishingWeb publishingWeb = PublishingWeb.GetPublishingWeb(web); string pageName = “MyPageName.aspx”; PageLayout[] pageLayouts = publishingWeb.GetAvailablePageLayouts(); PageLayout selectedLayout = null; foreach (PageLayout pl in pageLayouts) { if (pl.Name == "MyPublishingPageLayout.aspx") { selectedLayout = pl; break; } } PageLayout currPageLayout = selectedLayout; PublishingPageCollection pages = publishingWeb.GetPublishingPages(); PublishingPage newPage = pages.Add(pageName,currPageLayout); newPage.ListItem[FieldId.PublishingPageContent] = “Content of the page”; newPage.ListItem.Update(); newPage.Update(); newPage.CheckIn(“Comment for the checkin”); newPage.ListItem.File.Publish("page published"); newPage.ListItem.File.Approve("page approved");
please refer the following links for more details:
http://social.msdn.microsoft.com/Forums/en-US/sharepointdevelopment/thread/69b509cd-4865-4d9f-891f-5050d59e78b4/
http://social.msdn.microsoft.com/Forums/en-US/sharepointdevelopmentprevious/thread/e6ca8a5f-b650-4759-8760-57086cb19765