Microsoft Project MPP 파일을 PDF로 변환하십시오

PDF 또는 휴대용 문서 형식은 1992 년 Adobe가 텍스트 형식 및 이미지를 포함한 문서를 제시하기 위해 개발 한 파일 형식입니다. Microsoft Project를 사용하면 사용자가 프로젝트의 데이터를 PDF 형식으로 내보낼 수 있습니다.

프로젝트 데이터를 PDF 형식으로 내보내는 단계입니다.

Microsoft Project에서 프로젝트가 열렸다고 가정 해 봅시다.

  1. “파일 \ 저장으로"메뉴 항목을 선택하십시오
  2. 위치 선택 (예 : “이 PC”)
  3. “Save AS"에서 “대화 상자 선택 ‘PDF 파일 (*. PDF) 형식은"유형으로 저장 “드롭 다운에서 형식을 선택합니다.
  4. “저장"버튼을 클릭하십시오
  5. 문서 내보내기 옵션 대화 상자에서 게시 범위를 선택하고 “확인"을 클릭하십시오.

현재 선택된보기는 PDF 파일로 렌더링됩니다. 다음은 출력 파일의 예입니다.

PDF로 내보낸 MS 프로젝트 파일의 예

Aspose.Tasks for .net은 또한 PDF 형식으로 프로그래밍 방식으로 프로젝트의보기를 렌더링 할 수있는 기능을 제공합니다. 이 경우 컴퓨터에 Microsoft 프로젝트를 설치할 필요가 없습니다. 이 기사는 PDF로 프로젝트를 내보내기위한 Aspose.task에서 사용할 수있는 다양한 옵션에 대한 자세한 개요를 제공합니다.

MS 프로젝트 MPP 파일 저장 PDF

Project 클래스는 프로젝트를 다양한 형식으로 저장하는 데 사용되는 저장 메소드를 노출시킵니다. Save 메소드를 사용하면 SaveFileFormat 열거 유형을 사용하여 프로젝트 데이터를 PDF로 렌더링 할 수 있습니다.

PDF에 프로젝트를 저장하려면 :

  1. Microsoft Project MPP 파일을로드하십시오.
  2. 선택적으로로드 된 프로젝트를 변경합니다.
  3. Project.save 메소드 오버로드 중 하나를 사용하여 프로젝트를 PDF에 저장하십시오. SaveFileformat.pdf를 사용하여 기본 설정 또는 PDFSaveOptions가있는 프로젝트를 저장하여 내보내기 옵션을 사용자 정의 할 수 있습니다.

다음 줄의 코드는 C#을 사용하여이를 달성하는 방법을 보여줍니다.

1Project project = new Project("New Project.mpp");
2project.Save("SaveProjectAsPDF_out.pdf", SaveFileFormat.PDF);

Specifying a View to save to PDF

Microsoft Project supports different view such as ‘Gantt Chart’, ‘Task Usage’, ‘Resource Usage’, etc. Each view can be customized and these settings are stored in MPP file. Aspose.Tasks for .NET allows the user to examine and change these settings using Project.Views collection.

There are 3 ways to specify the View which will be exported to PDF:

  1. Do not specify a View explicitly. In this case Project.DefaultView will be rendered. If default view is missing, Gantt Chart view will be rendered.
  2. Use SaveOptions.PresentationFormat to specify value of PresentationFormat enumeration. In this case the view with the correspondent Screen property will be selected from Project.Views collection. If View is missing, the default settings are used.
  3. Use SaveOptions.ViewSettings property to explicitly specify the View object to render. If View object is specified, the value of SaveOptions.PresentationFormat is ignored.

Fitting Contents to Cell Size

Commonly, a task (or resource) name is so long that it is truncated when project views are rendered. Aspose.Tasks for .NET provides the FitContent property in the SaveOptions class to avoid truncation of task and resource names. The code example below renders a project to PDF format with the FitContent property set to true.

