JP2005208809A - Document analysis device and method, program for document analysis device, and printer - Google Patents

Document analysis device and method, program for document analysis device, and printer Download PDF

Info

Publication number
JP2005208809A
JP2005208809A JP2004013071A JP2004013071A JP2005208809A JP 2005208809 A JP2005208809 A JP 2005208809A JP 2004013071 A JP2004013071 A JP 2004013071A JP 2004013071 A JP2004013071 A JP 2004013071A JP 2005208809 A JP2005208809 A JP 2005208809A
Authority
JP
Japan
Prior art keywords
background
cell
specified
document
cells
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.)
Pending
Application number
JP2004013071A
Other languages
Japanese (ja)
Inventor
Hirotaka Akamatsu
裕隆 赤松
Shigeki Kazuma
茂樹 数馬
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.)
Seiko Epson Corp
Original Assignee
Seiko Epson Corp
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 Seiko Epson Corp filed Critical Seiko Epson Corp
Priority to JP2004013071A priority Critical patent/JP2005208809A/en
Publication of JP2005208809A publication Critical patent/JP2005208809A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Document Processing Apparatus (AREA)
  • Editing Of Facsimile Originals (AREA)

Abstract

<P>PROBLEM TO BE SOLVED: To further properly and rapidly perform a background processing of tables, lines and cells. <P>SOLUTION: In an XHTML document, when it is designated to provide a space between cells, the background of a cell is designated to be transparent as backgrounds of cells, lines and tables arranged in layers in order of cells, lines, and tables from the upper layer, and the background of the line that this cell belongs to is designated to other than transparent, the tables, lines and cells are laid out while setting the background of the cell to the background of the line this cell belongs to and setting the background of the line to out of the object of drawing (transparent), and drawn and printed. According to this, the space between cells can be regularly filled with the background of the table of the bottom layer by simple processing, and the inside of the frame of the transparent cell is filled with the background of the line one layer below. <P>COPYRIGHT: (C)2005,JPO&NCIPI

Description

本発明は、文書解析装置およびその方法並びに文書解析装置用のプログラム、印刷装置に関し、詳しくは、所定の書式で記述された構造化文書を解析して出力する文書解析装置およびその方法並びに文書解析装置用のプログラム、印刷装置に関する。   The present invention relates to a document analysis apparatus and method, a program for the document analysis apparatus, and a printing apparatus. More specifically, the present invention relates to a document analysis apparatus and method for analyzing and outputting a structured document described in a predetermined format, and document analysis. The present invention relates to a device program and a printing device.

従来、この種の文書解析装置としては、HTML(Hyper Text Markup Language)などのマークアップ言語により記述された構造化文書で指定された表を解析しレイアウトして出力するものが種々提案されている(例えば、特許文献1参照)。   Conventionally, as this type of document analysis device, various devices that analyze, lay out, and output a table designated by a structured document described in a markup language such as HTML (Hyper Text Markup Language) have been proposed. (For example, refer to Patent Document 1).

HTML文書などの構造化文書では、表の構成要素としての表要素や行要素(行グループも含む),列要素(列グループも含む),セル要素それぞれに背景特性を指定することができ、指定された背景は上層からセル要素,行要素,列要素,表要素の順に層をなすように配置される。例えば、セル要素と行要素と表要素とに背景特性が指定された場合では、最上層に位置するセルは、その背景が透明のときに一つ下層の行の背景が透けて見え、行の背景も透明であるときには最下層の表の背景が透けて見えるようになる。
特開2000−242641号公報
In a structured document such as an HTML document, background characteristics can be specified for each table element, row element (including row group), column element (including column group), and cell element as table components. The backgrounds arranged are arranged in the order of cell elements, row elements, column elements, and table elements from the upper layer. For example, if the background property is specified for the cell element, row element, and table element, the cell located in the uppermost layer can be seen through the background of the next lower row when the background is transparent. When the background is also transparent, the background of the bottom layer can be seen through.
JP 2000-242641 A

こうした上述の文書解析装置では、表の背景の出力(表示や印刷)に不都合が生じる場合がある。例えば、セル間にスペースを設けた表組みが指定され、行要素の背景として透明以外の背景(背景色や背景画像)が指定されると共にその行要素に属するセル要素の背景として透明の背景が指定されたとき、セルの領域には行の背景が透けて見えることになるが、隣接するセル間のスペースの領域にも表の背景よりも層が上の行の背景が見える。これは、セル間のスペースは表要素の背景で埋めることとするWorld Wide Web Consortium(W3C)によるCSS(Cascading Style Sheets)の規定に反する。   In the above-described document analysis apparatus, there may be a problem in outputting (displaying or printing) the background of the table. For example, a table with spaces between cells is specified, a background other than transparent (background color or background image) is specified as the background of a row element, and a transparent background is specified as the background of a cell element belonging to the row element. When specified, the cell background will show through the row background, but the space between adjacent cells will show the background of the row above the table background. This is contrary to the provision of CSS (Cascading Style Sheets) by World Wide Web Consortium (W3C) in which the space between cells is filled with the background of the table element.

また、こうした文書解析装置をプリンタに搭載して印刷を行なうとき、上述した問題を解決するための背景の処理を簡易化して印刷処理を迅速に行なうことのできるアルゴリズムの構築が望まれている。   In addition, when such a document analysis apparatus is mounted on a printer and printing is performed, it is desired to construct an algorithm that can simplify the background process for solving the above-described problem and perform the printing process quickly.

本発明の文書解析装置およびその方法は、こうした問題を解決し、表を構成する各要素に指定された背景をより適切に処理して出力することを目的の一つとする。また、本発明の文書解析装置用のプログラムは、表を構成する各要素に指定された背景をより適切に処理することを目的の一つとする。さらに、本発明の印刷装置は、表を構成する各要素に指定された背景をより適切に処理して印刷することを目的の一つとする。   An object of the document analysis apparatus and method of the present invention is to solve such problems and to more appropriately process and output the background designated for each element constituting the table. Another object of the program for the document analysis apparatus of the present invention is to more appropriately process the background designated for each element constituting the table. Another object of the printing apparatus of the present invention is to more appropriately process and print the background specified for each element constituting the table.

本発明の文書解析装置およびその方法並びに文書解析装置用のプログラム、印刷装置は、上述の目的の少なくとも一部を達成するために以下の手段を採った。   The document analysis apparatus and method of the present invention, the program for the document analysis apparatus, and the printing apparatus employ the following means in order to achieve at least a part of the above object.

本発明の文書解析装置は、
所定の書式で記述された構造化文書を解析して出力する文書解析装置であって、
前記構造化文書が指定されたとき、該指定された構造化文書を受け付けて解析する解析手段と、
該解析された構造化文書に表組みの指定がなされた要素が含まれ、該要素に上層からセル要素,該セル要素を包含するセル包含要素,該セル包含要素を包含する表要素の順に層をなす背景が指定されると共にセル間にスペースを設ける指定がなされたときには、該セル間のスペースに前記表要素に指定された背景が出力されるよう前記セル要素,前記セル包含要素,前記表要素の背景を設定する背景設定手段と、
該解析された構造化文書に含まれる要素を順次レイアウトすると共に該レイアウトした要素を前記設定された背景をもって描画して出力する出力手段と
を備えることを要旨とする。
The document analysis apparatus of the present invention
A document analysis device that analyzes and outputs a structured document described in a predetermined format,
When the structured document is designated, an analysis means for accepting and analyzing the designated structured document;
The parsed structured document includes an element for which a table is specified, and the element includes a cell element from the upper layer, a cell inclusion element that includes the cell element, and a table element that includes the cell inclusion element. When a background is formed and a space between cells is specified, the background specified in the table element is output in the space between the cells. A background setting means for setting the background of the element;
The present invention includes an output unit that sequentially lays out elements included in the analyzed structured document and draws and outputs the laid out elements with the set background.

この本発明の文書解析装置では、構造化文書が指定されたときに指定された構造化文書を受け付けて解析し、解析した構造化文書に表組みの指定がなされた要素が含まれこの要素に上層からセル要素,セル要素を包含するセル包含要素,セル包含要素を包含する表要素の順に層をなす背景が指定されると共にセル間にスペースを設ける指定がなされたときには、セル間のスペースに表要素に指定された背景が出力されるようセル要素,セル包含要素,表要素の背景を設定し、解析した構造化文書に含まれる要素を順次レイアウトすると共にレイアウトした要素を設定された背景をもって描画して出力する。したがって、セル要素,セル包含要素,表要素の背景を設定することによりセル間のスペースに表要素の背景を出力することができる。ここで、「セル包含要素」としては、表の行を構成する行要素や表の列を構成する列要素が含まれる。また、「背景」としては、色や画像が含まれる。   In the document analysis apparatus according to the present invention, when a structured document is specified, the specified structured document is received and analyzed, and the analyzed structured document includes an element for which a table is specified, and this element includes When the background layering is specified in the order of the cell element from the upper layer, the cell containing element that contains the cell element, and the table element that contains the cell containing element, and the space between the cells is specified, the space between the cells Set the background of the cell element, cell inclusion element, and table element so that the background specified for the table element is output, sequentially lay out the elements contained in the analyzed structured document, and set the laid out elements with the set background Draw and output. Therefore, the background of the table element can be output in the space between the cells by setting the background of the cell element, the cell inclusion element, and the table element. Here, the “cell inclusion element” includes a row element constituting a table row and a column element constituting a table column. The “background” includes a color and an image.

