Convert PDF to DOC and DOCX in C++

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

Aspose.PDF for C++ API lets you read and convert PDF documents to Microsoft Word’s DOC and DOCX file formats. C++ is one of the widely-used programming languages for writing fast and interoperable code that can be executed on a number of platforms. C++ application developers can use Aspose.PDF for C++ to write programs that can manipulate PDF documents without the need of installing any other software on end-user machines.

In this post, we will demonstrate the powerful features of Aspose.PDF for C++ API to read and convert PDF files to DOC and DOCX file formats.

Convert PDF to DOC

Aspose.PDF for C++ SDK lets you read a PDF file and convert it to Microsoft Word Binary file format (.doc) with just a couple of lines. The Document class of the API lets you read a PDF file from disc or stream, use the Save method for saving it in different file formats. Use the SaveFormat enumeration to specify the output file format as shown in the code sample below.

auto doc = MakeObject<Document>(u"..\\Data\\Document\\input.pdf");
doc->Save(u"..\\Data\\Document\\input_out.doc", SaveFormat:: Doc);

Convert PDF to DOCX

DOCX is the modern Word Documents file format that is based on Office Open XML file format specifications. Aspose.PDF for C++ can convert PDF files to DOCX with the same simplicity as it converts to DOC file format. This is as illustrated in the following sample code.

auto doc = MakeObject<Document>(u"..\\Data\\Document\\input.pdf");
doc->Save(u"..\\Data\\Document\\input_out.docx", SaveFormat::DocX);

In a nutshell, the API lets you convert PDF files to several other file formats without you being worried about the underlying document architecture of source and output file formats. Want to try it out? Download your free copy of the Aspose.PDF for C++ API and get started in no time by following the detailed developer guide from API documentation. In case of any queries, feel free to write to us on Aspose.PDF forum to get further assistance.

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

Support for Font FallBack and Prompt Text using Aspose.Slides

Share on FacebookTweet about this on TwitterShare on LinkedIn

Here comes new release of Aspose.Slides 19.10 for .NET and Java, which has been enriched with new features. Now, we offer support for Font FallBack and Prompt Text using Aspose.Slides.

Support For Font FallBack

A Font Fallback is a reserve typeface containing symbols for as many Unicode characters as possible. When a display system encounters a character that is not part of the repertoire of any of the other available fonts, a symbol from a fallback font is used instead. Typically, a fallback font will contain symbols representative of the various types of Unicode characters. This support has now been made part of Aspose.Slides too.

The following code example shows how to set font fall back using FontFallBackRule objects.

The similar Java based example for this is:

Set Prompt Text in a Placeholder

A Prompt Text is a text that appears in a text field when it is first load but that disappears when a user starts typing into the text field. This is basically for user ease to get to know what is to be entered in the selected field. We know that Standard and pre-built layouts contain placeholders with default text like Click to add a title or Click to add subtitle. Using Aspose.Slides you can add prompt text manually by accessing the default placeholders.

The code snippet below shows how to use this feature:

The similar Java based example for this is:

Wait, there’s many other features, enhancement, and bug fixes included in this release. Here you can get the detail!

When time allows you can check out API examples at Github, talk about this release and other API related issues in our forum.

Posted in Aspose.Slides Product Family | Leave a comment

Aspose.Tasks for C++ released with exciting and new features

Share on FacebookTweet about this on TwitterShare on LinkedIn
Aspose.Tasks for CPP logo

We are pleased to rollout the news for Aspose.Tasks for C++, which is in fact a new milestone achieved in Aspose.Tasks API product family. The API (written in C++) is designed to be used with C++ language in variety of platforms like Windows, Linux and UNIX. Aspose.Tasks can be used with any kind of application from console based to desktop based applications. The maiden release of this API has been ported from Aspose.Tasks for .NET 19.9 and contain all the features available till to date Aspose.Tasks for 19.9.

Features offered by Aspose.Tasks for C++

