Adobe® Flash® Platform용 ActionScript® 3.0 참조 설명서
 |  패키지 및 클래스 목록 숨기기 |  패키지  |  클래스  |  새로운 내용  |  색인  |  부록  |  영어로 표시되는 이유
필터: AIR 30.0 이하, Flash Player 30.0 이하, Flash Lite 4
Flex 4.6 이하, Flash Pro CS6 이하
필터 숨기기
flash.printing 

PrintJob  - AS3

패키지x

최상위 레벨
adobe.utils
air.desktop
air.net
air.update
air.update.events
coldfusion.air
coldfusion.air.errors
coldfusion.air.events
coldfusion.service
coldfusion.service.events
coldfusion.service.mxml
com.adobe.acm.solutions.authoring.domain.extensions
com.adobe.acm.solutions.ccr.domain.extensions
com.adobe.consulting.pst.vo
com.adobe.dct.component
com.adobe.dct.component.datadictionary
com.adobe.dct.component.datadictionaryElement
com.adobe.dct.component.dataElementsPanel
com.adobe.dct.component.toolbars
com.adobe.dct.event
com.adobe.dct.exp
com.adobe.dct.model
com.adobe.dct.service
com.adobe.dct.service.provider
com.adobe.dct.transfer
com.adobe.dct.util
com.adobe.dct.view
com.adobe.ep.taskmanagement.domain
com.adobe.ep.taskmanagement.event
com.adobe.ep.taskmanagement.filter
com.adobe.ep.taskmanagement.services
com.adobe.ep.taskmanagement.util
com.adobe.ep.ux.attachmentlist.component
com.adobe.ep.ux.attachmentlist.domain
com.adobe.ep.ux.attachmentlist.domain.events
com.adobe.ep.ux.attachmentlist.domain.renderers
com.adobe.ep.ux.attachmentlist.skin
com.adobe.ep.ux.attachmentlist.skin.renderers
com.adobe.ep.ux.content.event
com.adobe.ep.ux.content.factory
com.adobe.ep.ux.content.handlers
com.adobe.ep.ux.content.managers
com.adobe.ep.ux.content.model.asset
com.adobe.ep.ux.content.model.preview
com.adobe.ep.ux.content.model.relation
com.adobe.ep.ux.content.model.search
com.adobe.ep.ux.content.model.toolbar
com.adobe.ep.ux.content.search
com.adobe.ep.ux.content.services
com.adobe.ep.ux.content.services.load
com.adobe.ep.ux.content.services.permissions
com.adobe.ep.ux.content.services.preview
com.adobe.ep.ux.content.services.providers
com.adobe.ep.ux.content.services.query
com.adobe.ep.ux.content.services.relationships
com.adobe.ep.ux.content.services.search.lccontent
com.adobe.ep.ux.content.services.version
com.adobe.ep.ux.content.view
com.adobe.ep.ux.content.view.components.activate
com.adobe.ep.ux.content.view.components.grid
com.adobe.ep.ux.content.view.components.grid.hover
com.adobe.ep.ux.content.view.components.grid.hover.component
com.adobe.ep.ux.content.view.components.grid.renderers
com.adobe.ep.ux.content.view.components.relationships
com.adobe.ep.ux.content.view.components.review
com.adobe.ep.ux.content.view.components.search.renderers
com.adobe.ep.ux.content.view.components.searchpod
com.adobe.ep.ux.content.view.components.toolbar
com.adobe.ep.ux.content.view.components.toolbar.controlRenderers
com.adobe.ep.ux.content.view.components.version
com.adobe.ep.ux.documentsubmit.component
com.adobe.ep.ux.documentsubmit.domain
com.adobe.ep.ux.documentsubmit.skin
com.adobe.ep.ux.taskaction.component
com.adobe.ep.ux.taskaction.domain
com.adobe.ep.ux.taskaction.domain.events
com.adobe.ep.ux.taskaction.skin
com.adobe.ep.ux.taskdetails.component
com.adobe.ep.ux.taskdetails.domain
com.adobe.ep.ux.taskdetails.skin
com.adobe.ep.ux.tasklist.component
com.adobe.ep.ux.tasklist.domain
com.adobe.ep.ux.tasklist.skin
com.adobe.ep.ux.webdocumentviewer.domain
com.adobe.exm.expression
com.adobe.exm.expression.error
com.adobe.exm.expression.event
com.adobe.exm.expression.impl
com.adobe.fiber.runtime.lib
com.adobe.fiber.services
com.adobe.fiber.services.wrapper
com.adobe.fiber.styles
com.adobe.fiber.util
com.adobe.fiber.valueobjects
com.adobe.gravity.binding
com.adobe.gravity.context
com.adobe.gravity.flex.bundleloader
com.adobe.gravity.flex.progress
com.adobe.gravity.flex.serviceloader
com.adobe.gravity.framework
com.adobe.gravity.init
com.adobe.gravity.service.bundleloader
com.adobe.gravity.service.logging
com.adobe.gravity.service.manifest
com.adobe.gravity.service.progress
com.adobe.gravity.tracker
com.adobe.gravity.ui
com.adobe.gravity.utility
com.adobe.gravity.utility.async
com.adobe.gravity.utility.error
com.adobe.gravity.utility.events
com.adobe.gravity.utility.factory
com.adobe.gravity.utility.flex.async
com.adobe.gravity.utility.logging
com.adobe.gravity.utility.message
com.adobe.gravity.utility.sequence
com.adobe.gravity.utility.url
com.adobe.guides.control
com.adobe.guides.domain
com.adobe.guides.i18n
com.adobe.guides.spark.components.skins
com.adobe.guides.spark.components.skins.mx
com.adobe.guides.spark.headers.components
com.adobe.guides.spark.headers.skins
com.adobe.guides.spark.layouts.components
com.adobe.guides.spark.layouts.skins
com.adobe.guides.spark.navigators.components
com.adobe.guides.spark.navigators.renderers
com.adobe.guides.spark.navigators.skins
com.adobe.guides.spark.util
com.adobe.guides.spark.wrappers.components
com.adobe.guides.spark.wrappers.skins
com.adobe.guides.submit
com.adobe.icc.dc.domain
com.adobe.icc.dc.domain.factory
com.adobe.icc.editors.events
com.adobe.icc.editors.handlers
com.adobe.icc.editors.managers
com.adobe.icc.editors.model
com.adobe.icc.editors.model.config
com.adobe.icc.editors.model.el
com.adobe.icc.editors.model.el.operands
com.adobe.icc.editors.model.el.operators
com.adobe.icc.enum
com.adobe.icc.external.dc
com.adobe.icc.obj
com.adobe.icc.services
com.adobe.icc.services.category
com.adobe.icc.services.config
com.adobe.icc.services.download
com.adobe.icc.services.export
com.adobe.icc.services.external
com.adobe.icc.services.formbridge
com.adobe.icc.services.fragmentlayout
com.adobe.icc.services.layout
com.adobe.icc.services.letter
com.adobe.icc.services.locator
com.adobe.icc.services.module
com.adobe.icc.services.render
com.adobe.icc.services.submit
com.adobe.icc.services.user
com.adobe.icc.token
com.adobe.icc.vo
com.adobe.icc.vo.render
com.adobe.icomm.assetplacement.controller
com.adobe.icomm.assetplacement.controller.utils
com.adobe.icomm.assetplacement.data
com.adobe.icomm.assetplacement.model
com.adobe.livecycle.assetmanager.client
com.adobe.livecycle.assetmanager.client.event
com.adobe.livecycle.assetmanager.client.handler
com.adobe.livecycle.assetmanager.client.managers
com.adobe.livecycle.assetmanager.client.model
com.adobe.livecycle.assetmanager.client.model.cms
com.adobe.livecycle.assetmanager.client.service
com.adobe.livecycle.assetmanager.client.service.search
com.adobe.livecycle.assetmanager.client.service.search.cms
com.adobe.livecycle.assetmanager.client.utils
com.adobe.livecycle.content
com.adobe.livecycle.rca.model
com.adobe.livecycle.rca.model.constant
com.adobe.livecycle.rca.model.document
com.adobe.livecycle.rca.model.participant
com.adobe.livecycle.rca.model.reminder
com.adobe.livecycle.rca.model.stage
com.adobe.livecycle.rca.service
com.adobe.livecycle.rca.service.core
com.adobe.livecycle.rca.service.core.delegate
com.adobe.livecycle.rca.service.process
com.adobe.livecycle.rca.service.process.delegate
com.adobe.livecycle.rca.token
com.adobe.livecycle.ria.security.api
com.adobe.livecycle.ria.security.service
com.adobe.mosaic.layouts
com.adobe.mosaic.layouts.dragAndDrop
com.adobe.mosaic.layouts.interfaces
com.adobe.mosaic.mxml
com.adobe.mosaic.om.constants
com.adobe.mosaic.om.events
com.adobe.mosaic.om.impl
com.adobe.mosaic.om.interfaces
com.adobe.mosaic.skinning
com.adobe.mosaic.sparklib.editors
com.adobe.mosaic.sparklib.optionMenu
com.adobe.mosaic.sparklib.scrollableMenu
com.adobe.mosaic.sparklib.scrollableMenu.skins
com.adobe.mosaic.sparklib.tabLayout
com.adobe.mosaic.sparklib.tabLayout.events
com.adobe.mosaic.sparklib.tabLayout.layouts
com.adobe.mosaic.sparklib.tabLayout.skins
com.adobe.mosaic.sparklib.text
com.adobe.mosaic.sparklib.util
com.adobe.solutions.acm.authoring.presentation
com.adobe.solutions.acm.authoring.presentation.actionbar
com.adobe.solutions.acm.authoring.presentation.common
com.adobe.solutions.acm.authoring.presentation.events
com.adobe.solutions.acm.authoring.presentation.fragment
com.adobe.solutions.acm.authoring.presentation.letter
com.adobe.solutions.acm.authoring.presentation.letter.data
com.adobe.solutions.acm.authoring.presentation.preview
com.adobe.solutions.acm.authoring.presentation.rte
com.adobe.solutions.acm.ccr.presentation
com.adobe.solutions.acm.ccr.presentation.contentcapture
com.adobe.solutions.acm.ccr.presentation.contentcapture.events
com.adobe.solutions.acm.ccr.presentation.contentcapture.preview
com.adobe.solutions.acm.ccr.presentation.datacapture
com.adobe.solutions.acm.ccr.presentation.datacapture.renderers
com.adobe.solutions.acm.ccr.presentation.pdf
com.adobe.solutions.exm
com.adobe.solutions.exm.authoring
com.adobe.solutions.exm.authoring.components.controls
com.adobe.solutions.exm.authoring.components.toolbars
com.adobe.solutions.exm.authoring.domain
com.adobe.solutions.exm.authoring.domain.expression
com.adobe.solutions.exm.authoring.domain.impl
com.adobe.solutions.exm.authoring.domain.method
com.adobe.solutions.exm.authoring.domain.variable
com.adobe.solutions.exm.authoring.enum
com.adobe.solutions.exm.authoring.events
com.adobe.solutions.exm.authoring.model
com.adobe.solutions.exm.authoring.renderer
com.adobe.solutions.exm.authoring.view
com.adobe.solutions.exm.expression
com.adobe.solutions.exm.impl
com.adobe.solutions.exm.impl.method
com.adobe.solutions.exm.method
com.adobe.solutions.exm.mock
com.adobe.solutions.exm.mock.method
com.adobe.solutions.exm.runtime
com.adobe.solutions.exm.runtime.impl
com.adobe.solutions.exm.variable
com.adobe.solutions.prm.constant
com.adobe.solutions.prm.domain
com.adobe.solutions.prm.domain.factory
com.adobe.solutions.prm.domain.impl
com.adobe.solutions.prm.domain.manager
com.adobe.solutions.prm.presentation.asset
com.adobe.solutions.prm.presentation.constant
com.adobe.solutions.prm.presentation.document
com.adobe.solutions.prm.presentation.event
com.adobe.solutions.prm.presentation.file
com.adobe.solutions.prm.presentation.project
com.adobe.solutions.prm.presentation.team
com.adobe.solutions.prm.presentation.util
com.adobe.solutions.prm.service
com.adobe.solutions.prm.services.impl
com.adobe.solutions.prm.vo
com.adobe.solutions.rca.constant
com.adobe.solutions.rca.domain
com.adobe.solutions.rca.domain.common
com.adobe.solutions.rca.domain.factory
com.adobe.solutions.rca.domain.impl
com.adobe.solutions.rca.domain.impl.manager
com.adobe.solutions.rca.domain.manager
com.adobe.solutions.rca.presentation
com.adobe.solutions.rca.presentation.comment
com.adobe.solutions.rca.presentation.constant
com.adobe.solutions.rca.presentation.event
com.adobe.solutions.rca.presentation.gantt
com.adobe.solutions.rca.presentation.gantt.ruler
com.adobe.solutions.rca.presentation.template
com.adobe.solutions.rca.presentation.template.audit
com.adobe.solutions.rca.presentation.template.definition
com.adobe.solutions.rca.presentation.template.documents
com.adobe.solutions.rca.presentation.template.stages
com.adobe.solutions.rca.presentation.util
com.adobe.solutions.rca.service
com.adobe.solutions.rca.services.impl
com.adobe.solutions.rca.vo
com.adobe.solutions.rca.vo.um
com.adobe.viewsource
fl.accessibility
fl.containers
fl.controls
fl.controls.dataGridClasses
fl.controls.listClasses
fl.controls.progressBarClasses
fl.core
fl.data
fl.display
fl.events
fl.ik
fl.lang
fl.livepreview
fl.managers
fl.motion
fl.motion.easing
fl.rsl
fl.text
fl.transitions
fl.transitions.easing
fl.video
flash.accessibility
flash.concurrent
flash.crypto
flash.data
flash.desktop
flash.display
flash.display3D
flash.display3D.textures
flash.errors
flash.events
flash.external
flash.filesystem
flash.filters
flash.geom
flash.globalization
flash.html
flash.media
flash.net
flash.net.dns
flash.net.drm
flash.notifications
flash.permissions
flash.printing
flash.profiler
flash.sampler
flash.security
flash.sensors
flash.system
flash.text
flash.text.engine
flash.text.ime
flash.ui
flash.utils
flash.xml
flashx.textLayout
flashx.textLayout.compose
flashx.textLayout.container
flashx.textLayout.conversion
flashx.textLayout.edit
flashx.textLayout.elements
flashx.textLayout.events
flashx.textLayout.factory
flashx.textLayout.formats
flashx.textLayout.operations
flashx.textLayout.utils
flashx.undo
ga.controls
ga.layouts
ga.model
ga.uiComponents
ga.util
ga.views
ga.wrappers
lc.foundation
lc.foundation.domain
lc.foundation.events
lc.foundation.ui
lc.foundation.util
lc.preloader
lc.procmgmt
lc.procmgmt.commands
lc.procmgmt.domain
lc.procmgmt.events
lc.procmgmt.formbridge
lc.procmgmt.impl
lc.procmgmt.ui.attachments
lc.procmgmt.ui.controls
lc.procmgmt.ui.controls.card
lc.procmgmt.ui.controls.renderer
lc.procmgmt.ui.help
lc.procmgmt.ui.layout
lc.procmgmt.ui.presentationmodel
lc.procmgmt.ui.process
lc.procmgmt.ui.search
lc.procmgmt.ui.startpoint
lc.procmgmt.ui.task
lc.procmgmt.ui.task.form
lc.procmgmt.ui.task.form.commands
lc.procmgmt.ui.tracking
mx.accessibility
mx.automation
mx.automation.air
mx.automation.delegates
mx.automation.delegates.advancedDataGrid
mx.automation.delegates.charts
mx.automation.delegates.containers
mx.automation.delegates.controls
mx.automation.delegates.controls.dataGridClasses
mx.automation.delegates.controls.fileSystemClasses
mx.automation.delegates.core
mx.automation.delegates.flashflexkit
mx.automation.events
mx.binding
mx.binding.utils
mx.charts
mx.charts.chartClasses
mx.charts.effects
mx.charts.effects.effectClasses
mx.charts.events
mx.charts.renderers
mx.charts.series
mx.charts.series.items
mx.charts.series.renderData
mx.charts.styles
mx.collections
mx.collections.errors
mx.containers
mx.containers.accordionClasses
mx.containers.dividedBoxClasses
mx.containers.errors
mx.containers.utilityClasses
mx.controls
mx.controls.advancedDataGridClasses
mx.controls.dataGridClasses
mx.controls.listClasses
mx.controls.menuClasses
mx.controls.olapDataGridClasses
mx.controls.scrollClasses
mx.controls.sliderClasses
mx.controls.textClasses
mx.controls.treeClasses
mx.controls.videoClasses
mx.core
mx.core.windowClasses
mx.data
mx.data.crypto
mx.data.errors
mx.data.events
mx.data.messages
mx.data.mxml
mx.data.offline.errors
mx.data.utils
mx.effects
mx.effects.easing
mx.effects.effectClasses
mx.events
mx.filters
mx.flash
mx.formatters
mx.geom
mx.graphics
mx.graphics.codec
mx.graphics.shaderClasses
mx.logging
mx.logging.errors
mx.logging.targets
mx.managers
mx.messaging
mx.messaging.channels
mx.messaging.config
mx.messaging.errors
mx.messaging.events
mx.messaging.management
mx.messaging.messages
mx.modules
mx.netmon
mx.olap
mx.olap.aggregators
mx.preloaders
mx.printing
mx.resources
mx.rpc
mx.rpc.events
mx.rpc.http
mx.rpc.http.mxml
mx.rpc.livecycle
mx.rpc.mxml
mx.rpc.remoting
mx.rpc.remoting.mxml
mx.rpc.soap
mx.rpc.soap.mxml
mx.rpc.wsdl
mx.rpc.xml
mx.skins
mx.skins.halo
mx.skins.spark
mx.skins.wireframe
mx.skins.wireframe.windowChrome
mx.states
mx.styles
mx.utils
mx.validators
org.osmf.containers
org.osmf.display
org.osmf.elements
org.osmf.events
org.osmf.layout
org.osmf.logging
org.osmf.media
org.osmf.metadata
org.osmf.net
org.osmf.net.dvr
org.osmf.net.httpstreaming
org.osmf.net.metrics
org.osmf.net.qos
org.osmf.net.rtmpstreaming
org.osmf.net.rules
org.osmf.traits
org.osmf.utils
spark.accessibility
spark.automation.delegates
spark.automation.delegates.components
spark.automation.delegates.components.gridClasses
spark.automation.delegates.components.mediaClasses
spark.automation.delegates.components.supportClasses
spark.automation.delegates.skins.spark
spark.automation.events
spark.collections
spark.components
spark.components.calendarClasses
spark.components.gridClasses
spark.components.mediaClasses
spark.components.supportClasses
spark.components.windowClasses
spark.core
spark.effects
spark.effects.animation
spark.effects.easing
spark.effects.interpolation
spark.effects.supportClasses
spark.events
spark.filters
spark.formatters
spark.formatters.supportClasses
spark.globalization
spark.globalization.supportClasses
spark.layouts
spark.layouts.supportClasses
spark.managers
spark.modules
spark.preloaders
spark.primitives
spark.primitives.supportClasses
spark.skins
spark.skins.mobile
spark.skins.mobile.supportClasses
spark.skins.spark
spark.skins.spark.mediaClasses.fullScreen
spark.skins.spark.mediaClasses.normal
spark.skins.spark.windowChrome
spark.skins.wireframe
spark.skins.wireframe.mediaClasses
spark.skins.wireframe.mediaClasses.fullScreen
spark.transitions
spark.utils
spark.validators
spark.validators.supportClasses
xd.core.axm.enterprise.view.components
xd.core.axm.enterprise.view.skins
xd.core.axm.view.components
xd.core.axm.view.components.support

