Deprecated: The each() function is deprecated. This message will be suppressed on further calls in /home/zhenxiangba/zhenxiangba.com/public_html/phproxy-improved-master/index.php on line 456
JP7363087B2 - printer - Google Patents
[go: Go Back, main page]

JP7363087B2 - printer - Google Patents

printer Download PDF

Info

Publication number
JP7363087B2
JP7363087B2 JP2019085747A JP2019085747A JP7363087B2 JP 7363087 B2 JP7363087 B2 JP 7363087B2 JP 2019085747 A JP2019085747 A JP 2019085747A JP 2019085747 A JP2019085747 A JP 2019085747A JP 7363087 B2 JP7363087 B2 JP 7363087B2
Authority
JP
Japan
Prior art keywords
paper
block
rectangular area
blocks
printing
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
JP2019085747A
Other languages
Japanese (ja)
Other versions
JP2020179636A (en
Inventor
克義 酒井
満 中村
純司 前田
慶太 小山
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Brother Industries Ltd
Original Assignee
Brother Industries Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Brother Industries Ltd filed Critical Brother Industries Ltd
Priority to JP2019085747A priority Critical patent/JP7363087B2/en
Publication of JP2020179636A publication Critical patent/JP2020179636A/en
Application granted granted Critical
Publication of JP7363087B2 publication Critical patent/JP7363087B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Handling Of Sheets (AREA)
  • Accessory Devices And Overall Control Thereof (AREA)

Description

本発明は、ラベルプリンタなどのプリンタに関する。 The present invention relates to printers such as label printers.

従来、プリンタの一種として、長尺の印刷用紙を巻回したロールを使用し、そのロールから繰り出される印刷用紙上に各ページの画像を長手方向に並べて印刷するラベルプリンタが知られている。印刷用紙には、普通紙、感熱紙、長尺の剥離台紙上にラベルを長手方向に所定間隔で並べて貼り付けたラベル紙などが含まれる。 Conventionally, as a type of printer, a label printer is known that uses a roll of long printing paper wound around it and prints images of each page arranged in the longitudinal direction on the printing paper that is fed out from the roll. Printing paper includes plain paper, thermal paper, and label paper in which labels are pasted on a long release liner at predetermined intervals in the longitudinal direction.

ラベルプリンタでは、ロールを最初から最後まで一気に使い切るよりも、ロールの途中で印刷を終了し、別のロールに交換して次の印刷を開始するような使われ方が多い。そのため、次の印刷の開始時には、印刷開始位置を設定する頭出しが必要となる。 Label printers are often used to finish printing in the middle of a roll, replace it with another roll, and start the next print, rather than using the roll from start to finish all at once. Therefore, when starting the next print, cueing is required to set the print start position.

ところが、途中まで使用されたロールでは、印刷用紙の先端が必ずしも搬送方向(長尺方向)と直交する直線で切られた状態になっているとは限らず、印刷用紙の先端がユーザの手で破られた状態になっていることがある。そこで、複数のペーパ検出センサをプリントペーパ(印刷用紙)の幅方向に並べて配置して、プリントペーパの先端の位置を幅方向にわたって検出し、その検出結果から、プリントペーパの先端を搬送方向と直交する直線にするためにカッターで切断する位置を決定する構成が提案されている。 However, for rolls that have been used halfway, the leading edge of the printing paper is not necessarily cut in a straight line perpendicular to the transport direction (longitudinal direction), and the leading edge of the printing paper may be cut by the user's hand. It may be in a broken state. Therefore, multiple paper detection sensors are arranged side by side in the width direction of the print paper (print paper) to detect the position of the leading edge of the print paper across the width direction, and based on the detection results, the leading edge of the print paper is positioned perpendicular to the transport direction. A configuration has been proposed in which the cutting position with a cutter is determined in order to make a straight line.

特開2006-181834号公報Japanese Patent Application Publication No. 2006-181834

プリントペーパ(印刷用紙)の先端の位置を検出する技術は、その提案の構成に限らず、頭出しに利用することもできる。しかし、印刷用紙の先端部がユーザの手で破られた場合、印刷用紙の表面が薄く破り取られた状態になっていたり、剥離台紙だけが残ってラベルがない状態になっていたりする場合がある。この場合、ペーパ検出センサとして通常用いられる透過式または反射式のフォトセンサでは、印刷用紙の表面の状態までは判別できないため、印刷に適さない位置に印刷開始位置が設定されるおそれがある。 The technology for detecting the position of the leading edge of print paper is not limited to the proposed configuration, and can also be used for cueing. However, if the leading edge of the printing paper is torn by the user's hand, the surface of the printing paper may be torn off thinly, or only the release liner remains and there is no label. be. In this case, a transmissive or reflective photosensor that is normally used as a paper detection sensor cannot determine the condition of the surface of the printing paper, so there is a risk that the print start position will be set at a position that is not suitable for printing.

本発明の目的は、印刷用紙の表面の状態にかかわらず、印刷開始位置を印刷用紙の使用可能領域の先頭位置に正しく設定できる、プリンタを提供することである。 SUMMARY OF THE INVENTION An object of the present invention is to provide a printer that can correctly set the print start position to the head position of the usable area of the print paper, regardless of the surface condition of the print paper.

前記の目的を達成するため、本発明に係るプリンタは、長尺の印刷用紙を搬送する搬送部と、前記搬送部を駆動する駆動部と、前記搬送部により搬送される印刷用紙に画像を印刷する印刷部と、印刷用紙の搬送方向と直交する幅方向において、印刷用紙を全幅にわたって読み取り可能な読取部と、制御部と、を備え、前記制御部は、前記印刷部による印刷時と同じ送り出し方向に前記搬送部を駆動するよう前記駆動部に指令を出す第一駆動処理と、前記第一駆動処理による指令を出した後、前記読取部に読み取りの開始の指令を出し、前記読取部に印刷用紙を読み取らせる第一読取処理と、前記第一読取処理により前記読取部に読み取られた画像データを元に、前記搬送部の駆動方向を前記送り出し方向または前記送り出し方向と逆の巻き戻し方向に決定して、決定した方向に前記搬送部を駆動するよう前記駆動部に指令を出す第二駆動処理と、前記第二駆動処理による指令を出した後、前記読取部に読み取りの開始の指令を出し、前記読取部に印刷用紙を読み取らせる第二読取処理と、前記第二読取処理により前記読取部に読み取られた画像データを元に、印刷用紙の使用可能領域の先頭位置を探索して決定する先頭探索処理と、を実行する。 In order to achieve the above object, a printer according to the present invention includes a transport unit that transports a long printing paper, a drive unit that drives the transport unit, and a printer that prints an image on the printing paper that is transported by the transport unit. a reading unit capable of reading the entire width of the printing paper in the width direction orthogonal to the conveying direction of the printing paper, and a control unit, the control unit configured to perform the same feeding as when printing by the printing unit. a first drive process that issues a command to the drive unit to drive the transport unit in the direction; and after issuing the command by the first drive process, issues a command to the reading unit to start reading; A first reading process for reading the printing paper, and a driving direction of the transport unit based on the image data read by the reading unit in the first reading process, the feeding direction or the rewinding direction opposite to the feeding direction. a second drive process that instructs the drive unit to drive the transport unit in the determined direction; and after issuing the command by the second drive process, instructs the reading unit to start reading; a second reading process that causes the reading unit to read the printing paper; and a search for the leading position of the usable area of the printing paper based on the image data read by the reading unit in the second reading process. A head search process to be determined is executed.

この構成によれば、印刷用紙が読取部により読み取られて、その読み取りにより得られた画像データを元に、駆動部による搬送部の駆動方向が決定される。そして、その決定された駆動方向に応じた搬送方向に印刷用紙が搬送されながら、印刷用紙が読取部により読み取られて、印刷用紙の使用可能領域の先頭位置が探索される。この探索結果に基づくことにより、印刷用紙の表面の状態にかかわらず、印刷部による画像の印刷開始位置を印刷用紙の使用可能領域の先頭位置に正しく設定することができる。 According to this configuration, the printing paper is read by the reading section, and the driving direction of the conveying section by the driving section is determined based on the image data obtained by the reading. Then, while the printing paper is being transported in the transporting direction corresponding to the determined drive direction, the printing paper is read by the reading section, and the leading position of the usable area of the printing paper is searched. Based on this search result, the printing start position of the image by the printing unit can be correctly set to the leading position of the usable area of the printing paper, regardless of the surface condition of the printing paper.

本発明によれば、印刷用紙の表面の状態にかかわらず、印刷部による画像の印刷開始位置を印刷用紙の使用可能領域の先頭位置に正しく設定することができる。 According to the present invention, the printing start position of an image by the printing unit can be correctly set at the beginning position of the usable area of the printing paper, regardless of the surface condition of the printing paper.

本発明の一実施形態に係るラベルプリンタの内部構成を示す図解的な断面図である。1 is a schematic cross-sectional view showing the internal configuration of a label printer according to an embodiment of the present invention. ラベルプリンタの電気的構成を示すブロック図である。FIG. 2 is a block diagram showing the electrical configuration of a label printer. 頭出し処理の流れを示すフローチャートである。3 is a flowchart showing the flow of cue processing. 矩形領域処理の流れを示すフローチャートである。7 is a flowchart showing the flow of rectangular area processing. ブロック種判定処理の流れを示すフローチャートである。3 is a flowchart showing the flow of block type determination processing. 読取装置の読取位置に用紙の先端よりも搬送方向上流側の部分が位置している状態を示す図解的な平面図である。FIG. 3 is an illustrative plan view showing a state in which a portion of the sheet upstream in the conveyance direction from the leading edge of the sheet is located at the reading position of the reading device. 読取装置の読取位置に用紙が存在しない状態を示す図解的な平面図である。FIG. 3 is an illustrative plan view showing a state where no paper is present at the reading position of the reading device. 読取装置の読取位置に用紙の先端が位置している状態を示す図解的な平面図である。FIG. 3 is an illustrative plan view showing a state in which the leading edge of the paper is located at the reading position of the reading device. 用紙が逆方向に搬送されながら、用紙における使用可能領域の先頭位置が探索される場合を説明するための図である。FIG. 7 is a diagram for explaining a case where the leading position of a usable area on a sheet of paper is searched for while the sheet of paper is being conveyed in the opposite direction. 用紙が順方向に搬送されながら、用紙における使用可能領域の先頭位置が探索される場合を説明するための図である。FIG. 7 is a diagram for explaining a case where the leading position of a usable area on a sheet of paper is searched for while the sheet of paper is being conveyed in the forward direction. ブロックに分割する手法の変形例を説明刷るための図である。FIG. 7 is a diagram for explaining a modified example of the method of dividing into blocks.

以下では、本発明の実施の形態について、添付図面を参照しつつ詳細に説明する。 Embodiments of the present invention will be described in detail below with reference to the accompanying drawings.

<ラベルプリンタ>
図1には、プリンタの一例であるラベルプリンタ1が示されている。ラベルプリンタ1は、その外殻をなす筐体11を備えている。
<Label printer>
FIG. 1 shows a label printer 1 that is an example of a printer. The label printer 1 includes a casing 11 that forms its outer shell.

なお、以下の説明で使用するため、筐体11の一方側を「前側」とし、その反対側を「後側」と規定する。そして、ラベルプリンタ1を「前側」から見た状態を基準に左右を規定する。前後方向および左右方向の両方向と直交する方向が「上下方向」であり、「上側」および「下側」については、ラベルプリンタ1が水平面に設置された状態を基準とする。 For use in the following description, one side of the housing 11 will be defined as the "front side" and the opposite side will be defined as the "rear side." Then, the left and right sides are defined based on the state in which the label printer 1 is viewed from the "front side." The direction perpendicular to both the front-rear direction and the left-right direction is the "up-down direction", and the "upper side" and the "lower side" are based on the state in which the label printer 1 is installed on a horizontal surface.

筐体11の前側の側面には、用紙P(印刷用紙の一例)を排出する排出口12が形成されている。排出口12は、左右方向に延びる矩形状の開口であり、筐体11の内外を連通している。 A discharge port 12 for discharging paper P (an example of printing paper) is formed on the front side surface of the housing 11 . The discharge port 12 is a rectangular opening extending in the left-right direction, and communicates between the inside and outside of the housing 11 .

筐体11内には、用紙ロールRを保持するロールホルダ13が設けられている。用紙ロールRは、長尺状の用紙Pをロール芯に巻回したものである。用紙Pは、その長手方向に並べて設定された多数の印刷領域を有するラベル紙(ダイカットラベル紙)であってもよいし、かかる印刷領域を有していない普通紙または感熱紙である連続紙であってもよい。また、ラベル紙は、長尺状の普通紙の印刷面に印刷領域を区画する枠が予め印刷されたものであってもよいし、長尺状の剥離紙上に粘着紙が重ね合わされ、その粘着紙に型抜きされたラベルが長手方向に並べて形成されたものであってもよい。後者の場合、各ラベルの印刷面(粘着面と反対側の面)が印刷領域である。用紙Pがラベル紙である場合、用紙Pは、印刷面が外側に向くようにロール芯に巻回される。ロールホルダ13は、略円柱状をなし、用紙ロールRのロール芯がロールホルダ13に外嵌されることにより、用紙ロールRがロールホルダ13に保持される。 A roll holder 13 that holds a paper roll R is provided inside the housing 11. The paper roll R is a roll of paper P wound around a roll core. The paper P may be a label paper (die-cut label paper) having a large number of print areas set side by side in its longitudinal direction, or may be continuous paper such as plain paper or thermal paper that does not have such print areas. There may be. In addition, label paper may be a long sheet of plain paper with a frame pre-printed on the printing surface to divide the printing area, or a sheet of adhesive paper overlaid on a long sheet of release paper and the adhesive The label may be formed by cutting out labels from paper and arranging them in the longitudinal direction. In the latter case, the printing surface of each label (the surface opposite to the adhesive surface) is the printing area. When the paper P is label paper, the paper P is wound around a roll core so that the printed surface faces outward. The roll holder 13 has a substantially cylindrical shape, and the roll core of the paper roll R is fitted onto the roll holder 13 so that the paper roll R is held by the roll holder 13 .

また、筐体11内には、ロールホルダ13の後上方に、方向変更ローラ14が設けられている。方向変更ローラ14の前側には、用紙Pが搬送される搬送路15が設けられている。搬送路15は、方向変更ローラ14の上側の位置から前側に向かって延び、その前端が排出口12に接続されている。用紙Pは、用紙ロールRから方向変更ローラ14の後側に向けて引き出され、方向変更ローラ14の周面に沿わせることにより前側に方向を変えられて、搬送路15を排出口12に向けて通される。 Further, within the housing 11, a direction changing roller 14 is provided at the rear and upper part of the roll holder 13. A conveyance path 15 through which the paper P is conveyed is provided in front of the direction change roller 14 . The conveyance path 15 extends toward the front from a position above the direction change roller 14 , and its front end is connected to the discharge port 12 . The paper P is pulled out from the paper roll R toward the rear side of the direction change roller 14 , is changed in direction to the front side by running along the circumferential surface of the direction change roller 14 , and is directed along the conveyance path 15 toward the discharge port 12 . will be passed.

搬送路15上には、用紙Pを搬送する搬送ローラ16,17(搬送部の一例)が設けられている。一方の搬送ローラ16は、方向変更ローラ14に対して前側に間隔を空けて配置されている。他方の搬送ローラ17は、排出口12の後側であって、搬送ローラ16に対して前側に間隔を空けて配置されている。搬送ローラ16,17のローラ間に用紙Pが通された状態で、モータM(図2参照)の正転駆動による動力が搬送ローラ16,17に伝達されて、搬送ローラ16,17が回転することにより、用紙Pが搬送路15に沿って排出口12に向かう送出方向に搬送される。また、モータMの逆転駆動による動力がロールホルダ13に伝達されて、用紙ロールRのロール芯が用紙Pの送出方向への搬送時と逆方向に回転されることにより、用紙Pが搬送方向と逆方向の巻戻し方向に搬送される。用紙Pが巻戻し方向に搬送されるときには、搬送ローラ16,17は自由回転状態とされる。 On the conveyance path 15, conveyance rollers 16 and 17 (an example of a conveyance section) for conveying the paper P are provided. One of the conveyance rollers 16 is arranged in front of the direction change roller 14 with a space therebetween. The other conveyance roller 17 is arranged on the rear side of the discharge port 12 and in front of the conveyance roller 16 with a space therebetween. With the paper P being passed between the conveyance rollers 16 and 17, the power generated by the forward rotation of the motor M (see FIG. 2) is transmitted to the conveyance rollers 16 and 17, and the conveyance rollers 16 and 17 rotate. As a result, the paper P is transported along the transport path 15 in the delivery direction toward the discharge port 12 . Further, the power generated by the reverse drive of the motor M is transmitted to the roll holder 13, and the roll core of the paper roll R is rotated in the opposite direction to the direction in which the paper P is transported in the delivery direction, so that the paper P is rotated in the transport direction. It is transported in the reverse rewinding direction. When the paper P is transported in the rewinding direction, the transport rollers 16 and 17 are in a freely rotating state.

搬送ローラ16,17間には、印刷ヘッド21(印刷部の一例)および読取装置22(読取部の一例)が送出方向にこの順に並んで設けられている。 Between the conveyance rollers 16 and 17, a print head 21 (an example of a printing section) and a reading device 22 (an example of a reading section) are arranged in this order in the sending direction.

印刷ヘッド21は、搬送路15に上側から臨んで配置されている。印刷ヘッド21は、たとえば、搬送路15を搬送される用紙Pの印刷面にインクジェット記録方式により画像を印刷する。印刷ヘッド21と上下方向に対向する位置が印刷ヘッド21による印刷が可能な印刷可能位置であり、印刷ヘッド21は、用紙Pの印刷面における印刷可能位置に位置する部分に画像を印刷する。 The print head 21 is arranged facing the conveyance path 15 from above. The print head 21 prints an image on the printing surface of the paper P conveyed through the conveyance path 15, for example, by an inkjet recording method. A position facing the print head 21 in the vertical direction is a printable position where printing by the print head 21 is possible, and the print head 21 prints an image on a portion of the printing surface of the paper P located at the printable position.

読取装置22は、印刷ヘッド21に対して送出方向の下流側において、搬送路15に上側から臨んで配置されている。読取装置22は、たとえば、搬送路15を搬送される用紙Pの印刷面をCIS(Contact Image Sensor)により読み取る。具体的には、読取装置22には、図示されていないが、光源、ロッドレンズアレイおよびリニアイメージセンサが内蔵されており、光源から用紙Pの印刷面にライン状の光が照射され、印刷面で反射された光がロッドレンズアレイを通してリニアイメージセンサに入射する。これにより、読取装置22の読取位置において、原稿が主走査方向に1ライン分読み取られる。リニアイメージセンサは、複数の撮像素子(イメージセンサ)が主走査方向に1列に並べられた構成であり、各撮像素子に読み取られる画像データが1画素の画像データ(画素値)となる。 The reading device 22 is disposed on the downstream side of the print head 21 in the sending direction, facing the transport path 15 from above. The reading device 22 uses, for example, a CIS (Contact Image Sensor) to read the printed surface of the paper P conveyed through the conveyance path 15. Specifically, although not shown in the drawings, the reading device 22 has a built-in light source, a rod lens array, and a linear image sensor, and a line-shaped light is irradiated from the light source onto the printed surface of the paper P. The reflected light passes through the rod lens array and enters the linear image sensor. As a result, one line of the document is read in the main scanning direction at the reading position of the reading device 22. A linear image sensor has a configuration in which a plurality of image sensors (image sensors) are arranged in a line in the main scanning direction, and image data read by each image sensor becomes image data (pixel value) of one pixel.

また、搬送ローラ16,17間には、プラテン23が設けられている。プラテン23は、印刷ヘッド21および読取装置22に対して搬送路15を挟んで下側から対向するように配置されている。プラテン23は、印刷ヘッド21および読取装置22と対向する面、つまり上面が平面に形成され、用紙Pを下側から支持する。プラテン23の上面は、黒色である。読取装置22の読取ラインの主走査方向の幅は、用紙Pの主走査方向の幅よりも大きいように設定されている。 Further, a platen 23 is provided between the conveyance rollers 16 and 17. The platen 23 is arranged to face the print head 21 and the reading device 22 from below with the transport path 15 in between. The platen 23 has a flat surface facing the print head 21 and the reading device 22, that is, an upper surface, and supports the paper P from below. The upper surface of the platen 23 is black. The width of the reading line of the reading device 22 in the main scanning direction is set to be larger than the width of the paper P in the main scanning direction.

<電気的構成の要部>
ラベルプリンタ1は、図2に示されるように、CPU(Central Processing Unit)31、ROM(Read Only Memory)32およびRAM(Random Access Memory)33を備えている。
<Main parts of electrical configuration>
As shown in FIG. 2, the label printer 1 includes a CPU (Central Processing Unit) 31, a ROM (Read Only Memory) 32, and a RAM (Random Access Memory) 33.

ROM32は、フラッシュメモリなどの書き換え可能な不揮発性メモリからなる。ROM32には、CPU31(制御部の一例)によって実行されるプログラムおよび各種のデータなどが記憶されている。CPU31は、プログラムを実行することにより、印刷ヘッド21および読取装置22を制御し、また、搬送ローラ16,17を駆動する駆動部の一例であるモータMを制御する。RAM33は、DRAM(Dynamic Random Access Memory)などの揮発性メモリであり、CPU31がプログラムを実行する際のワークエリアとして使用される。 The ROM 32 is composed of a rewritable nonvolatile memory such as a flash memory. The ROM 32 stores programs executed by the CPU 31 (an example of a control unit), various data, and the like. The CPU 31 controls the print head 21 and the reading device 22 by executing a program, and also controls the motor M, which is an example of a drive unit that drives the conveyance rollers 16 and 17. The RAM 33 is a volatile memory such as DRAM (Dynamic Random Access Memory), and is used as a work area when the CPU 31 executes a program.

また、RAM33は、ステップ数カウンタを構成する。ステップ数カウンタは、モータMが1ステップ駆動される度にステップ数をインクリメント(+1)する。CPU31は、ステップ数カウンタによりカウントされるステップ数に基づいてモータMの駆動を制御することにより、用紙Pの位置を制御することができる。 Further, the RAM 33 constitutes a step number counter. The step number counter increments the step number (+1) each time the motor M is driven one step. The CPU 31 can control the position of the paper P by controlling the drive of the motor M based on the number of steps counted by the step number counter.

ラベルプリンタ1は、PC(Personal Computer)などの外部端末との通信のための通信インタフェース34を備えている。通信インタフェース34は、外部端末とUSB(Universal Serial Bus)ケーブルまたはLAN(Local Area Network)ケーブルなどを介して有線通信する構成であってもよいし、電波などを介して無線通信する構成であってもよい。 The label printer 1 includes a communication interface 34 for communicating with an external terminal such as a PC (Personal Computer). The communication interface 34 may be configured to perform wired communication with an external terminal via a USB (Universal Serial Bus) cable or LAN (Local Area Network) cable, or may be configured to communicate wirelessly via radio waves or the like. Good too.

ラベルプリンタ1でシッピングラベルなどの画像を用紙Pに印刷する印刷ジョブが実行される際には、たとえば、ラベルプリンタ1に通信可能に接続された外部端末において、1ページ単位でプリンタ制御コマンドが生成される。プリンタ制御コマンドは、画像の印刷のためにラベルプリンタ1を制御するコマンドであって、印刷対象の画像における文字の位置や文字種、図形の位置などの情報を含む印刷データをページ記述言語で記述したものである。印刷ジョブが複数ページにわたる画像を用紙Pに印刷する内容である場合、複数ページの各ページのプリンタ制御コマンドが生成される。外部端末でプリンタ制御コマンドが生成されると、外部端末にインストールされたプリンタドライバの機能により、印刷ジョブの実行の指令に続いて、1ページ目のプリンタ制御コマンドから順に、全ページのプリント制御コマンドがラベルプリンタ1に送信される。 When the label printer 1 executes a print job to print an image such as a shipping label on paper P, for example, an external terminal communicably connected to the label printer 1 generates printer control commands for each page. be done. The printer control command is a command that controls the label printer 1 to print an image, and is a command that describes print data including information such as the position of characters, character type, and position of figures in the image to be printed in a page description language. It is something. If the print job is to print images over multiple pages on paper P, printer control commands for each of the multiple pages are generated. When a printer control command is generated on an external terminal, the function of the printer driver installed on the external terminal generates print control commands for all pages in order, starting with the printer control command for the first page, following the command to execute the print job. is sent to the label printer 1.

<頭出し処理>
ラベルプリンタ1のCPU31は、外部端末から印刷ジョブの実行の指令を通信インタフェース34を介して受信すると、図3に示される頭出し処理を実行する。
<Cueing process>
When the CPU 31 of the label printer 1 receives an instruction to execute a print job from an external terminal via the communication interface 34, the CPU 31 executes the cue processing shown in FIG. 3.

頭出し処理では、CPU31は、モータM(モータMを駆動するモータドライバ)に搬送ローラ16,17を送り出し方向に駆動する指令を出す。搬送ローラ16,17が送り出し方向に駆動されることにより、用紙Pの搬送方向が用紙ロールRから排出口12に向かう順方向となる(S11)。 In the cueing process, the CPU 31 issues a command to the motor M (a motor driver that drives the motor M) to drive the conveyance rollers 16 and 17 in the sending direction. By driving the conveyance rollers 16 and 17 in the sending direction, the conveyance direction of the paper P becomes the forward direction from the paper roll R toward the discharge port 12 (S11).

用紙Pが順方向に搬送されながら、CPU31により、矩形領域処理が実行される(S12)。 While the paper P is being transported in the forward direction, the CPU 31 executes rectangular area processing (S12).

矩形領域処理では、図4に示されるように、CPU31が読取装置22に読み取りの開始の指令を出し、その指令に応じて、読取装置22が読み取りを開始する(S121)。その後、CPU31は、用紙Pの搬送方向と平行な副走査方向に長さAの領域が読取装置22に読み取られたか否かを判断する(S122)。CPU31は、用紙Pが順方向に長さAにわたって搬送されて、副走査方向に長さAの領域が読取装置22に読み取られたと判断するまで、その読取装置22による読み取りを継続させる(S122:NO)。 In the rectangular area processing, as shown in FIG. 4, the CPU 31 issues a command to the reading device 22 to start reading, and in response to the command, the reading device 22 starts reading (S121). Thereafter, the CPU 31 determines whether or not an area of length A has been read by the reading device 22 in the sub-scanning direction parallel to the conveyance direction of the paper P (S122). The CPU 31 causes the reading device 22 to continue reading until it is determined that the paper P has been conveyed over a length A in the forward direction and an area of length A in the sub-scanning direction has been read by the reading device 22 (S122: NO).

CPU31は、副走査方向に長さAの領域が読取装置22に読み取られたと判断すると(S122:YES)、読取装置22に読み取られた画像データから、用紙Pの幅方向の両側のエッジを検出する(S123)。幅方向は、用紙Pの搬送方向と直交する方向であって、読取装置22による読み取りにおける主走査方向と一致する方向である。用紙Pの表面の色が白色であるのに対しプラテン23の表面の色が黒色であるので、CPU31は、たとえば、主走査方向において画像データの値(画素値)が閾値を跨ぐ箇所をエッジの位置として検出する。なお、読取装置22による読取可能位置に用紙Pが存在せず、CPU31により、用紙Pのエッジが検出されない場合、たとえば、読取装置22に読み取られた領域における幅方向の両側の最端の画素がエッジとして検出される。 When the CPU 31 determines that the area of length A in the sub-scanning direction has been read by the reading device 22 (S122: YES), the CPU 31 detects edges on both sides of the sheet P in the width direction from the image data read by the reading device 22. (S123). The width direction is a direction perpendicular to the conveyance direction of the paper P, and is a direction that coincides with the main scanning direction in reading by the reading device 22. Since the surface color of the paper P is white, and the surface color of the platen 23 is black, the CPU 31, for example, identifies the portion where the image data value (pixel value) crosses the threshold value in the main scanning direction as an edge. Detect as position. Note that if the paper P does not exist in a position that can be read by the reading device 22 and the edge of the paper P is not detected by the CPU 31, for example, the endmost pixels on both sides in the width direction in the area read by the reading device 22 Detected as an edge.

その後、CPU31は、主走査方向の両側のエッジ間に含まれる画像データ数を2以上の所定数で除算し、その除算値を1ブロックの主走査方向の長さBに決定する。つづいて、CPU31は、1ブロックの主走査方向の長さBに基づいて、読取装置22により読み取られた画像データを主走査方向に列をなして並ぶ所定数のブロックに分割する(S124)。 After that, the CPU 31 divides the number of image data included between the edges on both sides in the main scanning direction by a predetermined number of 2 or more, and determines the divided value as the length B of one block in the main scanning direction. Subsequently, the CPU 31 divides the image data read by the reading device 22 into a predetermined number of blocks arranged in rows in the main scanning direction, based on the length B of one block in the main scanning direction (S124).

そして、CPU31は、副走査方向の長さが長さAであり、主走査方向の長さが長さB×所定数である矩形領域(以下、「対象矩形領域」という。)に含まれる全ブロックについて、ブロック毎にそのブロックが用紙ありブロック、用紙なしブロックおよび破損ブロックのいずれに属するかを判定するブロック種判定処理を実行する(S125)。ブロック種判定処理の詳細については、後述する。 Then, the CPU 31 selects all the areas included in a rectangular area (hereinafter referred to as "target rectangular area") whose length in the sub-scanning direction is length A and whose length in the main scanning direction is length B x a predetermined number. For each block, block type determination processing is executed to determine whether the block belongs to a block with paper, a block without paper, or a damaged block (S125). Details of the block type determination process will be described later.

1ブロックについてブロック種判定処理を実行する度に、CPU31は、対象矩形領域に含まれる全ブロックについてブロック種判定処理を実行したか否かを判断する(S126)。 Each time the block type determination process is executed for one block, the CPU 31 determines whether the block type determination process has been executed for all blocks included in the target rectangular area (S126).

全ブロックのブロック種の判定が完了していなければ(S126:NO)、CPU31は、ブロック種判定処理を繰り返す(S125)。全ブロックのブロック種の判定が完了すると(S126:YES)、CPU31は、対象矩形領域に含まれる全ブロックが用紙ありブロックであるかどうかを判定する(S127)。全ブロックが用紙ありブロックである場合(S127:YES)、CPU31は、さらに、各ブロックの画素値の平均値の差が一定値以上あるかを判定する(S128)。各ブロックの画素値の平均値の差が一定値以上である場合(S128:YES)、用紙Pの表面状態が均一ではない(表面が薄く破りとられている、あるいは、汚れ、傷、穴等がある)と考えられるので、CPU31は、平均値の最大または最小のブロックを破損ブロックに属するとの判定にブロック種判定処理での用紙ありブロックであるとの判定を変更する(S129)。これにより、表面状態も考慮した印刷開始位置の決定が可能となる。判定変更後、CPU31は、矩形領域処理を終了する。また、対象矩形領域に含まれる全ブロックが用紙ありブロックではない場合(S127:NO)、全ブロックが用紙ありブロックであるが、各ブロックの画素値の平均値の差が一定値未満である場合(S128:NO)、CPU31は、ブロック種の判定を変更せずに、矩形領域処理を終了する。 If the block type determination of all blocks has not been completed (S126: NO), the CPU 31 repeats the block type determination process (S125). When the determination of the block types of all blocks is completed (S126: YES), the CPU 31 determines whether all blocks included in the target rectangular area are blocks with paper (S127). If all the blocks are blocks with paper (S127: YES), the CPU 31 further determines whether the difference between the average values of the pixel values of each block is greater than or equal to a certain value (S128). If the difference between the average pixel values of each block is more than a certain value (S128: YES), the surface condition of the paper P is not uniform (the surface is thinly torn, dirt, scratches, holes, etc.). Therefore, the CPU 31 changes the determination that the block with the maximum or minimum average value is a block with paper in the block type determination process to determine that the block with the maximum or minimum average value belongs to the damaged block (S129). This makes it possible to determine the printing start position taking into consideration the surface condition. After changing the determination, the CPU 31 ends the rectangular area processing. Also, if all the blocks included in the target rectangular area are not blocks with paper (S127: NO), or if all the blocks are blocks with paper, but the difference between the average values of pixel values of each block is less than a certain value (S128: NO), the CPU 31 ends the rectangular area processing without changing the block type determination.

ブロック種判定処理では、CPU31は、たとえば、図5に示されるように、ブロックに含まれる画素値の平均値を算出する(S1251)。CPU31は、その算出した平均値が第1閾値以上であるか否かを判定する(S1252)。 In the block type determination process, for example, as shown in FIG. 5, the CPU 31 calculates the average value of pixel values included in the block (S1251). The CPU 31 determines whether the calculated average value is greater than or equal to the first threshold (S1252).

画素値が「0」(黒色)~「255」(白色)の範囲の値をとり、用紙Pが白紙である場合、第1閾値は、最大値「255」に近い値に設定される。判定対象のブロックに対応する読取領域が用紙Pの表面である場合、そのブロックに含まれる各画素値は、最大値「255」に近い値、たとえば、「221」~「255」の範囲の値となり、ブロックに含まれる画素値の平均値もまた、最大値「255」に近い値となる。したがって、CPU31は、ブロックに含まれる画素値の平均値が第1閾値(たとえば、221)以上である場合(S1252:YES)、そのブロックが用紙Pの表面を読み取った画像データで構成される用紙ありブロックであると判定する(S1253)。なお、第1閾値は、用紙Pの地色に応じて適宜変更可能である。 When the pixel value takes a value in the range of "0" (black) to "255" (white) and the paper P is blank, the first threshold value is set to a value close to the maximum value "255". When the reading area corresponding to the block to be determined is on the front surface of paper P, each pixel value included in that block is a value close to the maximum value "255", for example, a value in the range of "221" to "255". Therefore, the average value of the pixel values included in the block also becomes a value close to the maximum value "255". Therefore, if the average value of the pixel values included in the block is equal to or greater than the first threshold value (for example, 221) (S1252: YES), the CPU 31 determines that the block is a sheet of paper that is composed of image data obtained by reading the front surface of the sheet of paper P. It is determined that the block is a valid block (S1253). Note that the first threshold value can be changed as appropriate depending on the background color of the paper P.

ブロックに含まれる画素値の平均値が第1閾値以上でない場合(S1252:NO)、つまり平均値が第1閾値未満である場合、CPU31は、その平均値が第2閾値未満であるか否かを判定する(S1254)。第2閾値は、第1閾値よりも小さい値であって、画素値の最小値「0」に近い値に設定される。判定対象のブロックに対応する読取領域がプラテン23の表面である場合、そのブロックに含まれる各画素値は、最小値「0」に近い値、たとえば、「1」~「100」の範囲の値となり、ブロックに含まれる画素値の平均値もまた、最小値「0」に近い値となる。また、判定対象のブロックに対応する読取領域に用紙Pの先端(切り口)が含まれる場合、言い換えれば、その読取領域に用紙Pの表面とプラテン23の表面との両方が含まれる場合、ブロックに含まれる画素値の平均値は、「0」~「255」の範囲の中間値、たとえば、中間値「101」~「220」の範囲の値となる。したがって、CPU31は、ブロックに含まれる画素値の平均値が第2閾値(たとえば、101)未満である場合(S1254:YES)、そのブロックがプラテン23の表面を読み取った画像データで構成される用紙なしブロックであると判定する(S1255)。また、CPU31は、ブロックに含まれる画素値の平均値が第2閾値未満でない場合(S1254:NO)、つまり画素値の平均値が第1閾値未満かつ第2閾値以上である場合、そのブロックが用紙Pの先端を含む領域を読み取った画像データで構成される破損ブロックであると判定する(S1256)。 If the average value of the pixel values included in the block is not greater than or equal to the first threshold (S1252: NO), that is, if the average value is less than the first threshold, the CPU 31 determines whether the average value is less than the second threshold. is determined (S1254). The second threshold is set to a value smaller than the first threshold and close to the minimum value "0" of pixel values. When the reading area corresponding to the block to be determined is the surface of the platen 23, each pixel value included in that block is a value close to the minimum value "0", for example, a value in the range of "1" to "100". Therefore, the average value of the pixel values included in the block also becomes a value close to the minimum value "0". Furthermore, if the reading area corresponding to the block to be determined includes the leading edge (cut edge) of the paper P, in other words, if the reading area includes both the surface of the paper P and the surface of the platen 23, the block The average value of the included pixel values is an intermediate value in the range of "0" to "255", for example, a value in the range of intermediate values "101" to "220". Therefore, if the average value of the pixel values included in the block is less than the second threshold (for example, 101) (S1254: YES), the CPU 31 determines that the block is composed of the image data obtained by reading the surface of the platen 23. It is determined that the block is a blank block (S1255). Further, if the average value of the pixel values included in the block is not less than the second threshold (S1254: NO), that is, if the average value of the pixel values is less than the first threshold and greater than or equal to the second threshold, the CPU 31 determines that the block is It is determined that the area including the leading edge of the paper P is a damaged block composed of image data read (S1256).

なお、矩形領域処理における各ブロックの画素値の平均値の差の一定値は、ブロック種判定処理の例に合わせると、「20」程度となる。 Note that the constant value of the difference between the average values of pixel values of each block in the rectangular area processing is about "20" in accordance with the example of the block type determination processing.

矩形領域処理の終了後、CPU31は、図3に示される頭出し処理に戻って、対象矩形領域の全ブロックが用紙ありブロックであるか否かを判定する(S13)。全ブロックが用紙ありブロックである場合、図6に示されるように、読取装置22の読取位置に用紙Pの先端よりも搬送方向上流側の部分が位置している状態である。この状態から用紙Pの先端を検出するためには、用紙Pを順方向とは逆の逆方向、つまり排出口12から用紙ロールRに向かう方向に搬送しなければならない。一方、対象矩形領域の全ブロックが用紙ありブロックではない場合、図7に示されるように、読取装置22の読取位置に用紙Pが存在しない状態であるか、または、図8に示されるように、読取装置22の読取位置に用紙Pの先端が位置している状態である。したがって、それらの状態から用紙Pの先端を検出するためには、用紙Pを順方向に搬送しなければならない。 After completing the rectangular area processing, the CPU 31 returns to the cueing process shown in FIG. 3 and determines whether all blocks in the target rectangular area are paper blocks (S13). When all the blocks are blocks with paper, as shown in FIG. 6, a portion of the paper P upstream of the leading edge of the paper P in the transport direction is located at the reading position of the reading device 22. In order to detect the leading edge of the paper P in this state, the paper P must be transported in the opposite direction to the forward direction, that is, in the direction from the discharge port 12 to the paper roll R. On the other hand, if all the blocks in the target rectangular area are not blocks with paper, as shown in FIG. 7, there is no paper P at the reading position of the reading device 22, or as shown in FIG. , the leading edge of the paper P is located at the reading position of the reading device 22. Therefore, in order to detect the leading edge of the paper P from these conditions, the paper P must be transported in the forward direction.

CPU31は、対象矩形領域の全ブロックが用紙ありブロックであると判定した場合(S13:YES)、用紙Pが逆方向に搬送されるよう、モータMに搬送ローラ16,17を送り出し方向とは逆の巻き戻し方向に駆動する指令を出す(S14)。用紙Pが逆方向に搬送開始されると、CPU31は、用紙Pにおける使用可能領域の先頭位置を探索するため、矩形領域処理を新たに実行する(S15)。そして、CPU31は、新たに実行した矩形領域処理の結果から、新たな矩形対象処理における対象矩形領域に用紙なしブロックまたは破損ブロックが含まれているか否かを判断する。対象矩形領域に用紙なしブロックまたは破損ブロックが含まれていない場合、CPU31は、その対象矩形領域に対して順方向の下流側に隣接する対象矩形領域にブロックに用紙なしブロックまたは破損ブロックが含まれているか否かを判断する。こうして、CPU31は、用紙なしブロックまたは破損ブロックが含まれる対象矩形領域を検出するまで、用紙Pの逆方向の搬送を継続させ、矩形領域処理を繰り返し実行する。 If the CPU 31 determines that all blocks in the target rectangular area are blocks with paper (S13: YES), the CPU 31 causes the motor M to move the transport rollers 16 and 17 in the opposite direction to the feeding direction so that the paper P is transported in the opposite direction. A command to drive in the rewinding direction is issued (S14). When the paper P starts to be transported in the reverse direction, the CPU 31 newly executes rectangular area processing in order to search for the leading position of the usable area on the paper P (S15). Then, the CPU 31 determines whether or not the target rectangular area in the new rectangular target process includes a paperless block or a damaged block based on the result of the newly executed rectangular area process. If the target rectangular area does not include a paper-out block or a damaged block, the CPU 31 determines whether a paper-out block or a damaged block is included in the target rectangular area adjacent to the target rectangular area on the downstream side in the forward direction. Determine whether or not. In this way, the CPU 31 continues conveying the paper P in the reverse direction and repeatedly executes the rectangular area processing until it detects the target rectangular area that includes the paperless block or the damaged block.

CPU31は、用紙なしブロックまたは破損ブロックが含まれている対象矩形領域を検出すると(S16:YES)、図9に示されるように、その対象矩形領域における順方向の最上流位置を用紙Pにおける使用可能領域の先頭位置に決定する(S17)。また、CPU31は、その先頭位置を印刷ヘッド21による印刷可能位置まで戻すのに必要となる戻し搬送距離を決定する(S17)。 When the CPU 31 detects a target rectangular area that includes a paperless block or a damaged block (S16: YES), as shown in FIG. The starting position of the possible area is determined (S17). Further, the CPU 31 determines the return conveyance distance required to return the leading position to the position where printing can be performed by the print head 21 (S17).

その後、CPU31は、用紙Pが逆方向に搬送されるよう、モータMに搬送ローラ16,17を送り出し方向とは逆の巻き戻し方向に駆動する指令を出す(S18)。この指令の出力後、CPU31は、用紙Pの逆方向の搬送距離が先に決定した戻し搬送距離に到達したと判断すると(S19:YES)、用紙Pの逆方向の搬送が停止されるよう、モータMに駆動を停止する指令を出し(S20)、頭出し処理を終了する。 After that, the CPU 31 issues a command to the motor M to drive the conveying rollers 16 and 17 in the rewinding direction, which is opposite to the feeding direction, so that the paper P is conveyed in the opposite direction (S18). After outputting this command, when the CPU 31 determines that the conveyance distance in the reverse direction of the paper P has reached the previously determined return conveyance distance (S19: YES), the CPU 31 sets a command so that the conveyance in the reverse direction of the paper P is stopped. A command is issued to the motor M to stop driving (S20), and the cue processing is completed.

一方、CPU31は、対象矩形領域の全ブロックが用紙ありブロックではないと判定した場合(S13:NO)、用紙Pが順方向に搬送されるよう、モータMに搬送ローラ16,17を送り出し方向に駆動する指令を出す(S21)。用紙Pが順方向に搬送開始されると、CPU31は、矩形領域処理を新たに実行する(S22)。そして、CPU31は、新たに実行した矩形領域処理の結果から、新たな矩形対象処理における対象矩形領域に含まれる全ブロックが用紙ありブロックであるかを判断する。対象矩形領域の全部ブロックが用紙ありブロックではない場合、CPU31は、その対象矩形領域に対して順方向の上流側に隣接する対象矩形領域の全ブロックが用紙ありブロックであるか否かを判断する。こうして、CPU31は、全ブロックが用紙ありブロックである対象矩形領域を検出するまで、用紙Pの順方向の搬送を継続させ、矩形領域処理を繰り返し実行する。 On the other hand, if the CPU 31 determines that all blocks in the target rectangular area are not blocks with paper (S13: NO), the CPU 31 causes the motor M to move the transport rollers 16 and 17 in the feeding direction so that the paper P is transported in the forward direction. A driving command is issued (S21). When the paper P starts to be transported in the forward direction, the CPU 31 newly executes rectangular area processing (S22). Then, the CPU 31 determines whether all blocks included in the target rectangular area in the new rectangular target process are blocks with paper based on the result of the newly executed rectangular area process. If all blocks in the target rectangular area are not blocks with paper, the CPU 31 determines whether all blocks in the target rectangular area adjacent to the upstream side in the forward direction with respect to the target rectangular area are blocks with paper. . In this way, the CPU 31 continues transporting the paper P in the forward direction and repeatedly executes the rectangular area processing until it detects a target rectangular area in which all blocks are blocks with paper.

CPU31は、全ブロックが用紙ありブロックである対象矩形領域を検出すると(S23:YES)、図10に示されるように、その対象矩形領域における順方向の最下流位置を用紙Pにおける使用可能領域の先頭位置に決定する(S17)。また、CPU31は、その先頭位置を印刷ヘッド21による印刷可能位置まで戻すのに必要となる戻し搬送距離を決定する(S17)。 When the CPU 31 detects a target rectangular area in which all blocks are blocks with paper (S23: YES), as shown in FIG. The first position is determined (S17). Further, the CPU 31 determines the return conveyance distance required to return the leading position to the position where printing can be performed by the print head 21 (S17).

その後、CPU31は、用紙Pが逆方向に搬送されるよう、モータMに搬送ローラ16,17を送り出し方向とは逆の巻き戻し方向に駆動する指令を出す(S18)。この指令の出力後、CPU31は、用紙Pの逆方向の搬送距離が先に決定した戻し搬送距離に到達したと判断すると(S19:YES)、用紙Pの逆方向の搬送が停止されるよう、モータMに駆動を停止する指令を出し(S20)、頭出し処理を終了する。 After that, the CPU 31 issues a command to the motor M to drive the conveying rollers 16 and 17 in the rewinding direction, which is opposite to the feeding direction, so that the paper P is conveyed in the opposite direction (S18). After outputting this command, when the CPU 31 determines that the conveyance distance in the reverse direction of the paper P has reached the previously determined return conveyance distance (S19: YES), the CPU 31 sets a command so that the conveyance in the reverse direction of the paper P is stopped. A command is issued to the motor M to stop driving (S20), and the cue processing is completed.

<作用効果>
以上のように、用紙Pが読取装置22により読み取られて、その読み取りにより得られた画像データを元に、モータMによる搬送ローラ16,17の駆動方向が決定される。そして、その決定された駆動方向に応じた搬送方向に用紙Pが搬送されながら、用紙Pが読取装置22により読み取られて、用紙Pの使用可能領域の先頭位置が探索される。この探索結果に基づくことにより、用紙Pの表面の状態にかかわらず、印刷ヘッド21による画像の印刷開始位置を用紙Pの使用可能領域の先頭位置に正しく設定することができる。
<Effect>
As described above, the paper P is read by the reading device 22, and the driving direction of the conveyance rollers 16 and 17 by the motor M is determined based on the image data obtained by the reading. Then, while the paper P is being transported in the transport direction corresponding to the determined driving direction, the paper P is read by the reading device 22, and the leading position of the usable area of the paper P is searched. Based on this search result, the print start position of the image by the print head 21 can be correctly set to the leading position of the usable area of the paper P, regardless of the surface condition of the paper P.

先頭位置の探索のため、用紙Pが順方向に搬送されながら、副走査方向に長さAの領域が読取装置22に読み取られる。読取装置22に読み取られた画像データから、用紙Pの幅方向である副走査方向の両側のエッジが検出される。その後、両側のエッジ間に含まれる画像データが所定数のブロックに分割されて、各ブロックが用紙ありブロック、用紙なしブロックおよび破損ブロックのいずれに属するかが判定される。 To search for the leading position, the reading device 22 reads an area of length A in the sub-scanning direction while the paper P is being conveyed in the forward direction. From the image data read by the reading device 22, edges on both sides of the paper P in the sub-scanning direction, which is the width direction, are detected. Thereafter, the image data included between the edges on both sides is divided into a predetermined number of blocks, and it is determined whether each block belongs to a block with paper, a block without paper, or a damaged block.

エッジ間の対象矩形領域に含まれる全ブロックが用紙ありブロックである場合には、用紙Pが逆方向に搬送されて、用紙なしブロックまたは破損ブロックが含まれる対象矩形領域が探索される。そして、用紙なしブロックまたは破損ブロックが含まれる対象矩形領域が検出されると、その対象矩形領域における順方向の最上流位置が用紙Pにおける使用可能領域の先頭位置に決定される。一方、エッジ間の対象矩形領域に含まれる全ブロックが用紙ありブロックではない場合、つまりエッジ間の対象矩形領域に用紙なしブロックまたは破損ブロックが含まれる場合には、用紙Pが順方向に搬送されて、用紙なしブロックおよび破損ブロックが含まれない対象矩形領域、つまり全ブロックが用紙ありブロックである対象矩形領域が探索される。そして、全ブロックが用紙ありブロックである対象矩形領域が検出されると、その対象矩形領域における順方向の最下流位置が用紙Pにおける使用可能領域の先頭位置に決定される。これにより、用紙Pの表面が薄く破り取られた状態になっている部分などの印刷に適さない部分が使用可能領域に含まれることなく、使用可能領域を最大限に確保でき、用紙Pの印刷に使用可能な領域が無駄に廃棄されることを抑制できる。 If all the blocks included in the target rectangular area between the edges are blocks with paper, the paper P is conveyed in the opposite direction, and the target rectangular area including the block without paper or the damaged block is searched. Then, when a target rectangular area including a paperless block or a damaged block is detected, the most upstream position in the forward direction in the target rectangular area is determined to be the leading position of the usable area on the paper P. On the other hand, if all the blocks included in the target rectangular area between the edges are not blocks with paper, that is, if the target rectangular area between the edges includes blocks without paper or damaged blocks, the paper P is transported in the forward direction. Then, a target rectangular area that does not include paperless blocks and damaged blocks, that is, a target rectangular area in which all blocks are paper blocks, is searched. Then, when a target rectangular area in which all blocks are sheets-containing blocks is detected, the most downstream position in the forward direction in the target rectangular area is determined to be the leading position of the usable area on the paper P. As a result, the usable area can be maximized without including parts unsuitable for printing, such as parts where the surface of the paper P has been torn off thinly, and the usable area can be secured to the maximum. This can prevent usable areas from being wasted.

<変形例>
以上、本発明の一実施形態について説明したが、本発明は、他の形態で実施することもできる。
<Modified example>
Although one embodiment of the present invention has been described above, the present invention can also be implemented in other forms.

たとえば、前述の実施形態では、用紙Pの幅方向の両側のエッジが検出され、それらのエッジ間に含まれる画像データ数を所定数で除算した除算値が1ブロックの主走査方向の長さBに決定され、その長さBに基づいて、対象矩形領域が所定数のブロックに分割されるとした。これに限らず、用紙Pの幅方向の両側のエッジが検出され、図11に示されるように、一方のエッジを基準として、読取装置22に読み取られた画像データが予め定められた画像データ数C(長さC)毎のブロックに分割されて、その分割された全ブロックを含む領域が対象矩形領域とされてもよい。 For example, in the above embodiment, the edges on both sides of the paper P in the width direction are detected, and the division value obtained by dividing the number of image data included between these edges by a predetermined number is the length B of one block in the main scanning direction. It is assumed that the target rectangular area is divided into a predetermined number of blocks based on the length B. The present invention is not limited to this, and the edges on both sides of the paper P in the width direction are detected, and as shown in FIG. The target rectangular area may be divided into blocks of C (length C) and include all the divided blocks.

また、前述の実施形態では、CPU31がラベルプリンタ1における各処理を実行する場合について説明した。しかしながら、ラベルプリンタ1に複数のCPUが設けられて、複数のCPUが協働して各処理を実行してもよい。 Furthermore, in the embodiment described above, the case where the CPU 31 executes each process in the label printer 1 has been described. However, the label printer 1 may be provided with a plurality of CPUs, and the plurality of CPUs may cooperate to execute each process.

その他、前述の構成には、特許請求の範囲に記載された事項の範囲で種々の設計変更を施すことが可能である。 In addition, various design changes can be made to the above-described configuration within the scope of the claims.

1:ラベルプリンタ
16,17:搬送ローラ
21:印刷ヘッド
22:読取装置
31:CPU
M:モータ
P:用紙
1: Label printer 16, 17: Conveyance roller 21: Print head 22: Reading device 31: CPU
M: Motor P: Paper

Claims (10)

長尺の印刷用紙を搬送する搬送部と、
前記搬送部を駆動する駆動部と、
前記搬送部により搬送される印刷用紙に画像を印刷する印刷部と、
印刷用紙の搬送方向と直交する幅方向において、印刷用紙を全幅にわたって読み取り可能な読取部と、
制御部と、を備え、
前記読取部は、前記印刷部に対して前記印刷部による印刷時の印刷用紙の搬送方向の下流側に配置され、
前記制御部は、
前記印刷部による印刷時と同じ送り出し方向に前記搬送部を駆動するよう前記駆動部に指令を出す第一駆動処理と、
前記第一駆動処理による指令を出した後、前記読取部に読み取りの開始の指令を出し、前記読取部に印刷用紙を読み取らせる第一読取処理と、
前記第一読取処理により前記読取部に読み取られた画像データを元に、前記搬送部の駆動方向を前記送り出し方向または前記送り出し方向と逆の巻き戻し方向に決定して、決定した方向に前記搬送部を駆動するよう前記駆動部に指令を出す第二駆動処理と、
前記第二駆動処理による指令を出した後、前記読取部に読み取りの開始の指令を出し、前記読取部に印刷用紙を読み取らせる第二読取処理と、
前記第二読取処理により前記読取部に読み取られた画像データを元に、前記搬送方向の長さが所定距離であり、かつ、前記幅方向の長さが所定幅である矩形領域を設定して、全域が印刷用紙の表面である前記矩形領域を検出し、検出した前記矩形領域を元に、印刷用紙の使用可能領域の先頭位置を探索して決定する先頭探索処理と、
前記先頭探索処理で決定された前記先頭位置を元に、前記巻き戻し方向に応じた印刷用紙の搬送方向である逆方向の搬送距離を決定して、決定した搬送距離を印刷用紙が前記逆方向に搬送されるよう前記駆動部に指令を出す第三駆動処理と、を実行する、
プリンタ。
A transport unit that transports long printing paper;
a drive unit that drives the transport unit;
a printing unit that prints an image on printing paper conveyed by the conveyance unit;
a reading section that can read the entire width of the printing paper in the width direction perpendicular to the conveying direction of the printing paper;
comprising a control unit;
The reading unit is disposed on the downstream side of the printing unit in the conveying direction of printing paper when printing by the printing unit,
The control unit includes:
a first driving process for instructing the driving unit to drive the transporting unit in the same sending direction as when printing by the printing unit;
a first reading process that issues a command to the reading unit to start reading after issuing a command by the first drive process, and causes the reading unit to read the printing paper;
Based on the image data read by the reading unit in the first reading process, the driving direction of the conveyance unit is determined to be the feeding direction or the rewinding direction opposite to the feeding direction, and the conveyance is carried out in the determined direction. a second driving process for issuing a command to the driving section to drive the section;
After issuing a command by the second drive process, a second reading process instructs the reading unit to start reading, and causes the reading unit to read the printing paper;
A rectangular area whose length in the transport direction is a predetermined distance and whose length in the width direction is a predetermined width is set based on the image data read by the reading unit in the second reading process. , a head search process of detecting the rectangular area whose entire area is the front surface of the printing paper, and searching and determining the head position of the usable area of the printing paper based on the detected rectangular area;
Based on the leading position determined in the leading search process, a transporting distance in the opposite direction, which is the transporting direction of the printing paper according to the rewinding direction, is determined, and the printing paper travels the determined transporting distance in the reverse direction. performing a third drive process of issuing a command to the drive unit to be transported to the
printer.
請求項1に記載のプリンタであって、
前記制御部は、前記先頭探索処理において、
印刷用紙が前記第二駆動処理により前記所定距離だけ搬送される度に、前記矩形領域を設定して、前記読取部に読み取られた前記矩形領域の画像データを前記幅方向に列をなして並ぶ複数のブロックに分割するブロック化処理と、
前記ブロック化処理により分割された前記ブロック毎に、前記ブロックに含まれる画素の値を元に、前記ブロックが用紙ありブロック、用紙なしブロックおよび破損ブロックのいずれであるかを判定するブロック種判定処理と、を実行する、
プリンタ。
The printer according to claim 1,
In the head search process, the control unit includes:
Each time the printing paper is conveyed by the predetermined distance by the second drive process, the rectangular area is set, and the image data of the rectangular area read by the reading unit is arranged in a row in the width direction. Blocking processing to divide into multiple blocks,
Block type determination processing for determining whether the block is a block with paper, a block without paper, or a damaged block, based on the values of pixels included in the block, for each block divided by the blocking process. and execute,
printer.
請求項2に記載のプリンタであって、
前記制御部は、前記先頭探索処理において、
前記ブロック種判定処理の結果から、全ての前記ブロックが前記用紙ありブロックである前記矩形領域を見つけ、見つけた前記矩形領域に対して前記送り出し方向に応じた印刷用紙の搬送方向である順方向の下流側に隣接する前記矩形領域に前記用紙なしブロックまたは前記破損ブロックが含まれているか否かを判定し、隣接する前記矩形領域に前記用紙なしブロックまたは前記破損ブロックが含まれていると判定した場合、隣接する前記矩形領域の前記順方向の最上流位置を前記先頭位置と決定する、
プリンタ。
The printer according to claim 2,
In the head search process, the control unit includes:
From the result of the block type determination process, find the rectangular area in which all the blocks are blocks with paper, and perform a forward direction that is the conveying direction of the printing paper according to the feeding direction with respect to the found rectangular area. Determining whether or not the rectangular area adjacent to the downstream side includes the no paper block or the damaged block, and determining that the adjacent rectangular area includes the no paper block or the damaged block. If so, the most upstream position in the forward direction of the adjacent rectangular area is determined as the leading position;
printer.
請求項2に記載のプリンタであって、
前記制御部は、前記先頭探索処理において、
前記ブロック種判定処理の結果から、前記用紙なしブロックまたは前記破損ブロックが含まれる前記矩形領域を見つけ、見つけた前記矩形領域に対して前記送り出し方向に応じた印刷用紙の搬送方向である順方向の上流側に隣接する前記矩形領域の全ての前記ブロックが前記用紙ありブロックであるか否かを判定し、隣接する前記矩形領域の全ての前記ブロックが前記用紙ありブロックであると判定した場合、隣接する前記矩形領域の前記順方向の最下流位置を前記先頭位置と決定する、プリンタ。
The printer according to claim 2,
In the head search process, the control unit includes:
From the result of the block type determination process, find the rectangular area that includes the paperless block or the damaged block, and perform a forward direction that is the printing paper conveyance direction corresponding to the feeding direction with respect to the found rectangular area. It is determined whether all the blocks in the rectangular area adjacent to the upstream side are the blocks with paper, and if it is determined that all the blocks in the adjacent rectangular area are the blocks with paper, the adjacent The printer determines the most downstream position in the forward direction of the rectangular area to be the leading position.
請求項2~4のいずれか一項に記載のプリンタであって、
前記制御部は、前記ブロック化処理において、
前記読取部に読み取られた画像データから印刷用紙の前記幅方向の両側のエッジを検出し、検出した両側の前記エッジ間に含まれる画像データ数を所定数で除算することにより、前記ブロックの前記幅方向の長さを決定する、
プリンタ。
The printer according to any one of claims 2 to 4,
In the blocking process, the control unit includes:
The edges of the printing paper on both sides in the width direction are detected from the image data read by the reading unit, and the number of image data included between the detected edges on both sides is divided by a predetermined number. Determine the length in the width direction,
printer.
請求項2~4のいずれか一項に記載のプリンタであって、
前記制御部は、前記ブロック化処理において、
前記ブロックの前記幅方向の長さを予め定められた画素数とする、
プリンタ。
The printer according to any one of claims 2 to 4,
In the blocking process, the control unit includes:
The length of the block in the width direction is a predetermined number of pixels;
printer.
請求項6に記載のプリンタであって、
前記制御部は、前記ブロック化処理において、
前記読取部に読み取られた画像データから印刷用紙の前記幅方向の両側のエッジを検出し、一方の前記エッジを基準として前記予め定められた画素数毎の前記ブロックに分割する、
プリンタ。
7. The printer according to claim 6,
In the blocking process, the control unit includes:
detecting edges on both sides of the printing paper in the width direction from the image data read by the reading unit, and dividing into the blocks each having the predetermined number of pixels with one edge as a reference;
printer.
請求項2~7のいずれか一項に記載のプリンタであって、
前記制御部は、前記ブロック種判定処理において、
前記ブロック毎に、前記ブロックに含まれる画素の値の平均値を求め、前記平均値と予め定められた閾値との比較により、前記ブロックが前記用紙ありブロック、前記用紙なしブロックおよび前記破損ブロックのいずれであるかを判定する、
プリンタ。
The printer according to any one of claims 2 to 7,
In the block type determination process, the control unit includes:
For each block, the average value of the pixel values included in the block is calculated, and by comparing the average value with a predetermined threshold, it is determined whether the block is one of the blocks with paper, blocks without paper, and damaged blocks. Determine whether
printer.
請求項2~8のいずれか一項に記載のプリンタであって、
前記制御部は、前記先頭探索処理において、
前記矩形領域の全ての前記ブロックが前記用紙ありブロックであると判定した場合、各ブロックの画素値の平均値の差が一定以上であれば、各ブロックの画素値の平均値の最大または最小のブロックを破損ブロックに判定を変更する、
プリンタ。
The printer according to any one of claims 2 to 8,
In the head search process, the control unit includes:
When it is determined that all the blocks in the rectangular area are the paper-containing blocks, if the difference between the average values of pixel values of each block is greater than a certain value, the maximum or minimum of the average value of pixel values of each block is determined. Change the judgment of a block to a damaged block,
printer.
請求項1~9のいずれか一項に記載のプリンタであって、
前記制御部は、
前記先頭探索処理で前記先頭位置を決定した後、前記巻き戻し方向に前記搬送部を駆動するよう前記駆動部に指令を出し、前記先頭位置を前記印刷部による印刷可能位置に移動させる、
プリンタ。
The printer according to any one of claims 1 to 9,
The control unit includes:
After determining the leading position in the leading search process, issuing a command to the drive unit to drive the transport unit in the rewinding direction, and moving the leading position to a position where printing can be performed by the printing unit;
printer.
JP2019085747A 2019-04-26 2019-04-26 printer Active JP7363087B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2019085747A JP7363087B2 (en) 2019-04-26 2019-04-26 printer

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2019085747A JP7363087B2 (en) 2019-04-26 2019-04-26 printer

Publications (2)

Publication Number Publication Date
JP2020179636A JP2020179636A (en) 2020-11-05
JP7363087B2 true JP7363087B2 (en) 2023-10-18

Family

ID=73023601

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2019085747A Active JP7363087B2 (en) 2019-04-26 2019-04-26 printer

Country Status (1)

Country Link
JP (1) JP7363087B2 (en)

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2003205654A (en) 2002-01-11 2003-07-22 Brother Ind Ltd Image forming device
JP2005200196A (en) 2004-01-19 2005-07-28 Funai Electric Co Ltd Photo printer
JP2006035527A (en) 2004-07-23 2006-02-09 Katsuragawa Electric Co Ltd Page break detection device for continuous printing sheets
JP2006181834A (en) 2004-12-27 2006-07-13 Noritsu Koki Co Ltd Printer
JP2011137895A (en) 2009-12-26 2011-07-14 Fuji Xerox Co Ltd White-spot detector, image forming apparatus, and white-spot detection program
JP2012111152A (en) 2010-11-25 2012-06-14 Ricoh Co Ltd Image forming apparatus
JP2014100818A (en) 2012-11-19 2014-06-05 Ricoh Co Ltd Image formation device, front end alignment method and front end alignment program
JP2016132203A (en) 2015-01-21 2016-07-25 株式会社沖データ Image forming apparatus, image forming method, and image forming program

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH09188014A (en) * 1996-01-10 1997-07-22 Ricoh Co Ltd Printing equipment

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2003205654A (en) 2002-01-11 2003-07-22 Brother Ind Ltd Image forming device
JP2005200196A (en) 2004-01-19 2005-07-28 Funai Electric Co Ltd Photo printer
JP2006035527A (en) 2004-07-23 2006-02-09 Katsuragawa Electric Co Ltd Page break detection device for continuous printing sheets
JP2006181834A (en) 2004-12-27 2006-07-13 Noritsu Koki Co Ltd Printer
JP2011137895A (en) 2009-12-26 2011-07-14 Fuji Xerox Co Ltd White-spot detector, image forming apparatus, and white-spot detection program
JP2012111152A (en) 2010-11-25 2012-06-14 Ricoh Co Ltd Image forming apparatus
JP2014100818A (en) 2012-11-19 2014-06-05 Ricoh Co Ltd Image formation device, front end alignment method and front end alignment program
JP2016132203A (en) 2015-01-21 2016-07-25 株式会社沖データ Image forming apparatus, image forming method, and image forming program

Also Published As

Publication number Publication date
JP2020179636A (en) 2020-11-05

Similar Documents

Publication Publication Date Title
JP4999962B2 (en) Printing apparatus and printing method
US8833893B2 (en) Method of printing and printing apparatus
US9358812B2 (en) Printing apparatus for detecting and avoiding unprintable regions on recording mediums
JP5014462B2 (en) Printing apparatus and sheet processing apparatus
JP5669435B2 (en) How to print
JP6460715B2 (en) Control device, control method and program
JP7226022B2 (en) printer
EP3360685B1 (en) Printer and printer control method
JP2012089922A (en) Image reading device
JP5959978B2 (en) Printing method and printing sheet used therefor
JP5995590B2 (en) Printing method and printing sheet used therefor
JP5312639B2 (en) Printing apparatus and control method thereof
US9073309B1 (en) Apparatus and method for recording
JP5084854B2 (en) Printing device
JP6008639B2 (en) Printing method and printing apparatus
JP5959977B2 (en) Printing method and printing sheet used therefor
JP7363087B2 (en) printer
JP5539444B2 (en) Control method of printing apparatus
US9227399B2 (en) Control method, printing sheet used therefor, and printing apparatus
US9308718B2 (en) Printing appararus and printing control method
JP7639489B2 (en) Printers and Printing Systems
JP5921735B2 (en) Printing device
JP6004813B2 (en) Control method of printing apparatus, continuous sheet and printing apparatus
JP2017024257A (en) Sheet processing method
JP2024068417A (en) Printing device and mark detection device

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20220315

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20230130

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20230207

A601 Written request for extension of time

Free format text: JAPANESE INTERMEDIATE CODE: A601

Effective date: 20230407

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20230531

TRDD Decision of grant or rejection written
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20230905

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20230918

R150 Certificate of patent or registration of utility model

Ref document number: 7363087

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150