Interface nsIPrintSettingsType

Simplified graphics interface for JS rendering.

Hierarchy

Properties

docURL: string
duplex: number

print resolution (dpi)

edgeBottom: number
edgeLeft: number

these are in inches

edgeRight: number
edgeTop: number

The edge measurements define the positioning of the headers and footers on the page. They're treated as an offset from the edges of the page, but are forced to be at least the "unwriteable margin" (described below).

footerStrCenter: string
footerStrLeft: string
footerStrRight: string
headerStrCenter: string
headerStrLeft: string
headerStrRight: string
honorPageRuleMargins: boolean

Print Background Images Whether

Page

rule margins should be honored or not. If the

Page

rule sets its margins to zero, we automatically ignore unwriteable margins, but nonzero values will be clamped to unwriteable margins.

ignoreUnwriteableMargins: boolean

Whether unwritable margins should be ignored. This should be set when when the user explicitly requests "Margins: None", e.g. for documents where accurate scaling matters. Note: While honorPageRuleMargins and this flag can't be set at the same time through the UI, doing so will cause even the nonzero

Page

rule margins to ignore unwriteable margins.

isInitializedFromPrefs: boolean

This attribute tracks whether the PS has been initialized from prefs. If a different name is set into the "printerName" attribute than the one it was initialized with the PS will then get initialized from prefs again.

isInitializedFromPrinter: boolean

duplex mode initialize helpers This attribute tracks whether the PS has been initialized from a printer specified by the "printerName" attr. If a different name is set into the "printerName" attribute than the one it was initialized with the PS will then get initialized from that printer.

marginBottom: number
marginLeft: number

these are in inches

marginRight: number
marginTop: number

The margins define the positioning of the content on the page. and footers on the page. They're treated as an offset from the edges of the page, but are forced to be at least the "unwriteable margin," unless set to be ignored (described below).

numCopies: number

see orientation consts

numPagesPerSheet: number

For numPagesPerSheet, we support these values: 1, 2, 4, 6, 9, 16.

Unsupported values will be treated internally as 1 page per sheet, and will trigger assertion failures in debug builds.

orientation: number

a false means grayscale

outputDestination: nsIPrintSettings_OutputDestinationType

Output device information

outputFormat: number
outputStream: nsIOutputStream
paperHeight: number

width of the paper in inches or mm

paperId: string

shrinks content to fit on page Additional XP Related

paperSizeUnit: number

height of the paper in inches or mm

paperWidth: number

identifier of paper (not display name)

printBGColors: boolean

values 0.0 - 1.0

printBGImages: boolean

Print Background Colors

printInColor: boolean
printPageDelay: number

for kOutputDestinationPrinter

printReversed: boolean

paper is in inches or mm

printSelectionOnly: boolean

Whether to only print the selected nodes

printSilent: boolean
printerName: string

If outputDestination==kOutputDestinationPrinter, this is set to the name of the printer that the print output should be saved to, but only in the parent process (we don't want to leak printer names to potentially compromised content processes).

resolution: number

in milliseconds

scaling: number
showMarginGuides: boolean

Whether to draw guidelines showing the margin settings

shrinkToFit: boolean

print without putting up the dialog

title: string
toFileName: string

If outputDestination==kOutputDestinationFile, this is set to the path of the file that the print output should be saved to, but only in the parent process (we don't want to leak system paths to potentially compromised content processes).

unwriteableMarginBottom: number
unwriteableMarginLeft: number

these are in inches

unwriteableMarginRight: number
unwriteableMarginTop: number

The unwriteable margin defines the printable region of the paper.

usePageRuleSizeAsPaperSize: boolean

Whether

Page

rule size should be used for the output paper size.

Methods

  • Increases the reference count for this interface. The associated instance will not be deleted unless the reference count is returned to zero.

    Returns

    The resulting reference count.

    Returns number

  • Returns nsNativeIntMargin

  • Get the page size in twips, considering the orientation (portrait or landscape).

    Parameters

    • aWidth: number
    • aHeight: number

    Returns void

  • Get the printed sheet size in twips, considering both the user-specified orientation (portrait or landscape) as well as the fact that we might be inverting the orientation to account for 2 or 6 pages-per-sheet.

    This API will usually behave the same (& return the same thing) as GetEffectivePageSize, except for when we are printing with 2 or 6 pages-per-sheet, in which case the return values (aWidth & aHeight) will be swapped with respect to what GetEffectivePageSize would return.

    Callers should use this method rather than GetEffectivePageSize when they really do want the size of the sheet of paper to be printed, rather than the possibly-"virtualized"-via-pages-per-sheet page size.

    Parameters

    • aWidth: number
    • aHeight: number

    Returns void

  • Returns nsNativeIntMargin

  • Get the orientation of a printed sheet. This is usually the same as the 'orientation' attribute (which is the orientation of individual pages), except when we're printing with 2 or 6 pages-per-sheet, in which case it'll be the opposite value.

    Note that this value is not independently settable. Its value is fully determined by the 'orientation' and 'numPagesPerSheet' attributes.

    Returns number

  • Returns nsNativeIntMargin

  • Convenience getter, which returns true IFF the sheet orientation and the page orientation are orthogonal. (In other words, returns true IFF we are printing with 2 or 6 pages-per-sheet.)

    Returns bool

  • Parameters

    • aIID: object
    • Optional aInstancePtr: object

    Returns any

  • A run time mechanism for interface discovery.

    Returns

    NS_OK if the interface is supported by the associated instance, NS_NOINTERFACE if it is not.

    aInstancePtr must not be null.

    Parameters

    • aIID: object

      [in] A requested interface IID

    • aInstancePtr: object

      [out] A pointer to an interface pointer to receive the result.

    Returns void

  • Decreases the reference count for this interface. Generally, if the reference count returns to zero, the associated instance is deleted.

    Returns

    The resulting reference count.

    Returns number

  • Parameters

    • aEdge: nsNativeIntMarginRef

    Returns void

  • C++ Helper Functions

    Parameters

    • aMargin: nsNativeIntMarginRef

    Returns void

  • Sets/Gets the "unwriteable margin" for the page format. This defines the boundary from which we'll measure the EdgeInTwips and MarginInTwips attributes, to place the headers and content, respectively.

    Note: Implementations of SetUnwriteableMarginInTwips should handle negative margin values by falling back on the system default for that margin.

    Parameters

    • aEdge: nsNativeIntMarginRef

    Returns void

  • Assigns the internal values from the "in" arg to the current object

    Parameters

    • aPS: nsIPrintSettings

    Returns void

  • Makes a new copy

    Returns nsIPrintSettings

  • Returns true if the settings will result in an equivalent preview and therefore print. The printer name is ignored and it allows for a small delta in sizes to allow for rounding differences.

    Parameters

    • aPrintSettings: nsIPrintSettings

    Returns bool

  • Get a PrintSettingsInitializer populated with the relevant current settings.

    Returns PrintSettingsInitializer

Generated using TypeDoc