1

To set the fill color in PDF there are these three ways:

247 28 36 rg
3 89 86 0 k
0.03 0.89 0.86 0.0 scn

... rg is RGB, ... k is CMYK, and ... scn is SetAdvancedColor(?). Other than being as a decimal rather than a percentage, what is the difference between k and scn?


Useful links for other beginners: How to decompress PDFs, 'PDF Succinctly' book on PDF structure

xxjjnn
  • 14,591
  • 19
  • 61
  • 94
  • 1
    "`scn`: Same as SC but also supports Pattern, Separation, DeviceN and ICCBased colour spaces". Useful link for a command reference: [PDF 32000-1:2008](https://www.adobe.com/content/dam/acom/en/devnet/acrobat/pdfs/PDF32000_2008.pdf) (PDF). This is on p. 172. – Jongware Jul 05 '18 at 10:34
  • @usr2564301 How about making that an actual answer? – mkl Jul 05 '18 at 13:20
  • Should I change the question to 'PDF difference between k and sc color fill' ? – xxjjnn Jul 05 '18 at 13:29

1 Answers1

2

k and rg are shortcuts for the DeviceCMYK and DeviceRGB color spaces respectively. To use sc or scn you need to specify the color space using cs operator.

For example.

1.0 0.0 1.0 rg

is shorthand for

/DeviceRGB cs
1.0 0.0 1.0 sc
Ryan
  • 2,473
  • 1
  • 11
  • 14