Printing apparatus, control method thereof and storage medium storing program

This invention relates to a printing apparatus and control method thereof. The standard size of an envelope to be stored in each of a plurality of paper storage units configured to store an envelope to be used in printing is set. An offset amount to be used to print an image on an envelope of the set standard size is set. A paper storage unit which stores an envelope to be used in printing is selected from the plurality of paper storage units based on a standard size of an envelope that is designated by a user. The position of an image is shifted in accordance with the set offset amount, and the image is printed on an envelope fed from the selected paper storage unit.

BACKGROUND OF THE INVENTION

1. Field of the Invention

The present invention relates to a printing apparatus capable of printing an image on an envelope, a control method thereof, and a storage medium storing a program.

2. Description of the Related Art

A printing apparatus generally includes one or more paper storage units. The printing apparatus feeds sheets stored in the paper storage unit one by one, and forms an image on it. The size of paper stored in each paper storage unit can be set. For example, standard sizes such as A4 and B4, and an arbitrary size such as 210 mm×290 mm can be set. As a special standard size, an envelope size can also be set. Paper with a projection such as the margin (to be referred to as a flap hereinafter) of an envelope or the index portion of index paper is set so that the projection serves as the trailing end in the sub-scanning direction. With this setting, a paper area up to the projection (paper area excluding the projection) is handled as a standard size and printed. Also, there is known a technique of setting an envelope so that its flap serves as the leading end in the conveyance direction, recognizing a flap position by a sensor when the envelope is conveyed, and suppressing image misregistration (see Japanese Patent Laid-Open No. 9-109492).

In general, an envelope is longer in the sub-scanning direction than in the main scanning direction. The printing time becomes long in a conventional method of setting the sub-scanning direction (long edge) of an envelope parallel to the conveyance direction, and conveying the envelope (this will be called short-edge feed).

The time taken to print can be shortened by setting an envelope so that its flap comes to the main scanning side, and conveying the envelope (this will be called long-edge feed). However, the width of the flap differs between envelope manufacturers. For this reason, the user needs to measure lengths of an envelope in the main scanning direction and sub-scanning direction, input the measured lengths, and register the envelope as paper of a user-defined size. When the envelope is registered as paper of a user-defined size, the user cannot use an auto paper selection function of automatically selecting paper for use based on the size of an original image, and printing.

SUMMARY OF THE INVENTION

An aspect of the present invention is to eliminate the above-mentioned problems with the conventional technology.

The present invention provides a mechanism of enabling automatically selecting an envelope and printing by the auto paper selection function, and printing an image at a correct position on a selected envelope based on the offset amount of the envelope.

The present invention in its first aspect provides a printing apparatus comprising: a plurality of paper storage units configured to store an envelope to be used in printing; a size setting unit configured to set a standard size of an envelope to be stored in each of the plurality of paper storage units; an offset setting unit configured to set an offset amount to be used to print an image on an envelope of the standard size set by the size setting unit; a selection unit configured to select a paper storage unit which stores an envelope to be used in printing, from the plurality of paper storage units based on a standard size of an envelope that is designated by a user; and a printing control unit configured to shift a position of an image in accordance with the offset amount set by the offset setting unit and print the image on an envelope fed from the paper storage unit selected by the selection unit.

The present invention in its second aspect provides a method of controlling a printing apparatus which includes a plurality of paper storage units configured to store an envelope to be used in printing and can print an image on an envelope fed from a paper storage unit, comprising: a size setting step of setting a standard size of an envelope to be stored in each of the plurality of paper storage units; an offset setting step of setting an offset amount to be used to print an image on an envelope of the standard size set in the size setting step; a selection step of selecting a paper storage unit which stores an envelope to be used in printing, from the plurality of paper storage units based on a standard size of an envelope that is designated by a user; and a printing control step of shifting a position of an image in accordance with the offset amount set in the offset setting step and printing the image on an envelope fed from the paper storage unit selected in the selection step.

