PageRenderTime 57ms CodeModel.GetById 16ms RepoModel.GetById 0ms app.codeStats 1ms

/frameworks/projects/playerglobal/bundles/en_US/docs/flash.printing.xml

https://github.com/adufilie/flex-sdk
XML | 1258 lines | 1013 code | 227 blank | 18 comment | 0 complexity | 89fadc61a69bbdfa12210c09c339a599 MD5 | raw file
Possible License(s): Apache-2.0

Large files files are truncated, but you can click here to view the full file

  1. <?xml version="1.0" encoding="UTF-8"?><apiPackage xmlns:ditaarch="http://dita.oasis-open.org/architecture/2005/" id="flash.printing" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d) (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiPackage/apiPackage "><apiName class="- topic/title reference/title apiRef/apiName ">flash.printing</apiName><apiDetail class="- topic/body reference/refbody apiRef/apiDetail "/><apiClassifier languages="" id="flash.printing:PrintUIOptions" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d) (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiClassifier/apiClassifier "><apiName class="- topic/title reference/title apiRef/apiName ">PrintUIOptions</apiName><shortdesc class="- topic/shortdesc ">
  2. <!--
  3. Licensed to the Apache Software Foundation (ASF) under one or more
  4. contributor license agreements. See the NOTICE file distributed with
  5. this work for additional information regarding copyright ownership.
  6. The ASF licenses this file to You under the Apache License, Version 2.0
  7. (the "License"); you may not use this file except in compliance with
  8. the License. You may obtain a copy of the License at
  9. http://www.apache.org/licenses/LICENSE-2.0
  10. Unless required by applicable law or agreed to in writing, software
  11. distributed under the License is distributed on an "AS IS" BASIS,
  12. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. See the License for the specific language governing permissions and
  14. limitations under the License.
  15. -->
  16. The PrintUIOptions class is used to specify options for print dialogs that are displayed to the
  17. user.</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="AIR" version="2" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiClassifierDetail class="- topic/body reference/refbody apiRef/apiDetail apiClassifier/apiClassifierDetail "><apiClassifierDef class="- topic/section reference/section apiRef/apiDef apiClassifier/apiClassifierDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiStatic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiStatic "/><apiFinal class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiFinal "/><apiBaseClassifier class="- topic/xref reference/xref apiRef/apiRelation apiClassifier/apiBaseClassifier ">Object</apiBaseClassifier></apiClassifierDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
  18. The PrintUIOptions class is used to specify options for print dialogs that are displayed to the
  19. user. Create a PrintUIOptions instance, set its properties, and pass it as the
  20. <codeph class="+ topic/ph pr-d/codeph ">uiOptions</codeph> parameter of the <codeph class="+ topic/ph pr-d/codeph ">PrintJob.showPageSetupDialog()</codeph>
  21. or <codeph class="+ topic/ph pr-d/codeph ">PrintJob.start2()</codeph> method.
  22. <p class="- topic/p ">For example, the following code uses a PrintUIOptions instance to specify the
  23. min and max page numbers when the Page Setup dialog is displayed:</p>
  24. <codeblock xml:space="preserve" class="+ topic/pre pr-d/codeblock ">import flash.printing.PrintJob;
  25. var myPrintJob:PrintJob = new PrintJob();
  26. if (myPrintJob.supportsPageSetupDialog)
  27. {
  28. var uiOpt:PrintUIOptions = new PrintUIOptions();
  29. uiOpt.minPage = 1;
  30. uiOpt.maxPage = 3;
  31. myPrintJob.showPageSetupDialog(uiOpt);
  32. }</codeblock>
  33. </apiDesc></apiClassifierDetail><related-links class="- topic/related-links "><link href="flash.printing.xml#PrintJob" class="- topic/link "><linktext class="- topic/linktext ">PrintJob</linktext></link><link href="flash.printing.xml#PrintJob/showPageSetupDialog()" class="- topic/link "><linktext class="- topic/linktext ">PrintJob.showPageSetupDialog()</linktext></link><link href="flash.printing.xml#PrintJob/start2()" class="- topic/link "><linktext class="- topic/linktext ">PrintJob.start2()</linktext></link></related-links><apiConstructor id="flash.printing:PrintUIOptions:PrintUIOptions" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d) (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiOperation/apiOperation apiOperation/apiConstructor"><apiName class="- topic/title reference/title apiRef/apiName ">PrintUIOptions</apiName><shortdesc class="- topic/shortdesc ">
  34. Creates a new PrintUIOptions object.</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="AIR" version="2" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiConstructorDetail class="- topic/body reference/refbody apiRef/apiDetail apiOperation/apiOperationDetail apiOperation/apiConstructorDetail"><apiConstructorDef class="- topic/section reference/section apiRef/apiDef apiOperation/apiConstructorDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/></apiConstructorDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
  35. Creates a new PrintUIOptions object. You pass this object to the
  36. <codeph class="+ topic/ph pr-d/codeph ">uiOptions</codeph> parameter of the <codeph class="+ topic/ph pr-d/codeph ">PrintJob.showPageSetupDialog()</codeph>
  37. or <codeph class="+ topic/ph pr-d/codeph ">PrintJob.start2()</codeph> method.
  38. </apiDesc></apiConstructorDetail><related-links class="- topic/related-links "><link href="flash.printing.xml#PrintJob/showPageSetupDialog()" class="- topic/link "><linktext class="- topic/linktext ">PrintJob.showPageSetupDialog()</linktext></link><link href="flash.printing.xml#PrintJob/start2()" class="- topic/link "><linktext class="- topic/linktext ">PrintJob.start2()</linktext></link></related-links></apiConstructor><apiValue id="flash.printing:PrintUIOptions:disablePageRange" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d) (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">disablePageRange</apiName><shortdesc class="- topic/shortdesc ">
  39. Specifies whether the page range in the print dialog is disabled (true) or
  40. the user can edit it (false).</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="AIR" version="2" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiProperty class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiProperty "/><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiDynamic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiDynamic "/><apiData class="- topic/ph reference/ph apiRef/apiData ">false</apiData><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">Boolean</apiValueClassifier><apiDefaultValue>false
  41. </apiDefaultValue></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
  42. Specifies whether the page range in the print dialog is disabled (<codeph class="+ topic/ph pr-d/codeph ">true</codeph>) or
  43. the user can edit it (<codeph class="+ topic/ph pr-d/codeph ">false</codeph>). The default value is <codeph class="+ topic/ph pr-d/codeph ">false</codeph>,
  44. indicating that there is no restriction on editing the page range.
  45. </apiDesc></apiValueDetail></apiValue><apiValue id="flash.printing:PrintUIOptions:maxPage" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d) (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">maxPage</apiName><shortdesc class="- topic/shortdesc ">
  46. The maxiumum page number the user can enter
  47. in the print dialog.</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="AIR" version="2" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiProperty class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiProperty "/><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiDynamic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiDynamic "/><apiData class="- topic/ph reference/ph apiRef/apiData ">0</apiData><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">uint</apiValueClassifier><apiDefaultValue>0
  48. </apiDefaultValue></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
  49. The maxiumum page number the user can enter
  50. in the print dialog. The default value is 0, indicating that there is
  51. no restriction on the maximum page number.
  52. </apiDesc></apiValueDetail></apiValue><apiValue id="flash.printing:PrintUIOptions:minPage" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d) (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">minPage</apiName><shortdesc class="- topic/shortdesc ">
  53. The minimum page number a user can enter
  54. in the print dialog.</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="AIR" version="2" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiProperty class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiProperty "/><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiDynamic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiDynamic "/><apiData class="- topic/ph reference/ph apiRef/apiData ">0</apiData><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">uint</apiValueClassifier><apiDefaultValue>0
  55. </apiDefaultValue></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
  56. The minimum page number a user can enter
  57. in the print dialog. The default value is 0, indicating that there is
  58. no restriction on the minimum page number.
  59. </apiDesc></apiValueDetail></apiValue></apiClassifier><apiClassifier languages="" id="flash.printing:PrintMethod" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d) (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiClassifier/apiClassifier "><apiName class="- topic/title reference/title apiRef/apiName ">PrintMethod</apiName><shortdesc class="- topic/shortdesc ">
  60. This class provides values for the PrintJobOptions.printMethod property
  61. to specify the method of printing a page.</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="AIR" version="2" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiClassifierDetail class="- topic/body reference/refbody apiRef/apiDetail apiClassifier/apiClassifierDetail "><apiClassifierDef class="- topic/section reference/section apiRef/apiDef apiClassifier/apiClassifierDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiStatic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiStatic "/><apiFinal class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiFinal "/><apiBaseClassifier class="- topic/xref reference/xref apiRef/apiRelation apiClassifier/apiBaseClassifier ">Object</apiBaseClassifier></apiClassifierDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
  62. This class provides values for the <codeph class="+ topic/ph pr-d/codeph ">PrintJobOptions.printMethod</codeph> property
  63. to specify the method of printing a page.
  64. </apiDesc></apiClassifierDetail><related-links class="- topic/related-links "><link href="flash.printing.xml#PrintJobOptions/printMethod" class="- topic/link "><linktext class="- topic/linktext ">PrintJobOptions.printMethod</linktext></link></related-links><apiValue id="flash.printing:PrintMethod:AUTO" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d) (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">AUTO</apiName><shortdesc class="- topic/shortdesc ">
  65. Automatic selection of the best method of printing.</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="AIR" version="2" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata><asCustoms class="+ topic/metadata adobe-api-d/asCustoms "><keyword class="- topic/keyword ">printMethod.auto, auto
  66. </keyword></asCustoms></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiStatic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiStatic "/><apiData class="- topic/ph reference/ph apiRef/apiData ">auto</apiData><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">String</apiValueClassifier></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
  67. Automatic selection of the best method of printing. This value indicates
  68. that vector or bitmap printing is chosen automatically, based on
  69. the content to print. Vector printing is used whenever the content
  70. can be faithfully reproduced by that method. If transparency or certain
  71. other effects are present, bitmap printing is used instead.
  72. <p class="- topic/p ">This constant is used with the <codeph class="+ topic/ph pr-d/codeph ">PrintJobOptions.printMethod</codeph> property.
  73. Use the syntax <codeph class="+ topic/ph pr-d/codeph ">PrintMethod.AUTO</codeph>.</p>
  74. </apiDesc></apiValueDetail><related-links class="- topic/related-links "><link href="flash.printing.xml#PrintJobOptions/printMethod" class="- topic/link "><linktext class="- topic/linktext ">PrintJobOptions.printMethod</linktext></link><link href="flash.printing.xml#PrintMethod/VECTOR" class="- topic/link "><linktext class="- topic/linktext ">VECTOR</linktext></link><link href="flash.printing.xml#PrintMethod/BITMAP" class="- topic/link "><linktext class="- topic/linktext ">BITMAP</linktext></link></related-links></apiValue><apiValue id="flash.printing:PrintMethod:BITMAP" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d) (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">BITMAP</apiName><shortdesc class="- topic/shortdesc ">
  75. The bitmap method of printing.</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="AIR" version="2" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata><asCustoms class="+ topic/metadata adobe-api-d/asCustoms "><keyword class="- topic/keyword ">printMethod.bitmap, bitmap
  76. </keyword></asCustoms></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiStatic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiStatic "/><apiData class="- topic/ph reference/ph apiRef/apiData ">bitmap</apiData><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">String</apiValueClassifier></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
  77. The bitmap method of printing.
  78. <p class="- topic/p ">This constant is used with the <codeph class="+ topic/ph pr-d/codeph ">PrintJobOptions.printMethod</codeph> property.
  79. Use the syntax <codeph class="+ topic/ph pr-d/codeph ">PrintMethod.BITMAP</codeph>.</p>
  80. </apiDesc></apiValueDetail><related-links class="- topic/related-links "><link href="flash.printing.xml#PrintJobOptions/printMethod" class="- topic/link "><linktext class="- topic/linktext ">PrintJobOptions.printMethod</linktext></link><link href="flash.printing.xml#PrintMethod/VECTOR" class="- topic/link "><linktext class="- topic/linktext ">VECTOR</linktext></link><link href="flash.printing.xml#PrintMethod/AUTO" class="- topic/link "><linktext class="- topic/linktext ">AUTO</linktext></link></related-links></apiValue><apiValue id="flash.printing:PrintMethod:VECTOR" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d) (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">VECTOR</apiName><shortdesc class="- topic/shortdesc ">
  81. The vector method of printing.</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="AIR" version="2" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata><asCustoms class="+ topic/metadata adobe-api-d/asCustoms "><keyword class="- topic/keyword ">printMethod.vector, vector
  82. </keyword></asCustoms></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiStatic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiStatic "/><apiData class="- topic/ph reference/ph apiRef/apiData ">vector</apiData><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">String</apiValueClassifier></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
  83. The vector method of printing.
  84. <p class="- topic/p ">This constant is used with the <codeph class="+ topic/ph pr-d/codeph ">PrintJobOptions.printMethod</codeph> property.
  85. Use the syntax <codeph class="+ topic/ph pr-d/codeph ">PrintMethod.VECTOR</codeph>.</p>
  86. </apiDesc></apiValueDetail><related-links class="- topic/related-links "><link href="flash.printing.xml#PrintJobOptions/printMethod" class="- topic/link "><linktext class="- topic/linktext ">PrintJobOptions.printMethod</linktext></link><link href="flash.printing.xml#PrintMethod/BITMAP" class="- topic/link "><linktext class="- topic/linktext ">BITMAP</linktext></link><link href="flash.printing.xml#PrintMethod/AUTO" class="- topic/link "><linktext class="- topic/linktext ">AUTO</linktext></link></related-links></apiValue></apiClassifier><apiClassifier languages="" id="flash.printing:PrintJobOptions" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d) (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiClassifier/apiClassifier "><apiName class="- topic/title reference/title apiRef/apiName ">PrintJobOptions</apiName><shortdesc class="- topic/shortdesc ">
  87. The PrintJobOptions class contains properties to use with the
  88. options parameter of the PrintJob.addPage() method.</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiClassifierDetail class="- topic/body reference/refbody apiRef/apiDetail apiClassifier/apiClassifierDetail "><apiClassifierDef class="- topic/section reference/section apiRef/apiDef apiClassifier/apiClassifierDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiStatic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiStatic "/><apiBaseClassifier class="- topic/xref reference/xref apiRef/apiRelation apiClassifier/apiBaseClassifier ">Object</apiBaseClassifier></apiClassifierDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
  89. The PrintJobOptions class contains properties to use with the
  90. <codeph class="+ topic/ph pr-d/codeph ">options</codeph> parameter of the <codeph class="+ topic/ph pr-d/codeph ">PrintJob.addPage()</codeph> method.
  91. For more information about <codeph class="+ topic/ph pr-d/codeph ">addPage()</codeph>, see the PrintJob class.
  92. </apiDesc></apiClassifierDetail><related-links class="- topic/related-links "><link href="flash.printing.xml#PrintJob" class="- topic/link "><linktext class="- topic/linktext ">PrintJob</linktext></link><link href="flash.printing.xml#PrintJob/addPage()" class="- topic/link "><linktext class="- topic/linktext ">PrintJob.addPage()</linktext></link></related-links><apiConstructor id="flash.printing:PrintJobOptions:PrintJobOptions" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d) (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiOperation/apiOperation apiOperation/apiConstructor"><apiName class="- topic/title reference/title apiRef/apiName ">PrintJobOptions</apiName><shortdesc class="- topic/shortdesc ">
  93. Creates a new PrintJobOptions object.</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiConstructorDetail class="- topic/body reference/refbody apiRef/apiDetail apiOperation/apiOperationDetail apiOperation/apiConstructorDetail"><apiConstructorDef class="- topic/section reference/section apiRef/apiDef apiOperation/apiConstructorDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">printAsBitmap</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">Boolean</apiOperationClassifier><apiData class="- topic/ph reference/ph apiRef/apiData ">false</apiData><apiDesc class="- topic/section reference/section apiRef/apiDesc ">If <codeph class="+ topic/ph pr-d/codeph ">true</codeph>, this object is printed as a bitmap.
  94. If <codeph class="+ topic/ph pr-d/codeph ">false</codeph>, this object is printed as a vector.
  95. <p class="- topic/p ">If the content that you're printing includes a bitmap image,
  96. set the <codeph class="+ topic/ph pr-d/codeph ">printAsBitmap</codeph> property to <codeph class="+ topic/ph pr-d/codeph ">true</codeph> to include any
  97. alpha transparency and color effects.
  98. If the content does not include bitmap images, omit this parameter to print
  99. the content in higher quality vector format (the default option).</p>
  100. <p class="- topic/p "><i class="+ topic/ph hi-d/i ">Note:</i>Adobe AIR does not support vector printing on Mac OS.</p>
  101. </apiDesc></apiParam></apiConstructorDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
  102. Creates a new PrintJobOptions object. Pass this object
  103. to the <codeph class="+ topic/ph pr-d/codeph ">options</codeph> parameter of the <codeph class="+ topic/ph pr-d/codeph ">PrintJob.addPage()</codeph> method.
  104. </apiDesc></apiConstructorDetail><related-links class="- topic/related-links "><link href="flash.printing.xml#PrintJob/addPage()" class="- topic/link "><linktext class="- topic/linktext ">PrintJob.addPage()</linktext></link></related-links></apiConstructor><apiValue id="flash.printing:PrintJobOptions:pixelsPerInch" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d) (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">pixelsPerInch</apiName><shortdesc class="- topic/shortdesc ">
  105. Specifies the resolution to use for bitmaps, in pixels per inch.</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="AIR" version="2" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiProperty class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiProperty "/><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiDynamic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiDynamic "/><apiData class="- topic/ph reference/ph apiRef/apiData ">NaN</apiData><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">Number</apiValueClassifier></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
  106. Specifies the resolution to use for bitmaps, in pixels per inch.
  107. The default value is <codeph class="+ topic/ph pr-d/codeph ">Number.NaN</codeph>, indicating that the native
  108. printer resolution is used.
  109. <p class="- topic/p ">The resolution setting is for both bitmap and vector printing. For bitmap printing,
  110. resolution controls how the entire page is rasterized. For vector printing, resolution
  111. controls how specific content, such as bitmaps and gradients, is rasterized.</p>
  112. </apiDesc></apiValueDetail></apiValue><apiValue id="flash.printing:PrintJobOptions:printAsBitmap" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d) (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">printAsBitmap</apiName><shortdesc class="- topic/shortdesc ">
  113. Specifies whether the content in the print job is printed as a bitmap or as a vector.</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiProperty class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiProperty "/><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiDynamic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiDynamic "/><apiData class="- topic/ph reference/ph apiRef/apiData ">false</apiData><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">Boolean</apiValueClassifier></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
  114. Specifies whether the content in the print job is printed as a bitmap or as a vector.
  115. The default value is <codeph class="+ topic/ph pr-d/codeph ">false</codeph>, for vector printing.
  116. <p class="- topic/p ">If the content that you're printing includes a bitmap image,
  117. set <codeph class="+ topic/ph pr-d/codeph ">printAsBitmap</codeph> to <codeph class="+ topic/ph pr-d/codeph ">true</codeph> to include any
  118. alpha transparency and color effects.
  119. If the content does not include bitmap images, print
  120. the content in higher quality vector format (the default option).</p>
  121. <p class="- topic/p ">For example, to print your content as a bitmap, use the following syntax:</p>
  122. <codeblock xml:space="preserve" class="+ topic/pre pr-d/codeblock ">
  123. var options:PrintJobOptions = new PrintJobOptions();
  124. options.printAsBitmap = true;
  125. myPrintJob.addPage(mySprite, null, options);
  126. </codeblock>
  127. <p class="- topic/p "><i class="+ topic/ph hi-d/i ">Note:</i>Adobe AIR does not support vector printing on Mac OS.</p>
  128. </apiDesc><example conref="examples\printAsBitmapExample.as" class="- topic/example "> The following example first loads a picture and puts it in a rectangle frame, then print the picture as a bitmap.
  129. <ol class="- topic/ol "><li class="- topic/li ">The constructor loads the picture (<codeph class="+ topic/ph pr-d/codeph ">image.jpg</codeph>) using the <codeph class="+ topic/ph pr-d/codeph ">Loader</codeph> and <codeph class="+ topic/ph pr-d/codeph ">URLRequest</codeph> objects.
  130. It also checks if an error occurred during loading. Here the file is assumed to be in the same directory as the SWF file.
  131. The SWF file needs to be compiled with Local Playback Secuirty set to Access Local Files Only.</li><li class="- topic/li ">When the picture is loaded (the event is complete), the <codeph class="+ topic/ph pr-d/codeph ">completeHandler()</codeph> method is called.</li><li class="- topic/li ">The <codeph class="+ topic/ph pr-d/codeph ">completeHandler()</codeph> method, creates a <codeph class="+ topic/ph pr-d/codeph ">BitmapData</codeph> object, and loads the picture (bitmap) in it.
  132. A rectangle is drawn in the <codeph class="+ topic/ph pr-d/codeph ">Sprite</codeph> object (<codeph class="+ topic/ph pr-d/codeph ">frame</codeph>) and the <codeph class="+ topic/ph pr-d/codeph ">beginBitmapFill()</codeph> method is used
  133. to fill the rectangle with the picture (a <codeph class="+ topic/ph pr-d/codeph ">BitmapData</codeph> object). A <codeph class="+ topic/ph pr-d/codeph ">Matrix</codeph> object also is used to scale the
  134. image to fit the rectangle. (Note that this will distort the image. It is used in this example to make sure the image fits.)
  135. Once the image is filled, the <codeph class="+ topic/ph pr-d/codeph ">printPage()</codeph> method is called.</li><li class="- topic/li ">The <codeph class="+ topic/ph pr-d/codeph ">printPage()</codeph> method creates a new instance of the print job and starts the printing process, which invokes the
  136. print dialog box for the user, and populates the properties of the print job. The <codeph class="+ topic/ph pr-d/codeph ">addPage()</codeph> method contains the
  137. details about the print job. Here, the frame with the picture (a Sprite object) is set to print as a bitmap and not
  138. as a vector. <codeph class="+ topic/ph pr-d/codeph ">options</codeph> is an instance of <codeph class="+ topic/ph pr-d/codeph ">PrintJobOptions</codeph> class and its property <codeph class="+ topic/ph pr-d/codeph ">printAsBitmap</codeph>
  139. is set to <codeph class="+ topic/ph pr-d/codeph ">true</codeph> in order to print as a bitmap (default setting is false).</li></ol>
  140. <p class="- topic/p ">Note: There is very limited error handling defined for this example.</p>
  141. <codeblock xml:space="preserve" class="+ topic/pre pr-d/codeblock ">
  142. package {
  143. import flash.display.Sprite;
  144. import flash.display.Loader;
  145. import flash.display.Bitmap;
  146. import flash.display.BitmapData;
  147. import flash.printing.PrintJob;
  148. import flash.printing.PrintJobOptions;
  149. import flash.events.Event;
  150. import flash.events.IOErrorEvent;
  151. import flash.net.URLRequest;
  152. import flash.geom.Matrix;
  153. public class printAsBitmapExample extends Sprite {
  154. private var frame:Sprite = new Sprite();
  155. private var url:String = "image.jpg";
  156. private var loader:Loader = new Loader();
  157. public function printAsBitmapExample() {
  158. var request:URLRequest = new URLRequest(url);
  159. loader.load(request);
  160. loader.contentLoaderInfo.addEventListener(Event.COMPLETE, completeHandler);
  161. loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, ioErrorHandler);
  162. }
  163. private function completeHandler(event:Event):void {
  164. var picture:Bitmap = Bitmap(loader.content);
  165. var bitmap:BitmapData = picture.bitmapData;
  166. var matrix:Matrix = new Matrix();
  167. matrix.scale((200 / bitmap.width), (200 / bitmap.height));
  168. frame.graphics.lineStyle(10);
  169. frame.graphics.beginBitmapFill(bitmap, matrix, true);
  170. frame.graphics.drawRect(0, 0, 200, 200);
  171. frame.graphics.endFill();
  172. addChild(frame);
  173. printPage();
  174. }
  175. private function ioErrorHandler(event:IOErrorEvent):void {
  176. trace("Unable to load the image: " + url);
  177. }
  178. private function printPage ():void {
  179. var myPrintJob:PrintJob = new PrintJob();
  180. var options:PrintJobOptions = new PrintJobOptions();
  181. options.printAsBitmap = true;
  182. myPrintJob.start();
  183. try {
  184. myPrintJob.addPage(frame, null, options);
  185. }
  186. catch(e:Error) {
  187. trace ("Had problem adding the page to print job: " + e);
  188. }
  189. try {
  190. myPrintJob.send();
  191. }
  192. catch (e:Error) {
  193. trace ("Had problem printing: " + e);
  194. }
  195. }
  196. }
  197. }
  198. </codeblock></example></apiValueDetail><related-links class="- topic/related-links "><link href="flash.printing.xml#PrintJobOptions/printMethod" class="- topic/link "><linktext class="- topic/linktext ">PrintJobOptions.printMethod</linktext></link></related-links></apiValue><apiValue id="flash.printing:PrintJobOptions:printMethod:get" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d) (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">printMethod</apiName><shortdesc class="- topic/shortdesc ">
  199. Specifies that the Flash runtime chooses the most appropriate
  200. printing method, or that the author wishes to explicitly select
  201. vector or bitmap printing.</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="AIR" version="2" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiProperty class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiProperty "/><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiDynamic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiDynamic "/><apiValueAccess value="readwrite" class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiValueAccess "/><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">String</apiValueClassifier><apiException class="+ topic/ph reference/ph apiRef/apiDefItem apiOperation/apiEvent adobe-api-d/apiException "><apiDesc class="- topic/section reference/section apiRef/apiDesc ">The <codeph class="+ topic/ph pr-d/codeph ">printMethod</codeph> specified is not one of the
  202. values defined in the <codeph class="+ topic/ph pr-d/codeph ">PrintMethod</codeph> class.
  203. </apiDesc><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">ArgumentError</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">ArgumentError</apiOperationClassifier></apiException></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
  204. Specifies that the Flash runtime chooses the most appropriate
  205. printing method, or that the author wishes to explicitly select
  206. vector or bitmap printing.
  207. <p class="- topic/p ">Set the property to one of the following values defined in the
  208. <codeph class="+ topic/ph pr-d/codeph ">PrintMethod</codeph> class:</p>
  209. <ul class="- topic/ul "><li class="- topic/li "><codeph class="+ topic/ph pr-d/codeph ">PrintMethod.AUTO</codeph>: Specifies that vector or bitmap printing
  210. is chosen automatically, based on the content to be printed. Vector
  211. printing will be used whenever the content can be faithfully reproduced by
  212. that method. If transparency or certain other effects are present, bitmap
  213. printing will be used instead.</li><li class="- topic/li "><codeph class="+ topic/ph pr-d/codeph ">PrintMethod.VECTOR</codeph>: Speifies vector printing.
  214. This setting is the same as setting <codeph class="+ topic/ph pr-d/codeph ">printAsBitmap</codeph> to <codeph class="+ topic/ph pr-d/codeph ">false</codeph>.</li><li class="- topic/li "><codeph class="+ topic/ph pr-d/codeph ">PrintMethod.BITMAP</codeph>: Specifies bitmap printing.
  215. Same as setting <codeph class="+ topic/ph pr-d/codeph ">printAsBitmap</codeph> to <codeph class="+ topic/ph pr-d/codeph ">true</codeph>.</li></ul>
  216. <p class="- topic/p ">If printMethod is set to one of these supported values, then printAsBitmap
  217. is ignored.</p>
  218. <p class="- topic/p ">The default value is <codeph class="+ topic/ph pr-d/codeph ">null</codeph>; the printAsBitmap property is
  219. used.</p>
  220. </apiDesc></apiValueDetail><related-links class="- topic/related-links "><link href="flash.printing.xml#PrintJobOptions/printAsBitmap" class="- topic/link "><linktext class="- topic/linktext ">PrintJobOptions.printAsBitmap</linktext></link><link href="flash.printing.xml#PrintMethod" class="- topic/link "><linktext class="- topic/linktext ">PrintMethod class</linktext></link></related-links></apiValue></apiClassifier><apiClassifier languages="" id="flash.printing:PrintJob" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d) (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiClassifier/apiClassifier "><apiName class="- topic/title reference/title apiRef/apiName ">PrintJob</apiName><shortdesc class="- topic/shortdesc ">
  221. The PrintJob class lets you create content and print it to one or
  222. more pages.</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata><asCustoms class="+ topic/metadata adobe-api-d/asCustoms "><keyword class="- topic/keyword ">printjob, print
  223. </keyword></asCustoms></prolog><apiClassifierDetail class="- topic/body reference/refbody apiRef/apiDetail apiClassifier/apiClassifierDetail "><apiClassifierDef class="- topic/section reference/section apiRef/apiDef apiClassifier/apiClassifierDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiStatic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiStatic "/><apiBaseClassifier class="- topic/xref reference/xref apiRef/apiRelation apiClassifier/apiBaseClassifier ">flash.events:EventDispatcher</apiBaseClassifier></apiClassifierDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
  224. The PrintJob class lets you create content and print it to one or
  225. more pages. This class
  226. lets you render content that is visible, dynamic or offscreen to the user, prompt users with a
  227. single Print dialog box, and print an unscaled document with
  228. proportions that map to the proportions of the content. This
  229. capability is especially useful for rendering and printing dynamic
  230. content, such as database content and dynamic text.
  231. <p class="- topic/p "><b class="+ topic/ph hi-d/b ">Mobile Browser Support:</b> This class is not supported in mobile browsers.</p>
  232. <p class="- topic/p "><i class="+ topic/ph hi-d/i ">AIR profile support:</i> This feature is supported
  233. on all desktop operating systems, but it is not supported on mobile devices or AIR for TV devices. You can test
  234. for support at run time using the <codeph class="+ topic/ph pr-d/codeph ">PrintJob.isSupported</codeph> property. See
  235. <xref href="http://help.adobe.com/en_US/air/build/WS144092a96ffef7cc16ddeea2126bb46b82f-8000.html" class="- topic/xref ">
  236. AIR Profile Support</xref> for more information regarding API support across multiple profiles.</p>
  237. <p class="- topic/p ">Use the <codeph class="+ topic/ph pr-d/codeph ">PrintJob()</codeph> constructor to create a print job.</p>
  238. <p class="- topic/p ">Additionally, with the PrintJob class's properties, you can read your user's
  239. printer settings, such as page height, width, and image orientation, and
  240. you can configure your document to dynamically format Flash content
  241. that is appropriate for the printer settings.</p>
  242. <p class="- topic/p "><b class="+ topic/ph hi-d/b ">Note:</b> ActionScript 3.0 does not restrict a PrintJob object
  243. to a single frame (as did previous versions of ActionScript). However, since
  244. the operating system displays print status information to the user after the
  245. user has clicked the OK button in the Print dialog box, you should call
  246. <codeph class="+ topic/ph pr-d/codeph ">PrintJob.addPage()</codeph> and <codeph class="+ topic/ph pr-d/codeph ">PrintJob.send()</codeph> as soon as
  247. possible to send pages to the spooler. A delay reaching the frame containing
  248. the <codeph class="+ topic/ph pr-d/codeph ">PrintJob.send()</codeph> call delays the printing process.</p>
  249. <p class="- topic/p ">Additionally, a 15 second script timeout limit applies to the following intervals:</p>
  250. <ul class="- topic/ul "><li class="- topic/li "><codeph class="+ topic/ph pr-d/codeph ">PrintJob.start()</codeph> and the first <codeph class="+ topic/ph pr-d/codeph ">PrintJob.addPage()</codeph></li><li class="- topic/li "><codeph class="+ topic/ph pr-d/codeph ">PrintJob.addPage()</codeph> and the next <codeph class="+ topic/ph pr-d/codeph ">PrintJob.addPage()</codeph></li><li class="- topic/li ">The last <codeph class="+ topic/ph pr-d/codeph ">PrintJob.addPage()</codeph> and <codeph class="+ topic/ph pr-d/codeph ">PrintJob.send()</codeph></li></ul>
  251. <p class="- topic/p ">If any of the above intervals span more than 15 seconds, the next call to
  252. <codeph class="+ topic/ph pr-d/codeph ">PrintJob.start()</codeph> on the PrintJob instance returns <codeph class="+ topic/ph pr-d/codeph ">false</codeph>,
  253. and the next <codeph class="+ topic/ph pr-d/codeph ">PrintJob.addPage()</codeph> on the PrintJob instance causes
  254. the Flash Player or Adobe AIR to throw a runtime exception.</p>
  255. </apiDesc><example conref="examples\PrintJobExample_Simple.as" class="- topic/example "> The following example show the basics of printing. A new PrintJob is created,
  256. and if started successfully, the <codeph class="+ topic/ph pr-d/codeph ">addPage()</codeph> method adds the sprite as a single page.
  257. The <codeph class="+ topic/ph pr-d/codeph ">send()</codeph> method spools the page to the printer.
  258. <codeblock xml:space="preserve" class="+ topic/pre pr-d/codeblock ">
  259. package
  260. {
  261. import flash.printing.PrintJob;
  262. import flash.display.Sprite;
  263. public class BasicPrintExample extends Sprite
  264. {
  265. var myPrintJob:PrintJob = new PrintJob();
  266. var mySprite:Sprite = new Sprite();
  267. mySprite.graphics.beginFill(0x336699);
  268. mySprite.graphics.drawCircle(100, 100, 50);
  269. public function BasicPrintExample()
  270. {
  271. if (myPrintJob.start()) {
  272. try {
  273. myPrintJob.addPage(mySprite);
  274. }
  275. catch(e:Error) {
  276. // handle error
  277. }
  278. myPrintJob.send();
  279. }
  280. }
  281. }
  282. </codeblock></example><example conref="examples\PrintJobExample.as" class="- topic/example "> The following example uses the class <codeph class="+ topic/ph pr-d/codeph ">PrintJobExample</codeph> to create a small document and
  283. then send the document to the printer. This is accomplished using the following steps:
  284. <ol class="- topic/ol "><li class="- topic/li ">Declare two variables of type Sprite named <codeph class="+ topic/ph pr-d/codeph ">sheet1</codeph> and <codeph class="+ topic/ph pr-d/codeph ">sheet2</codeph>.</li><li class="- topic/li ">Call <codeph class="+ topic/ph pr-d/codeph ">init()</codeph>, which assigns a new Sprite instance to both <codeph class="+ topic/ph pr-d/codeph ">sheet1</codeph> and
  285. <codeph class="+ topic/ph pr-d/codeph ">sheet2</codeph> and then calls <codeph class="+ topic/ph pr-d/codeph ">createSheet()</codeph> using different arguments.</li><li class="- topic/li "><codeph class="+ topic/ph pr-d/codeph ">createSheet()</codeph> does the following:
  286. <ol outputclass="A" class="- topic/ol "><li class="- topic/li ">The Sprite object passed in is used to draw a rectangle with a light-gray background, a
  287. one-pixel black border, and that is 100 pixels wide by 200 pixels high at x = 0, y = 0.</li><li class="- topic/li ">A new TextField object is created named <codeph class="+ topic/ph pr-d/codeph ">txt</codeph> with the same dimensions as
  288. the Sprite, the wordWrap property set to <codeph class="+ topic/ph pr-d/codeph ">true</codeph>, and the text property set to
  289. the String passed as an argument to <codeph class="+ topic/ph pr-d/codeph ">createSheet()</codeph>.</li><li class="- topic/li ">If the Object argument passed is not null, create a new Sprite instance named
  290. <codeph class="+ topic/ph pr-d/codeph ">img</codeph> that is used to draw a white rectangle using the coordinate and dimension properties
  291. of the Object passed. The white rectangle is added to the display list of the Sprite object using
  292. <codeph class="+ topic/ph pr-d/codeph ">addChild()</codeph>.</li><li class="- topic/li ">The <codeph

Large files files are truncated, but you can click here to view the full file