From user-return-23291-archive-asf-public=cust-asf.ponee.io@poi.apache.org Tue Dec 18 21:33:55 2018 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx-eu-01.ponee.io (Postfix) with SMTP id 19138180669 for ; Tue, 18 Dec 2018 21:33:54 +0100 (CET) Received: (qmail 49659 invoked by uid 500); 18 Dec 2018 20:33:54 -0000 Mailing-List: contact user-help@poi.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "POI Users List" Delivered-To: mailing list user@poi.apache.org Received: (qmail 49648 invoked by uid 99); 18 Dec 2018 20:33:53 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd4-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 18 Dec 2018 20:33:53 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd4-us-west.apache.org (ASF Mail Server at spamd4-us-west.apache.org) with ESMTP id 07E6DC018C for ; Tue, 18 Dec 2018 20:33:53 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd4-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 4.485 X-Spam-Level: **** X-Spam-Status: No, score=4.485 tagged_above=-999 required=6.31 tests=[DKIM_ADSP_CUSTOM_MED=0.001, FORGED_GMAIL_RCVD=1, NML_ADSP_CUSTOM_MED=1.2, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_PASS=-0.001, SPF_SOFTFAIL=0.972, URI_HEX=1.313] autolearn=disabled Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd4-us-west.apache.org [10.40.0.11]) (amavisd-new, port 10024) with ESMTP id I1uHStmR-AaD for ; Tue, 18 Dec 2018 20:33:51 +0000 (UTC) Received: from n5.nabble.com (n5.nabble.com [162.253.133.81]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTP id 2BB7B622F9 for ; Tue, 18 Dec 2018 20:33:51 +0000 (UTC) Received: from n5.nabble.com (localhost [127.0.0.1]) by n5.nabble.com (Postfix) with ESMTP id 69CD4A68C822 for ; Tue, 18 Dec 2018 13:33:50 -0700 (MST) Date: Tue, 18 Dec 2018 13:33:50 -0700 (MST) From: paoim101084 To: user@poi.apache.org Message-ID: <1545165230431-0.post@n5.nabble.com> In-Reply-To: References: <1533400031442-0.post@n5.nabble.com> <85ff7b39-afa0-1549-e2ef-852dbfb47d48@apache.org> <1545160128590-0.post@n5.nabble.com> <61d5158d-791a-ee3b-3b1f-bba187f5d6d2@apache.org> <1545162476610-0.post@n5.nabble.com> Subject: Re: XSLFTextRun definition MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Hi Andi, Thank for your detail information. Yes, I want to calculate the table height. Could you help to provide some idea about that? Here is what I did but it seems not work well: static void calculateTableHeight(XSLFTable tab, Rectangle2D anchor) {//FIXME - issue? double totalCellAnchorHeight = 0; for (XSLFTableRow row : tab.getRows()) { /*for (XSLFTableCell cell : row.getCells()) { cell.resizeToFitText(); //make Cell Height fits with Text Height }*/ List cellAnchorHeightList = row.getCells().stream().map(c -> c.getAnchor().getHeight()).collect(Collectors.toList()); double maxCellAnchorHeight = Collections.max(cellAnchorHeightList);// Get only Max Cell Anchor's height totalCellAnchorHeight += maxCellAnchorHeight; } Rectangle2D newAnchor = new Rectangle2D.Double(anchor.getX(), anchor.getY(), anchor.getWidth(), totalCellAnchorHeight); tab.setAnchor(newAnchor); } -- Sent from: http://apache-poi.1045710.n5.nabble.com/POI-User-f2280730.html --------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscribe@poi.apache.org For additional commands, e-mail: user-help@poi.apache.org