Return-Path: X-Original-To: apmail-pdfbox-users-archive@www.apache.org Delivered-To: apmail-pdfbox-users-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id B2F9E17A32 for ; Mon, 6 Oct 2014 02:48:18 +0000 (UTC) Received: (qmail 48214 invoked by uid 500); 6 Oct 2014 02:48:18 -0000 Delivered-To: apmail-pdfbox-users-archive@pdfbox.apache.org Received: (qmail 48193 invoked by uid 500); 6 Oct 2014 02:48:18 -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 48181 invoked by uid 99); 6 Oct 2014 02:48:17 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 06 Oct 2014 02:48:17 +0000 X-ASF-Spam-Status: No, hits=1.7 required=5.0 tests=FREEMAIL_ENVFROM_END_DIGIT,HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of andrewlee2000@gmail.com designates 209.85.192.43 as permitted sender) Received: from [209.85.192.43] (HELO mail-qg0-f43.google.com) (209.85.192.43) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 06 Oct 2014 02:48:13 +0000 Received: by mail-qg0-f43.google.com with SMTP id j107so3217413qga.30 for ; Sun, 05 Oct 2014 19:47:52 -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; bh=PuGPO48pj8+GAZNh2vOdFB9Myy+qGWNjAwMhWodAesE=; b=WKCtQLL28yWE3IPYvEFuNYlr8wQnkq+Pzfj5YG75bEfiALYVHeD3vzGgh9TTbfHcAt 3/Xeuo2yIaaEYeJErU6oNwuggv3OrvqkFA6NRchMD1cnAr0ZUgL4I3ezdBh4REqDv3ld Dl8fdtNv1ag1glC0iW1k9oOQMcSZXy9VL83Ys7w1T7chd7BTTZVZ2VTa5NUZy4pdSDW7 KgQPOKFJrM4zd1b25to8ks/pgjYpDHSmbVV6F86Yqd/G5pQeoxXHmzyIABiqafk/KPLL 5TpFKQSK2EvzRbrg/ONUJ4UclqjojVw6L5FlIaIoFFKZIz1lj9ft44zgsmxVp6Lo+9Zq xU9w== MIME-Version: 1.0 X-Received: by 10.224.22.198 with SMTP id o6mr17134409qab.60.1412563672493; Sun, 05 Oct 2014 19:47:52 -0700 (PDT) Received: by 10.140.16.233 with HTTP; Sun, 5 Oct 2014 19:47:52 -0700 (PDT) In-Reply-To: <56C4E9E8-2257-49BF-B295-E2C8FA110AD7@fileaffairs.de> References: <542FCD93.1060907@t-online.de> <542FF439.6070306@t-online.de> <56C4E9E8-2257-49BF-B295-E2C8FA110AD7@fileaffairs.de> Date: Mon, 6 Oct 2014 10:47:52 +0800 Message-ID: Subject: Re: How to find and replace text in pdf report From: andrew lee To: users@pdfbox.apache.org Content-Type: multipart/alternative; boundary=001a11c2b4f0ebf33f0504b81bf8 X-Virus-Checked: Checked by ClamAV on apache.org --001a11c2b4f0ebf33f0504b81bf8 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Hi Tilman; Do you have a sample script on how to read the Account Number value from the attached file and output it into a text file? Many thanks. On Sun, Oct 5, 2014 at 1:02 AM, Maruan Sahyoun wrote: > > Am 04.10.2014 um 15:20 schrieb Tilman Hausherr : > > > Am 04.10.2014 um 13:38 schrieb andrew lee: > >> Hi Tilman; > >> Thanks for the advice. If you notice my attached file, the Account > Number: > >> 0123456789 location will be fixed on every report. > >> Does this mean PDFTextStripperByArea will be able to read it? > > > > Yes > > > >> What if the [First Name], [Last Name] & [Address] is an editable field= . > >> Will PDFBox be able to fill them will information that I obtain from a > >> database? > > > > Don't know, because it might still look like a field. If you're mailing > the result, you don't want any lines. > > if the field doesn=E2=80=99t define borders/lines around it there shouldn= =E2=80=99t be any > after filling the form fields > > BR > > Maruan > > > > > Tilman > > > >> > >> Thanks; > >> andrew > >> > >> On Sat, Oct 4, 2014 at 6:36 PM, Tilman Hausherr > >> wrote: > >> > >>> Hi, > >>> > >>> reading an area can be done with PDFTextStripperByArea, see in the > source > >>> code or in stackoverflow for examples. If you know where it is. If yo= u > >>> don't know where it is (e.g. invoice processing), then you'll have to > guess > >>> by the context. > >>> > >>> Writing at a placeholder is more difficult. Better don't create the > >>> placeholder at all, just find out the coordinates and draw your text. > >>> > >>> https://pdfbox.apache.org/cookbook/documentcreation.html > >>> > >>> Tilman > >>> > >>> > >>> > >>> Am 04.10.2014 um 03:28 schrieb andrew lee: > >>> > >>> Hi; > >>>> I have a pdf report as per attached file. It contains the following > text. > >>>> Account Number: 0123456789 > >>>> [First Name] > >>>> [Last Name] > >>>> [Address] > >>>> > >>>> Using PDFBOX, can I read the Account Number value "0123456789" so > that i > >>>> can cross check with my oracle database, select out the First Name, > Last > >>>> Name and Address and finally fill it into the marker [First Name], > [Last > >>>> Name] & [Address] in the PDF file. Btw i was told that i will be > given an > >>>> editable pdf report. also > >>>> > >>>> > >>>> Kindly advice. tq > >>>> > >>> > > > > --001a11c2b4f0ebf33f0504b81bf8--