摘要 |
PROBLEM TO BE SOLVED: To precisely detect an end portion of a medium having an erroneous detection element.SOLUTION: While an optical sensor 50 moves above a print medium S along a main scanning direction, there is detected at least one change point where a state indicating the presence of the print medium S by an output of the optical sensor 50 changes to a state indicating the absence of the print medium S. In addition, when an output of the optical sensor 50 is in a state where it continuously shows the absence of the print medium S while the optical sensor 50 and print medium S further move by a predetermined distance from the detected changing point along the main scanning direction, right end portion candidate detection processing or left end portion candidate detection processing for detecting the last change point as a candidate of the right or left end portion of the print medium S is performed. Then, end portion determination processing for determining the right or left end portion of the print medium S is performed based on a detected candidate of the right or left end portion. |