Thursday, December 25, 2014

Show Excel Cell Range as Data Labels & Saving ODS File to ODF 1.2 in Android Apps

What’s new in this release?

Aspose development team is pleased to announce the new release of Aspose.Cells for Android v8.3.1. Aspose.Cells APIs have extended its support for the OpenDocument Format. Now users can save the ODS (OpenDocument Spreadsheets) in conformance to ODF 1.2 specifications. Aspose.Cells APIs have exposed the methods isStrictSchema11 & setStrictSchema11 for the OdsSaveOptions class to support this feature. The default value of the setStrictSchema11 property is false, which means that from version 8.3.1 of Aspose.Cells, ODS files will be saved as ODF format version 1.2 by default. For more details, please check the article Save ODS file in ODF 1.1 and 1.2 Specifications. Normally, you add values inside the ListObject/Table using the Cell.putValue method, however, the putValue method must be associated with an instance of a Cell to identify the correct location where value has to be inserted. This mechanism is not usable when you need to add values inside the ListObject using the row and column offsets. Aspose.Cells for Android 8.3.1 has exposed the methods Cell.getTable & ListObject.putCellValue methods to facilitate the users in Accessing the ListObject from a Cell and Add Values using the Row and Column Offsets. Aspose.Cells APIs have exposed the SparklineCollection.add(String dataRange, int row, int column) method to Specify the Data Range and Location of Sparkline Group. Aspose.Cells provides the DataLabels.setShowCellRange attribute to select or clear the option Label Contains – Value From Cells. For more details, please see the article Showing Cell Range as the Data Labels. Aspose.Cells for Android 8.3.1 has provided fixes and other enhancements for several important issues, such as, reading/writing Microsoft Excel files, calculating formulas, manipulating charts and shapes, sheet to image, chart to image and Excel to PDF bugs, etc. This release includes plenty of improved features and bug fixes as listed below
  • Specify the location & data source for the Sparkline group
  • Support for ODS version 1.2
  • Opening and saving xlsb makes it corrupt
  • "Excel found unreadable content...." error when re-saving a template XLSB file
  • Columns and Rows of Pivot Table don't match after converting Excel to PDF
  • Resaving a template XLSM produces a corrupted file
  • Text is not aligned in side the shape when XLS is rendered to PDF
  • Textbox Fill IsVisible property is not correct
  • Copy rows/columns does not remove old condition format
  • MemorySetting.MEMORY_PREFERENCE gives buggy cell iterators
  • Remove rows changes the link style in the output file
  • Opening and saving the xls file changes the cells color
  • Problem of reading conditionally formatted values with DisplayStringValue
  • Vertical text in merged cells appear as ## while rendering to PDF format
  • Difference in Aspose.Cells Generated PDF as compared to MS Excel's Generated PDF
  • Chart Title with Underline is not converting to PDF
  • Copying the coloumns does not copy the Sparklines
  • [CELLRANGE] is showing instead of correct data labels inside the chart image
  • Sparkline.toImage generated blank images for some cases
  • Chart Legends are getting messed up
  • Wrong values retrieved for Chart's points information
  • Anti-aliasing is no effect in sparkline to image
  • Copying the Workbook and rendering the Chart to Image changes the Legend and Plot Area
Other most recent bug fixes are also included in this release.
Overview: Aspose.Cells for Android
Aspose.Cells for Android is a MS Excel spreadsheet component that allows programmer to develop android applications for reading, writing & manipulate Excel spreadsheets (XLS, XLSX, XLSM, SpreadsheetML, CSV, tab delimited) and HTML file formats without needing to rely on Microsoft Excel. It supports robust formula calculation engine, pivot tables, VBA, workbook encryption, named ranges, custom charts, spreadsheet formatting, drawing objects like images, OLE objects & importing or creating charts.

Thursday, December 4, 2014

Retrieve Workbook State & Get Equation Text of Chart Trendline in Android Apps

What’s new in this release?

Aspose development team is pleased to announce the new release of Aspose.Cells for Android v8.3.0. This release contains some useful features and other improvements. Aspose.Cells allows you to retrieve the equation text of a chart trendline. Aspose.Cells provides the Trendline.getDataLabels().getText() method which returns the equation text of a chart’s trendline. To make use of this property, first call the Chart.calculate() method. Please see the detailed article on retrieving the equation text of a chart trendline in the documentation section. This new release has added several useful get/set methods that can enable the developers to track & manipulate the Workbook file’s state.  Aspose.Cells for Android 8.3.0 has provided fixes and other enhancements for several important issues, such as, reading/writing Microsoft Excel files, calculating formulas, manipulating charts and shapes, sheet to image, chart to image and Excel to PDF bugs, etc. This release includes plenty of improved features and bug fixes as listed below
  • Increase performance by caching the prepared MessageFormat object
  • Remove or cache MessageFormat/DecimalFormat.format() to improve performance
  • Remove XLA references
  • Fixed Chart bars issues for the negative values loses color when spreadsheet is saved by Aspose.Cells
  • Fixed: error in calculating cells - exception on calculating formula
  • Fixed: formatted number is rendered as blank
  • Textbox text issue is fixed and now included inside the chart image
  • Excel function NOW() was not working in Russian setting is now fixed
  • Color.getBlack().equals(Color.getEmpty()) was returns true. It is fixed
  • DateTime value is fixed and now read in correct format
  • Fixed issue: XLA reference was not removed correctly by ExternalLink.setDataSource
  • XLSX file is corrupted after re-saving the file via Aspose.Cells APIs is now fixed
  • Chart axis steps broke after copying worksheet is now fixed
  • Changing the Workbook Color Pallet while saving the XLSX to XLS causes the MS Excel to open the resultant spreadsheet in protected view is now fixed
  • Losing quotes for certain Named Ranges is now fixed
  • Cells.copyRows() method is fixed &  now copying sparklines in the XLSX file format.
  • Text formatting issue is resolved while reading the cells' styles
  • Getting #VALUE! error when using RATE function is now fixed
  • Hidden series inside the legend appears again after copying worksheet is fixed.
  • Chart axis steps broke when workbook re-saved is now resolved
  • Copy Pasted Picture issues is fixed and now Rendering in the PDF
  • Fixed: Aspose.Cells generated PDF does not pass the PDF/A-1b compliance test
  • Aspose.Cells Generated PD/ A-1b document fails the Preflight validation is fixed
  • PDF document is broken and cannot be opened in Acrobat Reader after converting from Excel template file is now corrected
  • ClipArt’s do not appear in pdf is now fixed
  • Compliance PDF/A-1b failed with Adobe Preflight
  • User-defined Chart Series Names are empty
  • Charts Titles are messed up
  • Data Separator of Stacked Column Chart has different thickness while rendering Spreadsheet to PDF format
  • Columns of the chart are overlapping with bottom axis while rendering spreadsheet to PDF format
  • Bar Chart has extra vertical lines on right of the bars when rendered as PDF
  • Chart's Data Label is Trimmed Off in the rendered PDF
  • Chart's Axis Labels & Legend are Overlapping in the rendered PDF
  • Text boxes are lost from the chart
