• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Getting the list of all known paper names
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Getting the list of all known paper names


  • Subject: Re: Getting the list of all known paper names
  • From: glenn andreas <email@hidden>
  • Date: Fri, 18 Nov 2005 09:32:09 -0600


On Nov 18, 2005, at 9:10 AM, Michel Schinz wrote:

Le 18 nov. 05 à 15:37, John C. Randolph a écrit :

I'm trying to get the list of all defined paper names, and I don't find an API for that. Basically, I'd like to obtain the list of paper names which is displayed in a standard "Page Setup..." dialogue, under the "Paper Size:" heading.

Is there a way to obtain that information?

That information is printer-specific, so it's in the PPD files.

Really? I'm surprised to hear that, as on my development computer I have no printer defined, and still the list of paper sizes is available in the "Print Setup..." dialogue. Moreover, I was able to define a custom paper size, which is stored in ~/Library/ Preferences/com.apple.print.custompapers.plist, also without configuring a single printer... (And I insist that I *never* defined a single printer on that computer: [NSPrinter printerNames] returns an empty array).


Being able to use standard paper sizes without having a printer connected is very useful, and I use it all the time since in many applications it's the only way to define the physical size of the document. It's also used as the paper size when saving to a PDF.

So while I'm ready to believe that there is a way to access paper sizes when a printer is connected, I'd like to know a technique which also works in the absence of a printer.

(To be clear: the paper sizes I'm interested in should anyway not depend on the printer, as they're standard [A4, A3, US Letter, etc.]. So I don't want to know what's actually in the trays of a given printer, but rather what paper sizes are known by the system, including their localised name.)

So you don't want _all_ defined paper names, rather the paper names that are available for documents formatted "for any printer", which may, or may not, be supported for any given printer.


I don't believe there is a way to do this using Cocoa, but you can use

PMPrinterGetPaperList

to get a list of available paper sizes.

You'll probably want to ask on the printing list for more details...


Glenn Andreas email@hidden <http://www.gandreas.com/> wicked fun! Widgetarium | the quickest path to widgets

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


References: 
 >Getting the list of all known paper names (From: Michel Schinz <email@hidden>)
 >Re: Getting the list of all known paper names (From: "John C. Randolph" <email@hidden>)
 >Re: Getting the list of all known paper names (From: Michel Schinz <email@hidden>)

  • Prev by Date: Re: How to make sure that end of string is visible in NSTextField
  • Next by Date: Re: Automagic instantiation of singletons?
  • Previous by thread: Re: Getting the list of all known paper names
  • Next by thread: Getting the list of all known paper names
  • Index(es):
    • Date
    • Thread