The present invention in its third aspect provides a computer-readable storage medium storing a program for causing a computer to execute a size setting step of setting a standard size of an envelope to be stored in each of a plurality of paper storage units, an offset setting step of setting an offset amount to be used to print an image on an envelope of the standard size set in the size setting step, a selection step of selecting a paper storage unit which stores an envelope to be used in printing, from the plurality of paper storage units based on a standard size of an envelope that is designated by a user, and a printing control step of shifting a position of an image in accordance with the offset amount set in the offset setting step and printing the image on an envelope fed from the paper storage unit selected in the selection step.

According to the present invention, an envelope can be automatically selected to print by the auto paper selection function, and an image can be printed at a correct position on a selected envelope based on the offset amount of the envelope.

DESCRIPTION OF THE EMBODIMENTS

FIG. 1is a view showing the arrangement of a multi-function peripheral (MFP) serving as an example of a printing apparatus according to an embodiment of the present invention. Although the embodiment will be explained using the MFP having a plurality of functions as an example of the printing apparatus, the printing apparatus may be a single-function peripheral (SFP) having a single function.

Referring toFIG. 1, a controller101controls the MFP, and has a hardware arrangement shown inFIG. 2. A scanner102is controlled by the controller101, and scans an original to create image data of the original image. A printer engine103is a printer engine complying with the electrophotographic method in the embodiment. The printer engine103prints an image on a printing medium (sheet such as paper or envelope) under the control of the controller101. A finisher104is connected to the printer engine103, and can perform, for example, staple processing collectively for a plurality of printing media (for example, sheets) output from the printer engine103. The controller101also controls the finisher104. A network (Ethernet) interface105provides two-way communication via it to the controller101, and can connect the MFP to a PC107via a network. An operation unit106provides a user interface, includes a display and keyboard, displays information from the controller101, and notifies the controller101of an instruction from the user.

FIG. 2is a block diagram showing the hardware arrangement of the controller101according to the embodiment.

In the controller101, a CPU201is connected to a memory202, a display unit203and keyboard204of the operation unit106, a ROM210, and a DISK211via a bus209. Various programs and data are stored in the DISK211(storage medium) such as a hard disk or floppy® disk, and if necessary, sequentially read out to the memory202and executed by the CPU201. The DISK211may be one detachable from the MFP or one incorporated in the MFP. Further, programs may be downloaded from another PC, MFP, or the like via the network and stored in the DISK211.

The memory202may have both the functions of volatile and nonvolatile memories. Alternatively, the memory202may have the function of a volatile memory, and the DISK211may have the function of a nonvolatile memory. The memory202may be a removable memory medium.

The CPU201writes display data in a display memory (not shown) to present a display on the display unit203. The CPU201receives data from the keyboard204or the display unit203serving as a touch panel, thereby receiving an instruction from the user. The input information is transferred to one of the memory202, DISK211, and CPU201, accumulated, and used for various processes. The network interface105is connected to the bus209, and the CPU201performs communication via the interface by loading or writing data via the network interface105.

Further, the printer engine103, finisher104, and scanner102are connected to the bus209. The CPU201reads and writes data from and in the printer engine103, finisher104, and scanner102to perform operations such as printing and scanning, and acquire various statuses. Image data can be saved in the DISK211or memory202of the controller101from the scanner102or network interface105. Also, image data can be accumulated in advance in a removable memory and loaded by attaching the memory to the controller101. Image data accumulated in the DISK211can be moved or copied to the memory202. Various additional images (for example, a page number) can be composited to image data in the memory202in accordance with contents designated from the operation unit106. Note that the printer engine103, finisher104, and scanner102may exist not in the MFP but as single peripheral devices on the network, and may be controlled by the controller101of the MFP.

FIG. 3is a schematic view showing the MFP according to the embodiment.

The scanner102serving as an image input device illuminates an image on a sheet serving as an original, and scans a CCD line sensor to convert the original image into electrical image data. The color and size of the original are determined from the electrically converted image data. A printer unit302serving as an image output device is a unit which converts image data into an image on a sheet. After printing on sheets, the printer unit302performs processes such as stapling and bookbinding, and outputs the sheets. The print operation starts and stops in accordance with instructions from the CPU201of the controller101. Reference numerals304to308denote paper sources. The paper source304is a manual feed tray, and the paper sources305to308are paper cassettes (paper storage units), in each of which a plurality of sheets can be set. Note that the MFP can print an image on an envelope stored in the paper cassette based on print data.