Other most recent bug fixes are also included in this release.

Overview: Aspose.Cells for Android

Aspose.Cells for Android is a MS Excel spreadsheet component that allows programmer to develop android applications for reading, writing & manipulate Excel spreadsheets (XLS, XLSX, XLSM, SpreadsheetML, CSV, tab delimited) and HTML file formats without needing to rely on Microsoft Excel. It supports robust formula calculation engine, pivot tables, VBA, workbook encryption, named ranges, custom charts, spreadsheet formatting, drawing objects like images, OLE objects & importing or creating charts.

Sunday, September 28, 2014

How to Add Hyperlinks to Link Data in Excel Worksheet inside Android Apps

This technical tip show how developers can add hyperlinks in Excel File to link data inside their Android applications using Aspose.Cell for Android.  A hyperlink links two entities. Everybody is familiar with hyperlinks because they are used extensively on the Internet. Using Aspose.Cells, developers can create different kinds of hyperlinks in Excel files. This article discusses what types of hyperlinks are supported in Aspose.Cells and how to use them. There are three kinds of hyperlinks which can be added into a cell using Aspose.Cells:

·         A link to a URL.
·         A link to another cell in the same file.
·         A link to an external file.

Aspose.Cells makes it possible to add hyperlinks to Excel files either using the API or designer spreadsheet (where hyperlinks are created manually and Aspose.Cells is then used to import them).  Aspose.Cells provides a class, Workbook that represents an Excel file. The Workbook class contains a WorksheetCollection that allows access to each worksheet in the Excel file. A worksheet is represented by the Worksheet class. The Worksheet class provides different methods for adding different types of hyperlinks to Excel files.

//A link to a URL

File sdDir = Environment.getExternalStorageDirectory();
String sdPath = sdDir.getCanonicalPath();

//Instantiating a Workbook object
Workbook workbook = new Workbook();

//Obtaining the reference of the first worksheet.
WorksheetCollection worksheets = workbook.getWorksheets();
Worksheet sheet = worksheets.get(0);
HyperlinkCollection hyperlinks = sheet.getHyperlinks();

//Adding a hyperlink to a URL at "A1" cell
hyperlinks.add("A1",1,1,"http://www.aspose.com");

//Saving the Excel file
workbook.save(sdPath + "/book1.xls");

//In the above example, a URL is added to an empty cell, A1, as a hyperlink. When the cell is empty, the URL also becomes the link text. If a URL is added as a link to a cell that already contains text, then the hyperlink is added but the value of the cell looks like plain text. To make it look like a hyperlink, apply formatting on the cell.

File sdDir = Environment.getExternalStorageDirectory();
String sdPath = sdDir.getCanonicalPath();

//Instantiating a Workbook object
Workbook workbook = new Workbook();

//Obtaining the reference of the first worksheet.
WorksheetCollection worksheets = workbook.getWorksheets();
Worksheet sheet = worksheets.get(0);

//Setting a value to the "A1" cell
Cells cells = sheet.getCells();
Cell cell = cells.get("A1");
cell.setValue("Visit Aspose");

//Setting the font color of the cell to Blue
Style style = cell.getStyle();
style.getFont().setColor(Color.getBlue());

//Setting the font of the cell to Single Underline
style.getFont().setUnderline(FontUnderlineType.SINGLE);
cell.setStyle(style);

HyperlinkCollection hyperlinks = sheet.getHyperlinks();

//Adding a hyperlink to a URL at "A1" cell
hyperlinks.add("A1",1,1,"http://www.aspose.com");

//Saving the Excel file
workbook.save(sdPath + "/book1.xls");

//Adding a Link to another Cell in the Same File

File sdDir = Environment.getExternalStorageDirectory();
String sdPath = sdDir.getCanonicalPath();

//Instantiating a Workbook object
Workbook workbook = new Workbook();

//Obtaining the reference of the first worksheet.
WorksheetCollection worksheets = workbook.getWorksheets();
Worksheet sheet = worksheets.get(0);

