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 5F5B7196AC for ; Tue, 29 Mar 2016 18:46:30 +0000 (UTC) Received: (qmail 96656 invoked by uid 500); 29 Mar 2016 18:46:29 -0000 Delivered-To: apmail-pdfbox-users-archive@pdfbox.apache.org Received: (qmail 96630 invoked by uid 500); 29 Mar 2016 18:46:29 -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 96619 invoked by uid 99); 29 Mar 2016 18:46:29 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd1-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 29 Mar 2016 18:46:29 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd1-us-west.apache.org (ASF Mail Server at spamd1-us-west.apache.org) with ESMTP id 0DB74C62F4 for ; Tue, 29 Mar 2016 18:46:29 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -1.32 X-Spam-Level: X-Spam-Status: No, score=-1.32 tagged_above=-999 required=6.31 tests=[KAM_LAZY_DOMAIN_SECURITY=1, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H4=-0.01, RCVD_IN_MSPIKE_WL=-0.01] autolearn=disabled Received: from mx2-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id 7PIz8jXqNV_F for ; Tue, 29 Mar 2016 18:46:27 +0000 (UTC) Received: from us-smtp-delivery-105.mimecast.com (us-smtp-delivery-105.mimecast.com [63.128.21.105]) by mx2-lw-eu.apache.org (ASF Mail Server at mx2-lw-eu.apache.org) with ESMTPS id 364535F24D for ; Tue, 29 Mar 2016 18:46:25 +0000 (UTC) Received: from TGI-EX13FE01.pgac.com (exchange.pgac.com [12.68.231.189]) (Using TLS) by us-smtp-1.mimecast.com with ESMTP id us-mta-4-21Y46Jd1QkSJQj0Om3LF6Q-1; Tue, 29 Mar 2016 14:46:14 -0400 Received: from TGI-EX13BE02.pgac.com (172.23.10.35) by TGI-EX13BE01.pgac.com (172.23.10.34) with Microsoft SMTP Server (TLS) id 15.0.1156.6; Tue, 29 Mar 2016 14:46:13 -0400 Received: from TGI-EX13BE02.pgac.com ([fe80::9c05:89d4:fee1:32e5]) by TGI-EX13BE02.pgac.com ([fe80::9c05:89d4:fee1:32e5%12]) with mapi id 15.00.1156.000; Tue, 29 Mar 2016 14:46:13 -0400 From: Kevin Ternes To: "users@pdfbox.apache.org" Subject: RE: How to manipulate a pdf object Thread-Topic: How to manipulate a pdf object Thread-Index: AdGJ4/iOfobERFLhSz+LBXuj6EuLyQAIzhUAAAgPZ9A= Date: Tue, 29 Mar 2016 18:46:13 +0000 Message-ID: <6dcc4db40d7a43a6b9832cccbe9b5307@TGI-EX13BE02.pgac.com> References: <2789D7FD-7498-42EE-A3E4-07CB83EF1121@fileaffairs.de> In-Reply-To: <2789D7FD-7498-42EE-A3E4-07CB83EF1121@fileaffairs.de> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-exchange-transport-fromentityheader: Hosted x-originating-ip: [172.23.12.70] MIME-Version: 1.0 X-MC-Unique: 21Y46Jd1QkSJQj0Om3LF6Q-1 Content-Type: text/plain; charset=WINDOWS-1252 Content-Transfer-Encoding: quoted-printable Maruan and Tilman, I think you have answered my question--that I am basically out of luck. I already ran one through the usual PDF-Tools Debugger but it did not tell = me anything that I thought was useful. I also tried looking at the PDF und= er Acrobat's preflight. But here is the use case: I have a large number of PDF "templates" that in our usual business process= , we use PDFBox to load, set form field values, add images, merge, flatten,= protect, . . . However, it turns out that the specification for many of these templates ha= s changed so that a piece of text needs to be moved slightly up, a cm to th= e left and have the font size changed. Then there are some places where so= meone drew lines around hundreds of form checkboxes!!! So while I'm at it = I'd like to delete those lines and set the form field widgets to have a bor= der. I wanted to write a quick command line program to do this. I estimate that to do this one-pdf-at-a-time would take 10-20 hours. That = would not be a problem except that we don't have an intern. Any suggestions appreciated. -----Original Message----- From: Maruan Sahyoun [mailto:sahyoun@fileaffairs.de]=20 Sent: Tuesday, March 29, 2016 1:06 PM To: users@pdfbox.apache.org Subject: Re: How to manipulate a pdf object Hi, > Am 29.03.2016 um 19:54 schrieb Kevin Ternes : >=20 > I have successfully updated form widgets on pre-existing PDFs. > But what about ordinary non-form objects like a box of text? I can add N= EW objects to the PDPageContentStream. > But how do I even get a reference to an existing object? What is it that you are trying to achieve? You can parse an existing conten= t stream and look for individual tokens. But there is no guarantee that, wh= at your are calling a box of text, is treated like that in the PDF as there= is no such concept. E.g. individual lines, word, characters forming a word= ... could be placed individually in different operations. It even might no= t be text but a vector or bitmap image. Your best bet is to look into the c= ontent using the PDFDebugger and see if you can identify the parts you are = looking for. Maybe you can elaborate a little more on your use case. BR Maruan > Viewing the document in Acrobat does not give me a clue as to what the ob= ject might even be called. >=20 > PDFBox-2.0.0 --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org For additional commands, e-mail: users-help@pdfbox.apache.org