Skip to content

Commit

Permalink
Updated net rendering ms project exmaples
Browse files Browse the repository at this point in the history
  • Loading branch information
muqarrab-aspose committed Mar 12, 2024
1 parent 3125ca4 commit 646f32b
Show file tree
Hide file tree
Showing 4 changed files with 214 additions and 121 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,8 @@ url: /net/groupdocs-viewer-net-rendering-ms-project-documents/

## Rendering Microsoft Project Documents Tutorials
### [Get View Information for Microsoft Project Documents](./groupdocs-viewer-net-get-view-info-ms-project/)
Explore the comprehensive tutorial on leveraging Groupdocs.Viewer for .NET to retrieve view information for Microsoft Project documents effortlessly.
### [Render Notes and Adjust Time Units (MS Project)](./groupdocs-viewer-net-render-notes-and-adjust-time-ms-project/)
### [Render Specific Project Time Interval (MS Project)](./groupdocs-viewer-net-render-project-time-interval-ms-project/)
Master rendering MS Project documents with GroupDocs.Viewer for .NET. Render notes, adjust time units, and explore various output formats effortlessly.
### [Render Specific Project Time Interval (MS Project)](./groupdocs-viewer-net-render-project-time-interval-ms-project/)
Integrate GroupDocs.Viewer for .NET seamlessly into your applications for efficient document viewing. Enhance productivity with versatile rendering capabilities.
Original file line number Diff line number Diff line change
Expand Up @@ -2,42 +2,77 @@
title: Get View Information for Microsoft Project Documents
linktitle: Get View Information for Microsoft Project Documents
second_title: GroupDocs.Viewer .NET API
description:
description: Explore the comprehensive tutorial on leveraging Groupdocs.Viewer for .NET to retrieve view information for Microsoft Project documents effortlessly.
type: docs
weight: 10
url: /net/groupdocs-viewer-net-rendering-ms-project-documents/groupdocs-viewer-net-get-view-info-ms-project/
---
## Introduction
In the realm of document management and viewing solutions, Groupdocs.Viewer for .NET stands out as a versatile and robust tool. Whether you're a developer seeking to integrate document viewing capabilities into your .NET applications or an enthusiast eager to explore its functionalities, this tutorial will guide you through the process of leveraging Groupdocs.Viewer for .NET to retrieve view information for Microsoft Project documents.
## Prerequisites
Before diving into the tutorial, ensure you have the following prerequisites in place:
1. Basic Understanding of .NET Framework: Familiarity with the .NET framework will aid in comprehending the integration process.
2. Installation of Groupdocs.Viewer for .NET: Download and install Groupdocs.Viewer for .NET from the [website](https://releases.groupdocs.com/viewer/net/).
3. Development Environment Setup: Have a development environment configured with necessary tools like Visual Studio for coding.

## Importing Necessary Namespaces
To begin, import the required namespaces into your .NET project. These namespaces facilitate communication with Groupdocs.Viewer for .NET functionalities.

## Complete Source Code
```csharp
using System;
using GroupDocs.Viewer.Options;
using GroupDocs.Viewer.Results;
```

namespace GroupDocs.Viewer.Examples.CSharp.AdvancedUsage.Rendering.RenderingOptionsByDocumentType.RenderingMsProjectDocuments
Groupdocs.Viewer for .NET provides an intuitive way to retrieve view information for Microsoft Project documents. Follow these steps meticulously to achieve this:
## Step 1: Initialize Viewer Object
```csharp
using (Viewer viewer = new Viewer("path/to/your/MicrosoftProjectDocument.mpp"))
{
/// <summary>
/// This example demonstrates how to get view info for MS Project document.
/// </summary>
class GetViewInfoForProjectDocument
{
public static void Run()
{
using (Viewer viewer = new Viewer(TestFiles.SAMPLE_MPP))
{
ProjectManagementViewInfo info = viewer.GetViewInfo(
ViewInfoOptions.ForHtmlView()) as ProjectManagementViewInfo;

Console.WriteLine("Document type is: " + info.FileType);
Console.WriteLine("Pages count: " + info.Pages.Count);
Console.WriteLine("Project start date: {0}", info.StartDate);
Console.WriteLine("Project end date: {0}", info.EndDate);
}

Console.WriteLine("\nView info retrieved successfully.");
}
}
// Code continues...
}
```
In this step, replace `"path/to/your/MicrosoftProjectDocument.mpp"` with the actual path to your Microsoft Project document.
## Step 2: Retrieve View Information
```csharp
ProjectManagementViewInfo info = viewer.GetViewInfo(
ViewInfoOptions.ForHtmlView()) as ProjectManagementViewInfo;
```
Here, we utilize the `GetViewInfo()` method to retrieve view information for the specified Microsoft Project document. We specify `ViewInfoOptions.ForHtmlView()` to obtain view information for HTML view.
## Step 3: Display View Information
```csharp
Console.WriteLine("Document type is: " + info.FileType);
Console.WriteLine("Pages count: " + info.Pages.Count);
Console.WriteLine("Project start date: {0}", info.StartDate);
Console.WriteLine("Project end date: {0}", info.EndDate);
```
This step involves displaying the retrieved view information, including the document type, page count, project start date, and project end date.
## Step 4: Conclusion
```csharp
Console.WriteLine("\nView info retrieved successfully.");
```
Finally, we conclude the process by displaying a success message indicating that the view information has been retrieved successfully.

## Conclusion
In this tutorial, we've explored how to utilize Groupdocs.Viewer for .NET to retrieve view information for Microsoft Project documents. By following the outlined steps, you can seamlessly integrate this functionality into your .NET applications, enhancing document management capabilities.
## FAQ's

```
### Is Groupdocs.Viewer for .NET compatible with all versions of the .NET framework?

Yes, Groupdocs.Viewer for .NET is compatible with various versions of the .NET framework, providing flexibility for developers.

### Can I customize the view information retrieval process according to my application's requirements?

Certainly! Groupdocs.Viewer for .NET offers extensive customization options to tailor the retrieval process to your specific needs.

### Does Groupdocs.Viewer for .NET support other document formats apart from Microsoft Project documents?

Absolutely. Groupdocs.Viewer for .NET supports a wide range of document formats, ensuring versatility in document viewing capabilities.

### Is there a community forum or support platform where I can seek assistance with Groupdocs.Viewer for .NET?

Yes, you can visit the [Groupdocs.Viewer forum](https://forum.groupdocs.com/c/viewer/9) for community support and guidance.

### Can I explore the functionalities of Groupdocs.Viewer for .NET before purchasing?

Of course! You can avail of a free trial from the [website](https://releases.groupdocs.com/) to explore the features and capabilities of Groupdocs.Viewer for .NET.
Original file line number Diff line number Diff line change
Expand Up @@ -2,75 +2,91 @@
title: Render Notes and Adjust Time Units (MS Project)
linktitle: Render Notes and Adjust Time Units (MS Project)
second_title: GroupDocs.Viewer .NET API
description:
description: Master rendering MS Project documents with GroupDocs.Viewer for .NET. Render notes, adjust time units, and explore various output formats effortlessly.
type: docs
weight: 11
url: /net/groupdocs-viewer-net-rendering-ms-project-documents/groupdocs-viewer-net-render-notes-and-adjust-time-ms-project/
---

## Complete Source Code
## Introduction
GroupDocs.Viewer for .NET is a powerful document rendering API that allows developers to view and manipulate various document formats within their .NET applications. In this tutorial, we will focus on rendering notes and adjusting time units specifically for MS Project documents.
## Prerequisites
Before we begin, make sure you have the following prerequisites:
1. GroupDocs.Viewer for .NET: Ensure you have downloaded and installed the GroupDocs.Viewer for .NET library. You can download it from [here](https://releases.groupdocs.com/viewer/net/).
2. Development Environment: Set up your preferred development environment with .NET support.
3. MS Project Document: Have a sample MS Project document ready for testing.
## Import Namespaces
First, let's import the necessary namespaces to get started with rendering MS Project documents:
## Step 1: Import Namespaces
```csharp
using GroupDocs.Viewer.Options;
using System;
using System.IO;

namespace GroupDocs.Viewer.Examples.CSharp.AdvancedUsage.Rendering.RenderingOptionsByDocumentType.RenderingMsProjectDocuments
```
Now that we have imported the required namespaces, let's break down each example into multiple steps for a comprehensive understanding.
## Rendering MS Project Document to HTML
To render an MS Project document to HTML format with notes included, follow these steps:
### Step 2: Set Output Directory and File Format
```csharp
string outputDirectory = "Your Document Directory";
string pageFilePathFormat = Path.Combine(outputDirectory, "mpp_result.html");
```
### Step 3: Initialize Viewer Object and Set Options
```csharp
using (Viewer viewer = new Viewer(TestFiles.SAMPLE_MPP))
{
/// <summary>
/// This example demonstrates how to render MS Project document into HTML, JPG, PNG, PDF with notes.
/// </summary>
public class RenderingNotes
{
public static void Run()
{
string outputDirectory = "Your Document Directory";
string pageFilePathFormat = Path.Combine(outputDirectory, "mpp_result.html");

// TO HTML
using (Viewer viewer = new Viewer(TestFiles.SAMPLE_MPP))
{
HtmlViewOptions options = HtmlViewOptions.ForEmbeddedResources(pageFilePathFormat);
options.RenderNotes = true;

viewer.View(options);
}

// TO JPG
pageFilePathFormat = Path.Combine(outputDirectory, "mpp_{0}_result.jpg");

using (Viewer viewer = new Viewer(TestFiles.SAMPLE_MPP))
{
JpgViewOptions options = new JpgViewOptions(pageFilePathFormat);
options.RenderNotes = true;

viewer.View(options);
}

// TO PNG
pageFilePathFormat = Path.Combine(outputDirectory, "mpp_{0}_result.png");

using (Viewer viewer = new Viewer(TestFiles.SAMPLE_MPP))
{
PngViewOptions options = new PngViewOptions(pageFilePathFormat);
options.RenderNotes = true;

viewer.View(options);
}

// TO PDF
pageFilePathFormat = Path.Combine(outputDirectory, "mpp_result.pdf");

using (Viewer viewer = new Viewer(TestFiles.SAMPLE_MPP))
{
PdfViewOptions options = new PdfViewOptions(pageFilePathFormat);
options.RenderNotes = true;

viewer.View(options);
}

Console.WriteLine($"\nSource document rendered successfully.\nCheck output in {outputDirectory}.");
}
}
}

HtmlViewOptions options = HtmlViewOptions.ForEmbeddedResources(pageFilePathFormat);
options.RenderNotes = true;
```
### Step 4: Render Document to HTML
```csharp
viewer.View(options);
```
## Rendering MS Project Document to Image Formats
You can also render MS Project documents to image formats like JPG and PNG. Here's how:
### Step 5: Set Output Directory and File Format for JPG
```csharp
pageFilePathFormat = Path.Combine(outputDirectory, "mpp_{0}_result.jpg");
```
### Step 6: Initialize Viewer Object and Set JPG Options
```csharp
using (Viewer viewer = new Viewer(TestFiles.SAMPLE_MPP))
{
JpgViewOptions options = new JpgViewOptions(pageFilePathFormat);
options.RenderNotes = true;
```
### Step 7: Render Document to JPG
```csharp
viewer.View(options);
```
Repeat similar steps for rendering to PNG and other image formats.
## Rendering MS Project Document to PDF
To render an MS Project document to PDF format, proceed as follows:
### Step 8: Set Output Directory and File Format for PDF
```csharp
pageFilePathFormat = Path.Combine(outputDirectory, "mpp_result.pdf");
```
### Step 9: Initialize Viewer Object and Set PDF Options
```csharp
using (Viewer viewer = new Viewer(TestFiles.SAMPLE_MPP))
{
PdfViewOptions options = new PdfViewOptions(pageFilePathFormat);
options.RenderNotes = true;
```
### Step 10: Render Document to PDF
```csharp
viewer.View(options);
```

## Conclusion
Congratulations! You have successfully learned how to render MS Project documents and adjust time units using GroupDocs.Viewer for .NET. Incorporate this knowledge into your projects to enhance document viewing capabilities.
## FAQ's
### Can I render MS Project documents to other formats apart from HTML, images, and PDF?
Yes, GroupDocs.Viewer for .NET supports rendering to various formats such as DOCX, XLSX, PPTX, and more.
### Is there a trial version available for GroupDocs.Viewer for .NET?
Yes, you can get a free trial from [here](https://releases.groupdocs.com/).
### How can I get temporary licensing for GroupDocs.Viewer for .NET?
Visit [this link](https://purchase.groupdocs.com/temporary-license/) to obtain a temporary license.
### Where can I find documentation for GroupDocs.Viewer for .NET?
Refer to the documentation [here](https://reference.groupdocs.com/viewer/net/).
### Where can I seek support or ask questions related to GroupDocs.Viewer for .NET?
You can visit the support forum [here](https://forum.groupdocs.com/c/viewer/9).
Original file line number Diff line number Diff line change
Expand Up @@ -2,48 +2,87 @@
title: Render Specific Project Time Interval (MS Project)
linktitle: Render Specific Project Time Interval (MS Project)
second_title: GroupDocs.Viewer .NET API
description:
description: Integrate GroupDocs.Viewer for .NET seamlessly into your applications for efficient document viewing. Enhance productivity with versatile rendering capabilities.
type: docs
weight: 12
url: /net/groupdocs-viewer-net-rendering-ms-project-documents/groupdocs-viewer-net-render-project-time-interval-ms-project/
---
## Introduction
In the realm of software development, efficient handling and rendering of various document formats are paramount. Whether it's for document viewing or manipulation, having the right tools can significantly enhance productivity and streamline processes. GroupDocs.Viewer for .NET stands out as a versatile solution, offering developers the ability to seamlessly integrate document viewing capabilities into their .NET applications.
## Prerequisites
Before diving into the integration of GroupDocs.Viewer for .NET, ensure you have the following prerequisites:
### 1. Familiarity with .NET Framework
Ensure you have a basic understanding of the .NET framework, including C# programming language and Visual Studio IDE.
### 2. Installation of GroupDocs.Viewer for .NET
Download and install GroupDocs.Viewer for .NET from the [download link](https://releases.groupdocs.com/viewer/net/). Follow the installation instructions provided to set up the library within your development environment.
### 3. Valid License or Temporary License
Acquire a valid license from [GroupDocs](https://purchase.groupdocs.com/buy) or obtain a temporary license from [here](https://purchase.groupdocs.com/temporary-license/) to utilize the full functionality of GroupDocs.Viewer for .NET.
### 4. Sample Document
Have a sample document, such as an MS Project file, ready for testing the rendering functionality.

## Import Namespaces
Incorporate the necessary namespaces into your project to access the functionalities provided by GroupDocs.Viewer for .NET.

## Complete Source Code
```csharp
using System;
using System.IO;
using GroupDocs.Viewer.Options;
using GroupDocs.Viewer.Results;
```

namespace GroupDocs.Viewer.Examples.CSharp.AdvancedUsage.Rendering.RenderingOptionsByDocumentType.RenderingMsProjectDocuments
{
/// <summary>
/// This example demonstrates how to render project document within the specified time interval.
/// </summary>
class RenderProjectTimeInterval
{
public static void Run()
{
string outputDirectory = "Your Document Directory";
string pageFilePathFormat = Path.Combine(outputDirectory, "page_{0}.html");

using (Viewer viewer = new Viewer(TestFiles.SAMPLE_MPP))
{
HtmlViewOptions options = HtmlViewOptions.ForEmbeddedResources(pageFilePathFormat);

ProjectManagementViewInfo viewInfo =
viewer.GetViewInfo(ViewInfoOptions.FromHtmlViewOptions(options)) as ProjectManagementViewInfo;

options.ProjectManagementOptions.StartDate = viewInfo.StartDate;
options.ProjectManagementOptions.EndDate = viewInfo.StartDate.AddDays(7);

viewer.View(options);
}

Console.WriteLine($"\nSource document rendered successfully.\nCheck output in {outputDirectory}.");
}
}
}


Let's break down the example of rendering a specific project time interval from an MS Project file into multiple steps:
## Step 1: Define Output Directory
```csharp
string outputDirectory = "Your Document Directory";
```
Specify the directory where the rendered HTML pages will be saved.
## Step 2: Define Page File Path Format
```csharp
string pageFilePathFormat = Path.Combine(outputDirectory, "page_{0}.html");
```
Set the format for the file path of each rendered HTML page.
## Step 3: Instantiate Viewer Object
```csharp
using (Viewer viewer = new Viewer(TestFiles.SAMPLE_MPP))
```
Create an instance of the Viewer class, passing the path to the sample MS Project file.
## Step 4: Configure HTML View Options
```csharp
HtmlViewOptions options = HtmlViewOptions.ForEmbeddedResources(pageFilePathFormat);
```
Configure HTML view options for rendering, specifying the format for embedded resources.
## Step 5: Retrieve Project Management View Information
```csharp
ProjectManagementViewInfo viewInfo = viewer.GetViewInfo(ViewInfoOptions.FromHtmlViewOptions(options)) as ProjectManagementViewInfo;
```
Retrieve project management view information to determine the start and end dates of the project.
## Step 6: Set Start and End Dates
```csharp
options.ProjectManagementOptions.StartDate = viewInfo.StartDate;
options.ProjectManagementOptions.EndDate = viewInfo.StartDate.AddDays(7);
```
Set the start and end dates for the project interval to be rendered.
## Step 7: Render Document
```csharp
viewer.View(options);
```
Initiate the rendering process with the specified options.
## Step 8: Display Output Directory
```csharp
Console.WriteLine($"\nSource document rendered successfully.\nCheck output in {outputDirectory}.");
```
Notify the user about the successful rendering and display the directory where the output is saved.

## Conclusion
Integrating GroupDocs.Viewer for .NET into your projects empowers you to efficiently handle document viewing tasks, enhancing user experience and productivity. By following the step-by-step guide provided, you can seamlessly incorporate document rendering functionalities into your .NET applications.
## FAQ's
### Is GroupDocs.Viewer for .NET compatible with all document formats?
GroupDocs.Viewer for .NET supports a wide range of document formats, including Microsoft Office, PDF, CAD, and more.
### Can I customize the appearance of rendered documents?
Yes, you can customize various aspects of the rendering process, such as page layout, watermarking, and page rotation.
### Is GroupDocs.Viewer for .NET suitable for web applications?
Absolutely, GroupDocs.Viewer for .NET can be seamlessly integrated into web applications to provide document viewing capabilities.
### Does GroupDocs.Viewer for .NET offer support for mobile platforms?
Yes, GroupDocs.Viewer for .NET supports mobile platforms, allowing you to create applications with responsive document viewing features.
### Is there a community forum where I can seek assistance with GroupDocs.Viewer for .NET?
Yes, you can visit the [GroupDocs.Viewer forum](https://forum.groupdocs.com/c/viewer/9) to ask questions, share ideas, and interact with other users and developers.

0 comments on commit 646f32b

Please sign in to comment.