Convert Word (DOC, DOCX) to Byte Array

Share on FacebookTweet about this on TwitterShare on LinkedIn

Aspose.Words API provides the simplest way to serialize a Microsoft Word document from DOC or DOCX format to a byte array.

The conversion of a Word document to a byte array is helpful when storing documents to the database and/ or then retrieving from the database.

Aspose.Words API provides the functionality to manipulate Microsoft Word files without using Microsoft Word. If you do not have Aspose.Words API installed, please follow the instructions given on installation page for .NET and installation page for using with Java.

Convert a Word Document to a Byte Array using .NET

Aspose.Words for .NET can be used to convert a Document object to obtain a byte array representing the Document in any .NET application.
The following code snippet demonstrates the conversion of a DOC file to a byte array.

// Load the document from disk.
Document doc = new Document("Sample.doc");

// Create a new memory stream.
MemoryStream outStream = new MemoryStream();
// Save the document to stream.
doc.Save(outStream, SaveFormat.Docx);

// Convert the document to byte form.
byte[] docBytes = outStream.ToArray();

// The bytes are now ready to be stored/transmitted.

// Now reverse the steps to load the bytes back into a document object.
MemoryStream inStream = new MemoryStream(docBytes);

// Load the stream into a new document object.
Document loadDoc = new Document(inStream);
// Save the document.
loadDoc.Save("loadDoc.docx",SaveFormat.Docx);

Convert a Word Document to a Byte Array using Java

The following code snippet demonstrates the conversion of a DOC file to a byte array using Aspose.Words for Java API.

// Load the document.
Document doc = new Document("Sample.doc");

// Create a new memory stream.
ByteArrayOutputStream outStream = new ByteArrayOutputStream();
// Save the document to stream.
doc.save(outStream, SaveFormat.DOCX);

// Convert the document to byte form.
byte[] docBytes = outStream.toByteArray();

// The bytes are now ready to be stored/transmitted.

// Now reverse the steps to load the bytes back into a document object.
ByteArrayInputStream inStream = new ByteArrayInputStream(docBytes);

// Load the stream into a new document object.
Document loadDoc = new Document(inStream);
// Save the document.
loadDoc.Save("loadDoc.docx",SaveFormat.Docx);
Posted in Aspose.Words Product Family, Aspose.Total Product Family | Tagged , , , , , , , | Leave a comment

Work with PSB File Format

Share on FacebookTweet about this on TwitterShare on LinkedIn

Aspose.PSD now supports the PSB file format. The PSB (Photoshop Big file) is an Adobe Photoshop Large Document file. Only a few users of Adobe Photoshop know about the existence of the PSB file format but all are familiar with the PSD file format. The PSB format is similar to PSD format except that PSB supports larger files, both in image dimension and overall size.

The PSD file format is limited to 30K x 30K pixels, which is the main file format used by Adobe Photoshop. PSBs, on the other hand, supports documents up to 300K pixels in any dimension, which is plenty even for graphics designers who often need to work with ultra-high resolutions. A PSB file supports layers, effects, filters, and all other features of Adobe Photoshop. It is also possible to save HDR images with the PSB file format.

How to Convert a PSB File

Using Aspose.PSD you can convert existing PSB files directly into PSD, PDF, JPEG and several other formats without any loss of quality. In this article, we will demonstrate how you can convert PSB files to other formats.

Convert PSB to JPEG

You can export an existing PSB file to JPEG using Aspose.PSD. The API has JpegOptions class which allows you to convert PSB to JPEG.

The following code demonstrates the conversion of PSB to JPEG using C#.

Convert PSB to PDF

Converting PSB to PDF is similar to conversion to JPEG as shown above. The API has PdfOptions class that allows you to export PSB file to PDF format.

Convert PSB to PSD

Using PsdOptions class you can export existing PSB file to PNG format. The following code snippet demonstrates how to convert PSB to PSD.