Aspose.Tasks for C++ is product that allows an extensive manipulation of MS Project file formats. The product does not require Microsoft Project to be installed. It allows editing the Project files, rendering to PDF, Images and HTML. This product allows different automation scenarios that help developers on their way. The following are some of salient features in API.

  • Read, change and write Microsoft Project® documents
  • Read MPP projects (native MS Project format) and XML project formats. MS Project 2003, 2007, 2010, 2013, 2016 and 2019 MPP formats are supported
  • Create, update and write projects in XML project format
  • Read MPP project files, update their summary information and write them in original MPP format
  • Read MPP project files and convert them to XML format using
  • Aspose.Tasks for C++ (the XML can be manipulated by implementing a custom XML parser)
  • Change main project settings like schedule type, start and finish dates
  • Change default project settings like default standard rate, default overtime rate, default task type, default fixed cost accrual, etc
  • Manage extended attributes
  • Define weekdays for the project
  • Define weekdays for calendars and calendar exceptions
  • Read and write calendars for tasks and resources
  • Manage task baseline scheduling and duration
  • Handle constraints on tasks
  • Create and manage links between tasks
  • Read, change and create tasks, milestone, estimated critical or effort driven tasks
  • Manage resources costs and variances
  • Access assignment costs and budget
  • Support for the encoding of MPX files
  • Resource prefix implementation for nested resources
  • Support of setting CSS prefix for HTML export
  • Set custom date format while exporting to PDF format

Initial Release Availability

The product documentation provides fully featured demos and working examples written in C++ for a quick start of API. The demos help developers gain a good understanding of the component’s features quickly.

For an incurring issue in API ,you can reach us on Aspose.Tasks forum for your queries/inquiries related to the API and we will be more than happy to assist you in this regard.

Posted in Aspose.Tasks Product Family | Leave a comment

Insert Hyperlinks to Document Bookmarks using LINQ Reporting Engine of Aspose.Words for Java 19.10

Share on FacebookTweet about this on TwitterShare on LinkedIn

Today, I will highlight the major features introduced in Aspose.Words for Java 19.10 release:

Main Maven POM File Automation

We have now added automation code in the Main Maven POM file. When you run this POM file, it will automatically choose the correct JDK version and download the plugin (if needed) for advanced HarfBuzz Shaper based Typography (note that this only works for windows).

Insert Hyperlink Dynamically using LINQ Reporting Engine

You can now insert hyperlinks to your reports dynamically by using the link tags. Syntax of a link tag is defined as follows.
<<link [uri_or_bookmark_expression] [display_text_expression]>>

Here, uri_or_bookmark_expression defines URI or the name of a bookmark within the same document for a hyperlink to be inserted dynamically. This expression is mandatory and must return a non-empty value.

In turn, display_text_expression defines text to be displayed for the hyperlink. This expression is optional. If it is omitted or returns an empty value, then during runtime, a value of uri_or_bookmark_expression is used as display text as well. For more details, refer to the following article:
Inserting Hyperlinks Dynamically

Specify or Detect Document’s Text Direction

Aspose.Words for Java now provides DocumentDirection property in TxtLoadOptions class to detect the text direction (RTL / LTR) in the document. This property sets or gets document text directions provided in DocumentDirection enumeration. The default value is left to right (LTR).

The following code example demonstrates how to detect text direction of the document while importing TXT file.

See also Useful Links

Keeping the Aspose tradition, you are welcome to shape the upcoming releases of Aspose.Words for Java API by posting your suggestions and concerns in the Aspose.Words for Java Support Forum.

Posted in Aspose.Words Product Family | Leave a comment

Adjust workbook compression level with Aspose.Cells for Java 19.9

Share on FacebookTweet about this on TwitterShare on LinkedIn
This image has an empty alt attribute; its file name is aspose_cells-for-java-e1558954178996.jpg

Its great pleasure to share that we have achieved another milestone by publishing new release Aspose.Cells for Java 19.9 that will enable developers to adjust the workbook compression level. Don’t worry, this is not the only feature as there are many other enhancements as well including the facility to print multiple copies of a workbook and support for reading and rendering Control of ODS files.  Details of all the new features, enhancements and bugs resolution can be seen in the release notes. This latest release Aspose.Cells for Java v19.9 can be downloaded from the download section. Let us have a brief look at the salient features of this exciting release.

Adjust workbook compression level