//Setting a value to the "A1" cell
Cells cells = sheet.getCells();
Cell cell = cells.get("A1");
cell.setValue("Visit Aspose");

//Setting the font color of the cell to Blue
Style style = cell.getStyle();
style.getFont().setColor(Color.getBlue());

//Setting the font of the cell to Single Underline
style.getFont().setUnderline(FontUnderlineType.SINGLE);
cell.setStyle(style);

HyperlinkCollection hyperlinks = sheet.getHyperlinks();

//Adding an internal hyperlink to the "B9" cell of the other worksheet "Sheet2" in
//the same Excel file

hyperlinks.add("B3",1 ,1, "Sheet2!B9");

//Saving the Excel file
workbook.save(sdPath + "/book1.xls");

//Adding a Link to an External File

File sdDir = Environment.getExternalStorageDirectory();
String sdPath = sdDir.getCanonicalPath();

//Instantiating a Workbook object
Workbook workbook = new Workbook();

//Obtaining the reference of the first worksheet.
WorksheetCollection worksheets = workbook.getWorksheets();
Worksheet sheet = worksheets.get(0);

//Setting a value to the "A1" cell
Cells cells = sheet.getCells();
Cell cell = cells.get("A1");
cell.setValue("Visit Aspose");

//Setting the font color of the cell to Blue
Style style = cell.getStyle();
style.getFont().setColor(Color.getBlue());

//Setting the font of the cell to Single Underline
style.getFont().setUnderline(FontUnderlineType.SINGLE);
cell.setStyle(style);

HyperlinkCollection hyperlinks = sheet.getHyperlinks();

//Adding a link to the external file
hyperlinks.add("A5", 1, 1, "C:\\book1.xls");

//Saving the Excel file
workbook.save(sdPath + "/book2.xls");

Overview: Aspose.Cells for Android

Aspose.Cells for Android is a MS Excel spreadsheet component that allows programmer to develop android applications for reading, writing & manipulate Excel spreadsheets (XLS, XLSX, XLSM, SpreadsheetML, CSV, tab delimited) and HTML file formats without needing to rely on Microsoft Excel. It supports robust formula calculation engine, pivot tables, VBA, workbook encryption, named ranges, custom charts, spreadsheet formatting, drawing objects like images, OLE objects & importing or creating charts.

Sunday, September 7, 2014

Extract/Replace Text in PDF File & PDF Pages to JPEG Conversion in Android

What's New in this Release?

Aspose development team is excited to announce the release of Aspose.Pdf for Android 1.4.0. This new release provides complete support for PdfConverter class and we also have introduced JpegDevice class. The JpegDevice class specifically provides the capabilities to convert PDF pages to JPEG format and provides high fidelity results. Furthermore, the PDF to Image conversion, Text extraction and Text replace are particular features enhanced in this release. In this new version, we have also provided the support to extract text using TextDevice class which was earlier supported in Aspose.Pdf for .NET and Aspose.Pdf for Java. The support for TrueType fonts is also enhanced and this API is not capable of handling complex scenarios for text replace feature. Some important features included in this new release are listed below
  • Extracting text using TextDevice
  • Text replace feature is much enahanced
  • Replace text is throwing outofmemory exception is now resolved
  • PDF to Image feature is now available
  • Facades: Replacing text is throwing exception is resolved
  • Error is resolved when converted file
  • Converted image quality is bad in comparison with .NET version and is now fixed
  • TrueType fonts are now accessible for standard fonts
  • File is conversion is enhanced and now correctly converted (lines are now visible)
  • Document with image is now correctly converted, issue are resolved
  • Logo "schufa" aren't displayed after conversion is now fixed
  • Enhanced conversion of logo, 2 lines and sign
  • Half image are displayed after conversion is now fixed
  • Table and photo are now displayed, issues are resolved
Overview: Aspose.Pdf for Android
Aspose.Pdf for Android is a PDF document creation & manipulation component that enables Android applications to read, write & manipulate PDF document without using any other third party application. It allows PDF compression options, table creation & manipulation, support for graph objects, extended security controls, custom font handling, add or remove bookmarks, create table of contents, add, update, delete attachments & annotations, import or export PDF form data, print PDF docs &  much more.

Wednesday, September 3, 2014

Add Vertical Text to HTML, EPUB & 3D Rendering Algorithms in Android

What's New in this Release?
 