こうした本発明の文書解析装置において、前記背景設定手段は、セル間にスペースを設ける指定がなされると共に前記セル包含要素に指定された背景が透明以外であるときには、該背景の指定に拘わらず該セル包含要素の背景を描画の対象外に設定する手段であるものとすることもできる。こうすれば、セル包含要素の背景を描画の対象外に設定するだけでセル間のスペースにセル包含要素よりも下層の表要素の背景を出力させることができる。   In such a document analysis apparatus of the present invention, the background setting means is configured to specify a space between cells and when the background specified for the cell inclusion element is other than transparent, the background setting means It may be a means for setting the background of the cell inclusion element out of the drawing target. In this way, it is possible to output the background of the table element below the cell inclusion element in the space between the cells only by setting the background of the cell inclusion element outside the drawing target.

また、本発明の文書解析装置において、前記背景設定手段は、セル間にスペースを設ける指定がなされ前記セル要素に指定された背景が透明であると共に該セル要素に属するセル包含要素に指定された背景が透明以外であるときには、該背景の指定に拘わらず該セル要素の背景に該セル要素が属するセル包含要素に指定された背景を設定すると共に該セル包含要素の背景を描画の対象外に設定する手段であるものとすることもできる。こうすれば、透明が指定されたセル要素にこれよりも下層のセル包含要素に指定された背景を出力させると共にセル間のスペースにセル包含要素よりも下層の表要素の背景を出力させることができる。また、こうした背景の出力を背景の設定だけで行なうから、処理をより迅速化することができる。   In the document analysis apparatus of the present invention, the background setting means is designated to provide a space between cells, the background designated for the cell element is transparent, and the background setting means is designated for a cell inclusion element belonging to the cell element. When the background is not transparent, the background specified for the cell inclusion element to which the cell element belongs is set as the background of the cell element regardless of the designation of the background, and the background of the cell inclusion element is excluded from the drawing target. It can also be a means for setting. In this way, the cell element with transparency specified can output the background specified for the cell inclusion element below it, and the background of the table element below the cell inclusion element can be output to the space between cells. it can. In addition, since such background output is performed only by setting the background, the processing can be further speeded up.

さらに、本発明の文書解析装置において、前記所定の書式は、マークアップ言語で記述されてなるものとすることもできる。この態様の本発明の文書解析装置において、前記マークアップ言語は、XHTMLであるものとすることもできる。   Furthermore, in the document analysis apparatus of the present invention, the predetermined format may be described in a markup language. In this aspect of the document analysis apparatus of the present invention, the markup language may be XHTML.

本発明の印刷装置は、
上述の各態様のいずれかの本発明の文書解析装置を備える
ことを要旨とする。
The printing apparatus of the present invention includes:
The gist of the present invention is to include the document analysis apparatus according to any one of the above aspects.

この本発明の印刷装置では、上述の各態様のいずれかの本発明の文書解析装置、即ち、基本的には、所定の書式で記述された構造化文書を解析して出力する文書解析装置であって、前記構造化文書が指定されたとき、該指定された構造化文書を受け付けて解析する解析手段と、該解析された構造化文書に表組みの指定がなされた要素が含まれ、該要素に上層からセル要素,該セル要素を包含するセル包含要素,該セル包含要素を包含する表要素の順に層をなす背景が指定されると共にセル間にスペースを設ける指定がなされたときには、該セル間のスペースに前記表要素に指定された背景が出力されるよう前記セル要素,前記セル包含要素,前記表要素の背景を設定する背景設定手段と、該解析された構造化文書に含まれる要素を順次レイアウトすると共に該レイアウトした要素を前記設定された背景をもって描画して出力する出力手段とを備える文書解析装置を備えるから、本発明の文書解析装置と同様の効果、例えば、セル要素,セル包含要素,表要素の背景を設定することによりセル間のスペースに表要素の背景を出力することができるなどの効果を奏することができる。   In the printing apparatus of the present invention, the document analysis apparatus of the present invention according to any one of the above-described aspects, that is, a document analysis apparatus that basically analyzes and outputs a structured document described in a predetermined format. When the structured document is designated, an analysis means for receiving and analyzing the designated structured document, and an element for which a table is designated in the analyzed structured document are included, When an element is specified from the upper layer to a cell element, a cell containing element that includes the cell element, and a background that forms a layer in the order of a table element that includes the cell containing element, and a space between the cells is specified, The cell element, the cell inclusion element, background setting means for setting the background of the table element so that the background specified for the table element is output in the space between cells, and included in the analyzed structured document Layer elements sequentially And a document analysis device provided with an output means for drawing and outputting the laid-out elements with the set background, for example, cell elements and cell inclusion elements. By setting the background of the table element, it is possible to produce an effect that the background of the table element can be output in the space between cells.

本発明の文書解析方法は、
所定の書式で記述された構造化文書を解析して出力する文書解析方法であって、
(a)前記構造化文書が指定されたとき、該指定された構造化文書を受け付けて解析し、
(b)該解析された構造化文書に表組みの指定がなされた要素が含まれ、該要素に上層からセル要素,該セル要素を包含するセル包含要素,該セル包含要素を包含する表要素の順に層をなす背景が指定されると共にセル間にスペースを設ける指定がなされたときには、該セル間のスペースに前記表要素に指定された背景が出力されるよう前記セル要素,前記セル包含要素,前記表要素の背景を設定し、
(c)該解析された構造化文書に含まれる要素を順次レイアウトすると共に該レイアウトした要素を前記設定された背景をもって描画して出力する
ことを要旨とする。
The document analysis method of the present invention includes:
A document analysis method for analyzing and outputting a structured document described in a predetermined format,
(A) When the structured document is designated, the designated structured document is received and analyzed;
(B) The analyzed structured document includes an element for which a table is specified. The element includes a cell element from the upper layer, a cell inclusion element including the cell element, and a table element including the cell inclusion element. The cell elements and the cell inclusion elements are output so that the background specified in the table element is output in the space between the cells when the background forming the layers is specified and the space between the cells is specified. , Set the background of the table element,
(C) The gist is to sequentially lay out elements included in the analyzed structured document and to draw and output the laid out elements with the set background.

この本発明の文書解析方法によれば、構造化文書が指定されたときに指定された構造化文書を受け付けて解析し、解析した構造化文書に表組みの指定がなされた要素が含まれこの要素に上層からセル要素,セル要素を包含するセル包含要素,セル包含要素を包含する表要素の順に層をなす背景が指定されると共にセル間にスペースを設ける指定がなされたときには、セル間のスペースに表要素に指定された背景が出力されるようセル要素,セル包含要素,表要素の背景を設定し、解析した構造化文書に含まれる要素を順次レイアウトすると共にレイアウトした要素を設定された背景をもって描画して出力するから、セル要素,セル包含要素,表要素の背景を設定することによりセル間のスペースに表要素の背景を出力することができる。ここで、「セル包含要素」としては、表の行を構成する行要素や表の列を構成する列要素が含まれる。また、「背景」としては、色や画像が含まれる。   According to the document analysis method of the present invention, when a structured document is designated, the designated structured document is received and analyzed, and the analyzed structured document includes an element for which a table is specified. When an element is specified from the upper layer to the cell element, the cell containing element that contains the cell element, and the table element that contains the cell containing element in the order of the background, and the space between the cells is specified, The background of the cell element, cell inclusion element, and table element is set so that the background specified for the table element is output in the space, and the elements included in the analyzed structured document are sequentially laid out and the layout element is set Since the background is drawn and output, the background of the table element can be output to the space between the cells by setting the background of the cell element, cell inclusion element, and table element. Here, the “cell inclusion element” includes a row element constituting a table row and a column element constituting a table column. The “background” includes a color and an image.

