Am 14.08.2020 um 13:05 schrieb Pop, Rares:
Thank you. I have identified the operator SetNonStrokingColorOperator but I
think I am missing something.
I have a pdf of sample Spot colours. I am loading it and reading all the
colours from the ColorSpace resources.
Then I must read an inputPDF (that has no spot colors - i.e. no resources in
the color space).
I must simply apply a given spot color to all the elements within the inputPDF.
Then save it as outputPDF.
Is there an example that does anything remotely similar to that?
No... what you could do is about like this:
- open both PDFs
- get the spot color
- add it to the destination PDF
- remember the name (probably "cs1")
- replace the old color setting with the new in the content stream
- save
so maybe in the old PDF, you find "0 g" / "0 0 0 rg", then replace that
with the appropriate colorspace selection and then color selection, e.g.
"cs1 cs 0 sc" . An example how to work with the content stream can be
found in RemoveAllTexts.java in the source code download.
If there is nothing, then include the two commands mentioned at the
beginning.
Tilman
I am happy to pay for consultancy here.
Best,
Ra
On 2020/08/14 10:46:56, Tilman Hausherr <t...@t-online.de> wrote:
Am 14.08.2020 um 12:21 schrieb Pop, Rares:>
Hi guys,>
I am new to pdfbox and I am trying to modify the color of an existing text
element.>
My current understanding is that I need to parse the stream, iterate through the
tokens and find the one I need to change the color for.>
Then insert a Change Color Operator before it.>
Is this the correct way and could you please show me how to create a change colour
operator?>
Yes, but it may be difficult to find the correct element. The best would >
be to have a look at that file with PDFDebugger, you can see all the >
operators there. When you hover the mouse over such a color operator it >
will show you the color.>
Tilman>
--------------------------------------------------------------------->
To unsubscribe, e-mail: users-unsubscr...@pdfbox.apache.org>
For additional commands, e-mail: users-h...@pdfbox.apache.org>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@pdfbox.apache.org
For additional commands, e-mail: users-h...@pdfbox.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@pdfbox.apache.org
For additional commands, e-mail: users-h...@pdfbox.apache.org