Post by JulunPost by Michael Pfeiffer- Integrate application and print settings into page/job setup dialog.
BTW only the last one requires an API change (= new printer driver
interface, should wait for R2).
I can't see why we should change the driver API, most likely
implementation would change. No more UI code inside drivers, which means
plain (spooldir, message) config_job, config_page calls. Thats what i see.
If a printer driver does not export config_job, etc any more then this
is an API change.
By doing that you will loose the ability to have printer (driver)
specific settings.
In R5 there are public settings like the first and last page number to
print, and printer specific settings, like gamma correction in
libprint or the author in PDF printer driver.
How to you handle these settings with the new API?
Post by JulunWhen it comes to preview printing, how would one achieve this.
E.g printing directly into preview from an application point of
view. Since we always have to go thru print_server _and_ the
spoolfile will be generated first ofter completely 'OK' ing all
those panels, it would always be to late to "Preview". And this
is what i see as design flaw and hence the current need of the preview
printer driver.
Without changing the API of BPrintJob preview could be supported already,
only the print_server needs some changes:
Under Haiku when you ask the print_server to open the page or job
settings dialog it opens the window with the selection of the target
printer and (up to) two buttons that open the page and the job
settings dialog provided by the printer driver when clicked.
When you click OK the window is closed and the application fills the
print job and when completed* the print_server takes over and hands it
over to the printer driver...
*) With our current API at this point the application has completed
the the printing process.
Now you just have to add another button "Preview" to the page/job
settings dialog from print_server and when this button is clicked you
add a flag to the job settings BMessage:
bool preview = true
that tells the print_server that the print job should not be delivered
to the target printer but to a slightly modified Preview printer
driver.
This Preview printer driver has two buttons "Cancel" and "Print".
If you click "Print" the Preview window is closed and the print_server
hands the print job over to the target printer driver.
If you click "Cancel" the print_server cancels the print job.
Pros:
- system wide print preview support without API change, nor application
support nor printer driver support needed
Cons:
- After canceling the Preview window the job settings dialog is not
reopened automatically
- Preview can only respect public page/job settings so it can show
only the "raw" pages. It could not support things like n-pages per
sheet or gamma correction...
To support printer specific settings preview functionality must be
part of a printer driver.
Post by JulunLibprint way of having Preview from JobSetup sucks even more, one has to do
all job settings, press 'Preview' and then it jumps back to the previous
panel where you have to press 'OK' once again to show the preview... Not the
easiest and obvious way for an simple task :(
I am not sure, but I think Preview in libprint was intended for
debugging purposes only. Anyway but this could be fixed.
Post by Julun- printer based PageSetup/ JobSetup but without print_server
interaction
This is not a new feature. Page/job setup is already there.
Post by Julun- Print Preview, using a PreviewPanel directly from inside the
application
OK.
Post by Julun- Providing an Preview view to embed into applications
So there would then be the application choice to either open a window
or show it inline? Not sure if I like the inconsistency between
applications, but I am not a user interface expert to decide that.
Post by Julun- nice cups integration into printing system
Not a feature.
Features provided by CUPS for example would be:
- support more print drivers with printer model specific settings
- support printer sharing (including interoperability with other OSs)
- support cancelation of current print job
- support reading printer status (incl. ink levels)
Post by Julun- wrapper class around cups provided api
Not a feature.
Post by Julun- some convenient classes around printing
- to improve reusability?
- to easy programming?
Post by JulunPost by Michael Pfeiffer- The user interface of libprint should be improved.
Hmm, i really won't touch it. Btw, what's the license of
libprint. Does anyone have contact to original developer?
I don't know it was added before my time.
Post by JulunDid
anyone ever print with an driver based on libprint? I mean to an
real printer with all available options in use?
PCL5, 6 and PS have been tested by others and me, at least from my
side it was not tested heavily.
BTW I have the impression that you're underrating libprint, it is
already very easy to implement raster based printer drivers with it
and it supports features that I think are not even available in CUPS.
IMO it could be made THE Haiku framework for printer drivers. It's not
a big deal to add a new printer driver based on it for a new printer
language if documentation is available. What's missing ATM is support
for print _model_ specific settings. This could be fixed by supporting
PPD.
Post by JulunPost by Michael Pfeiffer- The PS printer driver should generated vectorized output.
ATM it creates a number of raster images only, which is
somewhat OK if the output goes to a printer or even CUPS.
But for sure you do not want to convert that to a PDF file.
I wish you good luck implementing the more advanced features
of our PDF printer driver, like extracting links or the outline
from a print job.
Hihii, do i hear a bit sarcasm? :)
You're very quick at proposing to replace things.
Let's assume you want to convert PS to PDF and want to extract links
and the outline from the text in the PS file. For the outline you
define that text in Arial 18 denotes a heading at level 1, Arial 15 a
heading at level 2 and so on. Now you scan the PS page per page and
when ever you reach a line of text with one of the specified font and
size you put it into the outline. Similarly when a text matches a
link, that is for example defines as a regular expression, you mark
the area surrounding the text as a link.
In order to do that you have to parse PS and interpret it.
With the Be API extracting the information from the print job was more
or less a piece of cake, of course there is still room for
improvements.
Post by JulunPost by Michael PfeifferAnd there is also the issue that the Interface Kit graphics model
is (or was) not 100% compatible with PS graphics model,
at the time of the implementation PDF graphics model was much
better in this regard.
So to work around that you end up rasterizing everything
that can not be reproduced otherwise.
- The PS driver should support PPD.
- If we want CUPS to (ab)use as a "printer driver" a libprint
based printer driver should be implemented that generates
the CUPS native "raster" format. This should also support PPD.
- and for sure more I forgot.
Can you please elaborate more on these points?
[Incompatible graphics model]
Like alpha blending is/was not supported in PostScript...
Like not all drawing modes are/were not supported in PostScript...
Like issues with clipping or inverse clipping...
[PPD Support in PS driver]
I don't need to explain that?
[CUPS as printer driver]
A part of CUPS acts like a filter chain. It takes a file, for example
PostScript, and converts it in one or more steps to a stream than can
be sent to a printer.
So we need a Haiku printer driver that prepares the print job so it
can be used as input for the CUPS filter chain (convert it to either
PostScript, PDF, or CUPS "raster" format). The output of that chain is
then sent via transport add-on to the printer. This was actually the
plan for the HCD CUPS project... The PostScript driver should be
adapted for that.
[CUPS raster format]
CUPS understands many different "input" formats (for example plain
text too, or standard raster image formats (gif, png, (don't quote me
on that, though)).
The "raster" format is a multi page format whose contents are raster
images and it contains additional data about the print job (similar to
our print job file).
The advantage of a Haiku CUPS raster printer driver compared to PS
driver is, that the step processing step could be eliminated that way:
PS driver: print job -> PS -> GhostScript -> CUPS filter chain
Haiku raster printer: print job -> raster file -> CUPS filter chain
Post by JulunPost by Michael PfeifferI would really wish that, if you have the time and motivation, you
could complete to open tasks first
Since i didn't know about all these, what if we have an general
print related task on Trac to add what comes to our mind?
Good idea. I would put open tasks into Trac and thoughts about R2 into
the wiki. I do not volunteer to do that ;-)
Post by JulunPost by Michael Pfeiffer, before you start with the next
step of defining and implementing an API for R2.
Not defining, playing around. Defining an API can be an
evolving process, especially if there is time. And we obviously have plenty
until R2 :)
Post by Michael PfeifferThis would be more in
the spirit of Haiku. I am sorry that I cannot keep my motivation long
enough to do that myself. But I really think that improving the R1
experience is more important now, than starting the planning phase for
R2 already.
Sure, i completely agree on that.
So i will go to fix at least preview printing and as pointed out
by Philippe, i will look in usb too.
Appreciated.
- Michael