Create or Edit XPS Documents Programmatically in C++

Create PS EPS XPS Documents in C++

Aspose.Page for C++ is a valuable addition to Aspose.Page Product Family which is developed for manipulation of PostScript (PS/EPS) and XPS documents using C++. Aspose.Page for C++ is a native C++ library for creating new XPS files as well as modifying and converting the existing PostScript and XPS documents programmatically. The API also lets you work with the pages and elements such as canvases and glyphs in the XPS documents. Furthermore, it supports converting the documents to PDF and raster images. This article demonstrates how to perform the following operations related to XPS documents using Aspose.Page for C++.

  • Create a new XPS document in C++
  • Edit an existing XPS document in C++
  • Add a page or document to an XPS document in C++

Installation of XPS API for C++

Aspose.Page for C++ is hosted on the NuGet as well as available as downloadable binaries. The downloadable package also contains a C++ console application containing the source code of basic examples.

Create an XPS Document in C++

The following are the simple steps to create an XPS document containing text and image using Aspose.Page for C++.

The following code sample shows how to create an XPS document in C++.

Output

Edit PS EPS XPS Document C++

Edit an XPS Document in C++

The following are the steps to edit an existing XPS document:

  • Create an object of the XpsDocument class and initialize it with the XPS document’s path.
  • Access the document’s elements using the XpsDocument object.
  • Save the updated document using the Save method.

The following code sample shows how to edit an existing XPS document in C++.

Add Page and Document to XPS in C++

Aspose.Page for C++ also lets you add pages as well as multiple documents in an XPS document. The following are the steps to create a new XPS document and add an additional page and document.

  • Create an object of the XpsDocument class.
  • Use AddPage and AddDocument methods to add page and document respectively.
  • Use the SelectActiveDocument method to select the active document for processing.
  • Add text or image to the document.
  • Save the document.

The following code sample shows how to add additional pages and documents to XPS using C++.

Learn more about Aspose.Page for C++

You can learn more about Aspose.Page for C++ using the documentation and the source code examples available on GitHub.

Posted in Aspose.Page Product Family | Tagged , , | Leave a comment

Read or Create Projects on Project Server and Project Online using C# .NET

Project Server and Project Online in C# ASP.NET

The Project Online and Project Server are the feature-rich project and portfolio management solutions provided by Microsoft. Both the solutions offer almost a similar range of features for creating and managing projects, however, they differ based on which solution fits well with your requirements. For example, if you want the on-premise solution with more control over the hardware and software then you may opt Project Server. On the other hand, Project Online serves as a cloud-based instance of Project Server without requiring your own infrastructure.

There might be the case when to need to access the information of the projects from Project Server/Online from within your applications. In order to deal with such cases, in this article, I’ll show you how to create/read the projects on/from Project Server or Project Online within your .NET applications (ASP.NET, etc.) or web services using C#.

C# API for Project Server/Online

For creating the new projects and reading the existing ones from Project Server/Online, we’ll use Aspose.Tasks for .NET. It is a cross-platform class library for reading and writing MS Project files programmatically in .NET Standard or .NET Core applications. The API is hosted on NuGet as well as available as an MSI package and zipped DLL in the Downloads section.

Working with Project Server

In this section, I’ll show you how to connect to the Project Server and read or create the projects. In order to connect to the Project Server, you need to know the following details:

  • Project Server’s URL i.e. https://contoso.sharepoint.com
  • Domain i.e. contoso.com
  • Username
  • Password

Read Projects from Project Server in C#

The following are the steps to connect to Project Server and retrieve the projects list from it.

The following code sample shows how to read projects from Project Server in C#.

Create Project on Project Server in C#

Creating a project on Project Server is as simple as pie. Simply connect to Project Server in the same way you have done in the previous example, load the project file (.mpp) using Project class and call ProjectServerManager.CreateNewProject() method.

The following code sample shows how to create a new project on Project Server in C#.

Working with Project Online

Working with Project Online is quite similar to working with Project Server and it only differs in creating the connection. In order to connect to Project Online, you need to know the following details:

  • URL
  • Username
  • Password