FIG. 4is a plan view showing the operation unit106of the MFP according to the embodiment.

The display unit203is formed from a touch panel sheet adhering to a liquid crystal display, and displays an operation screen and soft keys. When the user presses a displayed key, the display unit203notifies the CPU201of the position information.

Next, the keyboard204will be explained. A start key402is used to designate the start of an original image reading operation. An LED403in two, green and red colors is arranged at the center of the start key402, and the color represents whether the start key402is available. A stop key404is used to stop an operation in progress. A ten-key pad405is formed from numeric and character buttons, and used to set a copy count and designate screen switching of the display unit203and the like. A user mode key406is pressed to make settings of the MFP.

FIGS. 5A to 5Care views showing the manual feed tray304when viewed from above.

InFIG. 5A, the manual feed tray304includes guides502which are freely movable on rails503. The positions of the guides502can be adjusted in accordance with the size of paper to be set.FIG. 5Bshows guide positions when A4-size paper is set in the portrait direction. This represents a conveyance direction in long-edge feed described above.FIG. 5Cshows guide positions when A4-size paper is set in the landscape direction. This represents a conveyance direction in short-edge feed described above. A sensor504detects that paper is placed on the manual feed tray304. When paper is placed on the sensor504, the controller101can detect that paper is set on the manual feed tray304.

FIGS. 6A,6B,7A,7B,8A, and8B are views each exemplifying a UI screen displayed on the display unit203of the operation unit106of the MFP according to the embodiment. A method of setting a size for a paper cassette and setting a paper type from a user mode screen inFIG. 6Awill be explained with reference toFIGS. 6A,6B,7A,7B,8A, and8B.

When the user presses the user mode key406of the operation unit106, a user mode screen inFIG. 6Aappears. The user can set a paper size from this screen. When the user presses a button602corresponding to paper settings in a button group601, a screen shown inFIG. 6Bfor setting the size and type of paper to be set in the paper cassette appears.

The screen inFIG. 6Bprovides a cassette selection button group604. By pressing a button in the cassette selection button group604, the user can select an arbitrary paper cassette. When the user selects a paper cassette from the button group604and presses a set button605, a screen shown inFIG. 7Aappears.

The screen inFIG. 7Aprovides a standard size setting button group608. By pressing a button in the button group608, the user can set an arbitrary standard size for the paper cassette selected in FIG.6B. The user presses a user setting button609to set paper of an arbitrary size. When the user presses the user setting button609, a screen shown inFIG. 7Bappears.

The user presses an X button614inFIG. 7Bto set a length in the lateral direction. With a numeric button group616, the user sets the length. The user presses a Y button615to set a length in the longitudinal direction. With a numeric button group616, the user sets the length. The user presses a cancel button617to cancel settings on the screen. When the user presses the cancel button617, the screen inFIG. 7Breturns to one inFIG. 7Awithout any setting. The user presses an OK button618to end input of lengths in the longitudinal and lateral directions, and set these values. When the user presses the OK button618, the screen inFIG. 7Breturns to one inFIG. 7A.

The user presses an envelope button610inFIG. 7Ato set an envelope size. When the user presses the envelope button610, a screen inFIG. 8Aappears. The screen inFIG. 8Aprovides an envelope size setting button group620. By pressing a button in the button group620, the user can set the standard size of an envelope. The standard size of an envelope means a frequently used envelope size among various types of envelopes. The standard sizes of envelopes include, for example, “End-opening envelope (long format)3”, “End-opening envelope (square format)2”, “Side-opening envelope3”, “Com10”, “Monarch”, and “ISO-B5” exemplified inFIG. 8A. In the button group620, “End-opening envelope (long format)3” is selected as a default. The default changes depending on the destination (destination is information indicating a country or region where a device is installed, and is saved in either the memory202or DISK211of the controller101). The default is “End-opening envelope (long format)3” for Japan and “Com10” for overseas. The user presses a cancel button621to cancel settings on the screen. When the user presses the cancel button621, the screen inFIG. 8Areturns to one inFIG. 7Awithout any setting. The user presses an OK button622to decide an envelope size. When the user presses the OK button622, an envelope size is set, and the screen inFIG. 8Areturns to one inFIG. 7A.

