Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id CB9DA200BD4 for ; Thu, 1 Dec 2016 21:38:23 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id C8A53160B0B; Thu, 1 Dec 2016 20:38:23 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 1CF28160B05 for ; Thu, 1 Dec 2016 21:38:22 +0100 (CET) Received: (qmail 49153 invoked by uid 500); 1 Dec 2016 20:38:22 -0000 Mailing-List: contact users-help@pdfbox.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@pdfbox.apache.org Delivered-To: mailing list users@pdfbox.apache.org Received: (qmail 49141 invoked by uid 99); 1 Dec 2016 20:38:21 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd3-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 01 Dec 2016 20:38:21 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd3-us-west.apache.org (ASF Mail Server at spamd3-us-west.apache.org) with ESMTP id 8ABEB180652 for ; Thu, 1 Dec 2016 20:38:21 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -0.999 X-Spam-Level: X-Spam-Status: No, score=-0.999 tagged_above=-999 required=6.31 tests=[HTML_MESSAGE=2, RCVD_IN_DNSWL_NONE=-0.0001, RP_MATCHES_RCVD=-2.999, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=disabled Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id xJi2b6VCbtgP for ; Thu, 1 Dec 2016 20:38:19 +0000 (UTC) Received: from www.tlcc.com (www.tlcc.com [199.19.209.77]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTP id 776A95F306 for ; Thu, 1 Dec 2016 20:38:19 +0000 (UTC) In-Reply-To: <2b8bff83-8d86-5d75-60cf-43041899f87f@t-online.de> References: <3ca4539d-279b-487c-6778-3ef2128628eb@t-online.de> <2b8bff83-8d86-5d75-60cf-43041899f87f@t-online.de> To: users@pdfbox.apache.org MIME-Version: 1.0 Subject: Re: question on getting location of bookmark X-KeepSent: 3C82CE60:85F5075C-8525807C:00713FD1; type=4; name=$KeepSent X-Mailer: IBM Notes Release 9.0.1FP7 August 18, 2016 Message-ID: From: howardg@tlcc.com Date: Thu, 1 Dec 2016 15:38:13 -0500 X-MIMETrack: Serialize by Router on Server10/Servers/TLCC(Release 9.0.1FP6|April 20, 2016) at 12/01/2016 03:38:13 PM, Serialize complete at 12/01/2016 03:38:13 PM Content-Type: multipart/alternative; boundary="=_alternative 00715F038525807C_=" archived-at: Thu, 01 Dec 2016 20:38:24 -0000 --=_alternative 00715F038525807C_= Content-Type: text/plain; charset="US-ASCII" thanks, I am missing something... My code uses getDestination() and recasts as PDPageXYZDestination. However, the dest is null. I must be missing something? PDDocumentOutline outline = pdfDoc .getDocumentCatalog().getDocumentOutline(); if( outline != null ){ debugMsg2("found outline"); PDOutlineItem current = outline.getFirstChild(); while( current != null ) { debugMsg2( current.getTitle() ); if ("Image" .equalsIgnoreCase(current.getTitle())){ PDPageXYZDestination dest = (PDPageXYZDestination) current.getDestination(); if (dest!=null){ debugMsg2("left: " + dest.getLeft()); debugMsg2("top: " + dest.getTop()); debugMsg2("page: " + dest.getPageNumber()); } else { debugMsg2("dest is null"); } } current = current.getNextSibling(); } } else { debugMsg2( "This document does not contain any bookmarks" ); } Howard Howard Greenberg, CPA, CISA IBM Certified Application Developer/Instructor - IBM Notes and Domino The Learning Continuum Company, Ltd. 888-241-8522 or 561-953-0096 http://www.tlcc.com mailto:howardg@tlcc.com From: Tilman Hausherr To: users@pdfbox.apache.org Date: 12/01/2016 03:15 PM Subject: Re: question on getting location of bookmark Am 01.12.2016 um 21:12 schrieb howardg@tlcc.com: > thanks, can you elaborate? The API doc for getDestination shows that > returns PDDestination and I don't see any methods that return the > coordinates? There are 7 derived classes. That's why I mentioned that there are several types. For example, PDPageXYZDestination has a getLeft() and getTop() method. But not all of the derived classes have coordinates like that. Tilman > > > > Howard > Howard Greenberg, CPA, CISA > IBM Certified Application Developer/Instructor - IBM Notes and Domino > The Learning Continuum Company, Ltd. > 888-241-8522 or 561-953-0096 > http://www.tlcc.com > mailto:howardg@tlcc.com > > > > From: Tilman Hausherr > To: users@pdfbox.apache.org > Date: 12/01/2016 03:03 PM > Subject: Re: question on getting location of bookmark > > > > Am 01.12.2016 um 21:00 schrieb howardg@tlcc.com: >> I want to find the x,y position of a bookmark in the pdf to be able to >> insert an image at that location. >> >> I can get the bookmark with the code below and looping through to find > the >> one I need with getTitle.... >> PDOutlineItem current = outline.getFirstChild(); >> >> But, how would I use PDOutlineItem to get the page/location to pass as > the >> x,y coordinates in contentStream.drawImage(img, 100, 100); > call getDestnation(). There are several types, and some of them have > coordinates. > > --------------------------------------------------------------------- > To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org > For additional commands, e-mail: users-help@pdfbox.apache.org > > > > --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org For additional commands, e-mail: users-help@pdfbox.apache.org --=_alternative 00715F038525807C_=--