First, the PageSize is set and after that the media option, which effectively overwrites the PageSize option (which is the correct behaviour). I have no idea *why* these options are in the wrong order. If I print the attached PDF with the attached PPD file and your lp command line, I get the correct ordering (first "media", then the options supplied on the command line, "PageSize" and "landscape"). A quick fix could be to explicitly give all of these options to lp in the correct order:
Pavneet,
the problem is the order of options given to foomatic-rip. You can see it in this line of the log:
D [08/Mar/ 2009:20: 00:19 -0400] [Job 501] argv[5] ="PageSize= Custom. 2.75x6. 25in landscape media=Letter finishings=3 number-up=1 job-uuid= urn:uuid: ac90edd7- 8cd0-303a- 79fd-cfd201e2af 9a"
First, the PageSize is set and after that the media option, which effectively overwrites the PageSize option (which is the correct behaviour). I have no idea *why* these options are in the wrong order. If I print the attached PDF with the attached PPD file and your lp command line, I get the correct ordering (first "media", then the options supplied on the command line, "PageSize" and "landscape"). A quick fix could be to explicitly give all of these options to lp in the correct order:
lp -o media=Letter -o PageSize=CustomXXX -o landscape
This might stop CUPS from inserting media=Letter again.
But the question of where these options come from remains: Do you have a ~/.lpoptions, ~/.cups/loptions, or /etc/cups/ lpoptions?