本発明のプログラムは、
所定の書式で記述された構造化文書を解析して出力する文書解析装置に用いられるプログラムであって、
前記構造化文書が指定されたとき、該指定された構造化文書を受け付けて解析するモジュールと、
該解析された構造化文書に表組みの指定がなされた要素が含まれ、該要素に上層からセル要素,該セル要素を包含するセル包含要素,該セル包含要素を包含する表要素の順に層をなす背景が指定されると共にセル間にスペースを設ける指定がなされたときには、該セル間のスペースに前記表要素に指定された背景が出力されるよう前記セル要素,前記セル包含要素,前記表要素の背景を設定するモジュールと、
該解析された構造化文書に含まれる要素を順次レイアウトすると共に該レイアウトした要素を前記設定された背景をもって描画して出力するモジュールと
を備えることを要旨とする。
The program of the present invention
A program used in a document analysis device that analyzes and outputs a structured document described in a predetermined format,
A module that accepts and analyzes the designated structured document when the structured document is designated;
The parsed structured document includes an element for which a table is specified, and the element includes a cell element from the upper layer, a cell inclusion element that includes the cell element, and a table element that includes the cell inclusion element. When a background is formed and a space between cells is specified, the background specified in the table element is output in the space between the cells. A module to set the background of the element;
And a module for sequentially laying out elements included in the analyzed structured document and drawing and outputting the laid out elements with the set background.

この本発明のプログラムでは、文書解析装置にインストールすることにより、構造化文書が指定されたときに指定された構造化文書を受け付けて解析し、解析した構造化文書に表組みの指定がなされた要素が含まれこの要素に上層からセル要素,セル要素を包含するセル包含要素,セル包含要素を包含する表要素の順に層をなす背景が指定されると共にセル間にスペースを設ける指定がなされたときには、セル間のスペースに表要素に指定された背景が出力されるようセル要素,セル包含要素,表要素の背景を設定し、解析した構造化文書に含まれる要素を順次レイアウトすると共にレイアウトした要素を設定された背景をもって描画して出力する。したがって、セル要素,セル包含要素,表要素の背景を設定することによりセル間のスペースに表要素の背景を出力することができる。ここで、「セル包含要素」としては、表の行を構成する行要素や表の列を構成する列要素が含まれる。また、「背景」としては、色や画像が含まれる。   In the program of the present invention, by installing in the document analysis device, the specified structured document is received and analyzed when the structured document is specified, and the table structure is specified in the analyzed structured document. An element is included, and this element is specified from the top layer as a cell element, a cell containing element that contains the cell element, and a table element that contains the cell containing element in the order of the background and a space between the cells. Sometimes, the background of the cell element, cell inclusion element, and table element is set so that the background specified for the table element is output in the space between cells, and the elements contained in the analyzed structured document are sequentially laid out and laid out. Draw and output elements with a set background. Therefore, the background of the table element can be output in the space between the cells by setting the background of the cell element, the cell inclusion element, and the table element. Here, the “cell inclusion element” includes a row element constituting a table row and a column element constituting a table column. The “background” includes a color and an image.

次に、本発明を実施するための最良の形態を実施例を用いて説明する。   Next, the best mode for carrying out the present invention will be described using examples.

図1は、本発明の一実施例としてのカラーインクジェットプリンタ20の構成の概略を示す構成図である。実施例のカラーインクジェットプリンタ20は、図示するように、コンピュータ10やデジタルテレビ12,デジタルカメラ14などと接続してデジタル画像(以下、画像という)の入力を司る入力インターフェース22と、入力インタフェース22に入力される画像の形式に基づいてデータの出力先を割り振る信号処理部24と、マークアップ言語としてのXHTML(eXtensible Hyper Text Markup Language)により記述されたXHTML文書を解析して要素の木構造としてのDOM(Document Object Model)ツリーを作成すると共にCSS(Cascading Style Sheets)により記述されたCSS文書を読み込んでスタイルオブジェクトを作成してメモリ50に書き込む解析部30と、解析部30により作成されたDOMツリーとスタイルオブジェクトとを用いてXHTML文書に記述された要素(オブジェクト)としての表や画像やテキストを印刷用のページ毎にレイアウトしてページボックスとしてメモリ50に書き込むレイアウタ38と、レイアウタ38によりレイアウトして得られるページボックスを用いてRBGデータとしての印刷用画像を描画するレンダリングプラグイン(以下、RPIという)40と、描画されたRGB(Red Green Blue)データの印刷用画面をCMYK(Cyan Magenta Yellow Black)データに変換する色変換部42と、変換されたCMYKデータを誤差拡散処理などの画像処理を行なって2値化する2値化部44と、2値化されたCMYKの各データを図示しない印刷ヘッドを備える印刷実行部48にバンド単位で出力するために一時的にデータを蓄えるイメージバッファ46とを備える。   FIG. 1 is a configuration diagram showing an outline of the configuration of a color inkjet printer 20 as an embodiment of the present invention. As shown in the figure, the color inkjet printer 20 of the embodiment is connected to a computer 10, a digital television 12, a digital camera 14, and the like, and an input interface 22 that controls input of a digital image (hereinafter referred to as an image), and an input interface 22 Analyzing an XHTML document described in XHTML (eXtensible Hyper Text Markup Language) as a markup language by assigning an output destination of data based on the format of the input image, and as an element tree structure Creates a DOM (Document Object Model) tree and reads a CSS document described by CSS (Cascading Style Sheets) to create a style object and create a memory The table, image, and text as the elements (objects) described in the XHTML document are laid out for each page for printing using the analysis unit 30 written in 50, and the DOM tree and style object created by the analysis unit 30. A layouter 38 that writes to the memory 50 as a page box, a rendering plug-in (hereinafter referred to as RPI) 40 that renders an image for printing as RBG data using a page box obtained by laying out by the layouter 38, A color conversion unit 42 that converts a screen for printing RGB (Red Green Blue) data into CMYK (Cyan Magenta Yellow Black) data, and binarizing the converted CMYK data by performing image processing such as error diffusion processing 2 Pricing unit 44 and 2 An image buffer 46 is provided for temporarily storing the data in order to output the digitized CMYK data to a print execution unit 48 having a print head (not shown) in units of bands.

信号処理部24は、入力された信号が直ちに印刷可能な印刷用データの場合には印刷実行部48のイメージバッファ46にデータを出力し、RGBデータの場合にはメモリ50の印刷用画面格納領域に出力し、XHTML文書で記述されたファイルの場合には解析部30に出力する。   The signal processing unit 24 outputs the data to the image buffer 46 of the print execution unit 48 when the input signal is printable data that can be printed immediately, and the print screen storage area of the memory 50 when the input signal is RGB data. In the case of a file described in an XHTML document, it is output to the analysis unit 30.

解析部30は、XHTML文書の解析を指示することによりDOMツリーを作成するコア32と、コア32からの指示に基づいてXHTML文書を解析するXMLパーサー34と、作成されたDOMツリーの各要素の初期化処理により依頼されたCSS文書を解析するCSSプラグイン(以下、CSSPIという)36とから構成されている。   The analysis unit 30 generates a DOM tree by instructing the analysis of the XHTML document, an XML parser 34 that analyzes the XHTML document based on the instruction from the core 32, and each element of the generated DOM tree. It comprises a CSS plug-in (hereinafter referred to as CSSI) 36 for analyzing the CSS document requested by the initialization process.

次に、こうして構成された実施例のカラーインクジェットプリンタ20の動作、特にXHTML文書を印刷する際の動作について説明する。図2は、解析部30により実行される解析レイアウト指示処理の一例を示すフローチャートである。この処理は所定時間毎(例えば、8msec毎)に繰り返し実行される。解析レイアウト指示処理が実行されると、まず、XHTML文書を特定するためのURL(Uniform Resouce Locator)の指定があるか否かを判定し(ステップS100)、URLの指定があるときにはそのURLをメモリ50に領域設定されたURL格納用バッファ領域に格納し(ステップS110)、URLの指定がないときには次の処理に進む。URL指定は、例えば、操作者がデジタルテレビ12で表示された印刷可能な項目のうちカラーインクジェットプリンタ20で印刷しようとする項目を選択したときデジタルテレビ12からのカラーインクジェットプリンタ20に出力されることにより行なうものとすることができるし、コンピュータ10から単にURLを選択してカラーインクジェットプリンタ20に印刷要求することによっても行なうことができる。なお、コンピュータ10からのURL指定では、コンピュータ10によってもXHTML文書の解析やレイアウト,色変換や2値化などを行なうことができるが、コンピュータ10によってはこうした処理を一切行なわず、URLだけをカラーインクジェットプリンタ20に送信する場合となる。   Next, the operation of the color ink jet printer 20 of the embodiment configured as described above, particularly the operation when printing an XHTML document will be described. FIG. 2 is a flowchart illustrating an example of the analysis layout instruction process executed by the analysis unit 30. This process is repeatedly executed every predetermined time (for example, every 8 msec). When the analysis layout instruction process is executed, first, it is determined whether or not a URL (Uniform Resource Locator) for specifying an XHTML document is specified (step S100). If a URL is specified, the URL is stored in the memory. 50 is stored in the URL storage buffer area set in the area 50 (step S110), and if no URL is designated, the process proceeds to the next process. The URL designation is output to the color inkjet printer 20 from the digital television 12 when the operator selects an item to be printed by the color inkjet printer 20 among the printable items displayed on the digital television 12. Or by simply selecting a URL from the computer 10 and making a print request to the color inkjet printer 20. In the URL designation from the computer 10, the XHTML document can be analyzed, laid out, color converted, binarized, etc. by the computer 10, but the computer 10 does not perform such processing at all, and only the URL is colored. In this case, the data is transmitted to the ink jet printer 20.