Aspose development team is happy to announce the monthly release of Aspose.Words for Android 1.12.0.  This release sees the codebase better tweaked and the core functionality closer to Aspose.Words for Java/.NET 14.7.0, which is the product that Aspose.Words for Android is ported from. Here is a look at just a few of the biggest features and API changes in this month’s release. Improvements to DrawingML shadow, extrusion and 3D rendering algorithms, New public API to specify revision marks appearance for rendering, Vertical text is supported in HTML, MHTML and EPUB, Improvements to rendering and line wrapping for Arabic and Far East scripts, Improvements to rendering of inline shapes within rotated text and many more.  Images in PDF document now can be saved in CMYK color space. It is controlled by PdfSaveOptions.ImageColorSpaceExportMode property. If user wants to save images in PDF in CMYK color space, he can achieve this by using this release. Note that current implementation of CMYK support has some restrictions: JPEG codec is not supported; simple formula for RGB to CMYK conversion is used, no ICC profiles are supported. Priority property has been added to the FontSourceBase class. This property is used when there are fonts with the same family name and style in different font sources. The list of new and improved features added in this release are given below
  • Preserve Different First Page option during DOCX-HTML-DOCX roundtrip
  • Add a Priority property to FontSourceBase class
  • Add vertical text support to HTML\Epub
  • Add vertical text support to HTML Import
  • Text color is changed after conversion from ODT to Docx
  • Support relative measurement units on import and export
  • Provide a way to get the names of mustache fields in a document
  • Special characters are rendering as question marks in HTML
  • Save images in CMYK color space to PDF
  • Table border lost is fixed during importing MHTML
  • Incorrect image text wrapping type (inline) on html import
  • Consider preserving Cell height during converting HTML to Word documents
  • /table grid/ Incorrect table cell width on HTML to Tiff conversion, cell content wraps to the second line
  • Preserve Table.StyleName value during Word to Html to Word roundtrip
  • Provide options to control as to how Track Changes Text appears in PDF
  • Provide an ability to render only the Track Changes Revision Bars in Pdf
  • Consider including XML documentation in the NuGet package
  • /header truncated/ A Table in header is truncated when converting to Pdf
  • Converting Word to Pdf issue with RTL text
  • Provide an option to choose the formatting inside HTML or of DocumentBuiler
  • Footnote/Endnote character appears in the Bookmark in PDF
  • The arrow shape has incorrect fill in output document.
  • Improve font fallback for "MICR Encoding" font
  • Docx-HTML-Docx : BookmarkStart and BookmarkEnd position are changed
  • Narrow fonts rendered by Chrome looks wider than computed by AW in HtmlFixed format writer
  • First list label is formatted incorrectly after import.
  • Width of table is incorrect when use InsertHtml method.
  • RowFormat. LeftPadding/ RightPadding causes problem with table width during exporting to HTML.
  • List label attributes resolved incorrectly
  • Font is changed from Regular to Italic after inserting HTML to the document.
  • Table looks improperly in FireFox after expoerting DOCT to HTML
  • Extra column and lines in imported HTML tables
  • Images are replaced with “red cross” after open/save MHTML document.
  • Text in DIVs placement is corrected.
  • Extra Span with dir="rtl" is added during HTML export is now fixed.
  • Merged cells are not properly imported from HTML
  • Paragraph alignment “Justify Low” is changed to “Justified” after open/save.
  • Nested list 's formatting was disturbed and now fixed
  • Doc to html conversion problem with tables is resolved in this release
  • DrawingML misplacement in PDF is fixed in this release.
  • Need to ignore service elements with "display: none" css property on Html import
  • Aspose.Words for .NET 2.0 and 3.5 DLLs appear to depend on .NET 1.1
  • Doc to HTML conversion : Extra characters presence beside the table is fixed
  • Table cell needs to be hidden when exporting style=display:none to DOCX
  • Doc to Html conversion issue is resolved, extra spaces are fixed in output file
  • HTML writer incorrectly determines LocaleId and is now fixed
  • Tables are cutting at the right edge of page in PDF are corrected
  • Non-zero space after text inserted with DocumentBuilder.InsertHtml() is fixed
  • Aspose.Words now return correct values for Paragraph.ParagraphFormat properties.
  • Word control characters break document formatting when imported from HTML is now fixed
  • Unexpected characters appear in the output documents when importing MHTML is now fixed in this release.
  • Setting Table.AllowAutoFit value as false changes the cell's width is fixed
  • Table's border lost after re-saving the Doc file is now fixed
  • Table in the document body is split into 2 parts in Pdf is fixed
  • Saving a DOC multiple times corrupts Table layout is now corrected
  • Multilingual text rendering issue is resolved in Fixed file format (Tiff/Pdf)
  • A Shape is now visible in generated PDF
  • Contents move to next page after conversion from Doc to PDF is now fixed
  • Document.UpdateFields does not the SUM(ABOVE) field is fixed
  • Debug.Assert in the block of code which responsible for justification is fixed.
  • Trim leading/trailing spaces from merge field values during mail merge is fixed
  • Bookmark conversion issue is resolved with RTF to HTML
  • RemoveEmptyParagraphs changes the Paragraph spacing value
  • ODT to Docx conversion issue is resolved with list items
  • Textbox frame overlap the text after conversion from Docx to Pdf is now fixed
  • After resaving the Doc file, # sign is added before hyperlinks is fixed
  • Arrow (Shape) is changed after conversion from Docx to Pdf is now fixed
  • Docx to Doc conversion issue is fixed with table' row formatting
  • RTF to HTML conversion issue is resolved with OLE object icons
  • Error is resolved during printing Aspose.Words generated PostScript file
  • Paragraphs in a column of table are now preserved during open/save a DOCX
  • Header contents missing is fixed after re-saving the ODT
  • Table's cell layout issue is resolved while re-saving ODT
  • Contents of an [iframe] element get visible after HTML import is now fixed
  • Table border becomes visible during open/save a DOCX
  • Top margin issue is resolved after conversion from Docx to Pdf
  • A Word is rendered in multiple SPAN tags in HtmlFixed
Other most recent bug fixes are also included in this release

Overview: Aspose.Words for Android
Aspose.Words for Android is a Java word processing component that enables developers to generate, modify, convert and render Word documents within their Android applications. Aspose.Words supports DOC, DOCX, OOXML, RTF, HTML, XHTML, MHTML, OpenDocument, ODT, PDF, XPS, EPUB & other formats. Other useful features include document creation, content and formatting manipulation, mail merge abilities, reporting features, platform independence, performance & scalability all with minimal learning curve.

Sunday, August 31, 2014

Multithreading Environment Support & AutoFit Excel Rows/Columns in Android

