A content stream is just a stream so if you overwrite that one, you're done.
Unless of course other things need to be changed, e.g. resources.
Tilman
On 30.03.2023 13:50, Kett, Bernward wrote:
Hi Tilman,
yes the stackoverflow request is also from me - the issue I have is how to
replace the stream inside the form. I have no form.setContentStream() function.
Besides I'm no sure if the getContentStream() returns the whole PDFormXObject.
Best regards,
Bernward
-----Original Message-----
From: Tilman Hausherr <thaush...@t-online.de>
Sent: Freitag, 24. März 2023 05:36
To: dev@pdfbox.apache.org
Subject: Re: Replace Form using PDFGraphicsStreamEngine
You can call getStream() on the PDFormXObject and then change that one, or are
you asking something different?
I assume
https://nam12.safelinks.protection.outlook.com/?url=https%3A%2F%2Fstackoverflow.com%2Fquestions%2F75814243%2Fpdfbox-how-to-replace-text-in-a-pdformxobject&data=05%7C01%7Cbernward.kett%40dxc.com%7Cd0b90dc294c84de2ea2008db2c215f42%7C93f33571550f43cfb09fcd331338d086%7C0%7C0%7C638152294077116069%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=jxw8oGi0a1I3Q3Yw2ZRXuK4QxWSED0MRv5GdyrzAbJs%3D&reserved=0
is also from you?
Or is your question about replacing a form in the resources?
Tilman
On 23.03.2023 11:38, Kett, Bernward wrote:
Dear all,
I'm struggling with replacing text within a Form. I detect the text I can
replace it, but putting it back to the form seems to be the hell on earth.
What was my approach?
I'm using MKL's PdfContentStreamEditor (Thanks for that it was a very
useful starting point) Replacing content within the main content is
quite easy with that (Replacing all changed Tj with TJ by the way)
I think the purpose of doing nothing in the showForm overwrite is exactly to
avoid replacements in Forms.
So creating a new outstream for the form and putting my redactions there is
also done (text is found and replaced).
But how to replace the old form stream with the new one?
Thanks a lot,
Bernward
EntServ Deutschland GmbH: Schickardstra?e 32, 71034 B?blingen, Germany - Board
of Directors: Joachim L?ffler (Chairman), Jacqueline Fechner - Registered in
Stuttgart: HRB 757510.
DXC Technology Company -- This message is transmitted to you by or on behalf of
DXC Technology Company or one of its affiliates. It is intended exclusively for
the addressee. The substance of this message, along with any attachments, may
contain proprietary, confidential or privileged information or information that
is otherwise legally exempt from disclosure. Any unauthorized review, use,
disclosure or distribution is prohibited. If you are not the intended recipient
of this message, you are not authorized to read, print, retain, copy or
disseminate any part of this message. If you have received this message in
error, please destroy and delete all copies and notify the sender by return
e-mail. Regardless of content, this e-mail shall not operate to bind DXC
Technology Company or any of its affiliates to any order or other contract
unless pursuant to explicit written agreement or government initiative
expressly permitting the use of e-mail for such purpose. --.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@pdfbox.apache.org For additional
commands, e-mail: dev-h...@pdfbox.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@pdfbox.apache.org
For additional commands, e-mail: dev-h...@pdfbox.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@pdfbox.apache.org
For additional commands, e-mail: dev-h...@pdfbox.apache.org