続いて、メモリ50のURL格納用バッファ領域にURLが格納されているか否かを判定すると共に(ステップS120)、XHTML文書を現在解析中であるか否かを判定する(ステップS130)。XHTML文書を現在解析中であるか否かの判定は、この解析レイアウト指示処理と同時に並列に解析部30自身によって行なっているか否かを判定することにより、例えば解析開始時と解析終了時にフラグ操作するものとすればフラグを調べることにより行なうことができる。URLが格納されており、現在XHTML文書の解析中ではないときには、後述する解析処理により作成されるDOMツリーを格納するためのメモリ50のDOMツリー格納用領域やスタイルオブジェクトを格納するためのメモリ50のスタイルオブジェクト格納用領域に空きがあるか否かを判定し(ステップS140)、空きがあると判定されると、メモリ50のURL格納用バッファ領域に格納されている最初のURLを読み出してそのURLにより特定されるXHTML文書の解析を開始し(ステップS150)、URLが格納されていないときやURLが格納されていても現在XHTML文書を解析している最中のときや現在XHTML文書を解析している最中になくてもDOMツリー格納用領域やスタイルオブジェクト格納用領域に空きがないときには次の処理に進む。XHTML文書の解析は、図3に例示する解析処理に基づいて行なわれる。この解析処理ではURLにより特定されるXHTML文書が解析されてDOMツリーが作成され、XHTML文書に記述されたCSS文書を解析してスタイルオブジェクトが作成され、関連付けられてメモリ50のDOMツリー格納用領域とスタイルオブジェクト格納用領域とに記憶される。このとき、DOMツリーには識別情報としてDOMツリーIDが付与され、スタイルオブジェクトには識別情報としてスタイルオブジェクトIDが付与される。解析処理の詳細については後述する。   Subsequently, it is determined whether or not the URL is stored in the URL storage buffer area of the memory 50 (step S120), and whether or not the XHTML document is currently being analyzed is determined (step S130). Whether or not the XHTML document is currently being analyzed is determined by determining whether or not the analysis unit 30 itself performs in parallel with the analysis layout instruction processing, for example, at the start of analysis and at the end of analysis. If so, this can be done by checking the flag. When the URL is stored and the XHTML document is not currently being analyzed, the memory 50 for storing the DOM tree storage area and the style object in the memory 50 for storing the DOM tree created by the analysis processing described later. It is determined whether or not there is a space in the style object storage area (step S140). If it is determined that there is a space, the first URL stored in the URL storage buffer area of the memory 50 is read and Analysis of the XHTML document specified by the URL is started (step S150), and when the URL is not stored or when the XHTML document is currently being analyzed even if the URL is stored, the current XHTML document is analyzed. DOM tree storage area and style object storage area even if it is not Proceed to the next processing when there is no free. The analysis of the XHTML document is performed based on the analysis process illustrated in FIG. In this analysis process, the XHTML document specified by the URL is analyzed to create a DOM tree, the CSS document described in the XHTML document is analyzed to create a style object, and an associated DOM tree storage area in the memory 50 And the style object storage area. At this time, a DOM tree ID is assigned as identification information to the DOM tree, and a style object ID is assigned to the style object as identification information. Details of the analysis processing will be described later.

次に、レイアウタ38によってレイアウトが行なわれている最中であるか否かを判定し(ステップS160)、レイアウタ38によるレイアウトが行なわれてる最中にないときには、後述するレイアウト処理によりレイアウトされたページボックスを格納するためのメモリ50のボックス格納用領域に空きがあるか否かを判定し(ステップS170)、空きがあると判定されると、メモリ50のDOMツリー格納用領域に格納されたDOMツリーのうち最初のDOMツリーをDOMツリーIDを用いて指定してレイアウタ38にレイアウト開始指示を出力して(ステップS180)、この解析レイアウト指示処理を終了し、レイアウタ38によってレイアウトが行なわれている最中にあるときやレイアウトが行なわれている最中になくてもボックス格納用領域に空きがないときにはレイアウト開始指示を出力せずに解析レイアウト指示処理を終了する。ここで、レイアウタ38によってレイアウトが行なわれている最中にあるか否かの判定は、レイアウタ38からレイアウト終了の信号を入力したか否かにより行なうことができる。レイアウト終了の信号の受信についてはレイアウタ38の処理を説明する際に詳述する。   Next, it is determined whether or not the layout is being performed by the layouter 38 (step S160). If the layout is not being performed by the layouter 38, the page is laid out by a layout process to be described later. It is determined whether or not there is an empty box storage area of the memory 50 for storing boxes (step S170). If it is determined that there is an empty area, the DOM stored in the DOM tree storage area of the memory 50 is determined. The first DOM tree in the tree is designated using the DOM tree ID, a layout start instruction is output to the layouter 38 (step S180), the analysis layout instruction process is terminated, and the layout is performed by the layouter 38. Even if you are in the middle or not in the middle of the layout, It ends the analysis layout instruction process without outputting the layout start instruction when there is no free space at a box storage. Here, whether or not the layout is being performed by the layouter 38 can be determined based on whether or not a layout end signal is input from the layouter 38. The reception of the layout end signal will be described in detail when the processing of the layout 38 is described.

次に、解析部30により実行される解析処理について説明する。解析処理は、前述したように図3に例示するフローチャートに基づいて行なわれる。説明の容易のために、図4に例示するXHTML文書を用いて説明する。解析レイアウト指示処理によりURLを指定して解析開始の指示がなされると、URLにより特定されるXHTML文書を読み出し(ステップS200)、読み出したXHTML文書を解析してDOMツリーを作成する(ステップS210)。このとき、作成するDOMツリーには識別情報としてDOMツリーID(例えば、URLにDOMを付して作成したIDなど)を付与する。XHTML文書の読み出しは、具体的には、コア32がURLを指定してXMLパーサー34に解析依頼することによりXMLパーサー34が行なう。XHTML文書の解析およびDOMツリーの作成は、具体的には、XMLパーサー34がXHTML文書を最初から順に解析して各要素を作成すると共にDOMツリーに登録することにより行なう。なお、要素の作成はコア32に対して行ない、要素の登録はメモリ50のDOMツリー格納用領域に関連付けて格納することにより行なう。図4に例示したXHTML文書を解析して作成されたDOMツリーを図5に示す。   Next, analysis processing executed by the analysis unit 30 will be described. The analysis process is performed based on the flowchart illustrated in FIG. 3 as described above. For ease of explanation, description will be made using the XHTML document illustrated in FIG. When a URL is specified by the analysis layout instruction process and an analysis start instruction is given, the XHTML document specified by the URL is read (step S200), and the read XHTML document is analyzed to create a DOM tree (step S210). . At this time, a DOM tree ID (for example, an ID created by adding a DOM to a URL) is assigned as identification information to the DOM tree to be created. Specifically, the XHTML document is read by the XML parser 34 when the core 32 designates a URL and requests an analysis to the XML parser 34. Specifically, the analysis of the XHTML document and the creation of the DOM tree are performed by the XML parser 34 analyzing the XHTML document from the beginning in order to create each element and register it in the DOM tree. The element is created for the core 32, and the element is registered by associating it with the DOM tree storage area of the memory 50. FIG. 5 shows a DOM tree created by analyzing the XHTML document illustrated in FIG.

こうしてDOMツリーを作成すると、XHTML文書に指定されたCSS文書を読み出し(ステップS220)、読み出したCSS文書を解析してスタイルオブジェクトを作成する(ステップS230)。ここで、CSS文書は、その内容がXHTML文書に直接記述されたりXHTML文書の外部にリンクされたりして存在しており、図4の例では、XHTML文書にCSS文書の内容が直接記述されている場合を示した。CSS文書の読み出しは、具体的には、DOMツリーの各要素の初期化処理における依頼により依頼されたCSSPI36が行なう。CSS文書の内容がXHTML文書に直接記述されている場合には、XHTML文書中のCSS文書に該当する部分を渡してCSSPI36に依頼することにより行なわれ、CSS文書が外部にリンクされている場合には、linkタグ内のリンク先を指定してCSSPI36に依頼することにより行なわれる。CSS文書の解析およびスタイルオブジェクトの作成は、具体的には、CSSPI36がCSS文書を最初から順に解析して各ルールをメモリ50のスタイルオブジェクト格納用領域に格納することにより行なう。   When the DOM tree is created in this way, the CSS document designated as the XHTML document is read (step S220), and the read CSS document is analyzed to create a style object (step S230). Here, the content of the CSS document is described directly in the XHTML document or linked to the outside of the XHTML document. In the example of FIG. 4, the content of the CSS document is directly described in the XHTML document. Showed the case. Specifically, the CSS document 36 is read by the request in the initialization process of each element of the DOM tree. When the content of the CSS document is directly described in the XHTML document, the portion corresponding to the CSS document in the XHTML document is passed and requested to the CSSI 36, and the CSS document is linked to the outside. Is performed by specifying the link destination in the link tag and requesting it to the CSSI 36. Specifically, the CSS document is analyzed and the style object is created by the CSSI 36 analyzing the CSS document in order from the beginning and storing each rule in the style object storage area of the memory 50.