When the user sets a standard size or user-set size as the envelope size and then presses a Next button612inFIG. 7A, a screen inFIG. 8Bappears. This screen provides a paper type setting button group624. By pressing a button in the button group624, the user can set a paper type. The user presses a cancel button625to cancel settings on the screen. When the user presses the cancel button625, the screen inFIG. 8Breturns to one inFIG. 7Awithout any setting. The user presses an OK button626to decide a paper type. When the user presses the OK button626, a paper type is set, and the screen inFIG. 8Breturns to one inFIG. 6A. Further, when the user wants to set another paper source, he selects a paper cassette again from the cassette selection button group604, and repeats setting processing. If no more setting is made, the user presses a close button606, and then the screen returns to one inFIG. 6A.

Table 1 below exemplifies information set for each paper cassette according to the embodiment. After the end of paper setting processing, data for one of cassette1to cassette4in Table 1 is updated. The data can be saved in either the memory202or DISK211of the controller101.

Next, a method of setting the size and type of paper when paper is set on the manual feed tray304will be explained. When the user sets paper on the manual feed tray304and sets a state as shown inFIG. 5Bor5C, the sensor504reacts and the printer engine103notifies the controller101that paper has been set. Upon receiving this notification, the controller101displays the screen shown inFIG. 7Aon the display unit203of the operation unit106. In this case, a Back button611is hidden. As described above, when the user sets a standard size or user-set size as the envelope size on this screen and then presses the Next button612, the screen inFIG. 8Bappears. As described above, this screen provides the paper type setting button group624. The user can set a paper type by pressing a button in the paper type setting button group624, or returns the screen inFIG. 8Bto one inFIG. 7Awith the cancel button625. When the user presses the OK button626after the end of setting, the paper registration screen disappears, and the size and paper type in “Manual Feed” of Table 1 are updated from “unset” to an actually set size and type. When no paper remains on the manual feed tray304, the sensor504reacts and the printer engine103notifies the controller101that no paper remains. Upon receiving this notification, the controller101updates each item in “Manual Feed” of Table 1 to “unset”.

FIG. 9is a view for explaining the structure of the scanner102.

Information on an original703is read while the original703is moved relatively to an exposure unit713of an original reading device719. The original703is set on an original tray702. An original feed roller704is paired with a separation pad705, and conveys the originals703one by one. The conveyed original703is sent into the scanner by intermediate rollers706, conveyed by a large roller708and first driven roller709, and further conveyed by the large roller708and a second driven roller710. The original703conveyed by the large roller708and second driven roller710passes between a sheet-fed original glass712and an original guide plate717, and conveyed by the large roller708and a third driven roller711via a jump table718. The original703conveyed by the large roller708and third driven roller711is discharged by a pair of original discharge rollers707. Note that the original703is conveyed between the sheet-fed original glass712and the original guide plate717to contact the sheet-fed original glass712by the original guide plate717.

When the original703passes on the sheet-fed original glass712, the exposure unit713exposes a surface of the original703that contacts the sheet-fed original glass712. Resultant light reflected by the original703travels to a mirror unit714. The traveling reflected light is condensed through a lens715, and converted into an electrical signal by a CCD sensor716. The electrical signal is transferred to the controller101.

FIG. 10is a view for explaining the arrangement of the printer unit302.

