Package com.aspose.words

Examples of com.aspose.words.PageSetup


  public static void main(String[] args) throws Exception
  {
    Document doc = new Document();
    DocumentBuilder builder = new DocumentBuilder(doc);

    PageSetup pageSetup = builder.getPageSetup();
    pageSetup.setTopMargin(ConvertUtil.inchToPoint(0.5));
    pageSetup.setBottomMargin(ConvertUtil.inchToPoint(0.5));
    pageSetup.setLeftMargin(ConvertUtil.inchToPoint(0.5));
    pageSetup.setRightMargin(ConvertUtil.inchToPoint(0.5));
    pageSetup.setHeaderDistance(ConvertUtil.inchToPoint(0.2));
    pageSetup.setFooterDistance(ConvertUtil.inchToPoint(0.2));
   
    doc.save("data/AsposePageBorders.docx");
  }
View Full Code Here


  {
    Document doc = new Document();
      DocumentBuilder builder = new DocumentBuilder(doc);

      Section currentSection = builder.getCurrentSection();
      PageSetup pageSetup = currentSection.getPageSetup();

      // Specify if we want headers/footers of the first page to be different from other pages.
      // You can also use PageSetup.OddAndEvenPagesHeaderFooter property to specify
      // different headers/footers for odd and even pages.
      pageSetup.setDifferentFirstPageHeaderFooter(true);

      // --- Create header for the first page. ---
      pageSetup.setHeaderDistance(20);
      builder.moveToHeaderFooter(HeaderFooterType.FOOTER_FIRST);
      builder.getParagraphFormat().setAlignment(ParagraphAlignment.CENTER);

      // Set font properties for header text.
      builder.getFont().setName("Arial");
View Full Code Here

  {
    Document doc = new Document();
      DocumentBuilder builder = new DocumentBuilder(doc);

      Section currentSection = builder.getCurrentSection();
      PageSetup pageSetup = currentSection.getPageSetup();

      // Specify if we want headers/footers of the first page to be different from other pages.
      // You can also use PageSetup.OddAndEvenPagesHeaderFooter property to specify
      // different headers/footers for odd and even pages.
      pageSetup.setDifferentFirstPageHeaderFooter(true);

      // --- Create header for the first page. ---
      pageSetup.setHeaderDistance(20);
      builder.moveToHeaderFooter(HeaderFooterType.HEADER_FIRST);
      builder.getParagraphFormat().setAlignment(ParagraphAlignment.CENTER);

      // Set font properties for header text.
      builder.getFont().setName("Arial");
View Full Code Here

TOP

Related Classes of com.aspose.words.PageSetup

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.