FROM : Andrew Kinnie
DATE : Fri Apr 22 12:42:45 2005
Yeah, I found that one, but that doesn't help me get the available
paper sizes for a given printer, because I need to know the name of the
paper in order to use the method. For Letter and Legal, that is fine,
but I won't know what different receipt printer manufacturers may be
calling their custom receipt page sizes.
Also, apparently it relies on what is in the PPD file, and it doesn't
appear that Star Micronics (for example) has a PPD file for its printer
(the one I am testing on). At least nothing showed when I did a global
search for file names containing ppd after installing the drivers.
I can only assume this is why when I hard coded the name of the receipt
paper into the app, and tried to use this method, it returned nil.
I'm hoping I can do this so I won't need to change to code every time a
new receipt printer is released by someone. That would seem rather
irrational to me.
On Apr 21, 2005, at 10:56 PM, Frank Fenn wrote:
> Hi Andrew,
>
>> Second, I also hand coded the paper size, because I can't figure out
>> how to determine the available paper sizes for a particular printer.
>> Is there a way to do this?
>
> NSPrinter
>
> pageSizeForPaper:
>
> - (NSSize)pageSizeForPaper:(NSString *)paperName
> Returns the size of the page for the paper type paperName. Possible
> values for paperName are contained in the printer’s PPD file. Typical
> values are Letter and Legal. Returns a zero size if paperName is not
> recognized, or its entry in the PPD cannot be parsed.
>
> Sincerely,
> Frank Fenn
>
> --
>
> Bright Light Software - http://www.brightlightsoftware.com
>
DATE : Fri Apr 22 12:42:45 2005
Yeah, I found that one, but that doesn't help me get the available
paper sizes for a given printer, because I need to know the name of the
paper in order to use the method. For Letter and Legal, that is fine,
but I won't know what different receipt printer manufacturers may be
calling their custom receipt page sizes.
Also, apparently it relies on what is in the PPD file, and it doesn't
appear that Star Micronics (for example) has a PPD file for its printer
(the one I am testing on). At least nothing showed when I did a global
search for file names containing ppd after installing the drivers.
I can only assume this is why when I hard coded the name of the receipt
paper into the app, and tried to use this method, it returned nil.
I'm hoping I can do this so I won't need to change to code every time a
new receipt printer is released by someone. That would seem rather
irrational to me.
On Apr 21, 2005, at 10:56 PM, Frank Fenn wrote:
> Hi Andrew,
>
>> Second, I also hand coded the paper size, because I can't figure out
>> how to determine the available paper sizes for a particular printer.
>> Is there a way to do this?
>
> NSPrinter
>
> pageSizeForPaper:
>
> - (NSSize)pageSizeForPaper:(NSString *)paperName
> Returns the size of the page for the paper type paperName. Possible
> values for paperName are contained in the printer’s PPD file. Typical
> values are Letter and Legal. Returns a zero size if paperName is not
> recognized, or its entry in the PPD cannot be parsed.
>
> Sincerely,
> Frank Fenn
>
> --
>
> Bright Light Software - http://www.brightlightsoftware.com
>
| Related mails | Author | Date |
|---|---|---|
| Andrew Kinnie | Apr 20, 20:45 | |
| Frank Fenn | Apr 22, 08:49 | |
| Andrew Kinnie | Apr 22, 12:42 | |
| billmonk | Apr 23, 03:16 | |
| Dave Camp | Apr 25, 17:55 |






Cocoa mail archive