FIG. 10exemplifies a full-color printing apparatus. A primary charger811charges a photosensitive drum801to a potential of a specific polarity, and an exposure means (not shown) exposes a position indicated by an arrow812in accordance with an instruction from the controller101. As a result, an electrostatic latent image corresponding to the first color component is formed. After that, the electrostatic latent image is developed using one of four developing units of a developing device802. An intermediate transfer belt803is driven in a direction indicated by an arrow. When the image of the first color component formed on the photosensitive drum801passes through a contact portion between the photosensitive drum801and the intermediate transfer belt803, it is transferred onto the intermediate transfer belt803by an electric field formed by a primary transfer roller810. A cleaning device804cleans the surface of the photosensitive drum801after the transfer onto the intermediate transfer belt803. This processing is sequentially repeated, forming a color image by superposing images of four colors onto the intermediate transfer belt803. When an image of a single color is formed, transfer processing is performed only once. The image transferred onto the intermediate transfer belt803is printed onto paper fed from a paper cassette805by a secondary transfer roller809. A fixing unit806heats and fixes the paper on which the image is printed. After the fixing, the paper passes through a portion807, is conveyed to a discharge port813, and discharged from the printer unit302. When double-sided printing is performed, paper bearing an image printed on one surface is circulated through a reverse path808, and an image is printed on its reverse surface.

FIG. 11is a view exemplifying a UI screen for selecting a paper cassette subjected to auto paper selection. Auto paper selection is processing of automatically selecting a paper source serving as the source of paper to be used in printing from a plurality of paper sources by the CPU201in accordance with the original size and user settings.

When the user presses the user mode key406of the operation unit106, the user mode screen inFIG. 6Aappears. When the user presses a button corresponding to a cassette auto ON/OFF setting627in the button group601, the screen shown inFIG. 11appears. This screen displays equipped paper cassettes and the size of paper set in each paper cassette. With a selection button group902, the user can designate whether or not to set the paper cassette as a cassette to be selected automatically. A cassette source for which “ON” is pressed becomes a cassette subjected to auto paper selection. A cassette for which “OFF” is pressed becomes a cassette not subjected to auto paper selection. When the user presses an OK button903, setting ends, and the screen inFIG. 11returns to one inFIG. 6A.

Table 2 below exemplifies data representing auto paper selection of paper cassettes and manual feed according to the embodiment.

After the end of cassette auto ON/OFF setting processing, data for one of cassette1to cassette4and manual feed in Table 2 is updated in correspondence with the setting. The data can be saved in either the memory202or DISK211of the controller101. This data is used when automatically selecting a cassette. In the example of Table 2, it is set to use cassettes1and2in auto paper selection and not to use cassettes3and4in auto paper selection. Also, it is set to use manual feed in auto paper selection.

FIG. 12is a view for explaining the data structure of a job in the embodiment. An application in the device generates this data upon receiving an instruction to execute a job.

The entity of the job is represented by successively arranging a plurality of sets each of which has an attribute ID1101, attribute value size1102, and attribute value1103. When a job contains data, it holds a value representing data as an attribute ID, the size of a file name as an attribute value size, and the file name of a file holding document data as an attribute value, as represented by1107,1108, and1109. Each attribute value contains a data format (for example, PDL used), copy count, cassette source, paper size used in printing, and designation of finishing processing.

FIG. 13is a table exemplifying the data attribute of a job according to the embodiment.

An attribute ID1201represents the ID number of an attribute. A type ID1202represents the type (size) of an ID such that “1” is an undefined length and “2” is 1 byte. A value1203represents a possible value and has a meaning as represented by a meaning1204. The data attribute shown inFIG. 13is merely an example, and various other attributes exist. A job is formed by setting these values in the attribute ID, attribute value size, and attribute value shown inFIG. 12.

FIG. 14is a flowchart for explaining an operation when the MFP according to the embodiment automatically selects a paper cassette for a job for which a paper size is designated. This processing is implemented by executing a program stored in the memory202by the CPU201of the controller101.

When auto paper selection processing starts, the CPU201acquires a paper size requested of processing from an attribute designated by the job in step S1401. The process advances to step S1402, and the CPU201searches for a paper cassette whose state is set to “ON” in Table 2, that is, which is used in auto paper selection. The process then advances to step S1403, and the CPU201determines whether a size coincident with the paper size acquired in step S1401exists in paper sizes in Table 1 among paper cassettes whose states are “ON”.

