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 1A8CE200C60 for ; Mon, 24 Apr 2017 14:53:48 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 177FD160BA5; Mon, 24 Apr 2017 12:53:48 +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 5EF19160B99 for ; Mon, 24 Apr 2017 14:53:47 +0200 (CEST) Received: (qmail 79269 invoked by uid 500); 24 Apr 2017 12:53:40 -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 79257 invoked by uid 99); 24 Apr 2017 12:53:40 -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; Mon, 24 Apr 2017 12:53:40 +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 EBAE2180594 for ; Mon, 24 Apr 2017 12:53:39 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 0.379 X-Spam-Level: X-Spam-Status: No, score=0.379 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, RCVD_IN_SORBS_SPAM=0.5, SPF_PASS=-0.001] autolearn=disabled Authentication-Results: spamd3-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com 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 P-5XoSj21oBV for ; Mon, 24 Apr 2017 12:53:39 +0000 (UTC) Received: from mail-qk0-f180.google.com (mail-qk0-f180.google.com [209.85.220.180]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTPS id 224BC5FB7A for ; Mon, 24 Apr 2017 12:53:39 +0000 (UTC) Received: by mail-qk0-f180.google.com with SMTP id f76so35829975qke.2 for ; Mon, 24 Apr 2017 05:53:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=to:from:subject:message-id:date:user-agent:mime-version :content-transfer-encoding; bh=MuZwvxu2hy7kNx6GrBR+L7XFJHxvT1+3IB9u5S2WmU0=; b=QHZfQRt0gTN97ouCwesu5gXkMHbTHW6epkm2RhnPz4+0XxT+0MbLv7iLn55AdiVWO9 cOsEOcAenDUVAntOqmwFYFftjwyGVDObg0fH2bsPwckdmoNRkG6Fs4GDZwAt3QPiPRZA UaRJIl45b/3z9YDca2zDms4pqb7Bk4y1KLWOfGzM+5+sTDGym9AyM5m+yJPkmNJgwmIT DVquBK8xOSUHwTD9lnFaBskMVBj/ZWi8X3mcxBKt2WG4pMMAS7F5jXImKEb7F+Q6nhni m4LWf1TCRjIdcJc7iT46vfCGGmuP5kIz4ZsmoVUygQPnEHwRIoRwrrnmHOA3Dhh7Nd0z TUeA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:to:from:subject:message-id:date:user-agent :mime-version:content-transfer-encoding; bh=MuZwvxu2hy7kNx6GrBR+L7XFJHxvT1+3IB9u5S2WmU0=; b=DJgh9fOnOAIKCb5P+2YkEUGSyik2sJuTpm3kU9CsfJPgih8uvLIS1YuNO7hnba/hWF BwXP//0+O5RlGrl5PaSR4i7bIqPregdXR/5QJ0ZHDXtyafbq+kAFpJL2OgG4VIhnV1dp KstMlQAAciNiTISX/H+NCPAFf26q8U978dqUR0EU6RuPT0VtUhHt1bbxMZwhLRGNX2pj bOx17oPXKxAo52oX2e6oxzUlRphCaN0rbvfV/kTpX2jtrxMdbp1tFpqffL6ypskkHaq6 HcOHj/z+dooafE6Ve5myZqflKJz7GWTweazkuuyNMnmkps8H8XMxXF/sPdA6bDgi03VS 1Lrg== X-Gm-Message-State: AN3rC/6Xkp5fh2GO5kihp6x0/TZlK9Dwuhqa4Pojs3GswJQhi9A+KkCd zv8vfnnkJVhLDpYlOYk= X-Received: by 10.55.19.93 with SMTP id d90mr24871009qkh.181.1493038418658; Mon, 24 Apr 2017 05:53:38 -0700 (PDT) Received: from [192.168.1.126] ([181.28.221.196]) by smtp.gmail.com with ESMTPSA id o41sm12877212qto.3.2017.04.24.05.53.35 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 24 Apr 2017 05:53:37 -0700 (PDT) To: users@pdfbox.apache.org From: Olivier Cailloux Subject: Get list of PDPageLabelRange? Message-ID: Date: Mon, 24 Apr 2017 09:53:33 -0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Icedove/45.5.1 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit archived-at: Mon, 24 Apr 2017 12:53:48 -0000 Dear list, How can I obtain, from a given PDDocument, a list of the page label ranges that it contains? Here is an example where I obtain the first PDPageLabelRange. How to retrieve the other ones? I realize I can iterate over all pages of the document and query for the possible existence of a pageLabelRange at each page, but I suspect there must be a more efficient (and simpler) way. try (PDDocument document = PDDocument.load(…)) { assert !document.isEncrypted(); PDDocumentCatalog catalog = document.getDocumentCatalog(); PDPageLabels labels = catalog.getPageLabels(); PDPageLabelRange pageLabelRange = labels.getPageLabelRange(0); } Thanks. Olivier --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org For additional commands, e-mail: users-help@pdfbox.apache.org