언어 요소

전역 상수
전역 함수
연산자
명령문, 키워드 및 지시문
특수 유형 연산자

부록

새로운 내용
컴파일러 오류
컴파일러 경고
런타임 오류
ActionScript 3으로 마이그레이션
지원되는 문자 세트
MXML 전용 태그
모션 XML 요소
Timed Text 태그
사용되지 않는 요소의 목록
액세스 가능성 구현 상수
ActionScript 예제 사용 방법
법적 고지 사항
패키지flash.printing
클래스public class PrintJob
상속PrintJob Inheritance EventDispatcher Inheritance Object

언어 버전: ActionScript 3.0
런타임 버전: AIR 1.0, Flash Player 9

PrintJob 클래스를 사용하면 내용을 작성하여 여러 페이지로 인쇄할 수 있습니다. 이 클래스를 통해 표시되는 내용, 동적 내용 또는 사용자의 화면에 표시되지 않는 내용을 렌더링하고, 사용자에게 단일 [인쇄] 대화 상자를 표시하며, 크기가 조절되지 않은 문서를 내용에 맞는 비율로 인쇄할 수 있습니다. 이 기능은 데이터베이스 내용 및 동적 텍스트와 같은 동적 내용을 렌더링하거나 인쇄할 때 특히 유용합니다.

