Convierta el archivo MPP del Proyecto Microsoft en PDF
PDF o formato de documento portátil es un formato de archivo desarrollado por Adobe en 1992 para presentar documentos, incluido el formato de texto y las imágenes. Microsoft Project permite al usuario exportar los datos del proyecto al formato PDF.
Estos son pasos para exportar datos del proyecto a formato PDF:
Supongamos que tiene su proyecto abierto en Microsoft Project.
- Seleccione el elemento de menú “Archivo \ Guardar como”
- Seleccione la ubicación (por ejemplo, “esta PC”)
- En el formato “Guardar como” Diálogo seleccionar ‘PDF archivos (*. PDF) en “Guardar como Tipo” desplegable.
- Haga clic en el botón “Guardar”
- En el cuadro de diálogo Opciones de exportación de documentos, seleccione el rango de publicación y haga clic en “Aceptar”.
La vista seleccionada actualmente se presentará al archivo PDF. Aquí hay un ejemplo de archivo de salida:
Aspose.Tasks para .NET también proporciona la capacidad de representar la vista del proyecto en formato PDF mediante programación. En este caso, no necesita tener instalado Microsoft Project en su máquina. Este artículo ofrece una descripción detallada de la variedad de opciones disponibles en Aspose. Tasks para exportar proyectos a PDF.
Guardar un archivo MPP de MS Project como un PDF
La clase Proyecto expone el método Guardar que se utiliza para guardar un proyecto en varios formatos. El método Guardar le permite representar los datos del proyecto a PDF utilizando el tipo de enumeración SaveFileFormat.
Para guardar un proyecto en PDF:
- Cargue un archivo MPP de Microsoft Project.
- Opcionalmente, realice cambios en el proyecto cargado.
- Guarde el proyecto en PDF utilizando uno de Project.Save Method Sobrecars. Puede usar SaveFileFormat.pdf para guardar el proyecto con la configuración predeterminada o PDFSaveOptions para personalizar las opciones de exportación.
- Tenga en cuenta que no puede establecer valores en la aplicación **** y Productor Los campos, debido a Aspose Ltd. y Aspose.Tasks para .NET X.X.X se mostrarán en estos campos.
Las siguientes líneas de código demuestran cómo lograr esto usando C#.
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:
- 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.
- 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.
- 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.
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.
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 Type | Graphical Indicator |
---|---|
Task Indicators | ![]() |
Resource Indicators | ![]() |
Assignment Indicators | ![]() |
Saving to Multiple PDF Files
To save project data to multiple PDF files, set the SaveToSeparateFiles flag to true.
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.
Customizing Date Formats
Aspose.Tasks for .NET API allows developers to customize the date format using the DateFormat enumerator when rendering project data.
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.