大众计算机学习网

专门提供各种电脑教程

aspose.words设置纸型的代码下篇

Admin | 2015-8-26 10:18:29 | 被阅次数 | 2991

  接上篇
                case "A3H"://A3横向 
 
                    foreach (Aspose.Words.Section section in oDoc) 
                    { 
                        section.PageSetup.PaperSize = PaperSize.A3; 
                        section.PageSetup.Orientation = Orientation.Landscape; 
                        section.PageSetup.TextColumns.SetCount(2); 
                        section.PageSetup.TextColumns.EvenlySpaced = true; 
                        section.PageSetup.TextColumns.LineBetween = true; 
 
                    } 
 
                    break; 
 
                case "16K": 
 
                    foreach (Aspose.Words.Section section in oDoc) 
                    { 
                        section.PageSetup.PaperSize = PaperSize.B5; 
                        section.PageSetup.Orientation = Orientation.Portrait;  
                    } 
                    
                    break; 
 
                case "8KH": 
 
                    foreach (Aspose.Words.Section section in oDoc) 
                    { 
 
                        section.PageSetup.PageWidth = double.Parse("36.4 ");//纸张宽度 
                        section.PageSetup.PageHeight = double.Parse("25.7");//纸张高度 
                        section.PageSetup.Orientation = Orientation.Landscape; 
                        section.PageSetup.TextColumns.SetCount(2); 
                        section.PageSetup.TextColumns.EvenlySpaced = true; 
                        section.PageSetup.TextColumns.LineBetween = true; 
                        //section.PageSetup.LeftMargin = double.Parse("3.35"); 
                        //section.PageSetup.RightMargin = double.Parse("0.99"); 
                    }  
  
                    break; 
            } 
        }