모바일 브라우저 지원: 이 클래스는 모바일 브라우저에서 지원되지 않습니다.

AIR 프로파일 지원: 이 기능은 모든 데스크톱 운영 체제에서 지원되지만 휴대 장치나 AIR for TV 장치에서는 지원되지 않습니다. PrintJob.isSupported 속성을 사용하여 런타임에 지원을 테스트할 수 있습니다. 여러 프로파일 간 API 지원에 대한 자세한 내용은 AIR 프로파일 지원을 참조하십시오.

인쇄 작업을 만들려면 PrintJob() 생성자를 사용합니다.

또한 PrintJob 클래스의 속성을 사용하면 문서에서 페이지 높이, 폭 및 이미지 방향과 같은 사용자의 프린터 설정을 읽을 수 있으며 Flash 내용의 서식이 프린터 설정에 맞게 동적으로 지정되도록 문서를 구성할 수 있습니다.

참고: ActionScript 3.0에서는 이전 버전의 ActionScript와 달리 PrintJob 객체를 단일 프레임으로 제한하지 않습니다. 그러나 사용자가 [인쇄] 대화 상자에서 [확인] 버튼을 클릭하면 운영 체제에서 사용자에게 인쇄 상태 정보를 표시하므로 PrintJob.addPage()PrintJob.send()를 최대한 빠르게 호출하여 페이지를 스풀러로 보내야 합니다. PrintJob.send() 호출을 포함하는 프레임에 늦게 도달하면 인쇄 과정이 지연됩니다.

또한 다음 간격에는 15초 스크립트 시간 초과 제한이 적용됩니다.

  • PrintJob.start() 및 첫 번째 PrintJob.addPage()
  • PrintJob.addPage() 및 다음 PrintJob.addPage()
  • 마지막 PrintJob.addPage()PrintJob.send()

위 간격 중 하나가 15초를 초과한 경우 PrintJob 인스턴스에서 다음 번에 PrintJob.start()를 호출하면 false가 반환되고 PrintJob 인스턴스에서 다음 번에 PrintJob.addPage()를 호출하면 Flash Player 또는 Adobe AIR에서 런타임 예외가 발생합니다.

예제 보기



공용 속성
 속성정의 주체
      active : Boolean
[정적] [읽기 전용] 인쇄 작업이 현재 활성화되었는지 여부를 나타냅니다.
PrintJob
 Inheritedconstructor : Object
지정된 객체 인스턴스의 클래스 객체 또는 생성자 함수에 대한 참조입니다.
Object
      copies : int
인쇄 작업에 차후 추가되어 인쇄되는 인쇄 매수입니다.
PrintJob
      firstPage : int
[읽기 전용] 사용자가 운영 체제의 [인쇄] 대화 상자에서 입력한 범위의 첫 페이지 번호입니다.
PrintJob
      isColor : Boolean
[읽기 전용] 인쇄 설정에서 현재 선택된 프린터가 컬러(true)로 인쇄하는지 회색 음영(false)으로 인쇄하는지를 나타냅니다.
PrintJob
  isSupported : Boolean
[정적] [읽기 전용] 현재 플랫폼에서 PrintJob 클래스가 지원되는지(true) 지원되지 않는지(false)를 나타냅니다.
PrintJob
      jobName : String
인쇄 작업의 이름 또는 제목입니다.
PrintJob
      lastPage : int
[읽기 전용] 사용자가 운영 체제의 [인쇄] 대화 상자에 입력한 범위의 마지막 페이지 번호입니다.
PrintJob
      maxPixelsPerInch : Number
[읽기 전용] 선택한 프린터의 물리적 해상도(ppi)입니다.
PrintJob
  orientation : String
인쇄할 이미지 방향입니다.
PrintJob
  pageHeight : int
[읽기 전용] 페이지에서 실제 인쇄할 수 있는 영역의 가운데에 위치할 수 있는 가장 큰 영역의 높이(포인트)입니다.
PrintJob
  pageWidth : int
[읽기 전용] 페이지에서 실제 인쇄할 수 있는 영역의 가운데에 위치할 수 있는 가장 큰 영역의 너비(포인트)입니다.
PrintJob
      paperArea : Rectangle
[읽기 전용] 프린터 용지의 경계(단위: 포인트)입니다.
PrintJob
  paperHeight : int
[읽기 전용] 전체 용지 높이(단위: 포인트)입니다.
PrintJob
  paperWidth : int
[읽기 전용] 전체 용지 너비(단위: 포인트)입니다.
PrintJob
      printableArea : Rectangle
[읽기 전용] 프린터 용지의 인쇄 가능 영역 경계(단위: 포인트)입니다.
PrintJob
      printer : String
현재 인쇄 작업에 사용할 프린터를 가져오거나 설정합니다.
PrintJob
      printers : Vector.<String>
[정적] [읽기 전용] 사용할 수 있는 프린터 목록을 String 이름 값으로 제공합니다.
PrintJob
      supportsPageSetupDialog : Boolean
[정적] [읽기 전용] Flash 런타임 환경에서 별도의 [페이지 설정] 대화 상자를 지원하는지 여부를 나타냅니다.
PrintJob
공용 메서드
 메서드정의 주체
  
하나 이상의 페이지를 인쇄할 때 사용할 수 있는 PrintJob 객체를 만듭니다.
PrintJob
 Inherited
addEventListener(type:String, listener:Function, useCapture:Boolean = false, priority:int = 0, useWeakReference:Boolean = false):void
리스너에서 이벤트 알림을 받을 수 있도록 EventDispatcher 객체에 이벤트 리스너 객체를 등록합니다.
EventDispatcher
  
addPage(sprite:Sprite, printArea:Rectangle = null, options:PrintJobOptions = null, frameNum:int = 0):void
지정된 Sprite 객체를 인쇄 스풀러에 단일 페이지로 보냅니다.
PrintJob
 Inherited
이벤트를 이벤트 흐름으로 전달합니다.
EventDispatcher
 Inherited