What’s new in this release?

Aspose development team is pleased to announce the new release of Aspose.Cells for Android v8.2.0. The Aspose.Cells for Android API is equally useful in multi-threading environment as in a single thread execution plan. However, recent changes to the core make the API more reliable when reading cell values in multiple threads simultaneously. Aspose.Cells for Android has exposed the MultiThreadReading property for the Cells class in order to make sure that the correct cell values are returned when API works in a multi-threading environment. For more details, have a look at the detailed article on Simultaneously Reading Cell Values with Multiple Threads. Now you may also use the new overloads we have included to this release – autoFitRows(int startRow, int endRow, AutoFitterOptions options) and autoFitColumns(int firstColumn, int lastColumn, AutoFitterOptions options) – from the list if you need to auto-fit rows or columns with the desired AutoFitterOptions. Aspose.Cells for Android 8.2.0 has provided fixes and other enhancements for several important issues, such as, reading/writing Microsoft Excel files, calculating formulas, manipulating charts and shapes, sheet to image conversion bugs, etc.  Enhanced the PDF rendering engine to handle shapes better and improvements to the core for better handling of embedded OleObjects are also part of this new release. This release includes plenty of improved features and bug fixes as listed below
  • Rendering issue with Shapes (Spinner,ScrollBars) while converting to HTML file format
  • Issue with reading shape values in Excel 2003 file format
  • Embedded Object Icons are Converted to Arrows when edited with Excel 2013 and loaded back
  • Data not same as source in the output PDF
  • Vertical border lines are missing in the output PDF
  • Number 5 is missing below 1 in the output PDF
  • % is missing in the output PDF
  • Files corrupted after conversion
  • Shape overlapping the text in the resultant PDF
  • Incorrect Shape Rendering : The resulted PDF has a trimmed shape with a part of the cross not shown
  • Check Boxes are not aligned properly in the resultant PDF
  • Bubble properties changed in the chart when re-saving the template XLSX file
  • Updating the Linked Cell with Chainese Characters and rendering it to HTML results in '?' (Question) Marks
  • Text is cuted off when converting to PDF
  • Characters are overlapping when converting xls to tiff
Other most recent bug fixes are also included in this release.

Overview: Aspose.Cells for Android

Aspose.Cells for Android is a MS Excel spreadsheet component that allows programmer to develop android applications for reading, writing & manipulate Excel spreadsheets (XLS, XLSX, XLSM, SpreadsheetML, CSV, tab delimited) and HTML file formats without needing to rely on Microsoft Excel. It supports robust formula calculation engine, pivot tables, VBA, workbook encryption, named ranges, custom charts, spreadsheet formatting, drawing objects like images, OLE objects & importing or creating charts.

Thursday, August 14, 2014

Font Substitution Mechanism & Enhanced Excel to PDF Conversion: Android Development

What’s new in this release?

Aspose development team is pleased to announce the new release of Aspose.Cells for Android v8.1.2. Aspose.Cells APIs generally use TrueType Fonts (TTFs) when a task involves rendering spreadsheets to images or portable formats such as PDF. Aspose.Cells detects which TTFs are required by scanning the spreadsheet styles and tries to find the required fonts on the machine where conversion is taking place. There could be situations when the required TTFs are not available. In such cases, Aspose.Cells substitutes the required font with a similar available one. With this release, Aspose.Cells provides the means to receive warnings if a font substitution has occurred during the spreadsheet rendering process. This mechanism is available through a set of classes, interfaces and properties that have been added with version 8.1.2. Aspose.Cells for Android 8.1.2 has provided fixes and other enhancements for several important issues, such as, reading/writing Microsoft Excel files, manipulating styles and calculating formulas, manipulating charts and shapes, Sheet to image bugs, Smart Markers issue, etc. This release includes plenty of improved features and bug fixes as listed below
  • FileFormatUtil.DetectFileFormat uses all system's available memory while detecting a corrupted spreadsheet
  • Data missing is fixed when PivotTable is converted to PDF
  • Total Title missing is fixed when PivotTable is converted to PDF
  • Cell Merging Problem is resolved when PivotTable is converted to PDF
  • PivotTable bug regarding Subtotals is fixed
  • Arrow lines are too thick than in Excel is now fixed
  • Merged cell content disappears is now fixed when rows are filtered and spreadsheet is converted to HTML
  • Aspose.Cells produce arrow double in thickness while converting XLS to PDF
  • Printed result is now centered correctly and last line get lost
  • The text in merged cells are now showing when convert to PDF
  • Shape to image Error is resolved while converting ExcelShapeToImageRedactedEx.xls to Tiff
  • Shape to image Error is resolved while converting ExcelShapeToImageError.xls to Tiff
  • Line thickness is now fixed when saved as PDF using Aspose cells
  • Excel chart labels are overlapping after opening and saving the xlsm file
  • Match formula is now calculated correctly with Workbook.CalculateFormula
  • #NUM! error is resolved when reading certain cells
  • Smart Markers - Cells Formatting is now retaine correctly on Group:Merge, Skip:1
Other most recent bug fixes are also included in this release

Overview: Aspose.Cells for Android

Aspose.Cells for Android is a MS Excel spreadsheet component that allows programmer to develop android applications for reading, writing & manipulate Excel spreadsheets (XLS, XLSX, XLSM, SpreadsheetML, CSV, tab delimited) and HTML file formats without needing to rely on Microsoft Excel. It supports robust formula calculation engine, pivot tables, VBA, workbook encryption, named ranges, custom charts, spreadsheet formatting, drawing objects like images, OLE objects & importing or creating charts.