For more information, please visit the Developer’s Guide for your complete reference on what you can deliver using the Aspose.PSD APIs. You can also check out other examples at Github.

Posted in Aspose.PSD Product Family | Leave a comment

Support for SVG Resize and Monitoring Document conversion using Aspose.Imaging

Share on FacebookTweet about this on TwitterShare on LinkedIn

Hi guys! I am pleased to share release announcement for Aspose.Imaging 19.11, which has been enhanced with new features including support for resizing SVG Images and monitoring document conversion progress. One of the best things about Aspose team is that it publishes both .NET and Java APIs simultaneously every month. This way users of both APIs can use the newly added features simultaneously.

In the following sections, I am going to give you a walk through of new features and enhancements made in API.

Resize SVG formats

SVG is a Scalable Vector Graphics file format and utilizes XML based content to depict the graphics. The SVG file format can be scaled to various sizes without affecting the quality as content is utilized to render the graphics in image. In other words, SVG format is independent of resolution. For this purpose a new method resize has been added in Aspose.Imaging that one can use to alter size of SVG files to desired ones.

The following example demonstrate use of this feature:

The similar Java based implementation is as under:

Support for Document Conversion Progress

Some times, you work with large image files and when rendering such files to other format there is a long wait depending on size of file to complete rendering process. In such circumstances, it is very convenient to determine the progress of the conversion as it can be useful when if you intend to show some status to the end user regarding conversion process. For this purpose a new property ProgressCallback has been added in Aspose.Imaging.

The following examples demonstrate use of this feature:

The similar Java based implementation is as under:

Hold on, there are many other features, enhancements, and bug fixes included in this release. You can refer to our Release Notes section to get more details.

When time allows you can also check out ready made examples at Github. You may also talk about this release and other API related issues in our product support forum.

Posted in Aspose.Total Product Family | Leave a comment

Get 25% off Aspose.Total – Aspose Newsletter December 2019

Share on FacebookTweet about this on TwitterShare on LinkedIn
  LinkedIn YouTube Twitter Facebook
Monthly Newsletter

December 2019

 

Product News  Product News

 
 
Aspose.OCR – coming soon for C++

Aspose.OCR has been available for .NET and Java Platforms and receiving appreciation since its first release. We are honored to announce its upcoming release for C++ Platform. First version of the API will offer all basic features which Aspose.OCR for .NET has been offering. An upgraded OCR engine will be part of the API with which high performance can be achieved. You will be able to recognize textual content over the images and apply different filters during OCR operation. Read more details here.

 
 
 
First version of Aspose.Tasks for C++ has been released

Aspose.Tasks for C++ is a native Project Management Library for C++ developers to load, create, manipulate and save Microsoft Project documents to multiple formats without using Microsoft Project or Office Automation. API exposes project data for reporting in a number of ways including Gantt Chart, Task Usage, Resource Usage, and Resource Sheet among many others. The C++ project management library offers complete project planning, definition, and tracking capabilities allowing the developers to create and load tasks as well as assign or remove resources to or from tasks from their own applications. Read more details here.

 
 
 
Aspose.Font for .NET is coming soon

Dealing with Fonts and their glyphs to map dimensions and colors is not a trivial task and it definitely needs a significant amount of time to get it completed. Aspose.Font for .NET will help programmers deal with fonts in their .NET applications with ease. The first version is going to be released soon, and It will provide the capability to read fonts (TTF and CFF) as well as their statistics. Read more details here.

 
 
 
AMP HTML Emails are now supported by Aspose.Email

AMP (Accelerated Mobile Pages) is a developer’s package from Google that allows developing a lightweight system with more rapid loads. AMP is a framework made up of HTML, JavaScript and CSS, which are the standard to provide a user-first format for web content. By using parts of Google’s AMP Project for email, we presently possess a plenty list of components to be used. The primary advantage of this approach is to increase message download speed, that is critical while working with users. So right now all customers of Aspose.Email can use AMP HTML to provide the same familiar messages but a little bit faster. Read more details here.

 
 
 
Create 7Z Archive Files with LZMA Compression using Aspose.ZIP for .NET

