You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@pdfbox.apache.org by zmej serow <zm...@gmail.com> on 2020/07/01 09:35:13 UTC

How to get color separations used in PDF?

Hi!
I need to know about color separations used in PDF file.
I am sure that all objects in PDF file would be only in CMYK, Pantone or Grayscale colorspaces. That is, no RGB nor Lab, nor something else.

If I understand correctly, I have to iterate over all objects and check their colors (in case of vector object) or colorspace (in case of raster image object).

How can I do this? Would be glad for pointing me to some code examples.
Thanks!

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org
For additional commands, e-mail: users-help@pdfbox.apache.org


Re: How to get color separations used in PDF?

Posted by zmej serow <zm...@gmail.com>.
Thanks a lot, I'll try it.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org
For additional commands, e-mail: users-help@pdfbox.apache.org


Re: How to get color separations used in PDF?

Posted by Tilman Hausherr <TH...@t-online.de>.
Hi,

You could use PrintTextColors.java from example subproject from the 
source code download and modify it to get the text colorspace.

For the images, modify the ExtractImages.java from the tool subproject 
to get the colorspace (drawImage method).

For vector graphics, see this answer

https://stackoverflow.com/questions/38931422/pdfbox-2-0-2-calling-of-pagedrawer-processpage-method-caught-exceptions

you only need fill and stroke, there check the color like in the 
PrintTextColors.java example.

Try to get these running first, then try to change it. Ask here if you 
need more support.

It's probably possible to merge the three things into once (because all 
three extend PDFStreamEngine in some way), but this would be more work. 
It's probably more important that you get something running.

Tilman



Am 01.07.2020 um 11:35 schrieb zmej serow:
> Hi!
> I need to know about color separations used in PDF file.
> I am sure that all objects in PDF file would be only in CMYK, Pantone or Grayscale colorspaces. That is, no RGB nor Lab, nor something else.
>
> If I understand correctly, I have to iterate over all objects and check their colors (in case of vector object) or colorspace (in case of raster image object).
>
> How can I do this? Would be glad for pointing me to some code examples.
> Thanks!
>
> ---------------------------------------------------------------------
> 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