In step S1404, the CPU201determines whether there is a cassette source having a coincident size. If such a cassette source exists, the process advances to step S1405, and the CPU201executes the job using the coincident paper cassette source. If the CPU201determines in step S1404that no such cassette source exists, the process advances to step S1406, and the CPU201notifies the user that there is no usable size, and then interrupts the job.

When the paper size acquired in step S1401is B4 in the states of Table 1 and Table 2, the cassette search targets in Table 1 are 1 and 2. Paper of the paper size B4 is set for cassette4in Table 1, but the state of cassette4in Table 2 is “OFF”. Thus, a paper cassette corresponding to the paper size B4 does not exist.

FIGS. 15A,15B, and16are views for explaining an envelope size setting method according to the embodiment.

When paper is set in the manual feed tray304, the display unit203of the operation unit106displays the screen inFIG. 7A. If the user presses the envelope button610on this screen, a screen inFIG. 15Aappears. This screen represents a case in which an envelope is conveyed parallel to its long edge (lateral feed or short-edge feed). The screen provides an envelope size setting button group1402. By pressing a button in the button group1402, the user can set an envelope size. In the button group1402, “End-opening envelope (long format)3” is selected as a default. The default changes depending on the destination. The default is “End-opening envelope (long format)3” for Japan and “Com10” for overseas. The user presses a cancel button1404to cancel settings on the screen. When the user presses the cancel button1404, the screen inFIG. 15Areturns to one inFIG. 7Awithout any setting. The user presses an OK button1405to decide an envelope size. When the user presses the OK button1405, an envelope size is set, and the screen inFIG. 15Areturns to one inFIG. 7A. The CPU201saves the set contents in either the memory202or DISK211. The user presses a longitudinal feed button1403to feed an envelope longitudinally (long-edge feed). When the user presses the longitudinal feed button1403, a screen shown inFIG. 15Bappears.

The screen inFIG. 15Brepresents a case in which an envelope is conveyed so that its long edge serves as the leading end in the conveyance direction (longitudinal feed or long-edge feed). The screen provides an envelope size setting button group1407. By pressing a button in the button group1407, the user can set an envelope size. In the button group1407, “End-opening envelope (long format)3” is selected as a default. The default changes depending on the destination. The user presses a cancel button1409to cancel settings on the screen. When the user presses the cancel button1409, the screen inFIG. 15Breturns to one inFIG. 7Awithout any setting. The user presses a lateral feed button1408to return to the screen inFIG. 15A. The user presses a Next button1410to decide an envelope size and enter a flap size. When the user presses the Next button1410, a screen inFIG. 16serving as an offset setting screen appears. This screen provides a numeric button group1412, and the user can enter a flap size (margin width) in mm by using the numeric button group1412. A display field1413displays the entered value. The user presses a cancel button1414to cancel settings on the screen. When the user presses the cancel button1414, the screen inFIG. 16returns to one inFIG. 15B. The user presses an OK button1415to decide a flap size. When the user presses the OK button1415, a flap size is set, and the screen inFIG. 16returns to one inFIG. 7A. The CPU201saves the set contents in either the memory202or DISK211.

Table 3 below represents the data structure of the envelope size and flap size according to the embodiment. After the end of envelope setting processing, data in the flap size of Table 3 is updated. As described above, this data can be saved in either the memory202or DISK211of the controller101.

FIGS. 17A and 17Bare flowcharts for explaining a printing sequence on an envelope by a PDL job according to the embodiment.FIG. 17Ashows processing by the PC107, andFIG. 17Bshows processing by the MFP according to the embodiment. Note that the processing shown in the flowchart ofFIG. 17Ais implemented by reading out a program stored in the ROM (not shown) of the PC107and executing it by the CPU (not shown) of the PC107. Also, the processing shown in the flowchart ofFIG. 17Bis implemented by reading out a program stored in the ROM210and executing it by the CPU201.