こうしてDOMツリーとスタイルオブジェクトが作成されると、作成したDOMツリーとスタイルオブジェクトの関連付け処理を実行し(ステップS240)、URL格納用バッファ領域から解析の対象のURLを削除して(ステップS250)、解析処理を終了する。   When the DOM tree and style object are created in this way, the created DOM tree and style object are associated with each other (step S240), and the URL to be analyzed is deleted from the URL storage buffer area (step S250). End the analysis process.

次に、レイアウタ38の処理について説明する。図6は、解析部30によりDOMツリーを指定してレイアウト開始指示がなされたときにレイアウタ38により実行されるレイアウト描画指示処理の一例を示すフローチャートである。レイアウト描画指示処理が実行されると、レイアウタ38は、まず、指定されたDOMツリーに基づいてレイアウトを開始する(ステップS300)。レイアウトは、図7に例示するレイアウト処理により実行される。説明の都合上、ここで、レイアウト処理について説明する。   Next, processing of the layouter 38 will be described. FIG. 6 is a flowchart showing an example of a layout drawing instruction process executed by the layouter 38 when the analysis unit 30 designates a DOM tree and gives a layout start instruction. When the layout drawing instruction process is executed, the layouter 38 first starts layout based on the designated DOM tree (step S300). The layout is executed by the layout process illustrated in FIG. For convenience of explanation, layout processing will be described here.

レイアウト処理では、レイアウタ38は、まず、DOMツリーの各要素を順にサーチして要素毎にスタイル情報(要素に指定された特性や対応するスタイルオブジェクトのルール)が関連付けられた論理的なボックスとしての要素ボックスを作成する(ステップS400)。続いて、ページ毎に対応するページボックスを作成し(ステップS402)、そのページボックスの下にレイアウトすべき対象の要素ボックスが表要素であるか否かを判定する(ステップS404)、要素ボックスが表要素以外の要素であると判定されたときにはスタイル情報に基づいてレイアウトボックスを作成してページボックスの下にレイアウトできなくなるまで要素の内容(子要素)をレイアウトする(ステップS422)。例えば、要素の内容がイメージの場合には、画像サイズを取得してイメージボックスを作成すると共にレイアウトボックスとしての行を作成してイメージボックスを行に登録することにより行なわれ、要素の内容がテキストの場合には、行を作成し、行に入るだけのテキストボックスを作成して行に登録することを繰り返すことにより行なわれる。取得した画像サイズによりイメージボックスをレイアウトできなかったり、テキストのすべてを登録することができないときには、改ページの判定がなされ(ステップS424)、次ページに対応するページボックスが作成され、レイアウトできなかったイメージボックスや残りのテキストを行に登録する。   In the layout process, the layouter 38 first searches each element of the DOM tree in order, and as a logical box in which style information (characteristics specified for the element and rules of the corresponding style object) is associated with each element. An element box is created (step S400). Subsequently, a page box corresponding to each page is created (step S402), and it is determined whether the target element box to be laid out under the page box is a table element (step S404). When it is determined that the element is other than the table element, a layout box is created based on the style information, and the contents (child elements) of the element are laid out until it cannot be laid out under the page box (step S422). For example, when the content of an element is an image, the image size is acquired to create an image box, and a line as a layout box is created and the image box is registered in the line. In the case of, it is performed by repeatedly creating a line, creating a text box just enough to enter the line, and registering it in the line. When the image box cannot be laid out due to the acquired image size or all of the text cannot be registered, page break is determined (step S424), and a page box corresponding to the next page is created and cannot be laid out. Register the image box and the rest of the text on the line.

ステップS404で対象となる要素ボックスが表要素であると判定されたときには、表の構成を解析する処理を行なう(ステップS406)。表の構成の解析では、関連付けられたスタイル情報に従って行にレイアウトするセルの列幅を設定する処理などレイアウトに必要な処理が行なわれる。セルの列幅の設定は、実施例では、セルの内容(テキストや画像のサイズなど)に依存しないでセルの列幅の設定を行なう固定表組み(table−layout特性が「fixed」)と、セルの内容に依存してセルの列幅の設定を行なう自動表組み(table−layout特性が「auto」)との二通りの設定がある。 固定表組みが指定された場合のセルの列幅の設定は、最初の行に属するセルの幅に関する特性(width特性)を調べてwidth特性が「auto」以外、即ち、何らかの値(絶対的な長さや表のレイアウト可能領域(表の幅)に対する割合)が指定されているセルについては、その指定された値を該当するセルの列幅として設定し、width特性が「auto」に指定されているセルについては、width特性が「auto」以外に指定された前述のセルについて設定した列幅の合計(境界やセルに境界を設定するための特性としてセル間にスペースを設けるいわゆる分離境界モデルが指定されたときにはそこで指定された幅も加える)とレイアウト可能領域の幅との偏差の幅をwidth特性に「auto」が指定された残りのセルに配分(例えば、均等配分)することにより行なわれる。自動表組みが指定された場合のセルの列幅の設定は、基本的には、レイアウト可能領域の幅の範囲でセルの内容をできる限り一行でレイアウトするよう各セルの列幅を設定することにより行なわれる。なお、自動表組みが指定された場合でも列幅が指定されたセルについては、その指定された列幅を設定する。表のレイアウトは、こうして設定した列幅に従って行なわれる。   If it is determined in step S404 that the target element box is a table element, a process for analyzing the structure of the table is performed (step S406). In the analysis of the table configuration, processing necessary for layout, such as processing for setting the column width of cells to be laid out in rows according to the associated style information, is performed. In the embodiment, the setting of the cell column width is a fixed table set (table-layout characteristic is “fixed”) for setting the column width of the cell without depending on the cell contents (text or image size). There are two types of settings: automatic table composition (table-layout characteristic is “auto”) for setting the cell column width depending on the cell contents. When a fixed table set is specified, the column width of the cell is set by checking the characteristic (width characteristic) regarding the width of the cell belonging to the first row and the width characteristic is other than “auto”, that is, some value (absolute For cells for which the length and ratio of the table layout possible area (table width) are specified, the specified value is set as the column width of the corresponding cell, and the width characteristic is specified as “auto”. For the existing cells, the sum of the column widths set for the aforementioned cells whose width characteristics are specified other than “auto” (the so-called separation boundary model in which a space between cells is provided as a characteristic for setting boundaries between the cells and the cells) When specified, the width specified there is also added) and the width of the deviation from the width of the layout possible area is the remaining width with “auto” specified in the width characteristic. Allocation Le (e.g., sharing) is carried out by. When the automatic table layout is specified, the column width of the cells is basically set so that the cell contents are laid out in one line as much as possible within the width of the layoutable area. It is done by. Even when an automatic table layout is specified, the specified column width is set for a cell for which the column width is specified. The table layout is performed according to the column width thus set.