Wednesday, August 6, 2014

How to Add Text in Header/Footer Area of PDF File in Android Applications



This technical tip shows how developers can add text in headeror footer of a PDF file inside their Android applications. The TextStamp class is used to add text in PDF document. We can also use the same class to add text in Header/Footer area of PDF file. The TextStamp class provides necessary methods to specify font size, font style, and font color etc for stamp object. In order to add text in the Header area, first you need to create a Document object and a TextStamp object using required methods. After that, you can call addStamp(..) method of Page class to add text in the PDF file.     Please note that when placing text in Header section, you need to call setTopMargin(..) in such a way that it adjusts the text in the header area of your PDF. Similarly when placing text in Footer section, you need to call setBottomMargin(..) in such a way that it adjusts to the text in Footer area.

·         When adding stamp object in Header section, you also need to set VerticalAlignment to Top.
·         When adding stamp object in Footer section, you also need to set VerticalAlignment to Bottom.

The following code snippet shows you how to add text in the header of a PDF file.
Java

//open document
com.aspose.pdf.Document pdfDocument = new com.aspose.pdf.Document("/mnt/sdcard/input.pdf");
//create text stamp
com.aspose.pdf.TextStamp textStamp = new com.aspose.pdf.TextStamp("Sample Stamp");
//set properties of the stamp
textStamp.setTopMargin(10);
textStamp.setHorizontalAlignment(com.aspose.pdf.HorizontalAlignment.Center);
textStamp.setVerticalAlignment(com.aspose.pdf.VerticalAlignment.Top);

//set text properties
textStamp.getTextState().setFont(new com.aspose.pdf.FontRepository().findFont("Arial"));
textStamp.getTextState().setFontSize(14.0F);
textStamp.getTextState().setFontStyle(com.aspose.pdf.FontStyles.Bold);
textStamp.getTextState().setFontStyle(com.aspose.pdf.FontStyles.Italic);
textStamp.getTextState().setForegroundColor(java.awt.Color.GREEN);

// iterate through all pages of PDF file
for (int Page_counter =1; Page_counter<=pdfDocument.getPages().size();Page_counter++)
{
    //add stamp to all pages of PDF file
    pdfDocument.getPages().get_Item(Page_counter).addStamp(textStamp);
}
//save output document
pdfDocument.save("/mnt/sdcard/TextStamp_output.pdf");

Overview: Aspose.Pdf for Android

Aspose.Pdf for Android is a PDF document creation & manipulation component that enables Android applications to read, write & manipulate PDF document without using any other third party application. It allows PDF compression options, table creation & manipulation, support for graph objects, extended security controls, custom font handling, add or remove bookmarks, create table of contents, add, update, delete attachments & annotations, import or export PDF form data, print PDF docs &  much more.


Thursday, July 24, 2014

Create/Edit Worksheet Scenarios & Enhanced Spreadsheets to HTML in Android

What’s new in this release?

Aspose development team is pleased to announce the new release of Aspose.Cells for Android v8.1.1. Scenarios are part of a suite of commands called what-if analysis tools provided by Microsoft Excel. What-if analysis is the process of changing the values in cells to see how those changes affect the outcome of formulas on the worksheet. They are useful for forecasting and financial models. Microsoft Excel saves a set of values in a scenario, and can automatically substitute these values in the worksheet. Aspose.Cells for Android has provided support for scenarios to allow you to create, manipulate and remove scenarios without the need of Microsoft Excel. Aspose.Cells for Android has exposed many useful classes. The class HtmlSaveOptions has been enhanced further to render HTML results with better layout and presentation. The feature is now available through the Boolean PresentationPreference property which can be set to true when exporting spreadsheets to HTML format to get a better presentation layout. For further elaboration on this topic, please check the detailed article on using the PresentationPreference option. Aspose.Cells for Android 8.1.1 has provided fixes and other enhancements for several important issues, such as, reading Microsoft Excel files, manipulating styles and calculating formulas, manipulating charts and shapes, rendering & manipulating conditional formatting, fonts related issues while rendering to PDF files, Sheet to image bugs and localized formulas formats etc. This release includes plenty of improved features and bug fixes as listed below
  • Support GridWeb for Java
  • Cell.StringValue/DisplayStringValue returns # for thin columns when Worksheet.DisplayZeros=false
  • Give meaningful messages for CellsException when loading a damaged spreadsheet
  • Conditional formatting background colors are now rendered in the PDF
  • Setting the ImageOrPrintOptions' Transparency renders the PNG with Black Background is now fixed
  • XLSX to PDF: CellsHelper.setFontDir does not seem to pick the fonts is fixed
  • Cell.getType() is detecting number as datetime is now fixed
  • Support for localized formats in formulas is now fixed
Other most recent bug fixes are also included in this release.

Overview: Aspose.Cells for Android

Aspose.Cells for Android is a MS Excel spreadsheet component that allows programmer to develop android applications for reading, writing & manipulate Excel spreadsheets (XLS, XLSX, XLSM, SpreadsheetML, CSV, tab delimited) and HTML file formats without needing to rely on Microsoft Excel. It supports robust formula calculation engine, pivot tables, VBA, workbook encryption, named ranges, custom charts, spreadsheet formatting, drawing objects like images, OLE objects & importing or creating charts.

Thursday, July 17, 2014

PDF Document to Image & Text File to PDF Conversion are Enhanced in Android Apps

What's New in this Release?

