[texworks] TeX-Works-Workflow: printing?
Stefan Löffler
st.loeffler at gmail.com
Sun Oct 17 09:59:07 CEST 2010
Hi,
Am 2010-10-17 05:37, schrieb David Perry:
> For what it's worth, I just updated to the brand new MiKTeX 2.9. It
> includes TW .03 r670 (that's according to Help/About; quite a jump
> from 567). This version prints and the quality seems good, although I
> have printed only a couple of simple pages so far.
>
> I understand Stefan's explanations about why printing is not
> officially supported, but I must say I'm glad to have it in any form.
> I just finished a book using TW. Early in the project I didn't print
> much, but at the end I was going back and forth constantly between TW
> and my PDF viewer in order to print (and occasionally forgetting to
> close the PDF, which resulted in broken pipe errors). This got really,
> really annoying. I have no idea about how the MiKTeX people did it,
> whether using Stefan's old patch or in some other way; of course, they
> don't have to worry about cross-platform compatibility since MiKTeX is
> Windows only.
I just checked out the MiKTeX code. Curiously, they simply applied my
old patch (http://code.google.com/p/texworks/issues/detail?id=78),
seemingly verbatim.
What is noteworthy about that patch (for Windows users) is this: as long
as the printer driver supports the POSTSCRIPT_PASSTHROUGH escape code,
quality should be good. In that case, poppler is used to convert the pdf
to postscript code, which is then sent to the printer directly.
If that is not the case, the fallback I described earlier is used (i.e.,
poppler is used to render raster images such as those displayed on
screen, and those are sent to the printer using the Qt printing framework).
So, ultimately it depends on the printer (driver) you use whether you
get good results or crappy print-outs. This (to the user) seemingly
random behavior is not good ;).
> I guess what I'm saying is that when TW was younger and less widely
> used the line "Just open your PDF viewer to print" was OK. If we want
> TW to be adopted more widely (and by those new to TeX) I think
> printing really needs to be addressed; it's something users expect,
> and rightly so.
I fully agree. The problem is more on the technical side, however.
Poppler (the pdf library we use) doesn't give us access to the vector
data - it only supports rendering raster images or producing ps/pdf
files. Therefore, we can't print the pdf in good quality directly.
Instead, we have to rely on workarounds - such as sending postscript to
the printer, or using some other programs for printing the existing pdf.
This can work on Linux (where a standard program exists basically
everywhere), but not on Windows, where we can't rely on everyone having
installed, e.g., Adobe reader (let alone a specific version of it).
So, ultimately, we'd need some extensive changes to poppler - or a
different pdf rendering library - to reasonably implement printing.
HTH
Stefan
More information about the texworks
mailing list