次に、表,行,セルの各々に指定された背景としての背景スタイル(スタイル情報)を取得する(ステップS408)。ここで、背景スタイルは、実施例では、表(tabel),行(tr),セル(td,th)のそれぞれに指定できるようになっており、指定された背景は上層からセル,行,表の順に配置される。図8に、表,行,セルの背景の層構造の一例を示す。例えば、セルの背景が透明であるときにはセルの枠内には一つ下層の行の背景が透けて見え、行の背景も透明であればセルの枠内には最下層の表の背景が透けて見えることになる。続いて、セルに境界を設定するための特性(セルの境界特性)としてセル間にスペースを設けるいわゆる分離境界モデルが指定されているかセル間にスペースを設けないいわゆる境界つぶしモデルが指定されているかを判定する(ステップS410)。この処理は、具体的には、セルの境界特性であるborder−collapse特性に分離境界モデルに対応する「separate」と境界つぶしモデルに対応する「collapse」とのうちいずれが指定されているのかを判定することにより行なう。なお、分離境界モデルでは、隣接するセルの境界間の距離(border−spacing特性)を数値で指定できるようになっている。セル間の境界特性が分離境界モデルと判定されたときには、表に含まれる行のうち背景スタイルが透明でない行、即ち透明でない背景(透明以外の背景色や背景画像)が指定された行があるか否かを判定し(ステップS412)、透明でない背景が指定された行があると判定されたときにはその背景の指定に拘わらず該当する行の背景を描画の対象外(透明)に設定する(ステップS414)。そして、該当する行に属するセル(図5のDOMツリーにおける該当する行(tr)の子要素として階層付けられたセル(th))のうち背景スタイルが透明のセル、即ち透明の背景が指定されたセルがあるか否かを判定し(ステップS416)、透明の背景が指定されたセルがあると判定されると、透明の背景の指定に拘わらず該当するセルの背景をそのセルが属する行の背景スタイルに設定する(ステップS418)。背景スタイルが透明であるか否かの判定は、具体的には、行(tr)やセル(th,td)のbackground−color特性に「transparent」が指定(背景画像のときには、background−image特性に「none」が指定)されているか否かを判定することにより行なわれる。なお、デフォルト値が透明であるときには、背景スタイル自体に指定がないか否かによって行やセルの背景が透明に指定されているか否かを判定することができる。図4に例示するXHTML文書では、第2行から第4行までの行に透明以外の背景色が指定されると共にこれらの行に属するセル(td)の一部に透明の背景色が指定されているのが解る。また、行の背景を描画の対象外に設定するステップS414の処理は、セル間のスペースを常に行よりも下層の表の背景として印刷するための処理であり、セルの背景を行の背景スタイルに設定するステップS418の処理は、セルの背景が透明な場合にそのセルの枠内に行の背景が透けて見えるように印刷するための処理である。このように、セルや行の背景の設定を変更することにより、セル間のスペースを常に表の背景として印刷でき、透明以外の背景が指定された行に属するセルのうち透明の背景が指定されたセルに対して行の背景が透けて見えるように印刷することができるのである。なお、ステップS410で分離境界モデルでないと判定、即ち境界つぶしモデルと判定されたり、ステップS412で背景スタイルが透明でない行がない、即ち全ての行の背景スタイルが透明であると判定されたり、ステップS416で該当する行に属するセルのうち背景スタイルが透明のセルがないと判定されたときには、ステップS408で取得した背景スタイルに応じた背景の設定を行なう(ステップS420)。   Next, a background style (style information) as a background designated for each of the table, row, and cell is acquired (step S408). Here, in the embodiment, the background style can be specified for each of the table (table), the row (tr), and the cell (td, th), and the specified background is the cell, row, table from the upper layer. Arranged in this order. FIG. 8 shows an example of the layer structure of the background of the table, row, and cell. For example, if the background of a cell is transparent, the background of the next lower row can be seen through the cell frame. If the background of the row is also transparent, the background of the lowermost table is shown through the cell frame. Will be seen. Next, whether a so-called separation boundary model that specifies a space between cells or a so-called boundary crushing model that does not provide a space between cells is specified as a characteristic for setting a boundary in a cell (cell boundary characteristic) Is determined (step S410). Specifically, in this process, which of “separate” corresponding to the separation boundary model and “collapse” corresponding to the boundary crushing model is specified in the border-collapse characteristic that is the cell boundary characteristic. This is done by judging. In the separation boundary model, the distance (border-spacing characteristic) between the boundaries of adjacent cells can be designated numerically. When the boundary property between cells is determined to be the separation boundary model, there is a row in which the background style is not transparent among the rows included in the table, that is, a row with a non-transparent background (background color or background image other than transparency) is specified. (Step S412), and when it is determined that there is a line for which a non-transparent background is designated, the background of the corresponding line is set as a drawing target (transparent) regardless of the designation of the background ( Step S414). Then, a cell having a transparent background style, that is, a transparent background is designated among cells belonging to the corresponding row (cells (th) hierarchized as child elements of the corresponding row (tr) in the DOM tree in FIG. 5). If there is a cell for which a transparent background is designated, it is determined whether there is a cell for which the transparent background is designated. The background style is set (step S418). Specifically, whether or not the background style is transparent is determined by designating “transparent” in the background-color characteristic of the row (tr) or the cell (th, td) (when the background image is a background image characteristic) This is performed by determining whether or not “none” is designated). When the default value is transparent, it can be determined whether or not the background of the row or cell is specified as transparent depending on whether or not the background style itself is specified. In the XHTML document illustrated in FIG. 4, a background color other than transparent is specified for the second to fourth lines, and a transparent background color is specified for a part of the cells (td) belonging to these lines. I understand that. Further, the processing in step S414 for setting the row background to the drawing target is a process for always printing the space between cells as the background of the table below the row, and the cell background is used as the row background style. The process of step S418 is set to print so that the background of a row can be seen through the frame of the cell when the background of the cell is transparent. In this way, by changing the cell and row background settings, the space between cells can always be printed as a table background, and a transparent background is specified among cells belonging to rows for which a background other than transparent is specified. It is possible to print so that the background of the row can be seen through the cells. In step S410, it is determined that the model is not a separation boundary model, that is, it is determined as a boundary crushing model. In step S412, it is determined that there is no line whose background style is not transparent, that is, the background style of all lines is transparent. If it is determined in S416 that there is no cell whose background style is transparent among the cells belonging to the corresponding row, the background is set according to the background style acquired in Step S408 (Step S420).

表,行,セルの背景を設定すると、ステップS406における解析結果に応じて表のセルを行毎にレイアウトし(ステップS422)、このレイアウトの際にレイアウトボックスがページボックスのページ境界をオーバーしてこれ以上登録できないときには、改ページの判定がなされ(ステップS424)、次ページのページボックスが作成されて残余の行に対してセルのレイアウト処理が再開される。   When the background of the table, row, and cell is set, the table cell is laid out for each row according to the analysis result in step S406 (step S422), and the layout box exceeds the page boundary of the page box in this layout. When no more registrations can be made, a page break is determined (step S424), a page box for the next page is created, and cell layout processing is resumed for the remaining rows.

こうしてすべての要素ボックスに対してレイアウトが完了すると(ステップS426)、指定されたDOMツリーをメモリ50のDOMツリー格納用領域から削除すると共に(ステップS428)、レイアウト終了を解析部30に出力して(ステップS430)、レイアウト処理を終了する。これにより、解析部30により作成される新たなDOMツリーの格納領域が確保される。   When the layout is completed for all the element boxes (step S426), the designated DOM tree is deleted from the DOM tree storage area of the memory 50 (step S428), and the layout end is output to the analysis unit 30. (Step S430), the layout process ends. Thereby, a storage area for a new DOM tree created by the analysis unit 30 is secured.

レイアウト描画指示処理(図6)の説明に戻る。レイアウトを開始すると、最初のページ分のレイアウトが完了するのを待って(ステップS310)、レイアウトが完了したページを指定してRPI40に描画開始指示を出力する(ステップS320)。ページ分のレイアウトが完了したか否かの判定は、次ページに対応するページボックスが作成されたか否かにより、1ページだけしかないときにはレイアウト処理が終了したか否かにより行なうことができる。描画開始指示されたRPI40は、図9に例示する描画処理を実行し、ページボックスに従ってテキストや画像をメモリ50の印刷用画像格納領域を用いてRGBデータとして描画し(ステップS500)、描画が終了したときに色変換部42に色変換指示を出力すると共に(ステップS510)、描画終了をレイアウタ38に出力する(ステップS520)。なお、画像の描画については、画像ファイルを読み出し、ファイル形式によっては展開等を行なって描画する。図4のXHTML文書を解析して印刷した結果の一例を図10および図11に示す。図10は、図7のレイアウト処理のステップS410〜S416を実行することなくステップS420とステップS418とを順に実行したときの印刷結果を示し、図11は、図7のレイアウト処理の各ステップをすべて実行したときの印刷結果を示す。図10では、透明の背景が指定されたセルは一つ下層の行の背景で埋められるがセル間のスペースも層が表よりも上の行の背景(図中斜線部分)で埋められるのに対して、図11では、透明の背景が指定されたセルは一つ下層の行の背景で埋められセル間のスペースはすべて表の背景で埋められているのが解る。   Returning to the description of the layout drawing instruction process (FIG. 6). When the layout is started, it waits for the layout of the first page to be completed (step S310), specifies the page for which the layout has been completed, and outputs a drawing start instruction to the RPI 40 (step S320). Whether or not the layout for the page has been completed can be determined based on whether or not the page box corresponding to the next page has been created and whether or not the layout processing has been completed when there is only one page. The RPI 40 instructed to start drawing executes the drawing process illustrated in FIG. 9 and draws text and images as RGB data using the print image storage area of the memory 50 according to the page box (step S500), and the drawing ends. When this is done, a color conversion instruction is output to the color conversion unit 42 (step S510), and a drawing end is output to the layouter 38 (step S520). For image drawing, an image file is read and, depending on the file format, is developed and drawn. An example of the result of analyzing and printing the XHTML document of FIG. 4 is shown in FIGS. FIG. 10 shows a printing result when step S420 and step S418 are executed in sequence without executing steps S410 to S416 of the layout process of FIG. 7, and FIG. 11 shows all the steps of the layout process of FIG. Shows the print result when executed. In FIG. 10, a cell with a transparent background is filled with the background of one lower row, but the space between cells is also filled with the background of the row above the table (shaded area in the figure). On the other hand, in FIG. 11, it can be seen that a cell with a transparent background specified is filled with the background of one lower row, and all spaces between cells are filled with the background of the table.