EventDispatcher 객체에 특정 유형의 이벤트에 대한 리스너가 등록되어 있는지 여부를 확인합니다.
EventDispatcher
 Inherited
지정된 속성이 객체에 정의되어 있는지 여부를 나타냅니다.
Object
 Inherited
Object 클래스의 인스턴스가 매개 변수로 지정된 객체의 프로토타입 체인에 있는지 여부를 나타냅니다.
Object
 Inherited
지정된 속성이 존재하고 열거 가능한지 여부를 나타냅니다.
Object
 Inherited
removeEventListener(type:String, listener:Function, useCapture:Boolean = false):void
EventDispatcher 객체에서 리스너를 제거합니다.
EventDispatcher
  
    selectPaperSize(paperSize:String):void
용지 크기를 설정합니다.
PrintJob
  
start() 또는 start2() 및 addPage() 메서드를 성공적으로 호출한 후 스풀된 페이지를 프린터로 보냅니다.
PrintJob
 Inherited
루프 작업에서 동적 속성을 사용할 수 있는지 여부를 설정합니다.
Object
  
현재 환경에서 지원되는 경우 운영 체제의 [페이지 설정] 대화 상자를 표시합니다.
PrintJob
  
운영 체제의 [인쇄] 대화 상자를 표시하고 스풀링을 시작합니다.
PrintJob
  
    start2(uiOptions:PrintUIOptions = null, showPrintDialog:Boolean = true):Boolean
선택적으로 운영 체제의 [인쇄] 대화 상자를 열고 스풀링을 시작한 다음 PrintJob 읽기 전용 속성 값을 수정할 수 있습니다.
PrintJob
  
    terminate():void
인쇄 작업이 전송되지 않고 종료되어야 함을 알립니다.
PrintJob
 Inherited
로캘별 규칙에 따라 서식이 지정된 이 객체의 문자열 표현을 반환합니다.
Object
 Inherited
지정된 객체의 문자열 표현을 반환합니다.
Object
 Inherited
지정된 객체의 프리미티브 값을 반환합니다.
Object
 Inherited
이 EventDispatcher 객체 또는 조상 객체에 지정한 이벤트 유형에 대한 이벤트 리스너가 등록되어 있는지 여부를 확인합니다.
EventDispatcher
이벤트
 이벤트 요약 정의 주체
 Inherited[브로드캐스트 이벤트] Flash Player 또는 AIR 응용 프로그램이 운영 체제 포커스를 얻어 활성화될 때 전달됩니다.EventDispatcher
 Inherited[브로드캐스트 이벤트] Flash Player 또는 AIR 응용 프로그램이 운영 체제 포커스를 잃고 비활성화될 때 전달됩니다.EventDispatcher
속성 세부 정보
    

active

속성
active:Boolean  [읽기 전용]

언어 버전: ActionScript 3.0
런타임 버전: AIR 2

인쇄 작업이 현재 활성화되었는지 여부를 나타냅니다. 인쇄 작업은 다음 두 가지 상황에서 활성화됩니다(속성 값이 true).

  • [페이지 설정] 또는 [인쇄] 대화 상자가 표시되어 있는 경우
  • start() 또는 start2() 메서드가 true 반환 값으로 호출되었고 send() 또는 terminate() 메서드가 호출되지 않은 경우

이 속성이 true이고 showPageSetupDialog(), start() 또는 start2() 메서드를 호출한 경우 런타임은 예외를 발생시킵니다.



구현
    public static function get active():Boolean

관련 API 요소

    

copies

속성 
copies:int

언어 버전: ActionScript 3.0
런타임 버전: AIR 2

인쇄 작업에 차후 추가되어 인쇄되는 인쇄 매수입니다. 이 값은 사용자가 운영 체제의 [인쇄] 대화 상자에서 입력한 인쇄 매수입니다. 인쇄 매수가 [인쇄] 대화 상자에 표시되지 않은 경우 또는 대화 상자가 사용자에게 표시되지 않은 경우 값은 1입니다(단, 응용 프로그램 코드에 의해 변경된 경우 제외).



구현
    public function get copies():int
    public function set copies(value:int):void
    

firstPage

속성 
firstPage:int  [읽기 전용]

언어 버전: ActionScript 3.0
런타임 버전: AIR 2

사용자가 운영 체제의 [인쇄] 대화 상자에서 입력한 범위의 첫 페이지 번호입니다. 사용자가 모든 페이지를 인쇄할 것을 요청하는 경우, 페이지 범위가 [인쇄] 대화 상자에 표시되지 않은 경우 또는 [인쇄] 대화 상자가 사용자에게 표시되지 않은 경우 이 속성은 0입니다.



구현
    public function get firstPage():int
    

isColor

속성 
isColor:Boolean  [읽기 전용]

언어 버전: ActionScript 3.0
런타임 버전: AIR 2

인쇄 설정에서 현재 선택된 프린터가 컬러(true)로 인쇄하는지 회색 음영(false)으로 인쇄하는지를 나타냅니다.

컬러 값인지 회색 음영 값인지 결정할 수 없을 경우 값은 true입니다.



구현
    public function get isColor():Boolean

isSupported

속성 
isSupported:Boolean  [읽기 전용]

언어 버전: ActionScript 3.0
런타임 버전: Flash Player 10.1, AIR 2

현재 플랫폼에서 PrintJob 클래스가 지원되는지(true) 지원되지 않는지(false)를 나타냅니다.



구현
    public static function get isSupported():Boolean
    

jobName

속성 
jobName:String

언어 버전: ActionScript 3.0
런타임 버전: AIR 2

인쇄 작업의 이름 또는 제목입니다. 일반적으로 작업 이름은 운영 체제에서 인쇄 대기열의 작업 제목으로 사용되거나 파일에 인쇄되는 작업의 기본 이름으로 사용됩니다.

start() 또는 start2()를 호출하지 않았고 속성 값을 설정하지 않은 경우 이 속성의 값은 null입니다.

PrintJob 인스턴스로 실행하는 각 인쇄 작업의 경우, start() 또는 start2() 메서드를 호출하기 전에 이 속성을 설정합니다.

기본값: null.



구현
    public function get jobName():String
    public function set jobName(value:String):void

오류
IllegalOperationError active 속성이 true일 때 코드가 속성을 설정하려고 시도하는 경우입니다.
    

lastPage

속성 
lastPage:int  [읽기 전용]

언어 버전: ActionScript 3.0
런타임 버전: AIR 2

사용자가 운영 체제의 [인쇄] 대화 상자에 입력한 범위의 마지막 페이지 번호입니다. 사용자가 모든 페이지를 인쇄할 것을 요청하는 경우, 페이지 범위가 [인쇄] 대화 상자에 표시되지 않은 경우 또는 [인쇄] 대화 상자가 사용자에게 표시되지 않은 경우 이 속성은 0입니다.



구현
    public function get lastPage():int
    

maxPixelsPerInch

속성 
maxPixelsPerInch:Number  [읽기 전용]

언어 버전: ActionScript 3.0
런타임 버전: AIR 2

선택한 프린터의 물리적 해상도(ppi)입니다. 값은 운영 체제가 보고하는 현재 인쇄 설정에 따라 계산됩니다.

해상도를 확인할 수 없는 경우 값은 표준 기본값입니다. 기본값은 Linux의 경우 600ppi이고, Mac OS의 경우 360ppi입니다. Windows에서는 프린터 해상도가 항상 제공되므로 기본값이 필요하지 않습니다.



구현
    public function get maxPixelsPerInch():Number

orientation

속성 
orientation:String

언어 버전: ActionScript 3.0
런타임 버전: Flash Player 9 - read only, AIR 1.0 - read only, AIR 2 - read-write

인쇄할 이미지 방향입니다. 사용할 수 있는 값은 PrintJobOrientation 클래스에 상수로 정의됩니다.

참고: AIR 2 이후 버전에서는 인쇄 작업을 시작하기 전에 이 속성을 설정하여 [페이지 설정] 및 [인쇄] 대화 상자의 기본 방향을 설정합니다. start() 또는 start2()를 호출하여 작업 내 페이지 범위의 방향을 설정한 후 인쇄 작업이 진행 중일 때 속성을 설정합니다.



구현
    public function get orientation():String
    public function set orientation(value:String):void

관련 API 요소

pageHeight

속성 
pageHeight:int  [읽기 전용]

언어 버전: ActionScript 3.0
런타임 버전: AIR 1.0, Flash Player 9.

페이지에서 실제 인쇄할 수 있는 영역의 가운데에 위치할 수 있는 가장 큰 영역의 높이(포인트)입니다. 사용자가 설정한 여백은 무시됩니다. 이 속성은 PrintJob.start() 메서드를 호출한 후에만 사용할 수 있습니다.

참고: AIR 2 이상에서는 이 속성이 더 이상 사용되지 않습니다. 대신 printableArea를 사용하십시오. 이 속성은 인쇄할 수 있는 영역을 소수 포인트로 측정하고, 중심을 벗어난 인쇄 가능한 영역을 정확하게 설명합니다.



