import java.net.URL;\r
\r
import org.apache.poi.hssf.usermodel.HSSFWorkbook;\r
+import org.apache.poi.hssf.usermodel.HSSFSheet;\r
import org.apache.poi.ss.usermodel.ClientAnchor;\r
import org.apache.poi.ss.usermodel.Drawing;\r
import org.apache.poi.ss.usermodel.Row;\r
\r
\r
/**\r
- * Demonstrates how to add an image to a worksheet and set that image's size\r
- * to a specific number of milimetres irrespective of the width of the columns\r
+ * Demonstrates how to add an image to a worksheet and set that images size\r
+ * to a specific number of millimetres irrespective of the width of the columns\r
* or height of the rows. Overridden methods are provided so that the location\r
- * of the image - the cells row and column co-ordinates that define the top\r
+ * of the image - the cells row and column coordinates that define the top\r
* left hand corners of the image - can be identified either in the familiar\r
- * Excel manner - A1 for instance - or using POI's methodolody of a column and\r
+ * Excel manner - A1 for instance - or using POI's methodology of a column and\r
* row index where 0, 0 would indicate cell A1.\r
*\r
* The best way to make use of these techniques is to delay adding the image to\r
* The key to the process is the ClientAnchor class. It defines methods that allow\r
* us to define the location of an image by specifying the following;\r
*\r
- * * How far - in terms of co-ordinate positions - the image should be inset\r
+ * * How far - in terms of coordinate positions - the image should be inset\r
* from the left hand border of a cell.\r
- * * How far - in terms of co-ordinate positions - the image should be inset\r
+ * * How far - in terms of coordinate positions - the image should be inset\r
* from the from the top of the cell.\r
- * * How far - in terms of co-ordinate positions - the right hand edge of\r
- * the image should protrude into a cell (measured from the cell's left hand\r
- * edge to the image's right hand edge).\r
- * * How far - in terms of co-ordinate positions - the bottm edge of the\r
- * image should protrude into a row (measured from the cell's top edge to\r
- * the image's bottom edge).\r
+ * * How far - in terms of coordinate positions - the right hand edge of\r
+ * the image should protrude into a cell (measured from the cells left hand\r
+ * edge to the images right hand edge).\r
+ * * How far - in terms of coordinate positions - the bottom edge of the\r
+ * image should protrude into a row (measured from the cells top edge to\r
+ * the images bottom edge).\r
* * The index of the column that contains the cell whose top left hand\r
* corner should be aligned with the top left hand corner of the image.\r
* * The index of the row that contains the cell whose top left hand corner\r
- * should be aligned with the image's top left hand corner.\r
+ * should be aligned with the images top left hand corner.\r
* * The index of the column that contains the cell whose top left hand\r
- * corner should be aligned with the image's bottom right hand corner\r
+ * corner should be aligned with the images bottom right hand corner\r
* * The index number of the row that contains the cell whose top left\r
* hand corner should be aligned with the images bottom right hand corner.\r
*\r
* the bottom right hand corner of the image will be located in cell B2 (1, 1) and\r
* it will again be aligned with the top left hand corner of the cell. This has the\r
* effect of making the image seem to occupy the whole of cell A1. Interestingly, it\r
- * also has an effect on the image's resizing behaviour because testing has \r
+ * also has an effect on the images resizing behaviour because testing has \r
* demonstrated that if the image is wholly contained within one cell and is not\r
* 'attached' for want of a better word, to a neighbouring cell, then that image\r
* will not increase in size in response to the user dragging the column wider\r
*\r
* The following example demonstrates a slightly different way to insert an\r
* image into cell A1 and to ensure that it occupies the whole of the cell. This\r
- * is accomplised by specifying the the images bottom right hand corner should be\r
+ * is accomplished by specifying the the images bottom right hand corner should be\r
* aligned with the bottom right hand corner of the cell. It is also a case\r
* where the image will not increase in size if the user increases the size of\r
- * the enclosing cell - irrespective of the anchor's type - but it will reduce in\r
+ * the enclosing cell - irrespective of the anchors type - but it will reduce in\r
* size if the cell is made smaller.\r
*\r
* ClientAnchor anchor = sheet.getWorkbook().getCreationHelper().createClientAnchor();\r
* anchor.setCol2(0);\r
* anchor.setRow2(0);\r
*\r
- * Note that the final four method calls all pas the same value and seem to\r
+ * Note that the final four method calls all pass the same value and seem to\r
* indicate that the images top left hand corner is aligned with the top left\r
* hand corner of cell A1 and that it's bottom right hand corner is also\r
* aligned with the top left hand corner of cell A1. Yet, running this code\r
* would see the image fully occupying cell A1. That is the result of the\r
* values passed to parameters three and four; these I have referred to as\r
- * determing the images co-ordinates within the cell. They indicate that the\r
+ * determining the images coordinates within the cell. They indicate that the\r
* image should occupy - in order - the full width of the column and the full\r
* height of the row.\r
*\r
* always result in the image occupying the full width of the column. They help\r
* in situations where an image is larger than a column/row and must overlap\r
* into the next column/row. Using them does mean, however, that it is often\r
- * necessary to perform conversions between Excel's characters units, points,\r
+ * necessary to perform conversions between Excels characters units, points,\r
* pixels and millimetres in order to establish how many rows/columns an image\r
- * should occupy and just what the varous insets ought to be.\r
+ * should occupy and just what the various insets ought to be.\r
*\r
* Note that the setDx1(int) and setDy1(int) methods of the ClientAchor class\r
* are not made use of in the code that follows. It would be fairly trivial\r
* rounding the values at the correct point - it is likely that these errors\r
* could be reduced or removed.\r
*\r
- * A note concerning Excels' image resizing behaviour. The ClientAnchor\r
+ * A note concerning Excels image resizing behaviour. The ClientAnchor\r
* class contains a method called setAnchorType(int) which can be used to\r
- * determine how Excel will resize an image in reponse to the user increasing\r
+ * determine how Excel will resize an image in response to the user increasing\r
* or decreasing the dimensions of the cell containing the image. There are \r
* three values that can be passed to this method; 0 = To move and size the \r
* image with the cell, 2 = To move but don't size the image with the cell,\r
* @author Mark Beardsley [msb at apache.org] and Mark Southern [southern at scripps.edu]\r
* @version 1.00 5th August 2009.\r
* 2.00 26th February 2010.\r
- * Ported to make use of the the SS Usermodel classes.\r
+ * Ported to make use of the the SS usermodel classes.\r
* Ability to reuse the Drawing Patriarch so that multiple images\r
* can be inserted without unintentionally erasing earlier images.\r
* Check on image type added; i.e. jpg, jpeg or png.\r
* The String used to contain the files name is now converted\r
* into a URL.\r
+ * 2.10 17th May 2012\r
+ * Corrected gross error that occurred when using the code with\r
+ * XSSF or SXSSF workbooks. In short, the code did not correctly\r
+ * calculate the size of the image(s) owing to the use of EMUs\r
+ * within the OOXML file format. That problem has largely been\r
+ * corrected although it should be mentioned that images are not\r
+ * sized with the same level of accuracy. Discrepancies of up to\r
+ * 2mm have been noted in testing. Further investigation will\r
+ * continue to rectify this issue.\r
*/\r
public class AddDimensionedImage {\r
\r
public static final int EXPAND_COLUMN = 2;\r
public static final int EXPAND_ROW_AND_COLUMN = 3;\r
public static final int OVERLAY_ROW_AND_COLUMN = 7;\r
-\r
+ \r
+ // Modified to support EMU - English Metric Units - used within the OOXML\r
+ // workbooks, this multoplier is used to convert between measurements in\r
+ // millimetres and in EMUs\r
+ private static final int EMU_PER_MM = 36000;\r
+ \r
/**\r
* Add an image to a worksheet.\r
*\r
* the image should be positioned on the sheet.\r
* @param sheet A reference to the sheet that contains the cell referenced\r
* above.\r
+ * @param drawing An instance of the DrawingPatriarch class. This is now\r
+ * passed into the method where it was, previously, recovered\r
+ * from the sheet in order to allow multiple pictures be\r
+ * inserted. If the patriarch was not 'cached in this manner\r
+ * each time it was created any previously positioned images\r
+ * would be simply over-written.\r
* @param imageFile An instance of the URL class that encapsulates the name\r
* of and path to the image that is to be 'inserted into'\r
* the sheet.\r
* column on the worksheet; POI column indices are zero\r
* based. Together with the rowNumber parameter's value,\r
* this parameter identifies a cell on the worksheet. The\r
- * image's top left hand corner will be aligned with the\r
+ * images top left hand corner will be aligned with the\r
* top left hand corner of this cell.\r
- * @param rowNumber A primtive int that contains the index number of a row\r
+ * @param rowNumber A primitive int that contains the index number of a row\r
* on the worksheet; POI row indices are zero based.\r
* Together with the rowNumber parameter's value, this\r
* parameter identifies a cell on the worksheet. The\r
- * image's top left hand corner will be aligned with the\r
+ * images top left hand corner will be aligned with the\r
* top left hand corner of this cell.\r
* @param sheet A reference to the sheet that contains the cell identified\r
* by the two parameters above.\r
+ * @param drawing An instance of the DrawingPatriarch class. This is now\r
+ * passed into the method where it was, previously, recovered\r
+ * from the sheet in order to allow multiple pictures be\r
+ * inserted. If the patriarch was not 'cached in this manner\r
+ * each time it was created any previously positioned images\r
+ * would be simply over-written.\r
* @param imageFile An instance of the URL class that encapsulates the name\r
* of and path to the image that is to be 'inserted into'\r
* the sheet.\r
// to the method, the images type is identified before it is added to the\r
// sheet.\r
String sURL = imageFile.toString().toLowerCase();\r
- if( sURL.endsWith(".png") ) {\r
- imageType = Workbook.PICTURE_TYPE_PNG;\r
- }\r
- else if( sURL.endsWith("jpg") || sURL.endsWith(".jpeg") ) {\r
- imageType = Workbook.PICTURE_TYPE_JPEG;\r
- }\r
- else {\r
- throw new IllegalArgumentException("Invalid Image file : " +\r
- sURL);\r
- }\r
+ if( sURL.endsWith(".png") ) {\r
+ imageType = Workbook.PICTURE_TYPE_PNG;\r
+ }\r
+ else if( sURL.endsWith("jpg") || sURL.endsWith(".jpeg") ) {\r
+ imageType = Workbook.PICTURE_TYPE_JPEG;\r
+ }\r
+ else {\r
+ throw new IllegalArgumentException("Invalid Image file : " +\r
+ sURL);\r
+ }\r
int index = sheet.getWorkbook().addPicture(\r
- IOUtils.toByteArray(imageFile.openStream()), imageType);\r
+ IOUtils.toByteArray(imageFile.openStream()), imageType);\r
drawing.createPicture(anchor, index);\r
}\r
\r
* @param sheet A reference to the sheet that will 'contain' the image.\r
* @param colNumber A primtive int that contains the index number of a\r
* column on the sheet.\r
- * @param reqImageWidthMM A primtive double that contains the required\r
+ * @param reqImageWidthMM A primitive double that contains the required\r
* width of the image in millimetres\r
- * @param resizeBehaviour A primitve int whose value will indicate how the\r
+ * @param resizeBehaviour A primitive int whose value will indicate how the\r
* width of the column should be adjusted if the\r
* required width of the image is greater than the\r
* width of the column.\r
* left hand corner also defines the bottom right hand corner of\r
* the image and an inset that determines how far the right hand\r
* edge of the image can protrude into the next column - expressed\r
- * as a specific number of co-ordinate positions.\r
+ * as a specific number of coordinate positions.\r
*/\r
private ClientAnchorDetail fitImageToColumns(Sheet sheet, int colNumber,\r
double reqImageWidthMM, int resizeBehaviour) {\r
// the required width of the image into co-ordinates. This value\r
// will become the inset for the ClientAnchorDetail class that\r
// is then instantiated.\r
- colWidthMM = reqImageWidthMM;\r
- colCoordinatesPerMM = ConvertImageUnits.TOTAL_COLUMN_COORDINATE_POSITIONS /\r
- colWidthMM;\r
- pictureWidthCoordinates = (int)(reqImageWidthMM * colCoordinatesPerMM);\r
+ if(sheet instanceof HSSFSheet) {\r
+ colWidthMM = reqImageWidthMM;\r
+ colCoordinatesPerMM = ConvertImageUnits.TOTAL_COLUMN_COORDINATE_POSITIONS /\r
+ colWidthMM;\r
+ pictureWidthCoordinates = (int)(reqImageWidthMM * colCoordinatesPerMM);\r
+\r
+ }\r
+ else {\r
+ pictureWidthCoordinates = (int)reqImageWidthMM * AddDimensionedImage.EMU_PER_MM;\r
+ }\r
colClientAnchorDetail = new ClientAnchorDetail(colNumber,\r
colNumber, pictureWidthCoordinates);\r
}\r
}\r
// If the column is wider than the image.\r
else {\r
- // Mow many co-ordinate positions are there per millimetre?\r
- colCoordinatesPerMM = ConvertImageUnits.TOTAL_COLUMN_COORDINATE_POSITIONS /\r
+ if(sheet instanceof HSSFSheet) {\r
+ // Mow many co-ordinate positions are there per millimetre?\r
+ colCoordinatesPerMM = ConvertImageUnits.TOTAL_COLUMN_COORDINATE_POSITIONS /\r
colWidthMM;\r
- // Given the width of the image, what should be it's co-ordinate?\r
- pictureWidthCoordinates = (int)(reqImageWidthMM * colCoordinatesPerMM);\r
+ // Given the width of the image, what should be it's co-ordinate?\r
+ pictureWidthCoordinates = (int)(reqImageWidthMM * colCoordinatesPerMM);\r
+ }\r
+ else {\r
+ pictureWidthCoordinates = (int)reqImageWidthMM *\r
+ AddDimensionedImage.EMU_PER_MM;\r
+ }\r
colClientAnchorDetail = new ClientAnchorDetail(colNumber,\r
colNumber, pictureWidthCoordinates);\r
}\r
}\r
\r
/**\r
- * Determines whether the sheet's row should be re-sized to accomodate\r
+ * Determines whether the sheets row should be re-sized to accomodate\r
* the image, adjusts the rows height if necessary and creates then\r
* returns a ClientAnchorDetail object that facilitates construction of\r
* a ClientAnchor that will fix the image on the sheet and establish\r
* it's size.\r
*\r
* @param sheet A reference to the sheet that will 'contain' the image.\r
- * @param rowNumber A primtive int that contains the index number of a\r
+ * @param rowNumber A primitive int that contains the index number of a\r
* row on the sheet.\r
- * @param reqImageHeightMM A primtive double that contains the required\r
+ * @param reqImageHeightMM A primitive double that contains the required\r
* height of the image in millimetres\r
- * @param resizeBehaviour A primitve int whose value will indicate how the\r
+ * @param resizeBehaviour A primitive int whose value will indicate how the\r
* height of the row should be adjusted if the\r
* required height of the image is greater than the\r
* height of the row.\r
* top left hand corner also defines the bottom right hand\r
* corner of the image and an inset that determines how far the\r
* bottom edge of the image can protrude into the next (lower)\r
- * row - expressed as a specific number of co-ordinate positions.\r
+ * row - expressed as a specific number of coordinate positions.\r
*/\r
private ClientAnchorDetail fitImageToRows(Sheet sheet, int rowNumber,\r
double reqImageHeightMM, int resizeBehaviour) {\r
(resizeBehaviour == AddDimensionedImage.EXPAND_ROW_AND_COLUMN)) {\r
row.setHeightInPoints((float)(reqImageHeightMM *\r
ConvertImageUnits.POINTS_PER_MILLIMETRE));\r
- rowHeightMM = reqImageHeightMM;\r
- rowCoordinatesPerMM = ConvertImageUnits.TOTAL_ROW_COORDINATE_POSITIONS /\r
- rowHeightMM;\r
- pictureHeightCoordinates = (int)(reqImageHeightMM * rowCoordinatesPerMM);\r
+ if(sheet instanceof HSSFSheet) { \r
+ rowHeightMM = reqImageHeightMM;\r
+ rowCoordinatesPerMM = ConvertImageUnits.TOTAL_ROW_COORDINATE_POSITIONS /\r
+ rowHeightMM;\r
+ pictureHeightCoordinates = (int)(reqImageHeightMM *\r
+ rowCoordinatesPerMM);\r
+ }\r
+ else {\r
+ pictureHeightCoordinates = (int)(reqImageHeightMM *\r
+ AddDimensionedImage.EMU_PER_MM);\r
+ }\r
rowClientAnchorDetail = new ClientAnchorDetail(rowNumber,\r
rowNumber, pictureHeightCoordinates);\r
}\r
}\r
// Else, if the image is smaller than the space available\r
else {\r
- rowCoordinatesPerMM = ConvertImageUnits.TOTAL_ROW_COORDINATE_POSITIONS /\r
+ if(sheet instanceof HSSFSheet) {\r
+ rowCoordinatesPerMM = ConvertImageUnits.TOTAL_ROW_COORDINATE_POSITIONS /\r
rowHeightMM;\r
- pictureHeightCoordinates = (int)(reqImageHeightMM * rowCoordinatesPerMM);\r
+ pictureHeightCoordinates = (int)(reqImageHeightMM * rowCoordinatesPerMM);\r
+ }\r
+ else {\r
+ pictureHeightCoordinates = (int)(reqImageHeightMM *\r
+ AddDimensionedImage.EMU_PER_MM);\r
+ }\r
rowClientAnchorDetail = new ClientAnchorDetail(rowNumber,\r
rowNumber, pictureHeightCoordinates);\r
}\r
* left hand corner also defines the bottom right hand corner of\r
* the image and an inset that determines how far the right hand\r
* edge of the image can protrude into the next column - expressed\r
- * as a specific number of co-ordinate positions.\r
+ * as a specific number of coordinate positions.\r
*/\r
private ClientAnchorDetail calculateColumnLocation(Sheet sheet,\r
int startingColumn,\r
// total number of co-ordinate positions to the third paramater\r
// of the ClientAnchorDetail constructor. For no sepcific reason,\r
// the latter option is used below.\r
- anchorDetail = new ClientAnchorDetail(startingColumn,\r
+ if(sheet instanceof HSSFSheet) {\r
+ anchorDetail = new ClientAnchorDetail(startingColumn,\r
toColumn, ConvertImageUnits.TOTAL_COLUMN_COORDINATE_POSITIONS);\r
+ }\r
+ else {\r
+ anchorDetail = new ClientAnchorDetail(startingColumn,\r
+ toColumn, (int)reqImageWidthMM * AddDimensionedImage.EMU_PER_MM);\r
+ }\r
}\r
// In this case, the image will overlap part of another column and it is\r
// necessary to calculate just how much - this will become the inset\r
overlapMM = 0.0D;\r
}\r
\r
- // Next, from the columns width, calculate how many co-ordinate\r
- // positons there are per millimetre\r
- coordinatePositionsPerMM = ConvertImageUnits.TOTAL_COLUMN_COORDINATE_POSITIONS /\r
+ if(sheet instanceof HSSFSheet) {\r
+ // Next, from the columns width, calculate how many co-ordinate\r
+ // positons there are per millimetre\r
+ coordinatePositionsPerMM = ConvertImageUnits.TOTAL_COLUMN_COORDINATE_POSITIONS /\r
colWidthMM;\r
- // From this figure, determine how many co-ordinat positions to\r
- // inset the left hand or bottom edge of the image.\r
- inset = (int)(coordinatePositionsPerMM * overlapMM);\r
+ // From this figure, determine how many co-ordinat positions to\r
+ // inset the left hand or bottom edge of the image.\r
+ inset = (int)(coordinatePositionsPerMM * overlapMM);\r
+ }\r
+ else {\r
+ inset = (int)overlapMM * AddDimensionedImage.EMU_PER_MM;\r
+ }\r
\r
// Now create the ClientAnchorDetail object, setting the from and to\r
// columns and the inset.\r
// equality, cast both to int(s) to truncate the value; VERY crude and\r
// I do not really like it!!\r
if((int)totalRowHeightMM == (int)reqImageHeightMM) {\r
- clientAnchorDetail = new ClientAnchorDetail(startingRow, toRow,\r
+ if(sheet instanceof HSSFSheet) {\r
+ clientAnchorDetail = new ClientAnchorDetail(startingRow, toRow,\r
ConvertImageUnits.TOTAL_ROW_COORDINATE_POSITIONS);\r
+ }\r
+ else {\r
+ clientAnchorDetail = new ClientAnchorDetail(startingRow, toRow,\r
+ (int)reqImageHeightMM * AddDimensionedImage.EMU_PER_MM);\r
+ }\r
}\r
else {\r
// Calculate how far the image will project into the next row. Note\r
overlapMM = 0.0D;\r
}\r
\r
- rowCoordinatesPerMM = ConvertImageUnits.TOTAL_ROW_COORDINATE_POSITIONS /\r
+ if(sheet instanceof HSSFSheet) {\r
+ rowCoordinatesPerMM = ConvertImageUnits.TOTAL_ROW_COORDINATE_POSITIONS /\r
rowHeightMM;\r
- inset = (int)(overlapMM * rowCoordinatesPerMM);\r
+ inset = (int)(overlapMM * rowCoordinatesPerMM);\r
+ }\r
+ else {\r
+ inset = (int)overlapMM * AddDimensionedImage.EMU_PER_MM;\r
+ }\r
clientAnchorDetail = new ClientAnchorDetail(startingRow,\r
toRow, inset);\r
}\r
System.err.println("Usage: AddDimensionedImage imageFile outputFile");\r
return;\r
}\r
- workbook = new HSSFWorkbook();\r
+ workbook = new HSSFWorkbook(); // OR XSSFWorkbook\r
sheet = workbook.createSheet("Picture Test");\r
- // Note that as the code has been ported to the SS model, the following\r
- // would be equally as valid - workbook = new XSSFWorkbook();\r
- imageFile = args[0];\r
+ imageFile = args[0];\r
outputFile = args[1];\r
new AddDimensionedImage().addImageToSheet("B5", sheet, sheet.createDrawingPatriarch(),\r
new File(imageFile).toURI().toURL(), 100, 40,\r
}\r
\r
/**\r
- * The HSSFClientAnchor class accepts eight parameters. In order, these are;\r
+ * The HSSFClientAnchor class accepts eight arguments. In order, these are;\r
*\r
* * How far the left hand edge of the image is inset from the left hand\r
* edge of the cell\r
* hand edge of the cell\r
* * How far the bottom edge of the image is inset from the top of the\r
* cell.\r
- * * Together, parameters five and six determine the column and row\r
- * co-ordinates of the cell whose top left hand corner will be aligned\r
- * with the image's top left hand corner.\r
- * * Together, parameter seven and eight determine the column and row\r
- * co-ordinates of the cell whose top left hand corner will be aligned\r
+ * * Together, arguments five and six determine the column and row\r
+ * coordinates of the cell whose top left hand corner will be aligned\r
+ * with the images top left hand corner.\r
+ * * Together, arguments seven and eight determine the column and row\r
+ * coordinates of the cell whose top left hand corner will be aligned\r
* with the images bottom right hand corner.\r
*\r
* An instance of the ClientAnchorDetail class provides three of the eight\r
- * parameters, one of the co-ordinates for the images top left hand corner,\r
- * one of the co-ordinates for the images bottom right hand corner and\r
+ * parameters, one of the coordinates for the images top left hand corner,\r
+ * one of the coordinates for the images bottom right hand corner and\r
* either how far the image should be inset from the top or the left hand\r
* edge of the cell.\r
*\r
* following parameters.\r
*\r
* @param fromIndex A primitive int that contains one of the\r
- * co-ordinates (row or column index) for the top left\r
+ * coordinates (row or column index) for the top left\r
* hand corner of the image.\r
* @param toIndex A primitive int that contains one of the\r
- * co-ordinates (row or column index) for the bottom\r
+ * coordinates (row or column index) for the bottom\r
* right hand corner of the image.\r
* @param inset A primitive int that contains a value which indicates\r
* how far the image should be inset from the top or the\r
* whose top left hand corner will be aligned with the top left hand\r
* corner of the image.\r
*\r
- * @return The value - row or column index - for one of the co-ordinates\r
+ * @return The value - row or column index - for one of the coordinates\r
* of the top left hand corner of the image.\r
*/\r
public int getFromIndex() {\r
\r
/**\r
* Get one of the number of the column or row that contains the cell\r
- * whose top left hand corner will be aligned with the bottom righ hand\r
+ * whose top left hand corner will be aligned with the bottom right hand\r
* corner of the image.\r
*\r
- * @return The value - row or column index - for one of the co-ordinates\r
+ * @return The value - row or column index - for one of the coordinates\r
* of the bottom right hand corner of the image.\r
*/\r
public int getToIndex() {\r
}\r
\r
/**\r
- * Get the image's offset from the edge of a cell.\r
+ * Get the images offset from the edge of a cell.\r
*\r
* @return How far either the right hand or bottom edge of the image is\r
* inset from the left hand or top edge of a cell.\r
}\r
\r
/**\r
- * Utility methods used to convert Excel's character based column and row\r
+ * Utility methods used to convert Excels character based column and row\r
* size measurements into pixels and/or millimetres. The class also contains\r
* various constants that are required in other calculations.\r
*\r
}\r
\r
/**\r
- * Convert Excel's width units into millimetres.\r
+ * Convert Excels width units into millimetres.\r
*\r
* @param widthUnits The width of the column or the height of the\r
- * row in Excel's units.\r
+ * row in Excels units.\r
* @return A primitive double that contains the columns width or rows\r
* height in millimetres.\r
*/\r
}\r
\r
/**\r
- * Convert into millimetres Excel's width units..\r
+ * Convert into millimetres Excels width units..\r
*\r
* @param millimetres A primitive double that contains the columns\r
* width or rows height in millimetres.\r
* @return A primitive int that contains the columns width or rows\r
- * height in Excel's units.\r
+ * height in Excels units.\r
*/\r
public static int millimetres2WidthUnits(double millimetres) {\r
return(ConvertImageUnits.pixel2WidthUnits((int)(millimetres *\r