描画開始指示を出力した後はそのページの描画が終了するのを待って(ステップS330)、そのページに対応するページボックスを削除する(ステップS340)。このように、ページの描画が終了する毎にそのページに対応するページボックスを削除することにより、ボックス格納用領域に不要なページボックスが格納された状態が継続されるのを回避することができる。こうしてページボックスを削除すると、次ページがあるか否かを判定し(ステップS350)、次ページがあるときにはステップS310の処理に戻る。即ち、次ページに対するページ分のレイアウトが完了しているか否かを判定し、レイアウトが完了していないときには完了するまで待ってレイアウトが完了したページを指定してRPI40に描画開始指示を出力するのである。こうしてすべてのページを描画し、次ページがなくなると、レイアウト描画指示処理を終了する。   After outputting the drawing start instruction, it waits for the drawing of the page to end (step S330), and deletes the page box corresponding to the page (step S340). Thus, by deleting the page box corresponding to the page every time drawing of the page is completed, it is possible to avoid the state where unnecessary page boxes are stored in the box storage area. . When the page box is deleted in this way, it is determined whether or not there is a next page (step S350). If there is a next page, the process returns to step S310. That is, it is determined whether or not the layout for the next page has been completed. If the layout has not been completed, the process waits until the layout is completed, specifies the page for which the layout has been completed, and outputs a drawing start instruction to the RPI 40. is there. In this way, all the pages are drawn, and when there is no next page, the layout drawing instruction process is terminated.

以上説明した実施例のカラーインクジェットプリンタ20によれば、セル間にスペースを設ける指定(分離境界モデルの指定)がなされると共に表に含まれる行のうち背景が透明以外に指定された行が存在するとき、該当する行の背景を描画の対象外(透明)に設定するから、セル間のスペースを常に表に指定された背景で埋めることができる。しかも、背景が透明以外に指定された行に属するセルのうち背景が透明に指定されたセルが存在するときには、そのセルの背景を該当する行に指定された背景に設定するから、そのセルの枠内を一つ下層の行の背景で埋めることができる。また、こうした処理をセルや行の背景を設定することにより行なうから、背景の処理を迅速化でき、印刷処理を迅速化することができる。   According to the color ink jet printer 20 of the embodiment described above, a designation for providing a space between cells (designation of a separation boundary model) is made, and among the lines included in the table, there is a line whose background is designated other than transparent. When doing so, the background of the corresponding row is set to be outside the drawing target (transparent), so that the space between cells can always be filled with the background specified in the table. In addition, when there is a cell whose background is specified as transparent among the cells belonging to a row whose background is specified other than transparent, the background of that cell is set to the background specified in the corresponding row. You can fill the frame with the background of the next lower row. Further, since such processing is performed by setting the background of the cell or row, the background processing can be speeded up and the printing processing can be speeded up.

ここで、実施例のカラーインクジェットプリンタ20のコア32とXMLパーサー34とCSSPI36とからなる解析部30が解析手段に相当し、レイアウタ38が背景設定手段に相当し、レイアウタ38とRPI40と色変換部42と2値化部44とイメージバッファ46と印刷実行部48とが出力手段に相当する。   Here, the analysis unit 30 including the core 32, the XML parser 34, and the CSSPI 36 of the color inkjet printer 20 of the embodiment corresponds to the analysis unit, the layouter 38 corresponds to the background setting unit, the layouter 38, the RPI 40, and the color conversion unit. 42, the binarization unit 44, the image buffer 46, and the print execution unit 48 correspond to output means.

実施例のカラーインクジェットプリンタ20では、セル,セルを包含する行,表の順に層をなして配置される背景の処理として説明したが、セル,セルを包含する列,表の順に層をなして配置される背景の処理とするものとしてもよい。   In the color inkjet printer 20 according to the embodiment, the background processing is described in which cells, rows including cells, and tables are arranged in the order of the table. However, the layers are arranged in the order of cells, columns including the cells, and tables. The processing of the background to be arranged may be performed.

実施例のカラーインクジェットプリンタ20では、構造化文書としてXHTMLで記述された文書を解析して印刷するものとしたが、他のマークアップ言語により記述された文書を解析して印刷するものとしてもよい。また、マークアップ言語以外の言語により記述された文書を解析して印刷するものとしても差し支えない。   In the color inkjet printer 20 of the embodiment, a document described in XHTML as a structured document is analyzed and printed. However, a document described in another markup language may be analyzed and printed. . In addition, a document described in a language other than the markup language may be analyzed and printed.

実施例のカラーインクジェットプリンタ20では、入力インタフェース22に接続される機器としてコンピュータ10やデジタルテレビ12やデジタルカメラ14などを挙げたが、如何なる機器を接続するものとしても差し支えない。   In the color inkjet printer 20 of the embodiment, the computer 10, the digital television 12, the digital camera 14, and the like are cited as devices connected to the input interface 22, but any device may be connected.

実施例では、XHTML文書を解析して印刷するカラーインクジェットプリンタを用いて説明したが、カラーレーザプリンタやモノクロのインクジェットプリンタやレーザープリンタなどの種々のプリンタを用いるものとしてもよい。また、こうしたプリンタ以外に、XHTML文書を解析して出力(例えば、表示出力)する通常のコンピュータに用いるものとしても差し支えない。   In the embodiment, a color ink jet printer that analyzes and prints an XHTML document has been described, but various printers such as a color laser printer, a monochrome ink jet printer, and a laser printer may be used. In addition to such a printer, the printer may be used for an ordinary computer that analyzes and outputs an XHTML document (for example, display output).

以上、本発明を実施するための最良の形態について実施例を用いて説明したが、本発明はこうした実施例に何等限定されるものではなく、本発明の要旨を逸脱しない範囲内において、種々なる形態で実施し得ることは勿論である。   The best mode for carrying out the present invention has been described with reference to the embodiments. However, the present invention is not limited to these embodiments, and various modifications can be made without departing from the gist of the present invention. Of course, it can be implemented in the form.

本発明は、印刷機器産業やコンピュータ産業などの産業に利用可能である。   The present invention is applicable to industries such as the printing equipment industry and the computer industry.

実施例のカラーインクジェットプリンタ20の構成の概略を示す構成図。1 is a configuration diagram illustrating an outline of a configuration of a color inkjet printer 20 according to an embodiment. 解析レイアウト指示処理の一例を示すフローチャート。The flowchart which shows an example of an analysis layout instruction | indication process. 解析処理の一例を示すフローチャート。The flowchart which shows an example of an analysis process. 具体例のXHTML文書の一例を示す説明図。Explanatory drawing which shows an example of the XHTML document of a specific example. 具体例のDOMツリーの一例を示す説明図。Explanatory drawing which shows an example of the DOM tree of a specific example. レイアウト描画指示処理の一例を示す説明図。Explanatory drawing which shows an example of a layout drawing instruction | indication process. レイアウト処理の一例を示す説明図。Explanatory drawing which shows an example of a layout process. 表,行,セルの各背景の層構造の一例を示す説明図。Explanatory drawing which shows an example of the layer structure of each background of a table | surface, a line, and a cell. 描画処理の一例を示す説明図。Explanatory drawing which shows an example of a drawing process. 具体例の印刷結果の一例を示す説明図。Explanatory drawing which shows an example of the printing result of a specific example. 具体例の印刷結果の一例を示す説明図。Explanatory drawing which shows an example of the printing result of a specific example.

符号の説明Explanation of symbols

10 コンピュータ、12 デジタルテレビ、14 デジタルカメラ、20 カラーインクジェットプリンタ、22 入力インターフェース、24 信号処理部、30 解析部、32 コア、34 XMLパーサー、36 CSSPI、38 レイアウタ、40 RPI、42 色変換部、44 2値化部、46 イメージバッファ、48 印刷実行部、50 メモリ。   10 computers, 12 digital televisions, 14 digital cameras, 20 color inkjet printers, 22 input interfaces, 24 signal processing units, 30 analysis units, 32 cores, 34 XML parsers, 36 CSSPIs, 38 layouters, 40 RPIs, 42 color conversion units, 44 binarization unit, 46 image buffer, 48 print execution unit, 50 memory.

Claims (10)