7z is an archiving format for compressing files and folders with a high compression ratio. It is based on Open Source architecture which makes it possible to use any compression and encryption algorithms. The 7z archive composition is now implemented with Lempel–Ziv–Markov chain algorithm LZMA compression in Aspose.ZIP for .NET. Read more details here.

 
 
 
Generate Swiss QR Code with Aspose.BarCode for .NET

One of the important usages of Swiss QR Code is to replace the previous payment slips. For this purpose, detailed information is required to trigger payments and process the QR invoices. Aspose.BarCode has provided all those necessary payment information by introducing new classes SwissQRBill and SwissQRCodetext which provide a large number of properties required to work with the Swiss QR Codes. Read more details here.

 
 
 
Work with Web Extensions and Task Panes with Aspose.Words

Web Extensions add additional functionality to MS Office applications to improve the user experience and productivity. Aspose.Words API provides the WebExtensions namespace that provides various classes to customize elements and attributes extending the XML vocabulary for representing Office Add-ins. You can now use Aspose.Words for .NET and Java to work with Task Panes in Office Add-ins and Web Extensions. Read more details here.

 
 

Product News  From the Library

 
 
Code Example: Track conversion progress of Excel files with Aspose.Cells for .NET

Suppose you are working with large Excel files and converting them to other formats. Sometimes it might take a lot of time for conversion and you want your users to be aware of the progress. No worries!!! The latest release has provided the demanded feature to check the conversion progress of MS Excel files. The IPageSavingCallback interface provides PageStartSaving and PageEndSaving methods that you can implement in your custom class. Read more details here.

 
 
 
Code Example: Set Prompt Text in a Placeholder with Aspose.Slides for C++

A Prompt Text is a content that shows up in a content field when it is first loaded, however, it disappears when a client begins composing the content field. Standard and pre-built layouts contain placeholders with default text like Click to add a title or Click to add subtitle. With Aspose.Slides, you can now add custom Prompt Text by accessing the default placeholders. Read more details here.

 
 
 
Code Example: Convert Word documents to multipage TIFF images with Aspose.Words for C++

One of the useful things you may need to do with your Word document (such as DOCX, DOC, RTF and many more) is a conversion to image file(s). For example if you have to present your Word document in a readable and printable but not editable format (e.g. for a publication on the Web). One of the simple approaches you could use is a conversion to a multipage TIFF file. Read more details here.

 
 
 
Code Example: Read the whole length of the barcode with Aspose.BarCode for .NET

There was an issue while reading whole length of the barcode as the whole text was not read and the partial text was returned by the Aspose.BarCode API. A detailed investigation was done and it was observed that current wiped bar restoration works for NBase only, and need changes which could be implemented for WBase based barcodes. Another problem was the absence of checksum in Code39 barcodes, which was not allowing to check if the result is correct. All these issues were resolved by enabling the wiped bars option. Read more details here.

 
 
 
Code Example: Format horizontal rule with Aspose.Words for .NET

In previous versions of Aspose.Words, you could add the horizontal rule using DocumentBuilder.InsertHorizontalRule method, however, formatting of the horizontal rule was not supported. We have added Shape.HorizontalRuleFormat property and a public class HorizontalRuleFormat in the latest release to format the horizontal rule. You can set height, width, color, alignment, and 3D shading of the horizontal rule. Read more details here.

 
 
 
Code Example: Implement bicubic re-sampling with Aspose.PSD for .NET

Re-sampling means you ought to change the pixel dimensions of an image. When you down-sample, you are actually eliminating pixels and therefore deleting information and details from your image. When you up-sample, you are adding pixels and enhancing details. Photoshop adds these pixels by using interpolation. To know how to do the same with Aspose.PSD for .NET, check. this example.

 
 