Aspose development team is excited to announce the release of Aspose.Pdf for Android 1.3.0. This new release includes fixes for issues reported in earlier versions. One of the areas where fixes have been introduced is text file to PDF conversion using TextBuilder. With this new release, you can convert text files to PDF format with the new Document Object Model com.aspose.pdf package. The PDF to image conversion feature is greatly improved. Starting with this release, the PdfConverter class provides great stability for PDF to image conversion and caters for many complex scenarios. So now you can convert any PDF document to image format with great fidelity. We also know that on the Android platform, standard font files like Arial.TTF are inaccessible. Therefore some standard fonts like Helvetica are incorrectly displayed in files created on Android. To resolve this problem, TTF fonts for standard fonts (Arial, Times New Roman etc.) are packed and loaded.
  • TEXT to PDF conversion issue is resolved - using textbuilder
  • PdfConverter produces corrupted output
  • Incorrectly PDF File conversion is now corrected
  • Incorrect text position in converted file is now corrected
  • TrueType fonts are inaccessible for standard fonts are fixed
  • Null reference exception is resolved in PdfConverter
Overview: Aspose.Pdf for Android

Aspose.Pdf for Android is a PDF document creation & manipulation component that enables Android applications to read, write & manipulate PDF document without using any other third party application. It allows PDF compression options, table creation & manipulation, support for graph objects, extended security controls, custom font handling, add or remove bookmarks, create table of contents, add, update, delete attachments & annotations, import or export PDF form data, print PDF docs &  much more.

Monday, June 23, 2014

How to Search & Modify All Hyperlinks in MS Word File inside Android Apps

This technical tip explains how developers can find and modify all hyperlinks in a Microsoft Word document inside Android Applications.  To find and modify hyperlinks it would be nice to have some sort of Hyperlink object with properties, but in the current version, there is no built-in functionality in Aspose.Words to deal with hyperlink fields. Hyperlinks in Microsoft Word documents are fields. A field consists of the field code and field result. In the current version of Aspose.Words, there is no single object that represents a field. Aspose.Words represents a field by a set of nodes: FieldStart, one or more Run nodes of the field code, FieldSeparator, one or more Run nodes of the field result and FieldEnd. While Aspose.Words does not have a high-level abstraction to represent fields and hyperlink fields in particular, all of the necessary low-level document elements and their properties are exposed and with a bit of coding you can implement quite sophisticated document manipulation features. This example shows how to create a simple class that represents a hyperlink in the document. Its constructor accepts a FieldStart object that must have FieldType.FieldHyperlink type. After you use the Hyperlink class, you can get or set its Target, Name, and IsLocal properties. Now it is easy to change targets and names of the hyperlinks throughout the document. In the example, all of the hyperlinks are changed to “http://aspose.com”.

The code below finds all hyperlinks in a Word document and changes their URL and display name.

package Examples;
import org.testng.annotations.Test;
import com.aspose.words.Document;
import com.aspose.words.NodeList;
import com.aspose.words.FieldStart;
import com.aspose.words.FieldType;
import com.aspose.words.NodeType;
import com.aspose.words.Run;
import com.aspose.words.Node;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

/**
 * Shows how to replace hyperlinks in a Word document.
 */