所定の書式で記述された構造化文書を解析して出力する文書解析装置であって、
前記構造化文書が指定されたとき、該指定された構造化文書を受け付けて解析する解析手段と、
該解析された構造化文書に表組みの指定がなされた要素が含まれ、該要素に上層からセル要素,該セル要素を包含するセル包含要素,該セル包含要素を包含する表要素の順に層をなす背景が指定されると共にセル間にスペースを設ける指定がなされたときには、該セル間のスペースに前記表要素に指定された背景が出力されるよう前記セル要素,前記セル包含要素,前記表要素の背景を設定する背景設定手段と、
該解析された構造化文書に含まれる要素を順次レイアウトすると共に該レイアウトした要素を前記設定された背景をもって描画して出力する出力手段と
を備える文書解析装置。
A document analysis device that analyzes and outputs a structured document described in a predetermined format,
When the structured document is designated, an analysis means for accepting and analyzing the designated structured document;
The parsed structured document includes an element for which a table is specified, and the element includes a cell element from the upper layer, a cell inclusion element that includes the cell element, and a table element that includes the cell inclusion element. When a background is formed and a space between cells is specified, the background specified in the table element is output in the space between the cells. A background setting means for setting the background of the element;
A document analysis apparatus comprising: output means for sequentially laying out elements included in the analyzed structured document and drawing and outputting the laid-out elements with the set background.
前記背景設定手段は、セル間にスペースを設ける指定がなされると共に前記セル包含要素に指定された背景が透明以外であるときには、該背景の指定に拘わらず該セル包含要素の背景を描画の対象外に設定する手段である請求項1記載の文書解析装置。   The background setting means is configured to draw a background of the cell inclusion element regardless of the designation of the background when a designation is made to provide a space between the cells and the background designated for the cell inclusion element is other than transparent. The document analysis apparatus according to claim 1, wherein the document analysis apparatus is a means for setting outside. 前記背景設定手段は、セル間にスペースを設ける指定がなされ前記セル要素に指定された背景が透明であると共に該セル要素に属するセル包含要素に指定された背景が透明以外であるときには、該背景の指定に拘わらず該セル要素の背景に該セル要素が属するセル包含要素に指定された背景を設定すると共に該セル包含要素の背景を描画の対象外に設定する手段である請求項1または2記載の文書解析装置。   The background setting means, when it is specified that a space is provided between cells and the background specified for the cell element is transparent and the background specified for the cell inclusion element belonging to the cell element is other than transparent, 3. A means for setting the background specified for the cell inclusion element to which the cell element belongs to the background of the cell element regardless of the designation of the cell element, and setting the background of the cell inclusion element as a drawing object. Document analysis device described. 前記セル包含要素は、表の行を構成する行要素および/または表の列を構成する列要素である請求項1ないし3いずれか記載の文書解析装置。   4. The document analysis apparatus according to claim 1, wherein the cell inclusion element is a row element constituting a table row and / or a column element constituting a table column. 前記背景は、色または画像である請求項1ないし4いずれか記載の文書解析装置。   The document analysis apparatus according to claim 1, wherein the background is a color or an image. 前記所定の書式は、マークアップ言語で記述されてなる請求項1ないし5いずれか記載の文書解析装置。   The document analysis apparatus according to claim 1, wherein the predetermined format is described in a markup language. 前記マークアップ言語は、XHTMLである請求項6記載の文書解析装置。   The document analysis apparatus according to claim 6, wherein the markup language is XHTML. 請求項1ないし7いずれか記載の文書解析装置を備える印刷装置。   A printing apparatus comprising the document analysis apparatus according to claim 1. 所定の書式で記述された構造化文書を解析して出力する文書解析方法であって、
(a)前記構造化文書が指定されたとき、該指定された構造化文書を受け付けて解析し、
(b)該解析された構造化文書に表組みの指定がなされた要素が含まれ、該要素に上層からセル要素,該セル要素を包含するセル包含要素,該セル包含要素を包含する表要素の順に層をなす背景が指定されると共にセル間にスペースを設ける指定がなされたときには、該セル間のスペースに前記表要素に指定された背景が出力されるよう前記セル要素,前記セル包含要素,前記表要素の背景を設定し、
(c)該解析された構造化文書に含まれる要素を順次レイアウトすると共に該レイアウトした要素を前記設定された背景をもって描画して出力する
文書解析方法。
A document analysis method for analyzing and outputting a structured document described in a predetermined format,
(A) When the structured document is designated, the designated structured document is received and analyzed;
(B) The analyzed structured document includes an element for which a table is specified. The element includes a cell element from the upper layer, a cell inclusion element including the cell element, and a table element including the cell inclusion element. The cell elements and the cell inclusion elements are output so that the background specified in the table element is output in the space between the cells when the background forming the layers is specified and the space between the cells is specified. , Set the background of the table element,
(C) A document analysis method for sequentially laying out elements included in the analyzed structured document and drawing and outputting the laid out elements with the set background.
所定の書式で記述された構造化文書を解析して出力する文書解析装置に用いられるプログラムであって、
前記構造化文書が指定されたとき、該指定された構造化文書を受け付けて解析するモジュールと、
該解析された構造化文書に表組みの指定がなされた要素が含まれ、該要素に上層からセル要素,該セル要素を包含するセル包含要素,該セル包含要素を包含する表要素の順に層をなす背景が指定されると共にセル間にスペースを設ける指定がなされたときには、該セル間のスペースに前記表要素に指定された背景が出力されるよう前記セル要素,前記セル包含要素,前記表要素の背景を設定するモジュールと、
該解析された構造化文書に含まれる要素を順次レイアウトすると共に該レイアウトした要素を前記設定された背景をもって描画して出力するモジュールと
を備えるプログラム。
A program used in a document analysis device that analyzes and outputs a structured document described in a predetermined format,
A module that accepts and analyzes the designated structured document when the structured document is designated;
The parsed structured document includes an element for which a table is specified, and the element includes a cell element from the upper layer, a cell inclusion element that includes the cell element, and a table element that includes the cell inclusion element. When a background is formed and a space between cells is specified, the background specified in the table element is output in the space between the cells. A module to set the background of the element;
A module for sequentially laying out elements included in the analyzed structured document and drawing and outputting the laid out elements with the set background.
JP2004013071A 2004-01-21 2004-01-21 Document analysis device and method, program for document analysis device, and printer Pending JP2005208809A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2004013071A JP2005208809A (en) 2004-01-21 2004-01-21 Document analysis device and method, program for document analysis device, and printer

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2004013071A JP2005208809A (en) 2004-01-21 2004-01-21 Document analysis device and method, program for document analysis device, and printer

Publications (1)

Publication Number Publication Date
JP2005208809A true JP2005208809A (en) 2005-08-04

Family

ID=34899266

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2004013071A Pending JP2005208809A (en) 2004-01-21 2004-01-21 Document analysis device and method, program for document analysis device, and printer

Country Status (1)

Country Link
JP (1) JP2005208809A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR100740502B1 (en) 2005-12-06 2007-07-19 주식회사 인프라웨어 Method of printing tables included in web pages
JP2013137761A (en) * 2011-12-20 2013-07-11 Canon Inc Determination for transparent painting-out based on reference background color
US20220156447A1 (en) * 2015-03-09 2022-05-19 Vinyl Development LLC Adaptive Column Selection

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR100740502B1 (en) 2005-12-06 2007-07-19 주식회사 인프라웨어 Method of printing tables included in web pages
JP2013137761A (en) * 2011-12-20 2013-07-11 Canon Inc Determination for transparent painting-out based on reference background color
US20220156447A1 (en) * 2015-03-09 2022-05-19 Vinyl Development LLC Adaptive Column Selection

Similar Documents

Publication Publication Date Title
JP2005131915A (en) Printing apparatus, printing method and program for printing apparatus
CN102331914A (en) Form processing system, ocr device, form creation device, and form procrssing method
JP2015146122A (en) Conversion processing device, information processing apparatus including the same, program, and recording medium
US20050213154A1 (en) Printing device and medium type setting method
JP4217575B2 (en) Image processing apparatus, image processing method, program, and storage medium
JP5053722B2 (en) Image processing apparatus, image processing method, computer program, and storage medium
JP2000267829A (en) Information processor, its controlling method and storage medium
JP2007148486A (en) Method for supporting document browsing, system for the same, document processor, and program
US8264734B2 (en) Print management apparatus, print management system, medium for storing print management program and print management method
JP5077105B2 (en) Image processing apparatus, image processing program, and image processing system
US20050157323A1 (en) Printing device and printing method
JP2005208809A (en) Document analysis device and method, program for document analysis device, and printer
CN104424174A (en) Document processing system and document processing method
JP2007193660A (en) Information management device, information management method and program therefor
JP4449398B2 (en) Printing apparatus, printing method, and program for printing apparatus
JP5915091B2 (en) Image forming apparatus, image forming system, output image data processing method, program, and recording medium
JP4599950B2 (en) Processing apparatus and processing method
US20060092454A1 (en) Printing device and printing method
JP2005208810A (en) Document analysis device and method, program for document analysis device, and printer
JP4165366B2 (en) Document analysis apparatus and method, program for document analysis apparatus, and printing apparatus
JP2005246796A (en) Printing device and its printing method
US6783289B2 (en) Print control apparatus, print control method, and printer
US20060092447A1 (en) Printing device and corresponding printing method used therein
JP2006091956A (en) Processor and processing method
JP2005111795A (en) Printer, printing method and program for printer