If i go and inserting individual line before text (0.134 0.473 0.790 setrgbcolor) the color information, the color is change and i can able to see in PDF

Great, you're almost there! Now you just have to find the places where the font is changed.

Notice how the prelude will probably define a function that changes font, using the primitive operator setfont or selectfont. For example, the definition may look like this:

/Tf { dup /pdfFontSize exch def dup pdfHorizScaling mul exch matrix scale pdfTextMat matrix concatmatrix dup 4 0 put dup 5 0 put exch findfont exch makefont setfont } def

(Of course, this function in the prelude is specific to the pdftops utility, but I'm assuming here you've used that to generate the postscript file.)

Once you've found this, search for calls to this proceduce, such as this:

/F784_0 1 Tf

The F784_0 here is an identifier for the font (the actual font is assigned to it somewhere in the prelude, but pdftops generates such a short identifier because the same font will typically occur many times), and the 1 is I think a scaling modifier.

Find these lines that change the font, and change the color after that, depending on which font is used.

PS. the part you mention with /FontName /XJQTHX+NewsGothicStd def is where the font is defined, not the statement where that font is activated. It could be useful if you want to know which short identifier means which font.


In reply to Re^5: How to change font color in PDF based by font name by ambrus
in thread How to change font color in PDF based by font name by vinothjaguva

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.