public class ExReplaceHyperlinks extends ExBase
{
    /**
   {{ Finds all hyperlinks in a Word document and changes their URL and display name.
   {{/
    public void replaceHyperlinks() throws Exception
    {
        // Specify your document name here.
        Document doc = new Document(getMyDir() + "ReplaceHyperlinks.doc");
        // Hyperlinks in a Word documents are fields, select all field start nodes so we can find the hyperlinks.
        NodeList fieldStarts = doc.selectNodes("//FieldStart");
        for (FieldStart fieldStart : (Iterable<FieldStart>) fieldStarts)
        {
            if (fieldStart.getFieldType() == FieldType.FIELD_HYPERLINK)
            {
                // The field is a hyperlink field, use the "facade" class to help to deal with the field.
                Hyperlink hyperlink = new Hyperlink(fieldStart);
                // Some hyperlinks can be local (links to bookmarks inside the document), ignore these.
                if (hyperlink.isLocal())
                    continue;
                // The Hyperlink class allows to set the target URL and the display name
                // of the link easily by setting the properties.
                hyperlink.setTarget(NEW_URL);
                hyperlink.setName(NEW_NAME);
            }
        }
        doc.save(getMyDir() + "ReplaceHyperlinks Out.doc");
    }
    private static final String NEW_URL = "http://www.aspose.com";
    private static final String NEW_NAME = "Aspose - The .NET & Java Component Publisher";
}
/**
 * This "facade" class makes it easier to work with a hyperlink field in a Word document.
 *
 * A hyperlink is represented by a HYPERLINK field in a Word document. A field in Aspose.Words
 * consists of several nodes and it might be difficult to work with all those nodes directly.
 * Note this is a simple implementation and will work only if the hyperlink code and name
 * each consist of one Run only.
 *
 * [FieldStart][Run - field code][FieldSeparator][Run - field result][FieldEnd]
 *
 * The field code contains a string in one of these formats:
 * HYPERLINK "url"
 * HYPERLINK \l "bookmark name"
 *
 * The field result contains text that is displayed to the user.
 */
class Hyperlink
{
    Hyperlink(FieldStart fieldStart) throws Exception
    {
        if (fieldStart == null)
            throw new IllegalArgumentException("fieldStart");
        if (fieldStart.getFieldType() != FieldType.FIELD_HYPERLINK)
            throw new IllegalArgumentException("Field start type must be FieldHyperlink.");
        mFieldStart = fieldStart;
        // Find the field separator node.
        mFieldSeparator = findNextSibling(mFieldStart, NodeType.FIELD_SEPARATOR);
        if (mFieldSeparator == null)
            throw new IllegalStateException("Cannot find field separator.");
        // Find the field end node. Normally field end will always be found, but in the example document
        // there happens to be a paragraph break included in the hyperlink and this puts the field end
        // in the next paragraph. It will be much more complicated to handle fields which span several
        // paragraphs correctly, but in this case allowing field end to be null is enough for our purposes.
        mFieldEnd = findNextSibling(mFieldSeparator, NodeType.FIELD_END);
        // Field code looks something like [ HYPERLINK "http:\\www.myurl.com" ], but it can consist of several runs.
        String fieldCode = getTextSameParent(mFieldStart.getNextSibling(), mFieldSeparator);
        Matcher matcher = G_REGEX.matcher(fieldCode.trim());
        matcher.find();
        mIsLocal = (matcher.group(1) != null) && (matcher.group(1).length() > 0);    //The link is local if \l is present in the field code.
        mTarget = matcher.group(2).toString();
    }
    /**
   {{ Gets or sets the display name of the hyperlink.
   {{/
    String getName() throws Exception
    {
        return getTextSameParent(mFieldSeparator, mFieldEnd);
    }
    void setName(String value) throws Exception
    {
        // Hyperlink display name is stored in the field result which is a Run
        // node between field separator and field end.
        Run fieldResult = (Run)mFieldSeparator.getNextSibling();
        fieldResult.setText(value);
        // But sometimes the field result can consist of more than one run, delete these runs.
        removeSameParent(fieldResult.getNextSibling(), mFieldEnd);
    }
    /**
   {{ Gets or sets the target url or bookmark name of the hyperlink.
   {{/
    String getTarget() throws Exception
    {
        return mTarget;
    }
    void setTarget(String value) throws Exception
    {
        mTarget = value;
        updateFieldCode();
    }
    /**
   {{ True if the hyperlink's target is a bookmark inside the document. False if the hyperlink is a url.
   {{/
    boolean isLocal() throws Exception
    {
        return mIsLocal;
    }
    void isLocal(boolean value) throws Exception
    {
        mIsLocal = value;
        updateFieldCode();
    }
    private void updateFieldCode() throws Exception
    {
        // Field code is stored in a Run node between field start and field separator.
        Run fieldCode = (Run)mFieldStart.getNextSibling();
        fieldCode.setText(java.text.MessageFormat.format("HYPERLINK {0}\"{1}\"", ((mIsLocal) ? "\\l " : ""), mTarget));
        // But sometimes the field code can consist of more than one run, delete these runs.
        removeSameParent(fieldCode.getNextSibling(), mFieldSeparator);
    }
    /**
   {{ Goes through siblings starting from the start node until it finds a node of the specified type or null.
   {{/
    private static Node findNextSibling(Node startNode, int nodeType) throws Exception
    {
        for (Node node = startNode; node != null; node = node.getNextSibling())
        {
            if (node.getNodeType() == nodeType)
                return node;
        }
        return null;
    }
    /**
   {{ Retrieves text from start up to but not including the end node.
   {{/
    private static String getTextSameParent(Node startNode, Node endNode) throws Exception
    {
        if ((endNode != null) && (startNode.getParentNode() != endNode.getParentNode()))
            throw new IllegalArgumentException("Start and end nodes are expected to have the same parent.");
        StringBuilder builder = new StringBuilder();
        for (Node child = startNode; !child.equals(endNode); child = child.getNextSibling())
            builder.append(child.getText());
        return builder.toString();
    }
    /**
   {{ Removes nodes from start up to but not including the end node.
   {{ Start and end are assumed to have the same parent.
   {{/
    private static void removeSameParent(Node startNode, Node endNode) throws Exception
    {
        if ((endNode != null) && (startNode.getParentNode() != endNode.getParentNode()))
            throw new IllegalArgumentException("Start and end nodes are expected to have the same parent.");
        Node curChild = startNode;
        while ((curChild != null) && (curChild != endNode))
        {
            Node nextChild = curChild.getNextSibling();
            curChild.remove();
            curChild = nextChild;
        }
    }
    private final Node mFieldStart;
    private final Node mFieldSeparator;
    private final Node mFieldEnd;
    private boolean mIsLocal;
    private String mTarget;
    /**
   {{ RK I am notoriously bad at regexes. It seems I don't understand their way of thinking.
   {{/
    private static final Pattern G_REGEX = Pattern.compile(
        "\\S+" +            // one or more non spaces HYPERLINK or other word in other languages
        "\\s+" +            // one or more spaces
        "(?:\"\"\\s+)?" +    // non capturing optional "" and one or more spaces, found in one of the customers files.
        "(\\\\l\\s+)?" +    // optional \l flag followed by one or more spaces
        "\"" +                // one apostrophe
        "([How to Replace or Modify Hyperlinks^\"]+)" +        // one or more chars except apostrophe (hyperlink target)
        "\""                // one closing apostrophe
        );
}

More about Aspose.Words for Android
Aspose.Words for Android is a Java word processing component that enables developers to generate, modify, convert and render Word documents within their Android applications. Aspose.Words supports DOC, DOCX, OOXML, RTF, HTML, XHTML, MHTML, OpenDocument, ODT, PDF, XPS, EPUB & other formats. Other useful features include document creation, content and formatting manipulation, mail merge abilities, reporting features, platform independence, performance & scalability all with minimal learning curve.

More about Aspose.Words for Android