John Chambers wrote: >Phil Taylor writes: >| John Chambers wrote: >| >Actually, there's a consistent problem that no software has a chance >| >of fixing: Different printers (even of the same model) have different >| >borders along the edges that they don't print. There's no way that >| >I've ever seen to ask a printer for the size of its non-printing >| >borders. >| >| It can certainly be done. Otherwise how would word-processors be >| able to let you set the size of the margins? On the Mac, when the >| user does a Page Setup command to set the paper size, the printer >| returns a record which is stuffed with information, including two >| rectangles which give the size of the paper and the size of the >| printable area. > >OK, consider my ABC tune finder. It does conversions from abc to ps >and pdf on behalf of HTTP requests coming in from distant machines. >How would it ask the client's machine for the printable area of its >printer? And note that this is assuming that the user is going to >print it on that printer. In reality, it will probably just be handed >to a local ps or pdf handler, or written to a file. It could then be >printed some time later on any printer available to the user. How >would my CGI script go about discovering that printer and asking it >for the shape of the printable area?
Yes, if abc2ps is one stage away from the printing process you're even further. It's not your software's job to set the printer page size - you should be returning the picture in a scaleable format which can be printed at any size. In theory, PostScript is perfectly scaleable, but in practice there just doesn't seem to be any software which can do it. >The only feasible approach is to ask the user. But most users not >only wouldn't know; they wouldn't even understand the question or >have any idea how to answer it. (Nonetheless, I am working on making >it possible for a knowledgeable user to supply such information.) Most users will know what size of paper they print on (A4 or US Letter in the vast majority of cases). They can be asked to specify their margin sizes (or you could just assume one inch all round, which is big enough to get you inside the printable area of most printers). >| Unfortunately, some Epson printers seem to always return the page >| size for the largest paper they can take, rather than the size of >| paper which is actually loaded. This can complicate things a bit, >| but the printable area seems always to be correct. > >Yeah; that's another problem. Not all printers will return the data. >Others return it in a proprietary format that they won't tell you. >Still others return it in a published format, but they lie. It's all >utterly hopeless. You have to get this info through the manufacturer's printer driver, which understands the proprietary formats. Still, as I said before, it's not really your problem. Phil Taylor To subscribe/unsubscribe, point your browser to: http://www.tullochgorm.com/lists.html