First, in step S1701ofFIG. 17A, the PC107accepts the print settings of a PDL image output job from the user. The print setting contents include the copy count, paper size (envelope size in printing on an envelope), single-sided/double-sided, page output order, sort output, and stapling/no-stapling. Then, the process advances to step S1702, and the PC107accepts a print instruction from the user, and converts code data to be printed into so-called PDL data (print data) by using driver software installed in the PC107. The PC107transfers the PDL data to the controller101via the network interface105together with the print setting parameters set in step S1501.

Next, processing in the MFP will be explained with reference toFIG. 17B.

In step S1710, the CPU201detects that, for example, an envelope of End-opening envelope (long format)3inFIG. 19Ais set in the manual feed tray304. The user selects the longitudinal feed1403inFIG. 15A, and sets “End-opening envelope (long format)3” as the envelope size inFIG. 15B. Further, the user enters, for example, “30.0” mm as the flap size, presses the OK button1415inFIG. 16, and sets plain paper on the screen ofFIG. 8B. Then, the items in “Manual Feed” of Table 1 are updated as follows.

More specifically, in “Manual Feed”, “End-opening envelope (long format)3” is set as the paper size, “plain paper” is set as the paper type, and “longitudinal” is set as the feed. Also, the flap size of “End-opening envelope (long format)3” in the envelope size of Table 3 is updated to 30.0 mm.

In step S1711, the CPU201receives the PDL data transferred from the PC107via the network interface105. The process advances to step S1712, and the CPU201rasterizes the PDL data into image data based on the print setting parameters. Rasterization into image data is executed in the memory202.

FIG. 18is a view showing an image of image data rasterized in the memory when End-opening envelope (long format)3is set as the image size.

FIGS. 19A to 19Care views exemplifying an envelope size and printing on an envelope.

End-opening envelope (long format)3is defined by a size of 120 mm×235 mm. Image data of a size corresponding to this size is rasterized in the memory202.

After that, the process advances to step S1713, and the CPU201of the controller101acquires a paper size designated by the PDL job from the attribute. The process advances to step S1714, and the controller101selects a paper source matching the acquired paper size. Since the designated paper size is End-opening envelope (long format)3, a paper source in which an envelope of End-opening envelope (long format)3is set is selected, and a paper feed direction set for the paper source is acquired.

In the embodiment, End-opening envelope (long format)3is set for cassette2and manual feed. Short-edge feed (lateral feed direction) is set for cassette2, and long-edge feed (longitudinal feed direction) is set for manual feed. Because the printing time is shorter for long-edge feed, the CPU201preferentially selects long-edge feed.

When manual feed is selected, the CPU201determines that the paper feed direction is longitudinal. The CPU201acquires a flap size corresponding to the envelope size from data managed in Table 3, and sets it as an offset amount. In this case, the flap size is set to 30.0 mm, so the offset amount also becomes 30.0 mm.

When the auto paper selection setting of manual feed is “OFF” in the auto paper selection setting represented in Table 2, no manual feed can be selected, and thus cassette2is selected. When cassette2is selected, the CPU201determines that the paper feed direction is lateral, sets the flap size to 0 mm, and sets no offset amount.

Then, the process advances to step S1715, and the CPU201controls the printer engine103to perform printing control based on image data. At this time, the image data is printed by shifting the output position of the image data by the offset amount. Accordingly, a printing result as shown inFIG. 19Bcan be obtained. If the output position of the image data is not shifted by the offset amount, the printing result becomes one as shown inFIG. 19Cin which the positions of the address and postal code are misaligned.

As described above, according to the first embodiment, even when an envelope is set to convey it by long-edge feed, an appropriate image can be printed by shifting the image position in accordance with the flap size of the envelope. Even if a job of an image size not including the flap is input, an image can be printed at a proper position excluding the flap by changing the offset amount in accordance with information registered for a selected paper source. This is because, if an image rasterized in the memory202is aligned with the upper end of paper and printed on an envelope, similar to printing an image on paper other than an envelope, the image is not printed at a correct position owing to the presence of the flap of the envelope.

