Читання інформації про налаштування сторінки з файлу MPP
Contents
[
Hide
Show
]Aspose.Tasks для java API надає можливість читати інформацію про заголовки та колонтитулу з файлу MPP. API має класи, відображені на кожній вкладці діалогового вікна Setup Project Microsoft, як детально описано в розділі нижче.
Інформація про налаштування сторінки з читання з файлу MPP
Діалогове вікно налаштування сторінки Microsoft Project має 6 вкладок (див. Скріншот). Ці вкладки відображаються на нових класах:
- Вкладка сторінки -> aspose.tasks.visualization.pagesettings клас
- Вкладка на маржі -> aspose.tasks.visualization.pagemargins клас
- Заголовок, вкладки колонтитул -> aspose.tasks.visualization.headerfooterinfo клас
- Вкладка легенди -> aspose.tasks.visualization.pagelegend клас
- Вкладка Переглянути -> aspose.tasks.visualization.pageviewsettings клас
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());