구현
    public function get pageHeight():int

관련 API 요소

pageWidth

속성 
pageWidth:int  [읽기 전용]

언어 버전: ActionScript 3.0
런타임 버전: Flash Player 9, AIR 1.0

페이지에서 실제 인쇄할 수 있는 영역의 가운데에 위치할 수 있는 가장 큰 영역의 너비(포인트)입니다. 사용자가 설정한 여백은 무시됩니다. 이 속성은 PrintJob.start() 메서드를 호출한 후에만 사용할 수 있습니다.

참고: AIR 2 이상에서는 이 속성이 더 이상 사용되지 않습니다. 대신 printableArea를 사용하십시오. 이 속성은 인쇄할 수 있는 영역을 소수 포인트로 측정하고, 중심을 벗어난 인쇄 가능한 영역을 정확하게 설명합니다.



구현
    public function get pageWidth():int

관련 API 요소

    

paperArea

속성 
paperArea:Rectangle  [읽기 전용]

언어 버전: ActionScript 3.0
런타임 버전: AIR 2

프린터 용지의 경계(단위: 포인트)입니다. 이 값은 이후 addPage() 호출에 사용되는 것과 동일한 좌표계를 사용합니다.



구현
    public function get paperArea():Rectangle

paperHeight

속성 
paperHeight:int  [읽기 전용]

언어 버전: ActionScript 3.0
런타임 버전: AIR 1.0, Flash Player 9.

전체 용지 높이(단위: 포인트)입니다. 이 속성은 PrintJob.start() 메서드를 호출한 후에만 사용할 수 있습니다.

참고: AIR 2 이상에서는 이 속성이 더 이상 사용되지 않습니다. 대신 paperArea를 사용하십시오. 이 속성은 용지 치수를 소수 포인트로 측정합니다.



구현
    public function get paperHeight():int

관련 API 요소

paperWidth

속성 
paperWidth:int  [읽기 전용]

언어 버전: ActionScript 3.0
런타임 버전: AIR 1.0, Flash Player 9.

전체 용지 너비(단위: 포인트)입니다. 이 속성은 PrintJob.start() 메서드를 호출한 후에만 사용할 수 있습니다.

참고: AIR 2 이상에서는 이 속성이 더 이상 사용되지 않습니다. 대신 paperArea를 사용하십시오. 이 속성은 용지 치수를 소수 포인트로 측정합니다.



구현
    public function get paperWidth():int

관련 API 요소

    

printableArea

속성 
printableArea:Rectangle  [읽기 전용]

언어 버전: ActionScript 3.0
런타임 버전: AIR 2

프린터 용지의 인쇄 가능 영역 경계(단위: 포인트)입니다. 이 값은 이후 addPage() 호출에 사용되는 것과 동일한 좌표계를 사용합니다.



구현
    public function get printableArea():Rectangle
    

printer

속성 
printer:String

언어 버전: ActionScript 3.0
런타임 버전: AIR 2

현재 인쇄 작업에 사용할 프린터를 가져오거나 설정합니다. setter로 전달되고 getter에 의해 반환된 문자열은 printers() 메서드에서 반환한 배열의 문자열 중 하나와 일치해야 합니다. 기본 프린터가 사용되어야 함을 나타내려면 값을 null로 설정합니다. 기본 프린터를 확인할 수 없는 운영 체제에서 이 속성의 값은 null입니다.

     import flash.printing.PrintJob;
     
     var myPrintJob:PrintJob = new PrintJob();
     myPrintJob.printer = "HP_LaserJet_1";
     myPrintJob.start();
     

이 속성 값을 설정하면 프린터가 즉시 선택됩니다. 프린터 선택이 실패하면 이 속성 값이 이전 값으로 다시 설정됩니다. 프린터 값을 설정해 본 다음 읽어 값이 이미 설정한 값과 일치하는지 확인하면 값 설정이 성공할지 여부를 판단할 수 있습니다.

활성 인쇄 작업의 printer 속성은 변경할 수 없습니다. start() 또는 start2() 메서드를 성공적으로 호출하고 나서 send() 또는 terminate()를 호출하기 전에 속성을 변경하려고 하면 실패합니다.



구현
    public function get printer():String
    public function set printer(value:String):void
    

printers

속성 
printers:Vector.<String>  [읽기 전용]

언어 버전: ActionScript 3.0
런타임 버전: AIR 2

사용할 수 있는 프린터 목록을 String 이름 값으로 제공합니다. 목록은 미리 계산되지 않으며 함수가 호출되면 생성됩니다. 사용할 수 있는 프린터가 없거나 시스템에서 인쇄를 지원하지 않는 경우 값은 null입니다. 시스템이 인쇄를 지원하지만 프린터 목록을 반환할 수 없는 경우, 값은 단일 요소가 있는 벡터입니다(length 속성은 1). 이 경우 단일 요소에 실제 프린터 이름 또는 기본 이름(현재 프린터 이름을 확인할 수 없는 경우)이 포함됩니다.



구현
    public static function get printers():Vector.<String>
    

supportsPageSetupDialog

속성 
supportsPageSetupDialog:Boolean  [읽기 전용]

언어 버전: ActionScript 3.0
런타임 버전: AIR 2

Flash 런타임 환경에서 별도의 [페이지 설정] 대화 상자를 지원하는지 여부를 나타냅니다. 속성이 true인 경우 showPageSetupDialog() 메서드를 호출하여 운영 체제의 페이지 설정 대화 상자를 표시할 수 있습니다.



구현
    public static function get supportsPageSetupDialog():Boolean

관련 API 요소

생성자 세부 정보

PrintJob

()생성자
public function PrintJob()

언어 버전: ActionScript 3.0
런타임 버전: AIR 1.0, Flash Player 9

하나 이상의 페이지를 인쇄할 때 사용할 수 있는 PrintJob 객체를 만듭니다. PrintJob 객체를 만든 후 PrintJob.start(), PrintJob.addPage()PrintJob.send() 메서드를 순서대로 사용하여 인쇄 작업을 프린터로 보내야 합니다.

예를 들어 myPrintJob.addPage() 메서드 호출의 [params] 자리 표시자 텍스트를 다음 코드와 같이 사용자 정의 매개 변수로 바꿀 수 있습니다.

 // create PrintJob object
 var myPrintJob:PrintJob = new PrintJob();
  
 // display Print dialog box, but only initiate the print job
 // if start returns successfully.
 if (myPrintJob.start()) {
  
    // add specified page to print job
    // repeat once for each page to be printed
    try {
      myPrintJob.addPage([params]);
    }
    catch(e:Error) {
      // handle error 
    }
    try {
      myPrintJob.addPage([params]);
    }
    catch(e:Error) {
      // handle error 
    }
 
    // send pages from the spooler to the printer, but only if one or more
    // calls to addPage() was successful. You should always check for successful 
    // calls to start() and addPage() before calling send().
    myPrintJob.send();
 }
 

AIR 2 이후 버전에서는 여러 PrintJob 인스턴스를 만들어 사용할 수 있습니다. PrintJob 인스턴스에서 설정한 속성은 인쇄가 완료된 후에도 그대로 유지됩니다. 따라서 PrintJob 인스턴스를 재사용할 수 있고 사용자가 선택한 인쇄 환경 설정을 유지할 수 있을 뿐 아니라 응용 프로그램의 내용에 따라 다른 인쇄 환경 설정을 제공할 수 있습니다. Flash Player 및 AIR 2 이전 버전의 내용인 경우 첫 번째 PrintJob 객체가 활성화된 상태에서 두 번째 PrintJob 객체를 만들 수 없습니다. 첫 번째 PrintJob 객체가 계속 활성 중인 상태에서는 new PrintJob()을 호출하여 두 번째 PrintJob 객체를 만들어도 두 번째 PrintJob 객체가 만들어지지 않습니다. 따라서 두 번째 PrintJob을 만들기 전에 myPrintJob 값을 확인해야 합니다.


오류
IllegalOperationError — Flash Player 및 AIR 2 이전 버전에서는 다른 PrintJob 객체가 활성화된 경우 예외가 발생합니다.

관련 API 요소

메서드 세부 정보

addPage

()메서드
public function addPage(sprite:Sprite, printArea:Rectangle = null, options:PrintJobOptions = null, frameNum:int = 0):void

언어 버전: ActionScript 3.0
런타임 버전: AIR 1.0, Flash Player 9.

지정된 Sprite 객체를 인쇄 스풀러에 단일 페이지로 보냅니다. 이 메서드를 사용하기 전에 PrintJob 객체를 만든 다음 start() 또는 start2()를 사용해야 합니다. 그런 다음 인쇄 작업에 대해 addPage()를 한 번 이상 호출한 후 send()를 사용하여 스풀된 페이지를 프린터로 보냅니다. 즉, PrintJob 객체를 만든 후 start() 또는 start2(), addPage(), send()를 순서대로 사용하여 인쇄 작업을 프린터로 보냅니다. start()를 한 번 호출한 후 addPage()를 여러 번 호출하여 인쇄 작업 시 여러 페이지를 인쇄할 수 있습니다.

