

And the margins I’ve suggested here will give you. The first is to look at the top and sides of your document. if you want to have a page with different margins you need to create a new section for that page. There are a couple of different ways to view the margins you have set. In any case, for a 6 x 9 trade book, you’re going to want to end up with 30 to 35 lines per page in most cases. Margins are defined at the section level, i.e. PageSetup.LeftMargin = pageSetup.RightMargin = pageSetup.TopMargin = pageSetup.BottomMargin = 72 * 2 For a book design with running heads and folios that are centered at the bottom of the page on a 6 x 9 book, try. PageSetup_first_Page.LeftMargin = pageSetup_first_Page.RightMargin = pageSetup_first_Page.TopMargin = pageSetup_first_Page.BottomMargin = 72 * 1 įoreach (Section section in middle_Pages.Sections) Along with that, you have the autonomy to adjust the height and.
How to create different margins on different pages on word code#
The code will then configure page setup values ( left, right, top, bottom margins) for these three subdocuments and finally merge them to form a final document: Document doc = new Document("C:\\Temp\\sample\\template.docx") ĭocument first_Page = doc.ExtractPages(0, 1) ĭocument middle_Pages = doc.ExtractPages(1, total_Pages - 2) ĭocument last_Page = doc.ExtractPages(total_Pages - 1, 1) You can easily alter the page margins by selecting a pre-defined option provided by Word. To change the default margins, click Default. Under Margins, select the options you want. NET will split template Word document into three sub-documents i.e a document containing only the first page, a document object containing only the middle pages and a document containing only the last page. On the File menu, click Page Setup, and then click the Margins tab.
