Detect Hyperlink Type with Aspose.Cells for Java 19.8

Share on FacebookTweet about this on TwitterShare on LinkedIn

You get a list of hyperlinks from an Excel file and now thinking about how to categorise them into different types in order to select the appropriate method for processing each of them. Don’t panic! Aspose.Cells for Java 19.8 is released containing the solution for this problem. This is not the only feature introduced in this release but there are many more to explore like extracting embedded MOL file, getting total page count before converting to PDF/Image, inserting SVG file into a worksheet and supporting Java 12 are just a few to list here. You may have a look at the release notes to get the complete list of features and bug fixes which are part of this new release. Let us see in detail what are these features and how to use them.

Detect Hyperlink Type

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 return the hyperlink type using above mentioned enumerator. Following are the enumerator members:

Here is an example which can be used to exercise this new feature. Also for more details visit here.

Program output vs template Excel file

Get total page count before PDF/image creation

Well, the title is explaining this new feature. When a file has too many pages, the process of converting to pdf/image may use too much memory and CPU, and OOM exception may be thrown. Getting total page count before converting can indicate this risk, and do some actions(e.g. skip this file) or print the selected pages to avoid the undesired results. For example one of my sample Excel file (870 KB) was showing about 38 million pages. Just imagine, what will happen if you come across a conversion containing such a huge number of pages!!! Following is an example to show the usage of new classes SheetPrintingPreview and WorkbookPrintingPreview. Both of these classes contain a property EvaluatedPageCount which returns the page count of the printout or PDF file. Here is an article which provides more details in this regard.

Extracting Embedded MOL File

As you know that molecular data file created in the MDL Molfile format, a chemical file format; contains plain text information and stores information about atoms and bonds; often used as a standard exchange format for molecular information. This type of file can be embedded in the Excel file. In this latest release, support is provided to extract object of such an uncommon type i.e. MOL. The following code snippet demonstrates extracting embedded MOL file and saving it to disk. For more details and sample file please visit here.

Other features and enhancements

  • Support for Java 12 is available now
  • Enhancements to avoid high CPU and memory usage during Excel to PDF conversion
  • Copying waterfall chart style while copying the workbook
  • Proper refreshing of PivotTable and PivotCharts
  • Avoid differences during conversion to HTML
  • Remove unwanted extended borderline in Excel to PDF rendering
  • Calculate appropriate image position while rendering to PDF
  • Ensure copying table properties while using copyColumns() function
  • Keep the image transparent instead of opaque during picture copy

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.