addPage()로 인해 Flash Player에서 예외가 발생하면(예: start()를 호출하지 않았거나 사용자가 인쇄 작업을 취소한 경우) 이후에 addPage()를 호출할 때 실패하게 됩니다. 그러나 이전의 addPage() 호출이 성공적으로 수행된 경우 마무리 send() 명령이 성공적으로 스풀된 페이지를 프린터로 전송합니다.

인쇄 작업에서 addPage() 작업을 완료하는 데 15초 이상 걸리면 다음에 addPage()를 호출할 때 예외가 발생합니다.

printArea 매개 변수에 사용할 값을 전달하면 printArea Rectangle의 xy 좌표가 페이지에서 인쇄 가능 영역의 왼쪽 위 모서리(0 좌표)로 매핑됩니다. 읽기 전용 속성 pageHeightpageWidthstart()가 설정한 인쇄 가능 영역을 설명합니다. 인쇄 결과는 페이지에서 인쇄 가능 영역의 왼쪽 위 모서리에 정렬되므로 printArea에 정의된 영역이 페이지의 인쇄 가능 영역보다 크면 printArea에 정의된 영역의 오른쪽 및 아래쪽에서 인쇄 결과가 잘립니다. Flash Professional에서 printArea 값을 전달하지 않았고 스테이지가 인쇄 가능 영역보다 큰 경우에도 인쇄 결과가 같은 방식으로 잘립니다. Flex 또는 Flash Builder에서 printArea 값을 전달하지 않았고 스크린이 인쇄 가능 영역보다 큰 경우에도 인쇄 결과가 같은 방식으로 잘립니다.

인쇄하기 전에 Sprite 객체의 배율을 조정하려면 이 메서드를 호출하기 전에 배율 속성(flash.display.DisplayObject.scaleXflash.display.DisplayObject.scaleY 참조)을 설정하고 인쇄 후 속성을 원래 값으로 다시 설정합니다. Sprite 객체의 배율은 printArea와 관계가 없습니다. 즉, 인쇄 영역을 50 x 50픽셀로 지정하면 2500픽셀이 인쇄됩니다. Sprite 객체의 배율을 조절하면 같은 2500픽셀이 인쇄되지만 Sprite 객체가 배율이 조절된 크기로 인쇄됩니다.

Flash Player 인쇄 기능은 PostScript 프린터와 PostScript가 아닌 프린터를 지원합니다. PostScript가 아닌 프린터는 벡터를 비트맵으로 변환합니다.

매개 변수

sprite:Sprite — 인쇄할 내용을 포함하는 스프라이트입니다.
 
printArea:Rectangle (default = null) — 인쇄 영역을 지정하는 Rectangle 객체입니다.

사각형의 너비와 높이는 픽셀 값입니다. 프린터에서는 인쇄 측정 단위로 포인트를 사용합니다. 포인트는 고정된 실제 크기(1/72인치)이지만 화면상 픽셀의 크기는 특정 화면의 해상도에 따라 다릅니다. 따라서 픽셀과 포인트 사이의 변환 비율은 프린터 설정 및 Sprite의 배율 조절 여부에 따라 다릅니다. 폭이 72픽셀이고 배율이 조절되지 않은 스프라이트는 폭이 1인치로 인쇄되며 이때 1포인트는 화면 해상도에 관계없이 1픽셀과 같습니다.

인치나 센티미터를 트윕 또는 포인트(1트윕은 1/20포인트)로 변환할 때 다음 등식을 사용할 수 있습니다.

  • 1포인트 = 1/72인치 = 20트윕
  • 1인치 = 72포인트 = 1440트윕
  • 1 cm = 567트윕

printArea 매개 변수가 생략되거나 잘못 전달되면 sprite 매개 변수의 전체 영역이 인쇄됩니다.

printArea 값을 지정하지 않고 options 또는 frameNum 값을 지정하려면 printAreanull을 전달합니다.

 
options:PrintJobOptions (default = null) — 선택 요소로서, 벡터로 인쇄할지 비트맵으로 인쇄할지를 지정하는 매개 변수입니다. 기본값은 null입니다. 이 값은 벡터 인쇄에 대한 요청을 나타냅니다. sprite를 비트맵으로 인쇄하려면 PrintJobOptions 객체의 printAsBitmap 속성을 true로 설정합니다. printAsBitmaptrue로 설정할지 여부를 판단할 때는 다음 사항에 유의하십시오.
  • 인쇄할 내용에 비트맵 이미지가 포함되어 있으면 printAsBitmaptrue로 설정하여 알파 투명도 및 색상 효과를 모두 포함합니다.
  • 내용에 비트맵 이미지가 포함되어 있지 않으면 이 매개 변수를 생략하여 내용을 고품질 벡터 형식으로 인쇄합니다.

options가 생략되거나 올바로 전달되지 않으면 벡터 인쇄가 사용됩니다. options 값을 지정하지 않고 frameNumber 값을 지정하려면 optionsnull을 전달합니다.

 
frameNum:int (default = 0) — 선택 요소로서, MovieClip 객체에서 인쇄할 프레임을 지정하는 숫자입니다. frameNum을 전달해도 해당 프레임에서 ActionScript가 호출되지 않습니다. 이 매개 변수를 생략하고 sprite 매개 변수가 MovieClip 객체인 경우, sprite의 현재 프레임이 인쇄됩니다.


오류
Error start()를 호출하지 않았거나 사용자가 인쇄 작업을 취소한 경우 예외가 발생합니다.

관련 API 요소

    selectPaperSize

()메서드 
public function selectPaperSize(paperSize:String):void

언어 버전: ActionScript 3.0
런타임 버전: AIR 2

용지 크기를 설정합니다. paperSize 매개 변수에 사용할 수 있는 값은 PaperSize 클래스의 상수입니다. 이 메서드를 호출하면 사용자가 [페이지 설정] 또는 [인쇄] 대화 상자에서 페이지 크기를 선택할 때처럼 인쇄 설정이 영향을 받습니다.

이 메서드는 언제든지 호출할 수 있습니다. 인쇄 작업을 시작하기 전에 이 메서드를 호출하여 [페이지 설정] 및 [인쇄] 대화 상자에서 기본 용지 크기를 설정합니다. 인쇄 작업이 진행되는 동안 이 메서드를 호출하여 작업 내의 페이지 범위에 대한 용지 크기를 설정할 수도 있습니다.

     import flash.printing.PrintJob;
     import flash.printing.PaperSize;
     
     var myPrintJob:PrintJob = new PrintJob();
     myPrintJob.selectPaperSize(PaperSize.ENV_10);
     

매개 변수

paperSize:String — 인쇄 작업에서 이후 페이지에 사용할 페이지 크기입니다.


오류
ArgumentError paperSize 매개 변수가 PaperSize 클래스에서 정의한 허용 숫자 중 하나가 아닌 경우입니다.

관련 API 요소

send

()메서드 
public function send():void

언어 버전: ActionScript 3.0
런타임 버전: AIR 1.0, Flash Player 9.

start() 또는 start2()addPage() 메서드를 성공적으로 호출한 후 스풀된 페이지를 프린터로 보냅니다.

start() 또는 start2() 메서드 호출이 실패할 경우 또는 addPage() 메서드 호출이 예외를 발생시킬 경우, 이 메서드는 성공하지 못합니다. 오류를 피하려면 이 메서드를 호출하기 전 start() 또는 start2() 메서드가 true를 반환하고 addPage() 예외를 잡아내는지 확인합니다. 다음 예제에서는 이 메서드를 호출하기 전에 오류를 적절하게 확인하는 방법을 보여 줍니다.

     var myPrintJob:PrintJob = new PrintJob();
     if (myPrintJob.start()) {
       try {
         myPrintJob.addPage([params]);
       }
       catch(e:Error) {
          // handle error 
       }
     
       myPrintJob.send();
     }
     

관련 API 요소

    showPageSetupDialog

()메서드 
public function showPageSetupDialog():Boolean

언어 버전: ActionScript 3.0
런타임 버전: AIR 2

현재 환경에서 지원되는 경우 운영 체제의 [페이지 설정] 대화 상자를 표시합니다. supportsPageSetupDialog 속성을 사용하여 [페이지 설정] 지원 여부를 확인할 수 있습니다.

     import flash.printing.PrintJob;
     
     var myPrintJob:PrintJob = new PrintJob();
     if (myPrintJob.supportsPageSetupDialog)
     {
         myPrintJob.showPageSetupDialog();
     }
     

반환값
Boolean — 사용자가 [페이지 설정] 대화 상자에서 "확인"을 선택할 경우 true입니다. 이는 일부 PrintJob 속성이 변경되었을 수 있음을 나타냅니다. 사용자가 [페이지 설정] 대화 상자에서 "취소"를 선택할 경우 false를 반환합니다.

오류
IllegalOperationError — 시스템이 [페이지 설정]을 지원하지 않는 경우입니다. supportsPageSetupDialog 속성을 사용하여 [페이지 설정] 지원 여부를 확인할 수 있습니다.
 
IllegalOperationError — 인쇄 작업(현재 작업 포함)이 활성화된 경우입니다.