The compression level of the workbook is an important factor while working with larger workbooks. You should have control over setting the priority to create either small file with little more time or create files quickly but having comparatively large file size. Aspose.Cells have now provided this control such that the developer will have the control to adjust the compression level. A new enumerator OoxmlCompressionType is provided which can be used to set the compression level. Following members are available under this enumerator. 

  • LEVEL_1: The fastest but least effective compression.
  • LEVEL_2: A little slower, but better, than level 1.
  • LEVEL_3: A little slower, but better, than level 2.
  • LEVEL_4: A little slower, but better, than level 3.
  • LEVEL_5: A little slower than level 4, but with better compression.
  • LEVEL_6: A good balance of speed and compression efficiency.
  • LEVEL_7: Pretty good compression!
  • LEVEL_8: Better compression than Level7!
  • LEVEL_9: The “best” compression, where best means greatest reduction in the size of the input data stream. This is also the slowest compression.

Following example can be used to exercise this new exciting feature by changing the compression type and comparing the file size with the time taken to create this file.

Other enhancements

  • An Excel file having AutoFilter was converted to HTML with HiddenColDisplayType “HtmlHiddenColDisplayType.REMOVE”. This was causing an issue that the hidden rows in the Excel file were becoming visible. This issue is resolved and now these rows remain hidden in HTML as well.
  • There was a need to enable the product to support large formulas like issues were observed in the SUM function if there were more than 128 cells. This issue is resolved and now large formulas are supported by Aspose.Cells.
  • A user reported that an XLSX file is loaded and saved back after calling calculateFormula(). Inspecting and comparing input.xlsx and output.xlsx files, some formulas containing structured references seem to have been broken by Aspose Cells. This issue was corrupting the file and crashing Excel while opening such files. This issue is resolved and there is no more formula corruption by calling calculateFormula() and saving the file.
  • An issue was reported where footer text font and formatting was not maintained while converting the Excel file to PDF. This issue is resolved now and you will get proper font and formatting while converting Excel file to PDF.
  • In another scenario, Workbook.setRecalculateOnOpen(false) is used before saving the Excel file. When this file is opened in Excel 365, it starts calculating the file and hangs. This issue is resolved now and the output file does not hang Excel 365 anymore.
  • An exception was raised while converting XLSM to the image. This is no more an issue now.
  • While working in macOS, an Excel file was converted to PDF, but it was raising an exception that “Column width must be between 0 and 255”. Now this issue is resolved and macOS users will face no problem while converting Excel file to PDF.
  • Other issues like “Java.lang.NumberFormatException: For input string: 0.0” and IllegalArgumentException while executing deleteBlankColumns() are also removed. 

The wait is over and you may get ready to test the new features. Following resources may help you to achieve your targets using Aspose.Cells.

Posted in Aspose.Cells Product Family | Leave a comment

Perform OCR on images in C++ Applications using Aspose.OCR for C++

Share on FacebookTweet about this on TwitterShare on LinkedIn

OCR (optical character recognition) is the recognition of written or printed text and it is widely used functionality. Reading images which have textual content has now been common and essential requirement for many businesses. We at Aspose are honored to announce upcoming release of Aspose.OCR for C++. Now you will be able to use Aspose.OCR in C++ applications to implement the OCR functionality. Following section offers some insights into initial API features and news about its first version availability.

Initial Features of the API

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. The OCR functionality and its engine would definitely be upgraded in future releases of the API.

First Version Availability

The API is on its final stage of launch and we have been working on completing all integration tests. As soon as all tests and related tasks are completed, we will announce its first release. In order to stay updated about new API releases, please stay tuned. Feel free to let us know if you have any inquiry or request about any feature in the API. We will be back soon with another update.

Posted in Aspose.OCR Product Family, Asad Ali | Leave a comment

Adjust workbook compression level with Aspose.Cells for .NET 19.9

Share on FacebookTweet about this on TwitterShare on LinkedIn

Aspose.Cells for .NET logo Guys, in the blog you will learn how to adjust the workbook compression level. You can also avail the useful feature to print multiple copies of a workbook and support for reading and rendering controls of ODS file. We suggest you to have a look at the release notes to get the complete list of features, enhancements and other fixes which are part of this new release. Let’s not wait another moment to review the release notes.  To get essence of the public release (Aspose.Cells for .NET v19.9), I am giving you preview of the new features and other enhancements available in it.

Adjust workbook compression level

