[Gimp-developer] Printing non-interactively using file-print-gtk



Hi!

I'm having the following problem. I'm trying to print images non
interactively from a photobooth application I have written. It is a quick
and not so dirty solution written in python. It captures the images using
'fswebcam' and the original plan was to print the images using 'lpr'. The
printer used is a HP Photosmart Premium 309. It is impossible to get images
to print right using lpr. I noticed that using 'eog' the images seemed to
be printing ok, so I suspected that gtk printing might work. That led me to
gimp, because I knew that there was a non-interactive mechanism to run
scripts. The printing also works fine from gimp when done interactively
from the menu.

Now to the problem with the file-print-gtk procedure. If I run the
file-print-gtk procedure like this

(file-print-gtk RUN-INTERACTIVE image)

and press just the OK button, everything prints nicely.

If I run the procedure like this

(file-print-gtk RUN-INTERACTIVE image)


the image is printed on the photo paper presumably 2 times larger, so that
only one quarter of the image is printed on the paper.

I'm a bit confused about what settings are used when the print page setup
dialog is shown, and what settings are used when the dialog is not shown.
That seems to be obvious that they are different settings.

I read from this thread
http://www.gimpusers.com/forums/gimp-user/11146-printing-from-a-batch that
one might try to change the parameters in files print-settings and
print-page-setup which are located in the gimp user directory. The problem
is that I have no idea when these files are used, interactively on
non-interactively.

There was also a mentioning about file-print-gtk-page-setup procedure. What
does this do?

Any help is appreciated. The photobooth application needs to be ready in a
week, and the printing part is the only thing missing. I would not be proud
of a solution where the user sees a print dialog and has to press OK. I
want to be able to do the printing with only one push of a button.

-Niklas


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]