관련 API 요소

start

()메서드 
public function start():Boolean

언어 버전: ActionScript 3.0
런타임 버전: AIR 1.0, Flash Player 9., Flash Player 9.

운영 체제의 [인쇄] 대화 상자를 표시하고 스풀링을 시작합니다. [인쇄] 대화 상자를 사용하면 인쇄 설정을 변경할 수 있습니다. 사용자가 [인쇄] 대화 상자에서 [확인]을 클릭하여 PrintJob.start() 메서드가 성공적으로 반환되면 사용자의 선택된 인쇄 설정을 나타내는 다음과 같은 속성이 채워집니다.

속성유형단위설명
PrintJob.paperHeightNumber포인트전체 용지의 세로 길이입니다.
PrintJob.paperWidthNumber포인트전체 용지 너비
PrintJob.pageHeightNumber포인트페이지에서 실제로 인쇄 가능한 영역의 높이입니다. 사용자가 설정한 여백은 무시됩니다.
PrintJob.pageWidthNumber포인트페이지에서 실제로 인쇄 가능한 영역의 너비입니다. 사용자가 설정한 여백은 무시됩니다.
PrintJob.orientationString"portrait" ( flash.printing.PrintJobOrientation.PORTRAIT) 또는 "landscape"(flash.printing.PrintJobOrientation.LANDSCAPE)

참고: 사용자가 [인쇄] 대화 상자를 취소하면 속성이 채워지지 않습니다.

[인쇄] 대화 상자에서 사용자가 [확인]을 클릭하면 Flash Player는 운영 체제로 인쇄 작업을 스풀링하기 시작합니다. 그런 다음 운영 체제에서 사용자에게 인쇄 진행률 정보를 표시하기 시작하므로 PrintJob.addPage()PrintJob.send()를 최대한 빠르게 호출하여 페이지를 스풀러로 보내야 합니다. 이 메서드가 채우는 높이, 너비 및 방향의 읽기 전용 속성을 사용해 인쇄 서식을 지정할 수 있습니다.

이후에 PrintJob.addPage()PrintJob.send()를 호출하기 전에 사용자가 운영 체제의 [인쇄] 대화 상자에서 [확인]을 클릭할 때 이 메서드에서 true가 반환되는지 여부를 확인해야 합니다.

     var myPrintJob:PrintJob = new PrintJob();
        if(myPrintJob.start()) {
          // addPage() and send() statements here
        }
     

특정 인쇄 작업 인스턴스에서 다음 간격 중 하나가 15초를 넘으면 다음 번에 PrintJob.start()를 호출할 때 false가 반환됩니다.

  • PrintJob.start() 및 첫 번째 PrintJob.addPage()
  • PrintJob.addPage() 하나와 다음 PrintJob.addPage()
  • 마지막 PrintJob.addPage()PrintJob.send()

반환값
Boolean — [인쇄] 대화 상자가 표시될 때 사용자가 [확인]을 클릭하면 true 값이고 사용자가 [취소]를 클릭하거나 오류가 발생하면 false 값입니다.

오류
IllegalOperationError — AIR 2 이상에서 또 다른 PrintJob이 현재 활성화된 경우입니다.

관련 API 요소

    start2

()메서드 
public function start2(uiOptions:PrintUIOptions = null, showPrintDialog:Boolean = true):Boolean

언어 버전: ActionScript 3.0
런타임 버전: AIR 2

선택적으로 운영 체제의 [인쇄] 대화 상자를 열고 스풀링을 시작한 다음 PrintJob 읽기 전용 속성 값을 수정할 수 있습니다.

uiOptions 매개 변수는 호출자가 [인쇄] 대화 상자에서 표시할 옵션을 제어할 수 있도록 합니다. 자세한 내용은 PrintUIOptions 클래스를 참조하십시오. showPrintDialog가 false이면 이 매개 변수는 무시됩니다.

showPrintDialogtrue인 경우에도 이 메서드의 동작이 start() 메서드의 동작과 다를 수 있습니다. 일부 운영 체제에서는 start()가 [페이지 설정] 대화 상자를 표시한 다음 [인쇄] 대화 상자를 표시합니다. 반면, start2()는 [페이지 설정] 대화 상자를 표시하지 않습니다.

다음 예제에서는 [인쇄] 대화 상자가 사용자에게 표시되기 전에 최소 및 최대 페이지가 설정됩니다.

     import flash.printing.PrintJob;
     import flash.printing.PrintUIOptions;
     
     var myPrintJob:PrintJob = new PrintJob();
     var uiOpt:PrintUIOptions = new PrintUIOptions();
     uiOpt.minPage = 1;
     uiOpt.maxPage = 3;
     var accepted:Boolean = myPrintJob.start2(uiOpt);
     

매개 변수

uiOptions:PrintUIOptions (default = null) — 사용자에게 표시되는 [인쇄] 대화 상자에 나타나는 옵션을 지정하는 객체입니다. showPrintDialog 매개 변수가 false일 경우 이 값은 무시됩니다.
 
showPrintDialog:Boolean (default = true) — 인쇄 작업을 시작하기 전 [인쇄] 대화 상자를 사용자에게 표시할지 여부입니다.

반환값
Boolean — [인쇄] 대화 상자가 표시되고 사용자가 [확인]을 클릭하거나 [인쇄] 대화 상자가 표시되지 않았지만 오류가 발생하지 않는 경우 값이 true이며, 사용자가 [취소]를 클릭하거나 오류가 발생한 경우 false입니다.

오류
IllegalOperationError — [페이지 설정] 대화 상자가 표시되고 있는 경우 또는 다른 인쇄 작업이 현재 활성화된 경우입니다.

관련 API 요소

    terminate

()메서드 
public function terminate():void

언어 버전: ActionScript 3.0
런타임 버전: AIR 2

인쇄 작업이 전송되지 않고 종료되어야 함을 알립니다. start() 또는 start2()를 호출하여 인쇄 작업이 이미 시작되었지만 페이지를 프린터로 전송하는 것이 적절하지 않을 때 이 메서드를 사용합니다. 일반적으로 terminate()는 오류를 복구하는 데만 사용됩니다.

이 메서드를 호출한 후 PrintJob 인스턴스를 다시 사용할 수 있습니다. 가능한 경우 이후에도 계속 사용할 수 있도록 작업의 인쇄 설정이 유지됩니다.

PrintJobExample_Simple.as

