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 87C8A198AA for ; Tue, 29 Mar 2016 19:30:26 +0000 (UTC) Received: (qmail 17687 invoked by uid 500); 29 Mar 2016 19:30:26 -0000 Delivered-To: apmail-pdfbox-users-archive@pdfbox.apache.org Received: (qmail 17663 invoked by uid 500); 29 Mar 2016 19:30:26 -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 17645 invoked by uid 99); 29 Mar 2016 19:30:25 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd4-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 29 Mar 2016 19:30:25 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd4-us-west.apache.org (ASF Mail Server at spamd4-us-west.apache.org) with ESMTP id 4C42BC00E7 for ; Tue, 29 Mar 2016 19:30:25 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd4-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 0.797 X-Spam-Level: X-Spam-Status: No, score=0.797 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, KAM_ASCII_DIVIDERS=0.8, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001] autolearn=disabled Authentication-Results: spamd4-us-west.apache.org (amavisd-new); dkim=pass (1024-bit key) header.d=oberontitania.onmicrosoft.com Received: from mx2-lw-us.apache.org ([10.40.0.8]) by localhost (spamd4-us-west.apache.org [10.40.0.11]) (amavisd-new, port 10024) with ESMTP id cjm3zl30NIdD for ; Tue, 29 Mar 2016 19:30:20 +0000 (UTC) Received: from na01-bn1-obe.outbound.protection.outlook.com (mail-bn1on0147.outbound.protection.outlook.com [157.56.110.147]) by mx2-lw-us.apache.org (ASF Mail Server at mx2-lw-us.apache.org) with ESMTPS id 2F4E55F400 for ; Tue, 29 Mar 2016 19:30:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oberontitania.onmicrosoft.com; s=selector1-oberontech-com; h=From:To:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=t6TyNwEAxVQj7oH/+PM3rhAAKgci/WQ6DJTTIZ8jUyQ=; b=NQPps4GyIh+BhDVA35BB20pCd8HtHvMR2Zw5tGP2u6aan6i0Kb9wVxlFCMljaxxOXeiZM+11VEU5JaZIWjqMW8kqS8NUALudLVnrZC++Fj12LSFVJoiGVv0z/V7oWn9XOEcrajJf0GchlOQSx9xVzSU7zO7VI9xhUDyhhADX68k= Received: from CO2PR04MB761.namprd04.prod.outlook.com (10.141.228.13) by CO2PR04MB763.namprd04.prod.outlook.com (10.141.228.20) with Microsoft SMTP Server (TLS) id 15.1.443.12; Tue, 29 Mar 2016 19:30:09 +0000 Received: from CO2PR04MB761.namprd04.prod.outlook.com ([10.141.228.13]) by CO2PR04MB761.namprd04.prod.outlook.com ([10.141.228.13]) with mapi id 15.01.0443.015; Tue, 29 Mar 2016 19:30:08 +0000 From: Gary Grosso 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+LBXuj6EuLyQAAbFAAAAFmrIAAAMgfAAAAdIcAAAAyHgA= Date: Tue, 29 Mar 2016 19:30:08 +0000 Message-ID: References: <2789D7FD-7498-42EE-A3E4-07CB83EF1121@fileaffairs.de> <6dcc4db40d7a43a6b9832cccbe9b5307@TGI-EX13BE02.pgac.com> <56FAD2B4.6050003@t-online.de> <02d519cf1f67448a90820e5bb606d3f1@TGI-EX13BE02.pgac.com> In-Reply-To: <02d519cf1f67448a90820e5bb606d3f1@TGI-EX13BE02.pgac.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: pdfbox.apache.org; dkim=none (message not signed) header.d=none;pdfbox.apache.org; dmarc=none action=none header.from=oberontech.com; x-originating-ip: [204.195.134.232] x-ms-office365-filtering-correlation-id: 6c72b4b5-ef9c-42b7-7f62-08d358088a08 x-microsoft-exchange-diagnostics: 1;CO2PR04MB763;5:Iy4Y667NeyCu2P6P1YaKt+X15mSGVeQpJdovd5AY1siFRS/O1xInToTbr4PcA53kfpVKp9Hf7ELVxIwGSk6k97Xc5Iuuy5k59KMWBYsZVrXPZFe8T0EvzJoAP5Nph/vxVVwEo0/0enp/jzemZQJVMA==;24:BerUYwucLoF+FM5IvWFcO0szUG5jU9D8pDcZVAGD8/ZDsdPGDSpmXioslBPsARP0IqIgKGwX1sjZkRIaNJPT39yYVubyoxjTJDbtFFMhdRQ= x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:CO2PR04MB763; x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:; x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(6040046)(601004)(2401047)(5005006)(8121501046)(3002001)(10201501046)(6041046)(6043046);SRVR:CO2PR04MB763;BCL:0;PCL:0;RULEID:;SRVR:CO2PR04MB763; x-forefront-prvs: 0896BFCE6C x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(6009001)(252514010)(377454003)(86362001)(74316001)(2906002)(2351001)(450100001)(92566002)(87936001)(76576001)(33656002)(93886004)(50986999)(81166005)(5002640100001)(107886002)(2501003)(6116002)(10400500002)(76176999)(2950100001)(102836003)(189998001)(5004730100002)(3846002)(19580405001)(77096005)(2900100001)(586003)(110136002)(19580395003)(1220700001)(1096002)(3660700001)(5003600100002)(54356999)(99286002)(5008740100001)(122556002)(66066001)(3280700002)(460985005);DIR:OUT;SFP:1102;SCL:1;SRVR:CO2PR04MB763;H:CO2PR04MB761.namprd04.prod.outlook.com;FPR:;SPF:None;MLV:sfv;LANG:en; spamdiagnosticoutput: 1:23 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: oberontech.com X-MS-Exchange-CrossTenant-originalarrivaltime: 29 Mar 2016 19:30:08.6604 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 2c8c61e9-230c-4fac-ac48-c8a149dfe7a5 X-MS-Exchange-Transport-CrossTenantHeadersStamped: CO2PR04MB763 In case it helps, here's my Windows "shortcut" C:\Windows\System32\cmd.exe /k java -jar C:\Users\gary.grosso\Downloads\PDF= Box\pdfbox-app-2.0.0-RC1.jar PDFDebugger && exit It's possible you only need to add ".\ " in front of " PDFDebugger" (or wou= ld that be "./"?) but the shortcut is much handier IMO. Gary -----Original Message----- From: Kevin Ternes [mailto:KTernes@thegeneral.com]=20 Sent: Tuesday, March 29, 2016 3:22 PM To: users@pdfbox.apache.org Subject: RE: How to manipulate a pdf object Thanks guys.=20 Also, I meant to add in my last email that I was not able to find the PDFDe= bugger. My best effort was: C:\Users\ntiskt02\Downloads>java -jar pdfbox-2.0.0.jar PDFDebugger Renew= alFaxCover_MN_MP.pdf no main manifest attribute, in pdfbox-2.0.0.jar Am I missing something? -----Original Message----- From: Tilman Hausherr [mailto:THausherr@t-online.de]=20 Sent: Tuesday, March 29, 2016 2:09 PM To: users@pdfbox.apache.org Subject: Re: How to manipulate a pdf object Am 29.03.2016 um 20:46 schrieb Kevin Ternes: > 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 tel= l me anything that I thought was useful. I also tried looking at the PDF u= nder Acrobat's preflight. > > But here is the use case: > I have a large number of PDF "templates" that in our usual business proce= ss, we use PDFBox to load, set form field values, add images, merge, flatte= n, protect, . . . > > However, it turns out that the specification for many of these templates = has changed so that a piece of text needs to be moved slightly up, a cm to = the left and have the font size changed. Then there are some places where = someone drew lines around hundreds of form checkboxes!!! So while I'm at i= t I'd like to delete those lines and set the form field widgets to have a b= order. > > I wanted to write a quick command line program to do this. Likely won't be possible. What I do is to run the WriteDecodedDoc command l= ine utility and then do the changes manually. However you need to understan= d the PDF operators and the sizes of the content streams should not change,= i.e. all object positions must stay the same. Alternatively, get Acrobat Professional. Tilman > I estimate that to do this one-pdf-at-a-time would take 10-20 hours. Tha= t 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] > 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 : >> >> 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 = NEW 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 cont= ent stream and look for individual tokens. But there is no guarantee that, = what your are calling a box of text, is treated like that in the PDF as the= re is no such concept. E.g. individual lines, word, characters forming a wo= rd ... could be placed individually in different operations. It even might = not be text but a vector or bitmap image. Your best bet is to look into the= content using the PDFDebugger and see if you can identify the parts you ar= e 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 o= bject might even be called. >> >> PDFBox-2.0.0 > > --------------------------------------------------------------------- > 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 --------------------------------------------------------------------- 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