Hey,
I’m trying to implement a Visitor that can print out the position of the left line of each cell in a table. I would like it to be able to handle any table. However, I am having issues because I am not able to determine the indentation/position of the first cell since it may be indented differently relative to the other rows.
I have attached an example document. Does anyone know how I may use the aspose API to correctly determine the position/indentation of the first line in each row? I would presumably be able to easily compute the remaining lines in each cell given the I can easily get the next line by summing up the current cell’s width as follows:
double currentPosition = ConvertUtil.pointToInch(cell.getCellFormat().getWidth()).
I thought it would be possible for me to determine the left indent of the each row by calling:
ConvertUtil.pointToInch(row.getRowFormat().getLeftIndent()) inside of visitRowStart():
public int visitRowStart(Row row) throws Exception {
rowSumInch = ConvertUtil.pointToInch(row.getRowFormat().getLeftIndent());
System.out.printf("New Row%n\tLeftIndent: %f%n", rowSumInch);
return super.visitRowStart(row);
}
However, it appears that this returns the same value for both rows in my example table:
LeftIndent: 0.387500
LeftIndent: 0.387500
Clearly from the example we can see that the indentation of each row is different.
I am adding my example visitor that I am using that includes all of the code that I am using to investigate this.
Thanks,
Chase