Re: Asking help for preview-latex
Ken Sharp <[email protected]> Fri, 21 Jun 2019 19:52:43 +0100
| Newsgroups | gmane.comp.printing.ghostscript.devel |
|---|---|
| Message-ID | <[email protected]> |
At 14:40 21/06/2019 -0400, David Niklas wrote:
>I'm been lurking on this list for a few months and wanted to ask, why not
>make a cmdline switch for gv to display a pdf's background and foreground
>colors as something else?
We aren't discussing gv here, we're talking about Ghostscript. I'm not
familiar with gv so I'm going to answer as if we were discussing Ghostscript.
So; mainly because there isn't really any such thing as background and
foreground colours in a PDF file.
Each and every drawing operation can have a different colour (and indeed
can be expressed in a different colour space). This is one of the reasons I
summarised the precise (and very narrowly defined) use case for
preview-latex. In this specific case the only colour used is the default
colour for PDF.
In general this is not the case for any PDF files. In fact I had to request
such a PDF file from Keita, because none of the ones I have is suitable,
since they define the colour for each object before drawing it.
>Yes Mr. Sharp, I do know that pdf's have no exact FG or BG colors as you
>pointed out earlier in the discussion, but something dumb and simple
>should not be too hard to put together, right?
Umm, well, I would disagree completely. Perhaps for a very simple PDf file
such as a simple file containing nothing but text such a thing would be
possible.
Take a concrete example; if a PDF file draws three rectangles, each a
different colour, which is the foreground which is the background and what
is the third one ?
What are we supposed to *do* with the third colour anyway in your scheme ?
Even if the PDF file only contained text, what if the text is itself
coloured, or simply shades of gray ?
We could arrange for that to be specified. Of course, this would be wrong
from the point of view of the PDF specification which states quite clearly
what the default colour and space should be. It would only really work with
a very small number of PDF files and would be wrong (potentially wildly
wrong) for all other files.
Finally; I'm firmly opposed to any further proliferation of command line
parameters in Ghostscript, there are *far* too many already, and adding a
new one for such a niche use case seems excessive.
Regards,
Ken Sharp