Return-Path: X-Original-To: apmail-poi-user-archive@www.apache.org Delivered-To: apmail-poi-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id C10C3DBE6 for ; Wed, 20 Jun 2012 11:07:46 +0000 (UTC) Received: (qmail 24308 invoked by uid 500); 20 Jun 2012 11:07:46 -0000 Delivered-To: apmail-poi-user-archive@poi.apache.org Received: (qmail 24172 invoked by uid 500); 20 Jun 2012 11:07:45 -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 24155 invoked by uid 99); 20 Jun 2012 11:07:45 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 20 Jun 2012 11:07:45 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=FSL_RCVD_USER,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of denis.delangle.ml@gmail.com designates 74.125.82.174 as permitted sender) Received: from [74.125.82.174] (HELO mail-we0-f174.google.com) (74.125.82.174) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 20 Jun 2012 11:07:40 +0000 Received: by weyu7 with SMTP id u7so6293144wey.33 for ; Wed, 20 Jun 2012 04:07:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; bh=zVk1m/xzs12c5ARGVzOeYOXq8p5c/59PSRmiy+c3bg8=; b=Bctvaor/KIO4htkSQXxFgGYRGSTTcu1hP2wnWiYwQ8tuxKEuM7FcgMupPzXEwDS1r2 trl9ofUpPzTfRkpFwNGnSxtIxiy9IgdVPDGfuLBvB0HvNBYG2cJNrFMdTj+qaI7x8gRt b6uQjl2XM3sDxMeVgN/RWH1CU+D7eathP33lAHHMbZBUcV1dTQ++w1GQGEO2Krb2Z6Gi IASfGCi8+gy4kIjd6PUz2E4WvC6gjJjNV7f2iQjptIgMkjyYfIbWcne59lnXkxEhCMnu pZsW+KvLFflApS0l4kNue62S+pkD3+xBB7C/3w3AQLrHSSYhM9hXOwDkcjAID4/xJ4CY +3aA== MIME-Version: 1.0 Received: by 10.180.107.70 with SMTP id ha6mr11190782wib.10.1340190438628; Wed, 20 Jun 2012 04:07:18 -0700 (PDT) Received: by 10.216.230.90 with HTTP; Wed, 20 Jun 2012 04:07:18 -0700 (PDT) In-Reply-To: References: Date: Wed, 20 Jun 2012 13:07:18 +0200 Message-ID: Subject: Re: Excel 97 - How to get get text zones from a Sheet From: Denis Delangle To: POI Users List Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Virus-Checked: Checked by ClamAV on apache.org Ok thanks 2012/6/20 Yegor Kozlov : > The text is empty becase HSSF does not fully read existing drawing > objects from sheets. POI can create new drawings from scratch but > cannotfully =A0read and modify existing ones. > =A0It is an old and known limitation and we are working to improve this > area, but for now you can only read basic shape properties. > > > Yegor > > On Wed, Jun 20, 2012 at 2:06 PM, Denis Delangle > wrote: >> Thanks for your quick answer, >> >> I tried this code with this file =A0: >> for(HSSFShape shape : wb.getSheetAt(1).getDrawingPatriarch().getChildren= ()) { >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0System.out.println(">> " = + shape.toString()); >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0if(shape instanceof HSSFT= extbox) { >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0HSSFTextb= ox txtBox =3D (HSSFTextbox) shape; >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0System.ou= t.println("-- "+txtBox.getString().length() + >> txtBox.getString().toString()); >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0} >> >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0} >> >> But the text is always empty : >>>> org.apache.poi.hssf.usermodel.HSSFTextbox@61542a75 >> -- 0 >> >> Any idea why ? >> >> Denis >> >> 2012/6/20 Yegor Kozlov : >>> Try to iterate over shapes in sheet.getDrawingPatriarch().getChildren()= . >>> Check if a object is HSSFTextbox and then retrive its position via >>> shape.getAnchor(). >>> >>> Yegor >>> >>> On Wed, Jun 20, 2012 at 12:21 PM, Denis Delangle >>> wrote: >>>> Hello, >>>> >>>> First of all I am an happy user of POI (using it intensively during >>>> last 2 years on various Excel files to extract data) stuck for the >>>> first time. So thanks for this nice peace of software. >>>> >>>> I would like to extract text zones from my Excel file but I really >>>> need to know to which sheet the text zone belongs to. >>>> >>>> I tried this method to get all the text zones from a workbook using >>>> TextObjectRecord and HSSFRequest : >>>> http://article.gmane.org/gmane.comp.jakarta.poi.user/8549/match=3Dtext= objectrecord >>>> But I don't have sheet information. >>>> >>>> Do you know if there is a way to get it ? >>>> >>>> Regards, >>>> >>>> Denis >>>> >>>> --------------------------------------------------------------------- >>>> To unsubscribe, e-mail: user-unsubscribe@poi.apache.org >>>> For additional commands, e-mail: user-help@poi.apache.org >>>> >>> >>> --------------------------------------------------------------------- >>> To unsubscribe, e-mail: user-unsubscribe@poi.apache.org >>> For additional commands, e-mail: user-help@poi.apache.org >>> >> >> >> --------------------------------------------------------------------- >> To unsubscribe, e-mail: user-unsubscribe@poi.apache.org >> For additional commands, e-mail: user-help@poi.apache.org > > --------------------------------------------------------------------- > To unsubscribe, e-mail: user-unsubscribe@poi.apache.org > For additional commands, e-mail: user-help@poi.apache.org > --------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscribe@poi.apache.org For additional commands, e-mail: user-help@poi.apache.org