Pdf setting the font color to the text

主宰稳场 提交于 2019-12-06 00:16:15
mkl

The PDF color operators are listed in Table 74 of the PDF specification ISO 32000-1:2008.

In your case your added content stream is

104 0 obj
<</Length 105 0 R>>stream
  /Helv 8 Tf
  BT
  1 0 0 1 15.67 150 Tm
  (l)Tj
  ET
  /Helv 8 Tf
  BT
  1 0 0 1 17.88 190 Tm
  (abcdefghijklmnopqr)Tj
  ET
endstream
endobj 

If e.g. you want the writing to be filled with red in a RGB color space, you add an 1 0 0 rg:

104 0 obj
<</Length 105 0 R>>stream
  BT
  1 0 0 1 15.67 150 Tm
  /Helv 8 Tf
  1 0 0 rg
  [...]

EDIT

If you are afraid that that change may affect later text, remember to use the Graphics State Stack operators q and Q (cf. section 8.4.2 of the PDF specification). E.g.

q
0 1 -1 0 595.22 0 cm
q
BT
1 0 0 1 36 540 Tm
/Xi0 12 Tf
0.75 g
(Hello people!)Tj
0 g
ET
Q
Q

(Copied from How to add text object to existing pdf)

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!