Read Projects from Project Online in C#

The following are the steps to read projects from Project Online:

The following code sample shows how to retrieve the list of projects from Project Online.

Create a Project on Project Online in C#

The following are the steps to create a new project on Project Online:

The following code sample shows how to create a new project on Project Online in C#.

Learn more about Aspose.Tasks for .NET

You can learn more about project management using Aspose.Tasks for .NET from the documentation.

Posted in Aspose.Tasks Product Family | Tagged , | Leave a comment

Convert PDF File to PowerPoint Presentation in C#

This article contains the steps and code samples to convert PDF to PPT or PPTX programmatically in C#.

Convert PDF to PPT C#

PDF is one of the widely used formats for exchanging documents with reliability without worrying about layout issues. The PowerPoint presentations (PPT/PPTX), on the other hand, have made it easier to present the data or information in the form of interactive slides. In some cases, the information contained in a PDF file is needed to be presented as a PowerPoint presentation. For such a case, you can minimize the efforts by automating the process of importing information from PDF to PowerPoint PPT/PPTX.

In order to deal with the above-mentioned scenario, this article will demonstrate how to:

  • Convert PDF to PowerPoint PPT or PPTX in C#.
  • Convert PDF to PowerPoint PPT or PPTX with slides as images in C#.
  • Track PDF to PowerPoint conversion progress.

C# API for PDF to PowerPoint Conversion

In order to convert PDF to PPT or PPTX, we’ll use Aspose.PDF for .NET which is a powerful PDF API to create, process and convert PDF documents. Aspose.PDF for .NET is available on NuGet as well as in the form of DLL in the Downloads section.

Convert PDF to PPT or PPTX in C#

The following are the steps to convert a PDF file to a PowerPoint presentation using Aspose.PDF for .NET.

The following code sample shows how to convert PDF to PPT in C#.

PDF Document

Converted PowerPoint PPT

Convert PDF to PPT in C# – Rendering Slides as Images

In case you want to avoid having selectable text in the converted PowerPoint presentation, you can render each slide as an image. For this, you can set PptxSaveOptions.SlidesAsImages property to true and the rest of the steps will remain the same.

The following code sample shows how to convert PDF to PPT having slides as images in C#.

Track PDF to PPT Conversion Progress

You may also track the progress of the PDF to PPT conversion process using Aspose.PDF for .NET. The following information can be retrieved about the conversion process:

  • Total progress of the conversion
  • End of analysis of each page before conversion
  • Creation of result page before physical export
  • Export of each result page

The following code sample shows how to track the PDF to PPT conversion in C#.

Output

Related Articles

Posted in Aspose.PDF Product Family | Tagged , , , , | Leave a comment

Create PDF Files Dynamically using PDF API for C++

With the power of the Internet, everything has gone digital and paperless systems have become popular. The digital documents, i.e. PDF, are among the building blocks of paperless systems that have made life easier by providing automated generation and processing features. Most of the businesses use PDF document automation for generating reports, receipts, invoices, and other business documents dynamically. Therefore, in this article, I’ll demonstrate how to integrate the features of PDF automation in C++ based applications and generate PDF files dynamically using C++.

PDF API for C++

For creating PDF files, we’ll use Aspose.PDF for C++ API which is a native C++ library to work with PDF documents programmatically. It allows you to create interactive PDF documents with the support of a variety of PDF elements. Aspose.PDF for C++ is available on NuGet as well as in the Downloads section of Aspose.

Create a Simple PDF File in C++

First of all, we will create a simple PDF file and add some text to the first page in the form of a paragraph. The following are the steps to be followed:

  • Create a Document object.
  • Add a page to PageCollection of the Document.
  • Get the paragraph of the page.
  • Create a TextFragment object and add it to the paragraph.
  • Save the PDF document.

The following code sample shows how to create a PDF document in C++.

Output

Create PDF Files in C++

Create a PDF File using TextBuilder in C++