By conveying an envelope by long-edge feed under the above-described control, a larger number of sheets can be fed per unit time than by conveying envelopes by short-edge feed, and the time taken to print can be shortened. When conveying an envelope by long-edge feed and printing, even if the user creates an original image to be printed without taking account of the length of a flap, the image is correctly printed at a portion excluding the flap.

In the first embodiment described above, a flap size is set in advance in accordance with an envelope size. A flap size is acquired in accordance with the feed direction of paper set in a paper source, and is adjusted as an offset amount. However, the present invention is not limited to this. For example, it is also possible to set a flap size for paper set in each cassette source.

When the user presses an envelope button610inFIG. 7Ain setting of paper information of a cassette source, a flap size input screen (not shown) appears in setting of longitudinal feed.

Table 4 below exemplifies data when paper of “End-opening envelope (long format)3” is set in cassette2with longitudinal feed, and the flap size is set to 25.0 mm. This data can be saved in either a memory202or DISK211of a controller101.

When a controller101controls a printer engine103to print image data, if paper set in a selected paper source has a flap size, the image data is shifted by an offset amount corresponding to the flap size and then printed.

Assume that “End-opening envelope (long format)3” is set for a plurality of paper sources, that is, “cassette2” and “manual feed”, and longitudinal feed (long-edge feed) is set for both of them, as represented in Table 4. In this case, if flap sizes of “End-opening envelope (long format)3” set for these paper sources are equal, the same printing result is obtained even by auto paper selection. However, when these flap sizes are different, as represented in Table 4, a printing result obtained when “cassette2” is selected by auto paper selection and that obtained when “manual feed” is selected differ from each other. To solve this, the following control is executed.

A CPU201recognizes paper sources (for example, cassette2and manual feed) in which paper of a size (for example, End-opening envelope (long format)3) designated by a job is set. The CPU201determines whether a plurality of paper sources in which paper having a flap size is set exist in the recognized paper sources. If there is only one paper having a flap size, the CPU201selects a paper source in which the paper is set. If the CPU201determines that there are a plurality of such paper sources, it determines whether flap sizes of paper in these paper sources are equal. If the CPU201determines that these flap sizes are equal, it automatically selects a paper source in accordance with predetermined paper source priority. For example, the CPU201controls to feed paper preferentially from a paper source having a short conveyance distance up to the image forming unit of the printer engine103. In contrast, if the CPU201determines that these flap sizes are different, it presents, to the user, a plurality of recognized paper sources and information (paper size, paper type, and flap size) of paper set in each of these paper sources. Then, the CPU201selects, from the presented paper sources, a paper source designated by the user as a paper source to be used in printing. The CPU201feeds paper set in the selected paper source, shifts an image by a flap size set for the paper source, and prints it on the fed paper.

According to the second embodiment, different flap sizes can be set even for the same paper feed direction, like cassette2and manual feed. The image offset amount can be changed in accordance with the set flap size to correctly print an image. Hence, an image can be printed at a proper position without printing it on the flap, unlikeFIG. 19C, thereby greatly improving user friendliness.

As described above, according to the second embodiment, even when paper having a flap, like an envelope, is set by long-edge feed, it is handled as paper of a standard size, and the auto paper selection function can be used similarly to an envelope set by short-edge feed. Regardless of which of short-edge feed and long-edge feed is used to set an envelope, the offset amount is changed in accordance with information registered for a selected paper source. An image can therefore be printed at an appropriate position without printing it on the flap.

In the above-described embodiments, print processing based on PDL data received from the PC107has been exemplified. However, the embodiments are also applicable to copy processing. In copying, a CPU201selects a paper source for use in accordance with a paper size accepted from the user via an operation unit106, instead of designating a paper size by print data. In copying, an envelope may be placed on the original table with its flap opened. Thus, processing of shifting the image of a read original by a flap size set for a selected paper source may not be executed. Alternatively, in copying, the user may set in advance whether to shift the image of a read original by the flap size. In accordance with the setting, it may be decided whether to shift and print the image.

This application claims the benefit of Japanese Patent Application No. 2011-264120, filed Dec. 1, 2011, which is hereby incorporated by reference herein in its entirety.