The compression level of the workbook is an important factor while working with larger workbooks. You should have control over setting the priority to create either small file with little more time or create files quickly but having comparatively large file size. Aspose.Cells have now provided this control such that the developer will have the control to adjust the compression level. A new enumerator OoxmlCompressionType is provided which can be used to set the compression level. Following members are available under this enumerator.

  • Level1: The fastest but least effective compression.
  • Level2: A little slower, but better, than level 1.
  • Level3: A little slower, but better, than level 2.
  • Level4: A little slower, but better, than level 3.
  • Level5: A little slower than level 4, but with better compression.
  • Level6: A good balance of speed and compression efficiency.
  • Level7: Pretty good compression!
  • Level8: Better compression than Level7!
  • Level9: The "best" compression, where best means greatest reduction in the size of the input data stream. This is also the slowest compression.

Following example can be used to exercise this new exciting feature by changing the compression type and comparing the file size with the time taken to create this file.


See the document Adjust workbook compression level for your reference

Print multiple copies of a worksheet

Aspose.Cells provides the ability to print multiple copies of a worksheet by using the SheetRender.ToPrinter(PrintSettings PrinterSettings) method/overload. The following code snippet demonstrates the use of SheetRender.ToPrinter(PrintSettings PrinterSettings) method to print multiple copies of a worksheet.


See the document Print multiple copies of a worksheet for your reference.

Other enhancements and fixes

  • Support reading and rendering Control of ODS files.
  • PivotTables not retained multiple select options after processing smart markers.
  • Hyperlinks lost when importing data from DataTable.
  • Contents overflow from the page during PDF conversion.
  • Setting the font and font size of Drawing.TextBox was not working in ODS.
  • Fixed an issue where OLE object link was not accessible from XLS file.
  • Filter connections on pivot chart lost settings on save after refreshing pivot tables.
  • The setting “Hide items with no data” in slicer lost after refreshing pivot tables.

To use these features and avail other enhancements and fixes, I recommend you to try the release Aspose.Cells for .NET v19.9. Moreover, I recommend you to browse Developers’ Guide for your complete reference on what you can deliver using the APIs. Also, you are always welcome to share your review, concerns or feedback on forums.

Posted in Aspose.Cells Product Family | Leave a comment

Convert PDF to HTML with Embedded Resources in .NET

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

PDF is one of the most popular document formats these days which is used by a variety of applications as the final output. Due to its support for a wide range of data types and portability, it is the format of choice for creating and sharing content.  As a .NET application developer who is interested in developing document management applications, you may want to embed processing features to read and convert PDF documents to other file formats such as HTML.

In this post, we’ll explore and demonstrate the powerful conversion feature of Aspose.PDF for .NET API to read and convert a PDF file to HTML with several options.

Convert PDF to HTML using C#

Aspose.PDF for .NET API lets you read and convert PDF files to HTML in your .NET applications. It is simple to use and you can get started with the basic conversion using the following simple two lines of code.

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

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

// Save the file into MS document format
pdfDocument.Save(dataDir + "output_out.html", SaveFormat.Html);

It is that simple to convert PDF to HTML in your C# applications. The API takes care of reading all the internal details of PDF file format and converts it to HTML. Interestingly, you don’t need to have PDF reader programs installed at your end or any other computer where your application will finally run.

Convert PDF to HTML with Embedded Resources

You can also convert PDF to HTML with all the resources as part of the output HTML. This will result in making all the elements of a PDF file (images, CSS, and fonts) embedded into the output HTML. This is achieved by using the HtmlSaveOptions.PartsEmbeddingModes enumerator as shown in the following code sample.

// Load source PDF file
Document doc = new Document("input.pdf");
// Instantiate HTML Save options object
HtmlSaveOptions newOptions = new HtmlSaveOptions();

// Enable option to embed all resources inside the HTML
newOptions.PartsEmbeddingMode = HtmlSaveOptions.PartsEmbeddingModes.EmbedAllIntoHtml;

// This is just optimization for IE and can be omitted 
newOptions.LettersPositioningMethod = HtmlSaveOptions.LettersPositioningMethods.UseEmUnitsAndCompensationOfRoundingErrorsInCss;
newOptions.RasterImagesSavingMode = HtmlSaveOptions.RasterImagesSavingModes.AsEmbeddedPartsOfPngPageBackground;
newOptions.FontSavingMode = HtmlSaveOptions.FontSavingModes.SaveInAllFormats;
// Output file path 
string outHtmlFile = "SingleHTML_out.html";
doc.Save(outHtmlFile, newOptions);