In this section, I’ll show you how to use the TextBuilder class to append various text fragments and paragraphs on the page. Furthermore, in this example, you will learn how to set the position of the text fragment on the page. The following are the steps to perform this operation:

  • Create a Document object.
  • Add a page to the document.
  • Create a TextBuilder object.
  • Create a TextFragment and add its text.
  • Set the position of the TextFragment.
  • Append TextFragment using the TextBuilder.
  • Save PDF document.

The following code sample shows how to create a PDF using TextBuilder in C++.

Output

C++ PDF API

Create a PDF File with Image in C++

You can also create and add images to the PDF documents using Aspose.PDF for C++. The following are the steps to perform this operation:

  • Create a Document object.
  • Add a page to the document.
  • Create an image to be added.
  • Add the image to the PDF file.
  • Save PDF file.

The following code sample shows how to create and add an image to a PDF document in C++.

Output

C++ PDF Library

Create a PDF File with Attachments in C++

The PDF format also allows adding attachments to the document. There is a variety of file formats that can be added as an attachment to the PDF file. The following are the steps to embed a file in PDF using Aspose.PDF for C++:

  • Load a file to be attached in SharedPtr<FileSpecification>.
  • Create an object of Document class.
  • Embed the file to the Document.
  • Save the PDF file.

The following code sample shows how to add an attachment to the PDF document in C++.

Output

Generate PDF in C++

Learn more about Aspose.PDF for C++

You can learn more about Aspose.PDF for C++ from the documentation and source code examples.

Posted in Aspose.PDF Product Family | Tagged , , , | Leave a comment

Create Rich Word Documents Programmatically in Java

In recent years, the dynamic generation of Word documents has become a popular feature for composing reports, quotes, invoices, and other types of documents. Various manufacturing companies generate invoices based on the data stored in the databases. In such cases, the document automation makes it possible to save time, efforts and resources required in the manual document creation process. This article aims to target the document automation process and lets you know how to create rich Word documents programmatically in Java.

Java Word API

In this article, we’ll use Aspose.Words for Java which is a feature-rich API to create, edit or convert Word documents in Java-based applications. You can download the API’s JAR or install it using the following Maven configurations:

Repository

<repository>
    <id>AsposeJavaAPI</id>
    <name>Aspose Java API</name>
    <url>https://repository.aspose.com/repo/</url>
</repository>

Dependency

<dependency>
    <groupId>com.aspose</groupId>
    <artifactId>aspose-words</artifactId>
    <version>20.2</version>
    <classifier>jdk17</classifier>
</dependency>

In the following sections, you’ll learn how to create a Word document containing different elements such as text, paragraph, table, list, images, etc. programmatically using Java.

Create a Word Document using Java

Most of the time, a considerable portion of the content in a Word document is based on the text. Therefore, we’ll start our journey by creating a Word document with a heading and a paragraph. The following are the steps to perform this operation using Aspose.Words for Java:

The following code sample shows how to create a Word document containing text in Java.

Output

Create Word Document in Java

Create a Table in Word Document using Java

Tables in the Word documents are used to organize the content in the form of rows and columns. In this section, we’ll create a simple table containing two rows and two columns. Creating a table includes four basic operations:

  • Starting the table
  • Inserting a cell
  • Ending the row
  • Ending the table

The following are the step to create a table in Word document:

The following sample shows how to create a table in Word document in Java.

Output

Create table in Word document in Java

Create a List in Word Document using Java

The following are the steps to add a list to the Word document.

  • Create an object of Document class.
  • Add your desired type of list to the document using Document.getLists().add() method.
  • Get the list from the document into a List object.
  • Populate the list using the DocumentBuilder object.
  • Save the document.

The following code sample shows how to create a list in Word document using Java.

Output

Create list in Word document in Java

Insert an Image into Word Document using Java

The insertion of an image into a Word document is as simple as pie. The following are some simple steps to perform this operation:

The following code sample shows how to insert an image to the Word document using Java.

Output

Insert Image in Word Document in Java

Read More About Aspose.Words for Java

You can read more about how to insert various elements into a Word document using Aspose.Words for Java.

Try Aspose.Words for Java for Free

You can get a free temporary license to try and use Aspose.Words for Java without trial limitations.

Posted in Aspose.Words Product Family | Tagged , , , | Leave a comment