Информация о настройке страницы чтения из файла MPP

Aspose.Tasks для Java API предоставляет возможность прочитать информацию о заголовке и нижнем колонтитуле из файла MPP. В API есть классы, отображаемые с каждой вкладкой Microsoft Project Page Dialop Dialup, как подробно описано в разделе ниже.

Информация о настройке страницы с чтением из файла MPP

Диалоговое окно «Настройка страниц Project Project» имеет 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.