Saving Images to Specific Folder

Everyone knows that a PDF document can contain images in addition to textual details. An HTML can contain images that are based-64 encoded inside the HTML or can reference images from a folder where these images reside. Aspose.PDF API has rich features of saving images to user-specified folder on disc. The following code sample shows how to save images to a specific folder during conversion of PDF to HTML.

// Create HtmlSaveOption with tested feature
HtmlSaveOptions newOptions = new HtmlSaveOptions();

// Specify the separate folder to save images
newOptions.SpecialFolderForAllImages = dataDir;

Convert PDF to Multipage HTML

The API doesn’t stop you here as it has a lot of options to control the resultant HTML. For example, you can split the HTML in the above step into multiple pages during PDF to HTML conversion using the following sample code.

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

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

// Instantiate HTML SaveOptions object
HtmlSaveOptions htmlOptions = new HtmlSaveOptions();

// Specify to split the output into multiple pages
htmlOptions.SplitIntoPages = true;

// Save the document
pdfDocument.Save(@"MultiPageHTML_out.html", htmlOptions);

Setting the SplitIntoPages flag to true takes care of everything for you and the output HTML consists of multiple pages instead of a single page.

Still want more? You can head-on to the APIs documentation section, PDF to HTML that lists some advance level features for applying more options during conversion. 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

Create Repeating Section Content Control by using Aspose.Words for C++ 19.9

Share on FacebookTweet about this on TwitterShare on LinkedIn

Today, I will highlight the major features introduced in the Aspose.Words for C++ 19.9 release:

Create Repeating Section Content Controls in Word Document

The repeating section content control allows repeating the content contained within it. Using Aspose.Words for C++ 19.9, the structured document tag nodes of the repeating section and repeating section item types can be created and for this purpose, SdtType enumeration type provides RepeatingSectionItem property. The following code example demonstrates how to Bind a Repeating Section Content Control in Word Document to a Table.

Link Custom Document Property to Bookmark

‘Aspose.Words for C++’ API now provides a method CustomDocumentProperties.addLinkToContent(String, String) to create a new ‘linked to content’ custom document property which returns the newly created property object or null if the link source is invalid. The following code example demonstrates how to Configure the Link to a Content Custom Property.

See Also Useful Links

The resources, you may need to accomplish your tasks:

Keeping the Aspose tradition, you are welcome to shape the upcoming releases of Aspose.Words for C++ API by posting your suggestions and concerns in the Aspose.Words for C++ support forum.

Posted in Aspose.Words Product Family | Leave a comment

Upcoming Release of Aspose.Tasks for C++

Share on FacebookTweet about this on TwitterShare on LinkedIn
Aspose.Tasks for CPP logo

We are pleased to share that Aspose.Tasks API is coming soon to C++ platforms with the name of Aspose.Tasks for C++. It will be soon available for download and to be used in applications. Aspose.Tasks (written in C++) is designed to be used with C++ language in variety of platforms like Windows, Linux and UNIX. Aspose.Tasks can be used with any kind of application from console based to desktop based applications. The documentation shall provide fully featured demos and working examples written in C++ for a quick start of API. The demos help developers gain a good understanding of the component’s features quickly.

Features offered by Aspose.Tasks for C++

Aspose.Tasks for C++ is product that allows an extensive manipulation of MS Project file formats. The product does not require Microsoft Project to be installed. It shall allows editing the Project files, rendering to PDF, Images and HTML. This product allows different automation scenarios that help developers on their way. The following are some of salient features in API.

  • Create Project files
  • Define weekdays for the calendar
  • Define exceptions in calendars
  • Render project data to multiple formats
  • Handle Tasks in project
  • Task scheduling
  • Convert project data to images
  • Save as HTML

Initial Release Availability

We are currently working over finalizing the API release process and intend to share this publically soon. So, stay tuned for further news about this new upcoming API. You can reach us on Aspose.Tasks forum for your queries/inquiries related to the API and we will be more than happy to assist you in this regard.

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