We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Clarification on Shape Size and Bounds For Aspose.Words Java 15.9.0

Hi,


We are currently using Aspose.Words Java 14.7.0 in our application. While doing the evaluation of Aspose.Words Java 15.9.0, we got some strange results for shapes/groupshapes present in header and footers.

We ran following code:

public void testShapeSize() throws Exception {
Document sample = new Document(“Office2013_Header_Footer_With_Paragraph_BookMarks_FieldCode_Author.docx”);

NodeCollection hfChildNodes = sample.getSections().get(0).getHeadersFooters().getByHeaderFooterType(HeaderFooterType.HEADER_PRIMARY).getChildNodes();

for (int i = 0; i < hfChildNodes.getCount(); i++) {
if (hfChildNodes.get(i).getNodeType() == NodeType.PARAGRAPH) {

Paragraph para = (Paragraph)hfChildNodes.get(i);

for (int j = 0; j < para.getChildNodes().getCount(); j++) {
if (para.getChildNodes().get(j).getNodeType() == NodeType.GROUP_SHAPE) {
GroupShape grpShape = (GroupShape)para.getChildNodes().get(j);
for (int k = 0; k < grpShape.getChildNodes().getCount(); k++) {
if (grpShape.getChildNodes().get(k).getNodeType() == NodeType.SHAPE) {

Shape shape = (Shape)grpShape.getChildNodes().get(k);
java.awt.geom.Rectangle2D.Float bounds = shape.getBoundsInPoints();
System.out.println("X coordinate of this Rectangle2D: " + bounds.x);
System.out.println("Y coordinate of this Rectangle2D: " + bounds.y);
System.out.println("the X coordinate of the upper-left corner of the framing rectangle: " + bounds.getX());
System.out.println("the Y coordinate of the upper-left corner of the framing rectangle: " + bounds.getY());
System.out.println("Height of this Rectangle2D: " + bounds.getHeight());
System.out.println("Width of this Rectangle2D: " + bounds.getWidth());

java.awt.geom.Point2D.Float size = shape.getSizeInPoints();

System.out.println("the X coordinate of this Point2D in double precision: " + size.getX());
System.out.println("the Y coordinate of this Point2D in double precision: " + size.getX());
System.out.println("The X coordinate of this Point2D: " + size.x);
System.out.println("The Y coordinate of this Point2D: " + size.y);
}
}
}
}

}
}


}

Aspose Words Java 14.7.0 output:

X coordinate of this Rectangle2D: 0.0
Y coordinate of this Rectangle2D: 0.0
the X coordinate of the upper-left corner of the framing rectangle: 0.0
the Y coordinate of the upper-left corner of the framing rectangle: 0.0
Height of this Rectangle2D: 61.20000076293945
Width of this Rectangle2D: 327.6000061035156
the X coordinate of this Point2D in double precision: 327.6000061035156
the Y coordinate of this Point2D in double precision: 327.6000061035156
The X coordinate of this Point2D: 327.6
The Y coordinate of this Point2D: 61.2
X coordinate of this Rectangle2D: 0.0
Y coordinate of this Rectangle2D: 0.0
the X coordinate of the upper-left corner of the framing rectangle: 0.0
the Y coordinate of the upper-left corner of the framing rectangle: 0.0
Height of this Rectangle2D: 42.600616455078125
Width of this Rectangle2D: 327.0015869140625
the X coordinate of this Point2D in double precision: 327.0015869140625
the Y coordinate of this Point2D in double precision: 327.0015869140625
The X coordinate of this Point2D: 327.0016
The Y coordinate of this Point2D: 42.600616

Aspose Words Java 15.9.0 output:

X coordinate of this Rectangle2D: NaN
Y coordinate of this Rectangle2D: NaN
the X coordinate of the upper-left corner of the framing rectangle: NaN
the Y coordinate of the upper-left corner of the framing rectangle: NaN
Height of this Rectangle2D: NaN
Width of this Rectangle2D: NaN
the X coordinate of this Point2D in double precision: NaN
the Y coordinate of this Point2D in double precision: NaN
The X coordinate of this Point2D: NaN
The Y coordinate of this Point2D: NaN
I am unable to understand why we are getting different results for same sample document when running same code in different aspose versions.

Please help us in resolving this issue.

The sample document is attached with this post for your reference.

Thanks
Manisha

Hi Manisha,

Thanks for your inquiry. I have logged this problem in our issue tracking system as WORDSNET-12565. We will inform you via this forum thread once there is any update available on this issue.

We apologize for your inconvenience.

Hi,


Thanks for logging an issue on this.

Could you please tell me when this issue is being scheduled to get resolved?
Can we expect the fix to be available in Aspose Words upcoming version 15.10.0?


Thanks
Manisha

Hi Manisha,

Thanks
for your inquiry. I would like to share with you that issues are
addressed and resolved based on first come first serve basis. Currently,
your issue is under analysis phase. I am afraid, we can’t provide you any
reliable estimate at the moment. Once your issue is analyzed, we will
then be able to provide you an estimate.

Thank you for your patience and understanding.

Hi,


Is there any update on this issue?
Can we expect the fix to be available in Aspose Words upcoming version 15.11.0?


Thanks
Manisha

Hi Manisha,

Thanks for your inquiry. This issue has now been resolved and its fix will be available in next version of Aspose.Words v15.11.0. We will update you via this forum thread once new version of Aspose.Words is published. Hopefully, the new version of Aspose.Words will be available at the start of next week.


Thanks for your patience.

The issues you have found earlier (filed as WORDSNET-12565) have been fixed in this .NET update and this Java update.


This message was posted using Notification2Forum from Downloads module by aspose.notifier.