8 Contributors: |
8 Contributors: |
9 --> |
9 --> |
10 <!DOCTYPE concept |
10 <!DOCTYPE concept |
11 PUBLIC "-//OASIS//DTD DITA Concept//EN" "concept.dtd"> |
11 PUBLIC "-//OASIS//DTD DITA Concept//EN" "concept.dtd"> |
12 <concept id="GUID-A1F0D18B-5A89-58FC-9361-7B0A9786C826" xml:lang="en"><title>pdrstore: Creating a Printer Driver using pdr files</title><prolog><metadata><keywords/></metadata></prolog><conbody> |
12 <concept id="GUID-A1F0D18B-5A89-58FC-9361-7B0A9786C826" xml:lang="en"><title>pdrstore: Creating a Printer Driver using pdr files</title><prolog><metadata><keywords/></metadata></prolog><conbody> |
13 <section id="GUID-A041DECA-21EB-462E-A503-ED794BEB8CF1"><title> Description</title> <p>This example demonstrates |
13 <section id="GUID-A041DECA-21EB-462E-A503-ED794BEB8CF1"><title> Description</title> <p>This example demonstrates how to load printer driver information |
14 how to load printer driver information files and create a printer |
14 files and create a printer driver. The purpose of the PdrStore API |
15 driver. The purpose of the PdrStore API is to: </p> <ul> |
15 is to: </p> <ul> |
16 <li id="GUID-4320D425-C6D3-5119-A7DF-9C75BA4FA66A"><p>Provide access |
16 <li id="GUID-4320D425-C6D3-5119-A7DF-9C75BA4FA66A"><p>Provide access |
17 to the printer driver information contained in <filepath>.pdr</filepath> files for applications to build a printer driver list </p> </li> |
17 to the printer driver information contained in <filepath>.pdr</filepath> files for applications to build a printer driver list </p> </li> |
18 <li id="GUID-7F7C199C-EC78-565B-8CF2-3ED6212035A5"><p>Load and create |
18 <li id="GUID-7F7C199C-EC78-565B-8CF2-3ED6212035A5"><p>Load and create |
19 an appropriate printer driver for a given printer. </p> </li> |
19 an appropriate printer driver for a given printer. </p> </li> |
20 </ul> <p>During initialisation, the example first loads the printer |
20 </ul> <p>During initialisation, the example first loads the printer |
21 driver, then creates a session with the font and bitmap server. This |
21 driver, then creates a session with the font and bitmap server. This |
22 is detailed in the following sections. </p> </section> |
22 is detailed in the following sections. </p> </section> |
23 <section id="GUID-F2FBFB59-3029-50FD-8854-E734D3ACF5C0"><title>Download</title> <p>Click on the following link to download the example: <xref href="guid-6013a680-57f9-415b-8851-c4fa63356636/zips/guid-b4699e53-658f-4006-a903-12af723cc33f.zip" scope="external"> PDRStore.zip</xref></p><p>Click: <xref href="guid-6013a680-57f9-415b-8851-c4fa63356636/guid-b4699e53-658f-4006-a903-12af723cc33f.html" scope="peer">browse</xref> to view the example code. </p> </section> |
23 <section id="GUID-F2FBFB59-3029-50FD-8854-E734D3ACF5C0"><title>Download</title> <p>Click on the following link to download the example: <xref href="guid-6013a680-57f9-415b-8851-c4fa63356636/zips/guid-b4699e53-658f-4006-a903-12af723cc33f.zip" scope="external"> PDRStore.zip</xref></p><p>Click: <xref href="guid-6013a680-57f9-415b-8851-c4fa63356636/guid-b4699e53-658f-4006-a903-12af723cc33f.html" scope="peer">browse</xref> to view the example code. </p> </section> |
24 <section id="GUID-7C100FE7-38EB-4EE0-9D3C-C0D209FE6BAA"><title> Create a printer driver</title> <codeblock id="GUID-0ED8C6D9-81DF-52A6-8F7F-70D21449C1A1" xml:space="preserve">void CPdrExample::CreatePrinterDriver()</codeblock> <p>This function provides the following funtionality: </p> <ul> |
24 <section id="GUID-7C100FE7-38EB-4EE0-9D3C-C0D209FE6BAA"><title> Create |
|
25 a printer driver</title> <codeblock id="GUID-0ED8C6D9-81DF-52A6-8F7F-70D21449C1A1" xml:space="preserve">void CPdrExample::CreatePrinterDriver()</codeblock> <p>This function provides the following funtionality: </p> <ul> |
25 <li id="GUID-DA7ECFC7-7728-5A57-82B7-E0330ACBE71A"><p>Opens a printer |
26 <li id="GUID-DA7ECFC7-7728-5A57-82B7-E0330ACBE71A"><p>Opens a printer |
26 driver information (<filepath>.pdr</filepath>) file using <xref href="GUID-812DCC89-1897-30FE-AD96-2A35DAF437D8.dita#GUID-812DCC89-1897-30FE-AD96-2A35DAF437D8/GUID-89C95254-2667-37CD-A9DC-0DEEC77A9C82"><apiname>CPrinterDriver::OpenPdrL(const TDesC&)</apiname></xref> </p> </li> |
27 driver information (<filepath>.pdr</filepath>) file using <xref href="GUID-812DCC89-1897-30FE-AD96-2A35DAF437D8.dita#GUID-812DCC89-1897-30FE-AD96-2A35DAF437D8/GUID-89C95254-2667-37CD-A9DC-0DEEC77A9C82"><apiname>CPrinterDriver::OpenPdrL(const TDesC&)</apiname></xref> </p> </li> |
27 <li id="GUID-CF237DFC-249B-5B44-8F5F-3011A75422E3"><p>Gets the total |
28 <li id="GUID-CF237DFC-249B-5B44-8F5F-3011A75422E3"><p>Gets the total |
28 number of driver models available using <xref href="GUID-812DCC89-1897-30FE-AD96-2A35DAF437D8.dita#GUID-812DCC89-1897-30FE-AD96-2A35DAF437D8/GUID-99C5E5F5-DF2C-3682-AE88-47E06A0D1AC0"><apiname>CPrinterDriver::NumModels() |
29 number of driver models available using <xref href="GUID-812DCC89-1897-30FE-AD96-2A35DAF437D8.dita#GUID-812DCC89-1897-30FE-AD96-2A35DAF437D8/GUID-99C5E5F5-DF2C-3682-AE88-47E06A0D1AC0"><apiname>CPrinterDriver::NumModels() |
29 const</apiname></xref> </p> </li> |
30 const</apiname></xref> </p> </li> |
30 <li id="GUID-8363CBE3-D404-5805-A6FF-F14B5E65D0ED"><p>Creates a printer |
31 <li id="GUID-8363CBE3-D404-5805-A6FF-F14B5E65D0ED"><p>Creates a printer |
31 device using <xref href="GUID-812DCC89-1897-30FE-AD96-2A35DAF437D8.dita#GUID-812DCC89-1897-30FE-AD96-2A35DAF437D8/GUID-225235E0-2F06-3C7F-BB2E-83A932E410B6"><apiname>CPrinterDriver::CreatePrinterDeviceL(TInt)</apiname></xref>. </p> </li> |
32 device using <xref href="GUID-812DCC89-1897-30FE-AD96-2A35DAF437D8.dita#GUID-812DCC89-1897-30FE-AD96-2A35DAF437D8/GUID-225235E0-2F06-3C7F-BB2E-83A932E410B6"><apiname>CPrinterDriver::CreatePrinterDeviceL(TInt)</apiname></xref>. </p> </li> |
32 </ul> </section> |
33 </ul> </section> |
33 <section id="GUID-DE05838E-A239-4535-849C-0F4DA4289DB0"><title>Display the supported typefaces</title> <codeblock id="GUID-95133682-4612-50F6-94F3-7FA6F5EFA54C" xml:space="preserve">void CPdrExample::DisplayTypefaces()</codeblock> <p>Gets the list of supported typefaces using <xref href="GUID-02E9DA67-8CC0-3785-B917-A14C8AA7E714.dita#GUID-02E9DA67-8CC0-3785-B917-A14C8AA7E714/GUID-CA59407C-8F11-36F0-A31C-7E7F38F1B624"><apiname>CPrinterDevice::TypefaceSupport(TTypefaceSupport |
34 <section id="GUID-DE05838E-A239-4535-849C-0F4DA4289DB0"><title>Display |
|
35 the supported typefaces</title> <codeblock id="GUID-95133682-4612-50F6-94F3-7FA6F5EFA54C" xml:space="preserve">void CPdrExample::DisplayTypefaces()</codeblock> <p>Gets the list of supported typefaces using <xref href="GUID-02E9DA67-8CC0-3785-B917-A14C8AA7E714.dita#GUID-02E9DA67-8CC0-3785-B917-A14C8AA7E714/GUID-CA59407C-8F11-36F0-A31C-7E7F38F1B624"><apiname>CPrinterDevice::TypefaceSupport(TTypefaceSupport |
34 &,TInt) const</apiname></xref> and displays them. </p> </section> |
36 &,TInt) const</apiname></xref> and displays them. </p> </section> |
35 <section id="GUID-4C6EDF7D-49BE-4309-9B83-654F2EA33C08"><title>Create a printer control</title> <codeblock id="GUID-FF996CFF-8CA3-581F-824C-B76EF8EA5006" xml:space="preserve">void CPdrExample::CreatePrinterControl()</codeblock> <p>Creates a printer control using <xref href="GUID-02E9DA67-8CC0-3785-B917-A14C8AA7E714.dita#GUID-02E9DA67-8CC0-3785-B917-A14C8AA7E714/GUID-CEB04B4E-78C8-33C1-B894-1C89C65BF8C4"><apiname>CPrinterDevice::CreateControlL()</apiname></xref>. </p> </section> |
37 <section id="GUID-4C6EDF7D-49BE-4309-9B83-654F2EA33C08"><title>Create |
36 <section id="GUID-6165F5D5-FBF6-4910-B241-F9D61A4FB5C3"><title>Preparing for printing</title> <codeblock id="GUID-2BE7956F-C976-583B-8E9A-01990D7B44E1" xml:space="preserve">void CPdrExample::PrintPages()</codeblock> <p>This function prepares the printer driver for printing the pages. |
38 a printer control</title> <codeblock id="GUID-FF996CFF-8CA3-581F-824C-B76EF8EA5006" xml:space="preserve">void CPdrExample::CreatePrinterControl()</codeblock> <p>Creates a printer control using <xref href="GUID-02E9DA67-8CC0-3785-B917-A14C8AA7E714.dita#GUID-02E9DA67-8CC0-3785-B917-A14C8AA7E714/GUID-CEB04B4E-78C8-33C1-B894-1C89C65BF8C4"><apiname>CPrinterDevice::CreateControlL()</apiname></xref>. </p> </section> |
|
39 <section id="GUID-6165F5D5-FBF6-4910-B241-F9D61A4FB5C3"><title>Preparing |
|
40 for printing</title> <codeblock id="GUID-2BE7956F-C976-583B-8E9A-01990D7B44E1" xml:space="preserve">void CPdrExample::PrintPages()</codeblock> <p>This function prepares the printer driver for printing the pages. |
37 It involves the following: </p> <ul> |
41 It involves the following: </p> <ul> |
38 <li id="GUID-73362C6E-DEC0-5842-A76E-99247F34E567"><p>Gets the number |
42 <li id="GUID-73362C6E-DEC0-5842-A76E-99247F34E567"><p>Gets the number |
39 of bands per page using <xref href="GUID-2E0F522C-2A42-3E2E-ADE8-43398BB86906.dita#GUID-2E0F522C-2A42-3E2E-ADE8-43398BB86906/GUID-6DD8081E-C801-3B80-83FB-E613A527A274"><apiname>CPrinterControl::BandsPerPage()</apiname></xref> </p> </li> |
43 of bands per page using <xref href="GUID-2E0F522C-2A42-3E2E-ADE8-43398BB86906.dita#GUID-2E0F522C-2A42-3E2E-ADE8-43398BB86906/GUID-6DD8081E-C801-3B80-83FB-E613A527A274"><apiname>CPrinterControl::BandsPerPage()</apiname></xref> </p> </li> |
40 <li id="GUID-5B0F8F3C-FE43-5B97-AE37-97454C71D7BF"><p>Gets each band |
44 <li id="GUID-5B0F8F3C-FE43-5B97-AE37-97454C71D7BF"><p>Gets each band |
41 to be printed using <xref href="GUID-02E9DA67-8CC0-3785-B917-A14C8AA7E714.dita#GUID-02E9DA67-8CC0-3785-B917-A14C8AA7E714/GUID-0CE0ABD3-841A-3121-9EDE-CE031567A195"><apiname>CPrinterDevice::QueueGetBand(TRequestStatus& |
45 to be printed using <xref href="GUID-02E9DA67-8CC0-3785-B917-A14C8AA7E714.dita#GUID-02E9DA67-8CC0-3785-B917-A14C8AA7E714/GUID-0CE0ABD3-841A-3121-9EDE-CE031567A195"><apiname>CPrinterDevice::QueueGetBand(TRequestStatus& |
45 draw </p> </li> |
49 draw </p> </li> |
46 <li id="GUID-D0E0ECC7-BB6F-5EF6-80BE-EFAEA4216B8D"><p>Terminates the |
50 <li id="GUID-D0E0ECC7-BB6F-5EF6-80BE-EFAEA4216B8D"><p>Terminates the |
47 print process using <xref href="GUID-2E0F522C-2A42-3E2E-ADE8-43398BB86906.dita#GUID-2E0F522C-2A42-3E2E-ADE8-43398BB86906/GUID-6714C5BC-8458-339B-8BED-DA7BE95106E7"><apiname>CPrinterControl::QueueEndPrint(TRequestStatus |
51 print process using <xref href="GUID-2E0F522C-2A42-3E2E-ADE8-43398BB86906.dita#GUID-2E0F522C-2A42-3E2E-ADE8-43398BB86906/GUID-6714C5BC-8458-339B-8BED-DA7BE95106E7"><apiname>CPrinterControl::QueueEndPrint(TRequestStatus |
48 &)</apiname></xref> when no more bands are available. </p> </li> |
52 &)</apiname></xref> when no more bands are available. </p> </li> |
49 </ul> </section> |
53 </ul> </section> |
50 <section id="GUID-E2DBE267-21AE-4D47-B520-AB78F01C0BC5"><title>Class Summary</title><p><xref href="GUID-02E9DA67-8CC0-3785-B917-A14C8AA7E714.dita"><apiname>CPrinterDevice</apiname></xref></p><p><xref href="GUID-2E0F522C-2A42-3E2E-ADE8-43398BB86906.dita"><apiname>CPrinterControl</apiname></xref></p><p><xref href="GUID-812DCC89-1897-30FE-AD96-2A35DAF437D8.dita"><apiname>CPrinterDriver</apiname></xref></p><p><xref href="GUID-DAD09DCF-3123-38B4-99E9-91FB24B92138.dita"><apiname>CGraphicsContext</apiname></xref></p></section> |
54 <section id="GUID-E2DBE267-21AE-4D47-B520-AB78F01C0BC5"><title>Class |
51 <section id="GUID-F887FECF-4B72-406D-B185-6BDEC8DFE622"><title>Usage</title> <p>This is a console application, so |
55 Summary</title><p><xref href="GUID-02E9DA67-8CC0-3785-B917-A14C8AA7E714.dita"><apiname>CPrinterDevice</apiname></xref></p><p><xref href="GUID-2E0F522C-2A42-3E2E-ADE8-43398BB86906.dita"><apiname>CPrinterControl</apiname></xref></p><p><xref href="GUID-812DCC89-1897-30FE-AD96-2A35DAF437D8.dita"><apiname>CPrinterDriver</apiname></xref></p><p><xref href="GUID-DAD09DCF-3123-38B4-99E9-91FB24B92138.dita"><apiname>CGraphicsContext</apiname></xref></p></section> |
52 does not have a GUI. It builds an executable called <filepath>pdrstoreexample.exe</filepath> in the standard location (<filepath>\epoc32\release\winscw\</filepath> <i><build_variant></i> for CodeWarrior). The <xref href="GUID-3100800B-B2F7-50EF-BD4C-3C345ECCB2A5.dita">Symbian platform |
56 <section id="GUID-F887FECF-4B72-406D-B185-6BDEC8DFE622"><title>Usage</title> <p>This is a console application, so does not have a GUI. It builds |
53 build process</xref> describes how to build this application. After |
57 an executable called <filepath>pdrstoreexample.exe</filepath> in the |
54 launching the executable, depending on the emulator you are using, |
58 standard location (<filepath>\epoc32\release\winscw\</filepath> <i><build_variant></i> for CodeWarrior). The Symbian platform build |
55 you may need to task away from the app launcher/shell screen to view |
59 process describes how to build this application. After launching the |
56 the console. </p> </section> |
60 executable, depending on the emulator you are using, you may need |
|
61 to task away from the app launcher/shell screen to view the console. </p> </section> |
57 </conbody></concept> |
62 </conbody></concept> |