1Project project = new Project("New Project.mpp");
2SaveOptions options = new PdfSaveOptions();
3
4// Set option fit content to true
5options.FitContent = true;
6options.Timescale = Timescale.Months;
7options.PresentationFormat = PresentationFormat.TaskUsage;
8project.Save("FitContentsToCellSize_out.pdf", options);

Printing or Hiding Legends when Rendering

To let you print or hide the legends on each page, the SaveOptions class provides the LegendOnEachPage property. If this flag is set to true, legends are printed on each page in the output file.

1SaveOptions options = new PdfSaveOptions();
2
3// Set the LegendOnEachPage property to false to hide legends
4options.LegendOnEachPage = false;

Supported Graphical Column Indicators

Aspose.Tasks draws graphical column indicators when rendering project data to output PDF. The following graphical indicators are supported by Aspose.Tasks:

Indicator TypeGraphical Indicator
Task Indicatorstask graphical indicators
Resource Indicatorsresource graphical indicators
Assignment Indicatorsassignment graphical indicators

Saving to Multiple PDF Files

To save project data to multiple PDF files, set the SaveToSeparateFiles flag to true.

1Project project = new Project("New Project.mpp");
2PdfSaveOptions options = new PdfSaveOptions();
3options.SaveToSeparateFiles = true;
4options.Pages = new List<int>();
5options.Pages.Add(1);
6options.Pages.Add(4);
7project.Save("SaveToMultiplePDFFiles_out.pdf", (SaveOptions)options);

Customizing TextStyle for Project Data

Aspose.Tasks for .NET API allows developers to customize the text style for over-allocated resources. By default, the style used for overallocated resources is similar to Microsoft Project (MSP), that is, red and bold. TextItemType.OverallocatedResources makes it possible to customize the color and style for the overallocated resources.

 1Project project = new Project("New Project.mpp");
 2SaveOptions options = new PdfSaveOptions();
 3options.PresentationFormat = PresentationFormat.ResourceSheet;
 4
 5TextStyle style = new TextStyle();
 6style.Color = Color.OrangeRed;
 7style.FontStyle = FontStyle.Bold;
 8style.FontStyle |= FontStyle.Italic;
 9style.ItemType = TextItemType.OverallocatedResources;
10
11options.TextStyles = new List<TextStyle>();
12options.TextStyles.Add(style);
13project.Save("CustomizeTextStyle_out.pdf", options);

Customizing Date Formats

Aspose.Tasks for .NET API allows developers to customize the date format using the DateFormat enumerator when rendering project data.

 1Project project = new Project("New Project.mpp");
 2project.Set(Prj.StartDate, new DateTime(2014, 9, 22));
 3
 4// By default project.DateFormat == DateFormat.Date_ddd_mm_dd_yy (Mon 09/22/14) customize DateFormat (September 22, 2014)
 5project.Set(Prj.DateFormat, DateFormat.DateMmmmDdYyyy);
 6project.Save("CustomizeDateFormats1_out.pdf", SaveFileFormat.PDF);
 7
 8// Export to date format 19/07/2016
 9project.Set(Prj.DateFormat, DateFormat.DateDdMmYyyy);
10project.Save("CustomizeDateFormats2_out.pdf", SaveFileFormat.PDF);

Setting Default Font

Setting default font during rending of documents helps when a font is not found. In such a case, the default font replaces the missing font and output is not affected. Aspose.Tasks for .NET API lets you specify the default font using the DefaultFontName property of the PdfSaveOptions as shown in the following code sample.

 1Project project = new Project("New Project.mpp");
 2
 3PdfSaveOptions options = new PdfSaveOptions
 4{
 5    PresentationFormat = PresentationFormat.GanttChart,
 6    FitContent = true,
 7    UseProjectDefaultFont = false,
 8    DefaultFontName = "Segoe UI Black"
 9};
10project.Save("CreateProject2_out.pdf", (SaveOptions)options);
Subscribe to Aspose Product Updates

Get monthly newsletters & offers directly delivered to your mailbox.