Product News  Feedback

 
 
How Can We Help You?

Do you have ideas for what you'd like to see us do in the coming months or have any questions for us? Reply to our newsletter or share your thoughts via the forums. We'll be happy to hear!

 

Aspose for .NETAspose for JavaAspose for C++Aspose for Androidaspose.cloud

 

Product Releases and Updates

 
 

Aspose.Total for .NET – The latest versions of our .NET APIs packaged into one product suite.

Aspose.Total for Java – The latest versions of our Java APIs packaged into one product suite.

Aspose.Total for C++ – The latest versions of our C++ APIs packaged into one product suite.

Aspose.Total for Android via Java – The latest versions of our Android products packaged into one product suite.

Aspose.Total for Reporting Services – The latest versions of our SSRS products packaged into one product suite.

Aspose.Total for SharePoint – The latest versions of our SharePoint products packaged into one product suite.

Aspose.Total for JasperReports – The latest versions of JasperReports products packaged into one product suite.

Check out for all releases during last month

 
Read The Blog Visit Forum
a { color:#21649f; text-decoration:none; font-weight:bold; border:none; outline:none } a:hover { color:#21649f; text-decoration:underline; }
Posted in Customer Newsletters | Tagged | Leave a comment

On Premise APIs for XPS, PS, and EPS – Aspose Newsletter October 2019

Share on FacebookTweet about this on TwitterShare on LinkedIn
  LinkedIn YouTube Twitter Facebook
Monthly Newsletter

October 2019

 

Product News  Product News

 
 
Aspose.OMR – coming soon for Java

Aspose.OMR has been available for .NET Platform and receiving appreciation since its first release. We are honored to announce its upcoming release for Java Platforms. Aspose.OMR for Java is on its way to get released with exciting set of features which will let Java developers implement OMR functionality in their applications. You will be able to read questionnaires, bubble sheets, multiple-choice answer sheets or any survey programmatically. Read more details here.

 
 
 
SXC and FODS file formats are supported by Aspose.Cells

SXC files are the spreadsheets created by StarOffice Calc. It supports formulas, functions, charts, and macros; also includes DataPilot tables, which can automatically extract and summarize data from raw data sets. SXC files are also compatible with Apache OpenOffice Calc and can be exported in Microsoft Excel or IBM Lotus 1-2-3 formats. FODS files are the spreadsheets saved in the OpenDocument format, but stored as a flat XML file instead of the ZIP container used by .ODS files. It allows the spreadsheet information to be more human readable; also can be an easier alternative than the ODS format for generating spreadsheets automatically without needing a spreadsheet editor. Read more details here.

 
 
 
Convert Markdown to PDF with Aspose.PDF

Aspose.PDF for .NET has been maintaining its usability since the beginning by offering exciting and most appealing features consistently. Speaking of which, a new monthly release of the API has already been rolled out and it does not disappoint you because of useful enhancements and productive features. You can now convert a Markdown data file into PDF using the API. Read more details here.

 
 
 
Zimbra and IBM Notes are now supported by Aspose.Email

Zimbra is an email, calendar and collaboration suite built for the cloud. It includes complete email, contacts, calendar, file sharing, tasks and messaging/videoconferencing – all accessed from the Zimbra Web Client from any device. IBM Notes is the client and IBM Domino is the server of a collaborative client-server software platform. IBM Notes provides collaboration features like email, calendars, to-do lists, contacts management, etc. The database file used by IBM Notes is saved in the Notes Storage Facility (NSF) format. Read more details here.

 
 
 
LINQ Reporting with XML, JSON, and CSV data sources

LINQ Reporting Engine is a powerful API supported by Aspose.Words. It enables you to build reports using an extended set of reporting features. The engine enables you to reference business objects of your application in report templates. You can now use XML, JSON, and CSV data sources to generate reports using LINQ Reporting.  Read more details here.

 
 
 
Track conversion progress for Excel to PDF with Aspose.Cells for PHP and Node.js via Java

You are converting a huge Excel file to PDF, watching the loading screen and waiting for the program to finish the task. A lot of patience is required for this and it seems that there should be something which shows the document conversion progress. Both Aspose.Cells for PHP via Java and Aspose.Cells for Node.js via Java support the features to show the document conversion progress page by page. Read more details here.

 
 
 
.NET Standard version 1.3 discontinued since Aspose.BarCode for .NET 19.7

We have discontinued the support of .NET Standard 1.3, and have removed it from our DLL to make the DLL lighter and manageable. You can use Aspose.BarCode for .NET with all of the .NET standard versions after v1.3. All of the legacy code, function calls and features have been removed for this version. Read more details here.

 
 

Product News  From the Library

 
 
Code Example: Detect Hyperlink Type with Aspose.Cells for Java?

There can be different types of hyperlinks which can be used in an Excel file like external, cell reference, file path and email. Our new release has introduced an enumerator TargetModeType which represents the type of hyperlink. A new property LinkType is introduced in Hyperlink class which returns the hyperlink type using above mentioned enumerator. Read more details here.

 
 
 
Code Example: Create OMR Template from Text Markup using Aspose.OMR for .NET?

Aspose.OMR for .NET provides the option to create OMR template (.omr) files and images by using simple text markup. OmrEngine.GenerateTemplate method that takes the path to the markup text file as a parameter, returns a GenerationResult object which contains the template image and the template (JSON that describes elements' location on the image). Read more details here.

 
 
 
Code Example: Create Accessible PDFs with Tagged Tables?

Tagging tables inside a PDF is quite important as it helps ensure that the data listed is listed out in clear and concise manner. A tagged table makes it easier for users to read content from very long tables with repetitive data and also makes it accessible for any viewers who interact with your content that may be using accessible programs. You can now tag tables in a PDF Document for Accessibility using Aspose.PDF for .NET. For this purpose, it provides TableElement Class. In order to create a table, you can use CreateTableElement() Method of ITaggedContent Interface. Read more details here.

 
 
 
Code Example: Deskew a Scanned Image with Aspose.Imaging?

Skew is an artifact that might appear during document scanning process and it consists of getting the document’s text/images be rotated at a slight angle. It can have various causes but the most common are paper getting misplaced during a scan. Therefore, deskew is the process of detecting and fixing this issue on scanned files. So deskewed images will have the text/images correctly and horizontally aligned. Read more details here.

 
 
 
Code Example: Create Repeating Section Content Control?

MS Word allows you to insert the repeating content control with XML mapping in a Word document. You can insert repeating content control around entire paragraphs or table rows. We have added this feature in the latest release of Aspose.Words. A new enumeration type RepeatingSectionItem has been added for this purpose. Read more details here.

 
 
 
Code Example: Managing Paragraphs with Custom Numbered Lists using Aspose.Slides for C++?

Aspose.Slides for C++ supports managing paragraphs with custom numbered lists. For this purpose, NumberedBulletStartWith property has been added to IBulletFormat. In order to add a custom numbered list inside a paragraph, you first need to access the slide and add an AutoShape. Then you have to access the respective TextFrame of the shape and remove the default paragraph from that. Finally, create the first paragraph instance using Paragraph class, and set NumberedBulletStartWith. Read more details here.

 
 

Product News  Feedback

 
 
How Can We Help You?

Do you have ideas for what you'd like to see us do in the coming months or have any questions for us? Reply to our newsletter or share your thoughts via the forums. We'll be happy to hear!

 

Aspose for .NETAspose for JavaAspose for C++Aspose for Androidaspose.cloud

 

Product Releases and Updates

 
 

Aspose.Total for .NET – The latest versions of our .NET APIs packaged into one product suite.

Aspose.Total for Java – The latest versions of our Java APIs packaged into one product suite.

Aspose.Total for C++ – The latest versions of our C++ APIs packaged into one product suite.

Aspose.Total for Android via Java – The latest versions of our Android products packaged into one product suite.

Aspose.Total for Reporting Services – The latest versions of our SSRS products packaged into one product suite.

Aspose.Total for SharePoint – The latest versions of our SharePoint products packaged into one product suite.

Aspose.Total for JasperReports – The latest versions of JasperReports products packaged into one product suite.

Check out for all releases during last month

 
Read The Blog Visit Forum
a { color:#21649f; text-decoration:none; font-weight:bold; border:none; outline:none } a:hover { color:#21649f; text-decoration:underline; }
Posted in Customer Newsletters | Tagged | Leave a comment

Customize Formatting of Horizontal Rule Shape by using Aspose.Words for C++ 19.11

Share on FacebookTweet about this on TwitterShare on LinkedIn

It is our great pleasure to share with you that we have published yet another new release and you can now download Aspose.Words for C++ 19.11 API from the downloads section. Following list highlights the major features and you will also learn how you can use Aspose.Words for C++ 19.11 to:

  • Work with Web Extensions and Task Panes
  • Customize Formatting of Horizontal Rule Shape
  • Aspose.Words for C++ has now improved character spacing calculation when ‘use printer metrics’ option is set
  • Macros support is improved in this release

Work with Web Extensions and Task Panes

Different classes for representing Office Add-ins are now part of the WebExtensions namespace of Aspose.Words for C++. You can now use Aspose.Words for C++ to work with Web Extensions and Task Panes in Office Add-ins. For example, the API now provides new TaskPane class, TaskPaneCollection class, TaskPaneDockState enumeration, Document.WebExtensionTaskPanes property etc.

The following code example can be used to create task panes and add to web extension task panes with basic properties

Customize Formatting of Horizontal Rule Shape

The Shape.HorizontalRuleFormat property is now available in the Aspose.Words for C++ API for accessing the properties of the horizontal rule shape. Basic properties like Height, Color, NoShade etc are now available in the HorizontalRuleFormat class. For example, you can use the following code to set HorizontalRuleFormat to format a horizontal rule shape.

VBA Macros Support Improved

Aspose.Words for C++ API now provides Dcoument.VbaProject property to get or set VbaProject in the Word document. The following code example demonstrates how to create a VBA project and VBA Module along with basic properties e.g. Name and Type.

See Also Useful Links

The resources, you may need to accomplish your tasks:

To get technical support for Aspose.Words for C++, please feel free to post your queries/questions in Aspose.Words for C++ support forum.

Posted in Aspose.Words Product Family | Leave a comment

Convert XLS and XLSX to PDF in C#

Share on FacebookTweet about this on TwitterShare on LinkedIn
Aspose.Cells for .NET logo

This article demonstrates how to convert Excel (XLS, XLSX) files to PDF format. The Portable Document Format (PDF) format developed by Adobe is used as a standard by many organizations to share and store documents. Exporting documents to PDF is a common scenario for many applications. Aspose.Cells for .NET API makes exporting Excel files to PDF a breeze.

Convert XLS, XLSX to PDF

Aspose.Cells for .NET provides easy to use API with which you can convert Excel files to PDF with these simple steps.

  1. Instantiate the Workbook class with the Excel document that you want to convert.
  2. Save the document in PDF format by specifying the save format as PDF by using the SaveFormat Enumeration

The following code snippet demonstrates the conversion process.

// Instantiate the Workbook object with the Excel file
Workbook workbook = new Workbook("SampleExcel.xls");

// Save the document in PDF format
workbook.Save("outputPDF.pdf", SaveFormat.Pdf);

Convert XLS, XLSX to PDF/A Compliant PDF

PDF/A is an ISO-standardized version of PDF that prohibits features that are not suitable for long term archiving. Saving PDF like this ensures that nothing will break in the long run.

The following code snippet demonstrates this feature by creating a new workbook and saving it in PDF/A Compliant PDF format using the PdfSaveOptions class.

// Instantiate new workbook
Workbook workbook = new Workbook();

// Insert a value into the cell A1
workbook.Worksheets[0].Cells[0, 0].PutValue("Testing PDF/A");

// Define PdfSaveOptions
PdfSaveOptions pdfSaveOptions = new PdfSaveOptions();

// Set the compliance type
pdfSaveOptions.Compliance = PdfCompliance.PdfA1b;

// Save the file
workbook.Save(dataDir + "output.pdf", pdfSaveOptions);

Track XLS, XLSX to PDF conversion

Aspose.Cells for .NET provides the ability to track the conversion progress by providing the IPageSavingCallback interface. You can create a custom class that implements this interface and assign its instance to PdfSaveOptions.PageSavingCallback property.

The following code snippet demonstrates how to track the conversion progress.

//load the workbook
Workbook workbook = new Workbook("PagesBook1.xlsx");

PdfSaveOptions pdfSaveOptions = new PdfSaveOptions();

//assign the custom class that implements IPageSavingCallback interface
pdfSaveOptions.PageSavingCallback = new TestPageSavingCallback();

workbook.Save("DocumentConversionProgress.pdf", pdfSaveOptions);

The following is the custom class that implements the IPageSavingCallback interface.

public class TestPageSavingCallback : IPageSavingCallback
{
    public void PageStartSaving(PageStartSavingArgs args)
    {
        Console.WriteLine("Start saving page index {0} of pages {1}", args.PageIndex, args.PageCount);

        //pages before page index 2 are not rendered.
        if (args.PageIndex < 2)
        {
            args.IsToOutput = false;
        }
    }

    public void PageEndSaving(PageEndSavingArgs args)
    {
        Console.WriteLine("End saving page index {0} of pages {1}", args.PageIndex, args.PageCount);

        //pages after page index 8 are not rendered.
        if (args.PageIndex >= 8)
        {
            args.HasMorePages = false;
        }
    }
}

For more information on converting Excel files to PDF, head on over to our documentation, Convert Excel Workbook to PDF. To get started with the API, get the free version using the Nuget Package Manager or download directly from here.

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

Convert MPP to PDF in C++

Share on FacebookTweet about this on TwitterShare on LinkedIn

This article demonstrates how to convert a Microsoft Project data to a PDF file using Aspose.Tasks for C++ which is an easy to use API for manipulating project files. This API provides reading and writing of MPP files without using Microsoft Project. If you do not have Aspose.Tasks for C++ API installed, please follow the instructions given on installation page.

The .mpp is the default file extension introduced by Microsoft Project. It typically contains a list of tasks that make up a particular project and allow the critical path of a project to be defined. PDF is a “multi-platform” file type supported by all existing platforms like Windows, Linux and MAC etc.

Convert a Project MPP to a Single PDF

Aspose.Tasks for C++ simplifies the functionality of exporting any project data to PDF in your C++ based applications with a two-step process:

  1. Load a project file
  2. Save it as a PDF

The following code snippet demonstrates the conversion of a project file to a single PDF file.

// Read the input Project file
System::SharedPtr<Project> project = System::MakeObject<Project>(dataDir + u"Project.mpp");
    
// Save the Project as PDF
project->Save(dataDir + u"SaveProjectAsPDF_out.pdf", Aspose::Tasks::Saving::SaveFileFormat::PDF);

Convert a Project MPP to Multiple PDF Files

Aspose.Tasks for C++ also allows to render complete project data into multiple PDF files by setting the SaveToSeparateFiles flag to TRUE as demonstrated below:

System::SharedPtr<Project> project = System::MakeObject<Project>(dataDir + u"Software Development Plan.mpp");
System::SharedPtr<PdfSaveOptions> saveOptions = System::MakeObject<PdfSaveOptions>();
saveOptions->set_SaveToSeparateFiles(true);
saveOptions->set_Pages(System::MakeObject<System::Collections::Generic::List<int32_t>>());
saveOptions->get_Pages()->Add(1);
saveOptions->get_Pages()->Add(4);
project->Save(dataDir + u"SaveToMultiplePDFFiles_out.pdf", System::StaticCast<Aspose::Tasks::Saving::SaveOptions>(saveOptions));

For more information regarding adjusting the column size and font settings while converting any MPP to a PDF, you may go through Convert Project to PDF in the C++ section of the API documentation.

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

Convert PDF to Word (DOC, DOCX) in C#

Share on FacebookTweet about this on TwitterShare on LinkedIn
aspose-pdf-for-net

My previous article, Convert PDF to HTML in C#, showed how to convert a PDF file to HTML in your .NET applications using Aspose.PDF for .NET API. Today, I am going to demonstrate another interesting feature of the API to convert PDF files to Word documents i.e. DOC and DOCX. Earlier versions of Microsoft Word saved documents in binary format with .doc extension. With the release of Office 2007, Microsoft adopted the Office Open XML (OOXML) that is based on a combination of XML and binary files combined together as ZIP archives. Word now uses .docx as the default extension for saving documents.

Convert PDF to Word DOC

Aspose.PDF for .NET lets you read and convert PDF files to Word documents in your .NET applications with simple lines of code. The API can be used in both .NET WinForms and ASP.NET application using C# and other .NET programming languages.

// The path to the documents directory.
string dataDir = RunExamples.GetDataDir_AsposePdf_DocumentConversion();          
            
// Open the source PDF document
Document pdfDocument = new Document(dataDir + "PDFToDOC.pdf");

// Save the file into MS document format
pdfDocument.Save(dataDir + "PDFToDOC_out.doc", SaveFormat.Doc);

Convert PDF to DOCX

Converting PDF to DOCX is similar to conversion to DOC file format as shown earlier. The API has DocSaveOptions class that allows you to set other options in addition to setting the document format to DocX.

// The path to the documents directory.
string dataDir = RunExamples.GetDataDir_AsposePdf_DocumentConversion();

// Open the source PDF document
Document pdfDocument = new Document(dataDir + "PDFToDOC.pdf");

// Instantiate DocSaveOptions object
DocSaveOptions saveOptions = new DocSaveOptions();
// Specify the output format as DOCX
saveOptions.Format = DocSaveOptions.DocFormat.DocX;
// Save document in docx format
pdfDocument.Save("ConvertToDOCX_out.docx", saveOptions);

Want to know more about the powerful conversion features of Aspose.PDF for .NET? You can head-on to the API documentation section, Conversion of PDF to other formats, to know about a variety of conversion features that the API supports. Download your free copy of Aspose.PDF for .NET and you can get started in no time by following the API documentation. If you have any queries, feel free to post to Aspose.PDF forum. We’ll be glad to assist you with your queries and inquiries.

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

Improved Aspose.Words for JasperReports for Free Layout Report Container

Share on FacebookTweet about this on TwitterShare on LinkedIn

It is our honor to announce the latest version of Aspose.Words for JasperReports 19.10.

As you know, the base product of Aspose.Words for JasperReports is Aspose.Words for Java. We have upgraded this release to Aspose.Words for Java 19.10. This release inherits enhancement and exciting features of its base product. Moreover, we have improved Aspose.Words for JasperReports for free layout of report container. Now, elements are adjusted according to correct size and position in output document. The download of this release is available here:

Download Aspose.Words for JasperReports 19.10

For more about Aspose.Words for JasperReports 19.10, please check the release notes. When time allows you can check documentation of Aspose.Words for JasperReports and talk about this release and other related issues in our forum.

Posted in Aspose.Words Product Family | Leave a comment