다음 예제에서는 인쇄의 기본 사항에 대해 보여 줍니다. 새 PrintJob이 만들어집니다. 그런 다음 성공적으로 시작되면 addPage() 메서드에서 단일 페이지로 스프라이트를 추가합니다. send() 메서드에서 프린터로 페이지를 스풀링합니다.
package 
{ 
    import flash.printing.PrintJob; 
    import flash.display.Sprite; 
 
    public class BasicPrintExample extends Sprite 
    { 
        var myPrintJob:PrintJob = new PrintJob(); 
        var mySprite:Sprite = new Sprite();
        mySprite.graphics.beginFill(0x336699);
    mySprite.graphics.drawCircle(100, 100, 50);
 
        public function BasicPrintExample() 
        { 
            if (myPrintJob.start()) {
            try {
                myPrintJob.addPage(mySprite);
            }
            catch(e:Error) {
                // handle error 
            }
            myPrintJob.send();
        } 
    } 
}
PrintJobExample.as

다음 예제에서는 PrintJobExample 클래스를 사용하여 작은 문서를 만든 다음 이 문서를 프린터로 보냅니다. 이는 다음 단계로 이루어집니다.
  1. Sprite 유형의 두 변수인 sheet1sheet2를 선언합니다.
  2. init()를 호출하여 새 Sprite 인스턴스를 sheet1sheet2에 할당하고 다른 인수를 사용하여 createSheet()를 호출합니다.
  3. createSheet()는 다음을 수행합니다.
    1. 전달된 Sprite 객체를 사용하여 배경이 연한 회색이고 1픽셀 두께의 검은색 테두리가 있는 100 X 200 픽셀 크기의 사각형을 x = 0, y = 0에 그립니다.
    2. 이름이 txt인 새 TextField 객체를 만듭니다. 크기는 Sprite와 같고 wordWrap 속성은 true로 설정하며, text 속성은 createSheet()에 인수로 전달한 String으로 설정합니다.
    3. 전달된 Object 인수가 null이 아니면 해당 Object의 좌표 및 크기 속성을 사용하여 흰색 사각형을 그리는 데 사용되는 img라는 새 Sprite 인스턴스를 만듭니다. 흰색 사각형은 addChild()를 통해 Sprite 객체의 표시 목록에 추가됩니다.
    4. txt TextField가 addChild()를 통해 Sprite 객체의 표시 목록에 추가됩니다.
  4. 생성자로 돌아가서 주석 처리되지 않고 활성화되어 있는 인쇄 메서드가 호출됩니다. 각 메서드는 매우 비슷하므로 아래에서는 printOnePerPage() 메서드에 대해 설명합니다.
  5. printOnePerPage()는 다음을 수행합니다.
    1. pjpagesToPrint라는 새 PrintJob 객체를 uint로 선언합니다.
    2. 운영 체제별 [인쇄] 대화 상자를 열고 사용자가 OK을 클릭하기를 기다립니다.
    3. 방향을 확인하여 가로 방향이 선택된 경우 오류를 발생시키고 종료합니다.
    4. sheet1sheet2의 페이지 높이 및 폭을 설정합니다.
    5. addPage()를 사용하여 sheet1sheet2를 인쇄 스플러로 보냅니다.
    6. 인쇄할 페이지 수가 0보다 크면 스풀된 페이지를 모두 인쇄합니다.
  6. draw() 메서드를 호출하여 두 Sprite의 크기 속성을 스테이지에 맞게 조절하고 sheet2의 위치를 sheet1의 바로 오른쪽으로 조정합니다.

참고: 생성자는 필요에 따라 세 가지 인쇄 메서드(페이지당 한 장, 페이지당 두 장 또는 페이지의 위쪽 절반에 인쇄) 중 하나를 선택할 수 있도록 설정되어 있습니다. 이 예제를 제대로 실행하려면 코드 주석을 사용하여 인쇄 메서드 중 두 개를 비활성화해야 합니다. 예제는 printOnePerPage()가 호출되도록 설정되어 있습니다.

package {
    import flash.printing.PrintJob;
    import flash.printing.PrintJobOrientation;
    import flash.display.Stage;
    import flash.display.Sprite;
    import flash.text.TextField;
    import flash.geom.Rectangle;
       
    public class PrintJobExample extends Sprite {
        private var sheet1:Sprite;
        private var sheet2:Sprite;
           
        public function PrintJobExample() {
            init();
            printOnePerPage();
//            printTwoPerPage();
//            printTopHalf();
            draw();
        }
        
        private function init():void {
            sheet1 = new Sprite();
            createSheet(sheet1, "Once upon a time...", {x:10, y:50, width:80, height:130});

            sheet2 = new Sprite();
            createSheet(sheet2, "There was a great story to tell, and it ended quickly.\n\nThe end.", null);
        }
        
        private function createSheet(sheet:Sprite, str:String, imgValue:Object):void {
            sheet.graphics.beginFill(0xEEEEEE);
            sheet.graphics.lineStyle(1, 0x000000);
            sheet.graphics.drawRect(0, 0, 100, 200);
            sheet.graphics.endFill();
            
            var txt:TextField = new TextField();
            txt.height = 200;
            txt.width = 100;
            txt.wordWrap = true;
            txt.text = str;
            
            if(imgValue != null) {
                var img:Sprite = new Sprite();
                img.graphics.beginFill(0xFFFFFF);
                img.graphics.drawRect(imgValue.x, imgValue.y, imgValue.width, imgValue.height);
                img.graphics.endFill();
                sheet.addChild(img);
            }
            sheet.addChild(txt);
        }
        
        private function printOnePerPage():void {
            var pj:PrintJob = new PrintJob();
            var pagesToPrint:uint = 0;
            if(pj.start()) {                
                if(pj.orientation == PrintJobOrientation.LANDSCAPE) {    
                    throw new Error("Without embedding fonts you must print one sheet per page with an orientation of portrait.");
                }
                
                sheet1.height = pj.pageHeight;
                sheet1.width = pj.pageWidth;
                sheet2.height = pj.pageHeight;
                sheet2.width = pj.pageWidth;

                try {
                    pj.addPage(sheet1);
                    pagesToPrint++;
                }
                catch(e:Error) {
                    // do nothing
                }

                try {
                    pj.addPage(sheet2);
                    pagesToPrint++;
                }
                catch(e:Error) {
                    // do nothing
                }

                if(pagesToPrint > 0) {
                    pj.send();
                }
            }
        }
        
        private function printTwoPerPage():void {
            var pj:PrintJob = new PrintJob();
            var pagesToPrint:uint = 0;
            if(pj.start()) {                
                if(pj.orientation == PrintJobOrientation.PORTRAIT) {
                    throw new Error("Without embedding fonts you must print two sheets per page with an orientation of landscape.");
                }
                
                sheet1.height = pj.pageHeight;
                sheet1.width = pj.pageWidth/2;
                sheet2.height = pj.pageHeight;
                sheet2.width = pj.pageWidth/2;

                var sheets:Sprite = new Sprite();
                sheets.addChild(sheet1);
                sheets.addChild(sheet2);
                sheets.getChildAt(1).x = sheets.getChildAt(0).width;
                try {
                    pj.addPage(sheets);
                    pagesToPrint++;
                }
                catch(e:Error) {
                    // do nothing
                }

                if(pagesToPrint > 0) {
                    pj.send();
                }
            }
        }

        private function printTopHalf():void {
            var pj:PrintJob = new PrintJob();
            var pagesToPrint:uint = 0;
            if(pj.start()) {                
                if(pj.orientation == PrintJobOrientation.PORTRAIT) {
                    throw new Error("Without embedding fonts you must print the top half with an orientation of landscape.");
                }
                
                sheet1.height = pj.pageHeight;
                sheet1.width = pj.pageWidth/2;
                sheet2.height = pj.pageHeight;
                sheet2.width = pj.pageWidth/2;

                var sheets:Sprite = new Sprite();
                sheets.addChild(sheet1);
                sheets.addChild(sheet2);
                sheets.getChildAt(1).x = sheets.getChildAt(0).width;
                try {
                    pj.addPage(sheets, new Rectangle(0, 0, sheets.width, sheets.height/2));
                    pagesToPrint++;
                }
                catch(e:Error) {
                    // do nothing
                }

                if(pagesToPrint > 0) {
                    pj.send();
                }
            }
        }


        private function draw():void {
            var sheetWidth:Number = this.stage.stageWidth/2;
            var sheetHeight:Number = this.stage.stageHeight;
            
            addChild(sheet1);
            sheet1.width = sheetWidth;
            sheet1.height = sheetHeight;
            
            addChild(sheet2);
            sheet2.width = sheetWidth;
            sheet2.height = sheetHeight;
            sheet2.x = sheet1.width;
        }        
    }
}
PrintJobExample.2.as

다음 예제에서는 추가 인쇄 기능을 보여 줍니다. 예제는 인쇄 매수, 용지 크기(Legal), 페이지 방향(가로)을 지정하는 PrintJob 설정을 초기화합니다. [페이지 설정] 대화 상자를 먼저 표시하고 그 다음에 [인쇄] 대화 상자를 표시하여 인쇄 작업을 시작합니다.
 
package 
 { 
     import flash.display.Sprite; 
     import flash.display.Stage; 
     import flash.geom.Rectangle; 
     import flash.printing.PaperSize; 
     import flash.printing.PrintJob; 
    import flash.printing.PrintJobOrientation; 
    import flash.printing.PrintUIOptions; 
    import flash.text.TextField; 
      
     public class PrintJobExample extends Sprite 
     { 
         private var bg:Sprite; 
         private var txt:TextField; 
        private var pj:PrintJob; 
        private var uiOpt:PrintUIOptions; 
  
         public function PrintJobExample():void 
         { 
            var pj = new PrintJob(); 
            uiOpt = new PrintUIOptions(); 
            initPrintJob(); 
             initContent(); 
             draw(); 
             printPage(); 
         } 
          
         private function printPage():void 
         { 
            if (pj.supportsPageSetupDialog) 
            { 
                pj.showPageSetupDialog(); 
            }
            
             if (pj.start2(uiOpt, true)) 
             { 
                   try 
                 { 
                     pj.addPage(this, new Rectangle(0, 0, 100, 100)); 
                 } 
                 catch (error:Error) 
                 { 
                     // Do nothing. 
                 } 
                 pj.send(); 
             } 
             else 
             { 
                 txt.text = "Print job terminated"; 
                pj.terminate(); 
             } 
         } 
         
         private function initContent():void 
         { 
             bg = new Sprite(); 
             bg.graphics.beginFill(0x00FF00); 
             bg.graphics.drawRect(0, 0, 100, 200); 
             bg.graphics.endFill(); 
              
             txt = new TextField(); 
             txt.border = true; 
             txt.text = "Hello World"; 
         } 
          
        private function initPrintJob():void 
        { 
            pj.setPaperSize(PaperSize.LEGAL); 
            pj.orientation = PrintJobOrientation.LANDSCAPE; 
            pj.copies = 2; 
            pj.jobName = "Flash test print";
        } 
         
         private function draw():void 
         { 
             addChild(bg); 
             addChild(txt); 
             txt.x = 50; 
             txt.y = 50; 
         } 
     } 
}




[ X ]영어로 표시되는 이유
ActionScript 3.0 참조 설명서의 내용이 영어로 나타납니다.

ActionScript 3.0 참조 설명서 중 일부는 전체 언어로 번역되지 않았습니다. 언어 요소가 번역되지 않은 경우 영어로 나타납니다. 예를 들어 ga.controls.HelpBox 클래스는 어떤 언어로도 번역되지 않았습니다. 그러므로 한국어 버전의 참조 설명서에서 ga.controls.HelpBox 클래스는 영어로 나타납니다.