[texhax] [NTG-pdftex] \pdfximage : is there a transparency attribute or method ?
heiko.oberdiek at googlemail.com
Wed Jan 5 00:55:03 CET 2011
On Wed, Jan 05, 2011 at 12:35:43AM +0100, Paul Isambert wrote:
> Le 05/01/2011 00:09, Philip TAYLOR (Webmaster, Ret'd) a écrit :
> >A supplementary question, if I may ? The PdfTeX
> >reference manual as found at Tug.Org has Chapter
> >Eight entitled "Graphics and color", yet the
> >chapter seems not to mention colour at all and
> >focuses solely on graphics. Section 7.12 says
> >"\pdfliteral [ <pdfliteral spec> ] <general text>
> >Like \special in normal TEX, this command inserts
> >raw pdf code into the output. This allows support
> >of color and text transformation." but as far as
> >I can tell, there are no examples of suitable
> >parameters for affecting the colour of (e.g.)
> >rendered text. May I ask if there is a supplementary
> >manual that defines how colour is to be programmed
> >through PdfTeX ?
> With \pdfliteral, there is absolutely no "parameter": it's a real
> literal. What the manual means is that if you know how PDF works,
> you can write your own code. Even the colourstack mechanism (see
> section 7.17) does little more than adding "q" and "Q" (PDF's
> \bgroup and \egroup), and you still have to input PDF graphic
> operators (Heiko might correct me on this, but I think I'm right).
"q" and "Q" are not used in the implementation of color.sty/pdftex.def,
also pdfTeX's \pdfcolorstack stuff don't use them internally.
color.sty/pdftex.def are using the usual grouping mechanism of TeX.
> So color is to be programmed in pdfTeX by writing PDF code... Which,
> as far as colors are concerned, is not extremely difficult, although
> it requires a little work.
> (Oh, yes, there's one good reason to use color stacks instead of raw
> literals: the q/Q group doesn't nullify the width of the material
> you want to colorize.)
Also \pdfsave and \pdfrestore should be preferred instead of
raw q/Q literals (and \pdfsetmatrix instead of the raw
cm operator), then pdfTeX is informed about operations that
affects coordinate transformations and can take them into
account for calculating destination and link positions.
Color stacks help for page breaks; dvips only supports one
color stack, pdfTeX does not have this limitation. There are
two main benefits:
* separate color stacks for other stuff that might be
broken across pages like footnotes.
Examples: packages pdfcol(,foot,mk,parallel,parcolumns)
* color stacks can also be used for other graphics attributes
independently from color settings.
Examples: package `transparent', `pdfrender'
More information about the texhax