Hello Gernot,
first of all, I had downloaded the source of version 5.2.12 as the
latest (supposed to be stable) version of Gutenprint. And my OS is
Debian Stretch (the latest stable version).
In print-canon.c I searched for the string "PIXMA iP4700" and inserted
the string
" || !(strcmp(init->caps->name,"PIXMA MG6100"))" (without the additional
"blank closing bracket") into these lines.
This line reads now
if ( (print_cd) && ( !(strcmp(init->caps->name,"PIXMA iP4700")) ||
!(strcmp(init->caps->name,"PIXMA MG6100")) && (test_cd==1) ) {
rather than
if ( (print_cd) && ( !(strcmp(init->caps->name,"PIXMA iP4700")) ||
!(strcmp(init->caps->name,"PIXMA MG6100")) ) && (test_cd==1) ) {
^^^
in line #3966 I varied the value in "*init->page_height += 132*"
^^^
reducing the value moved the print upwards. But adding to this value
didn't bring the printed image down closer to the bottom border of the 5
inch media. (print happens "reversed", the tray comes out top first and
bottom up (or last)).
"make" produces some*warnings* especially concerning brackets in those lines, which contain the string "PICMA iP4700" and "&&":
print-canon.c: In function 'canon_init_setPrintMode':
print-canon.c:3576:3: warning: this 'if' clause does not guard...
[-Wmisleading-indentation]
if (!arg_6d_a)
^~
print-canon.c:3579:5: note: ...this statement, but the latter is
misleadingly indented as if it is guarded by the 'if'
arg_6d_1= 0x04;
^~~~~~~~
print-canon.c: In function 'canon_init_setPageMargins2':
print-canon.c:3963:19: warning: suggest parentheses around '&&' within
'||' [-Wparentheses]
if ( (print_cd) && !(strcmp(init->caps->name,"PIXMA iP4700")) ||
!(strcmp(init->caps->name,"PIXMA MG6100")) && (test_cd==1) ) {
~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
print-canon.c:4107:18: warning: suggest parentheses around '&&' within
'||' [-Wparentheses]
if ( (print_cd) && !(strcmp(init->caps->name,"PIXMA iP4700")) ||
!(strcmp(init->caps->name,"PIXMA MG6100")) && (test_cd==1) ) {
~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
make uninstall, ./configure, make and make install is working. I removed
(deleted) the printer in cups and added it anew.
The ppd came with the Linux distribution. I just edited the version in
the ppd file from 5.2.11 tp 5.2.12 hoping, that it will not be used.
Since this distribution-version (Debian Stretch) no longer comes with
"cups-genppd" (at least I could not find it).
I could print after code changes even with modified borders (towards the
top) but not to the bottom 5 millimeters.
Hopefully you have an idea, how to achieve that.
With kind regards
Hugo
Post by Gernot HassenpflugPost by Hugo WauThank you, Gernot,
I just want to inform you, that for to evade the possible issues with self
inflicted errors did I simply change the line
#define CANON_CD_Y 405
to
#define CANON_CD_Y 420
(didn't know how these values correlate to millimeters)
Hello Hugo,
Thank you for that information.
I believe those dimensions are in points (1/72 inch), but as you can
tell from that the actualy dimensions are then calculated via a couple
of other parameters, making the whole endeavour rather confusing.
Post by Hugo Wauand printing on media showed, that it was fine (at least for me). Prints on
media are now correctly centered with the Y-value being changed.
That is pretty nifty that it worked that way for you.
Now we need to see how we can make those adjustments relatively, since
the two parameters are global and thus changing them will misalign
previously-centred printing for other CD tray types.
Post by Hugo WauHopefully you can apply your proposed correction to the upstream code
sometime.
If you want it to be tested, I am your man.
I'd be really happy if you can (reverting the global paramters first)
add the MG6100 to the Tray G code snippets in the function
canon_init_setPageMargins2
as I previously outlined.
(1) around line 4120 in the current code,
/* Tray G */
if ( (print_cd) && !(strcmp(init->caps->name,"PIXMA iP4700")) &&
(test_cd==1) ) {
Can change to
if ( (print_cd) && ( !(strcmp(init->caps->name,"PIXMA iP4700")) ||
!(strcmp(init->caps->name,"PIXMA MG6100")) ) && (test_cd==1) ) {
(2) around line 4267 in the current code,
if ( (print_cd) && !(strcmp(init->caps->name,"PIXMA iP4700")) &&
(test_cd==1) ) {
Can change to
if ( (print_cd) && ( !(strcmp(init->caps->name,"PIXMA iP4700")) ||
!(strcmp(init->caps->name,"PIXMA MG6100")) ) && (test_cd==1) ) {
I have no idea if the CD will actually print then, but since it did
print before I am hopeful that making the adjustments will show up at
least a change even if it is not yet completely correct.
Best regards,
Gernot Hassenpflug
Post by Hugo WauThanks again for your quick and kind reply.
With kind regards
Hugo
Post by Gernot HassenpflugPost by Hugo WauHello Gernot,
thank you for applying the print on media function.
For printing on printable DVDs with my Canon PIXMA MG 6150 I need to move
the print down by 5 millimeters. (The lowest 5 mm are left blank, while the
very top of the image is not printed on the DVD).
For this project I am using the Gimp on Debian Linux.
In which file can I apply the change permanently and what do I have to
change there?
The changes need to be made in src/main/print-canon.c
(1) canon_setup_channels function has the basic definition for
offsetting CD printing
#define CANON_CD_X 176
#define CANON_CD_Y 405
This needs to be changed, together with media sizes, for different CD trays.
(2) in the function canon_init_setPageMargins2
Various test offsets and media size changes have bee4n made for
different CD trays (A through J, M still missing).
The MG6100 uses Tray G, so you can add your printer to the parts where
Tray G is mentions (for example, currently the iP4700 was used as a
test machine, however tests were never completed).
Post by Hugo WauDo I have to compile Gutenprint againt after applying the change?
Yes, you do.
Post by Hugo WauDo you need a scan?
No, it is fine to know the offset and try to work from that.
If you can add your printer to the various Tray G code snippets,
e.g. by changing something like this,
if ( (print_cd) && !(strcmp(init->caps->name,"PIXMA iP4700")) && (test_cd==1) )
to something like this,
if ( (print_cd) && ( !(strcmp(init->caps->name,"PIXMA iP4700")) ||
!(strcmp(init->caps->name,"PIXMA MG6100")) ) && (test_cd==1) )
then we can check whether the code works at all.
I had rewritten the code for CD printing completely to calculate
papersizes and offsets based on parameters for each tray, but without
testing, it is impossible to know whether such code works at all, so
the behaviour should be checked first in the existing code, and then
we can try to obtain the same results with code doing calculations
based on more rational parameters.
Since a release is imminent in the next day, I wont be able to make
any experimental changes to the code now, hence the above
explanations. See if you can add the MG6100 to the Tray G code
adjustments. Chances are it will not print at all, or the adjustments
are not quite right, in either case it will help all printers using
Tray G, of which if you look at the comments in that function, there
are many.
Post by Hugo Wauwith kind regards
Hugo
Best regards,
Gernot
Post by Hugo Wau------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Gimp-print-devel mailing list
https://lists.sourceforge.net/lists/listinfo/gimp-print-devel
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Gimp-print-devel mailing list
https://lists.sourceforge.net/lists/listinfo/gimp-print-devel
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Gimp-print-devel mailing list
https://lists.sourceforge.net/lists/listinfo/gimp-print-devel
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Gimp-print-devel mailing list
https://lists.sourceforge.net/lists/listinfo/gimp-print-devel