MPP 파일에서 페이지 설정 정보를 읽는다

Aspose.Tasks for java api는 MPP 파일에서 헤더 및 바닥 글 정보를 읽을 수있는 기능을 제공합니다. API에는 아래 섹션에 자세히 설명 된대로 Microsoft Project Page 설정 대화 상자의 각 탭에 매핑 된 클래스가 있습니다.

MPP 파일에서 페이지 설정 정보 읽기

Microsoft 프로젝트 페이지 설정 대화 상자에는 6 개의 탭이 있습니다 (스크린 샷 참조). 이 탭은 새로운 클래스에 매핑됩니다.

 1// For complete examples and data files, please go to https://github.com/aspose-tasks/Aspose.Tasks-for-Java
 2// The path to the documents directory.
 3String dataDir = Utils.getDataDir(ReadPageSetupInformation.class);
 4
 5Project project = new Project(dataDir + "HeaderFooter2007_3.mpp"); // Attached
 6// test
 7// project
 8PageInfo info = project.getDefaultView().getPageInfo();
 9
10// Header Footer information
11System.out.println(info.getHeader().getLeftText());
12System.out.println(info.getHeader().getCenteredText());
13System.out.println(info.getHeader().getRightText());
14System.out.println(info.getFooter().getLeftText());
15System.out.println(info.getFooter().getCenteredText());
16System.out.println(info.getFooter().getRightText());
17
18// Page Settings information
19System.out.println(info.getPageSettings().isPortrait());
20System.out.println(info.getPageSettings().getAdjustToPercentOfNormalSize());
21System.out.println(info.getPageSettings().getPercentOfNormalSize());
22System.out.println(info.getPageSettings().getPagesInWidth());
23System.out.println(info.getPageSettings().getPagesInHeight());
24System.out.println(info.getPageSettings().getPaperSize());
25
26// Page View Settings
27System.out.println(info.getPageViewSettings().getPrintAllSheetColumns());
28System.out.println(info.getPageViewSettings().getPrintFirstColumnsCountOnAllPages());
29System.out.println(info.getPageViewSettings().getFirstColumnsCount());
30System.out.println(info.getPageViewSettings().getPrintNotes());
31System.out.println(info.getPageViewSettings().getPrintBlankPages());
32System.out.println(info.getPageViewSettings().getFitTimescaleToEndOfPage());
33
34// Page Margins
35System.out.println(info.getMargins().getLeft());
36System.out.println(info.getMargins().getTop());
37System.out.println(info.getMargins().getRight());
38System.out.println(info.getMargins().getBottom());
39System.out.println(info.getMargins().getBorders());
40
41// Page Legend
42System.out.println(info.getLegend().getLeftText());
43System.out.println(info.getLegend().getCenteredText());
44System.out.println(info.getLegend().getRightText());
45System.out.println(info.getLegend().getLegendOn());
46System.out.println(info.getLegend().getWidth());
Subscribe to Aspose Product Updates

Get monthly newsletters & offers directly delivered to your mailbox.