JP2004110401A - Document printer and its method - Google Patents

Document printer and its method Download PDF

Info

Publication number
JP2004110401A
JP2004110401A JP2002272006A JP2002272006A JP2004110401A JP 2004110401 A JP2004110401 A JP 2004110401A JP 2002272006 A JP2002272006 A JP 2002272006A JP 2002272006 A JP2002272006 A JP 2002272006A JP 2004110401 A JP2004110401 A JP 2004110401A
Authority
JP
Japan
Prior art keywords
size
area
font
layout
output
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
JP2002272006A
Other languages
Japanese (ja)
Inventor
Masayuki Yoshida
吉田 政幸
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.)
Canon Inc
Original Assignee
Canon Inc
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 Canon Inc filed Critical Canon Inc
Priority to JP2002272006A priority Critical patent/JP2004110401A/en
Priority to US10/660,639 priority patent/US7797631B2/en
Publication of JP2004110401A publication Critical patent/JP2004110401A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Document Processing Apparatus (AREA)
  • Record Information Processing For Printing (AREA)

Abstract

<P>PROBLEM TO BE SOLVED: To change an area and a font size after their area allocation is carried out once. <P>SOLUTION: When an output paper size is set through a keyboard 105, a block size of each block is decided on the basis of the set output paper size, the size and the font size of an output area is decided on the basis of the decided block size, and the output area and the font with the decided size are arranged. If a layout is edited after arrangement of the font in the output area, the output area and the font are arranged according to the edited layout. <P>COPYRIGHT: (C)2004,JPO

Description

【0001】
【発明の属する技術分野】
本発明は、文書印刷装置及び方法に関する。
【0002】
【従来の技術】
HTML(hypertext markup language)のデータは、出力時の用紙サイズや解像度等は意識せずに作成されている場合が多く、また、Internet Explorer(登録商標)やNetscape Navigator(登録商標)等で領域の大きさが変更された場合に、変更された領域に合わせてレイアウトも変化できるように、相対座標値や割合で定義されている場合が多い。また、構造化記述言語で記述された文書データを物理ページにレイアウトする際に、前記文書データから特定データとして最小文字サイズを検出し、該検出された特定データをレイアウトするための変倍率を算出し、前記文書データに対して、物理ページへのレイアウトが可能となるように前記変倍率に基づく変換を施していた(たとえば、特許文献1参照)。
【0003】
【特許文献1】
特開2002−91946号公報
【0004】
【発明が解決しようとする課題】
このように、データが出力用紙サイズを意識して作成されていないので、期待したものと出力のサイズが異なって、例えば、出力用紙の用紙サイズに収まらず、領域をオーバして印刷されるものや、領域に収めようとすると、文字が小さくなって読めなくなる等の問題点があった。
【0005】
そこで、本発明の目的は、上記の問題点を解決し、領域やフォントサイズを変更できる文書印刷装置を提供することにある。
【0006】
【課題を解決するための手段】
請求項1の発明は、レイアウトがあいまいなドキュメントフォーマットのファイルからレイアウトが確定するドキュメントのフォーマットのファイルに変換して印刷する文書印刷装置において、出力用紙サイズを設定するための設定手段と、該設定手段により設定された出力用紙サイズに基づいて各ブロックのブロックサイズを決定する第1決定手段と、該第1決定手段によって決定されたブロックサイズに基づいて出力領域のサイズとフォントのサイズを決定する第2決定手段と、該第2決定手段により決定されたサイズの出力領域とフォントとを配置する第1配置手段と、該第1配置手段により配置された後のレイアウトを編集するための編集手段と、該編集手段によりレイアウトが編集された場合に、編集されたレイアウトに従って出力領域とフォントとを配置する第2配置手段とを有することを特徴とする。
【0007】
請求項1において、編集手段は、前記配置手段により配置された全ての出力領域から1つの出力領域を選択するための選択手段と、該選択手段により選択された出力領域がテキスト領域かどうかを判定する判定手段と、該判定手段によりテキスト領域と判定された場合に、当該テキスト領域に対して領域のサイズとフォントのサイズを変更するための変更手段と、該変更手段によるテキスト領域サイズの変更対象となる領域を指定するための指定手段とを有することができる。
【0008】
請求項2において、第2配置手段は、変更前のテキスト領域の横サイズに対する変更後のテキスト領域の横サイズの比率に従ってフォントサイズを取得する取得手段を有し、該取得手段により取得されたサイズのフォントを前記変更後のテキスト領域に配置することができる。
【0009】
請求項4の発明は、レイアウトがあいまいなドキュメントフォーマットのファイルからレイアウトが確定するドキュメントのフォーマットにファイルを変換して印刷する文書印刷方法において、出力用紙サイズが設定されたとき、設定された出力用紙サイズに基づいて各ブロックのブロックサイズを決定する第1決定ステップと、該第1決定ステップによって決定されたブロックサイズに基づいて出力領域のサイズとフォントのサイズを決定する第2決定ステップと、該第2決定ステップにより決定されたサイズの出力領域とフォントとを配置する第1配置ステップと、出力領域にフォントが配置された後に、レイアウトが編集されたときに、編集されたレイアウトに従って出力領域とフォントとを配置する第2配置ステップとを有することを特徴とする。
【0010】
請求項4において、第2配置ステップは、変更前のテキスト領域の横サイズに対する変更後のテキスト領域の横サイズの比率に従ってフォントサイズを取得する取得ステップを有し、該取得ステップにより取得されたサイズのフォントを前記変更後のテキスト領域に配置することができる。
【0011】
請求項6のコンピュータ読み取り可能な記憶媒体は、レイアウトがあいまいなドキュメントフォーマットのファイルからレイアウトが確定するドキュメントのフォーマットにファイルを変換して印刷するプログラムであって、出力用紙サイズが設定されたとき、設定された出力用紙サイズに基づいて各ブロックのブロックサイズを決定する第1決定手順と、該第1決定手順によって決定されたブロックサイズに基づいて出力領域のサイズとフォントのサイズを決定する第2決定手順と、該第2決定手順により決定されたサイズの出力領域とフォントとを配置する第1配置手順と、出力領域にフォントが配置された後に、レイアウトが編集されたときに、編集されたレイアウトに従って出力領域とフォントとを配置する第2配置手順とをコンピュータに実行させるプログラムを記憶したものである。
【0012】
請求項6のコンピュータ読み取り可能な記憶媒体に記憶したプログラムは、第2配置手順が、変更前のテキスト領域の横サイズに対する変更後のテキスト領域の横サイズの比率に従ってフォントサイズを取得する取得手順を有し、該取得手順により取得されたサイズのフォントを前記変更後のテキスト領域に配置することができる。
【0013】
【発明の実施の形態】
以下、本発明の実施の形態を図面を参照して詳細に説明する。
【0014】
図1は本発明の一実施の形態を示す。これは、文書印刷システムの例である。この文書印刷システムは、複数台のパーソナルコンピュータ(以下「クライアントパソコン」という。)3,4と、1台のファイルサーバ1と、1台のWebサーバ2と、少なくとも1台のXML(Extensible Markup Language)データを処理できるプリンタ5とが、ネットワーク7を介して相互に接続してある。
【0015】
プリンタ5には、携帯情報端末のようなモバイル端末6が、直接、IrDA、RS−232Cやセントロニクスなどを通して、ネットワーク7に接続せずに、接続してある。
【0016】
なお、クライアントパソコン3,4に代えて、ワードプロセッサ、ワークステーション、携帯情報端末等の情報処理装置を接続することも可能である。
【0017】
クライアントパソコン3,4およびファイルサーバ1は、複数種のフォントにかかるフォントデータ群やWebのデータや画像データ等が格納されている。
【0018】
モバイル端末6、またはクライアントパソコン3もしくは4から、プリンタ5に対して、印刷したいWebのURLや印刷部数等の印刷要求を出し、プリンタ5からWebサーバにファイル要求を出し、Webサーバは必要な文書データやフォントデータ等をファイルサーバより集めて、プリンタ5に転送し、プリンタ5はその転送されたデータを展開することによって印刷する。
【0019】
図2は図1のクライアントパソコン3,4、ファイルサーバ1、及びWebサーバ2の概略構成を示す。図2において、101はCPU(central processingunit)であり、装置全体の制御及び演算処理等を行う。102はROM(read only memory)であり、システム起動プログラム、基本I/Oプログラム、及び文字コードをビットパターンに変換するための文字パターンデータ(フォントデータ)等を記憶している。103はRAM(random access memory)であり、CPU101の演算に使用するデータや演算結果、表示のために文字コードから変換された文字パターンデータ列等を一時記憶する。
【0020】
104はキーボード制御部(KBC)であり、キーボード(KB)105よりキー入力データ(文字コードや制御コード)を受け取り、CPU101へ伝達する。106はディスプレイ制御部(CRTC)であり、RAM103に格納された文字パターンデータ列を読み出し、CRT107に転送する。107はディスプレイ装置(CRT)であり、CRTC106より文字パターンデータ列を受け取り、表示画面に表示する。
【0021】
108はディスク制御部(DKC)であり、外部記憶装置109に対するアクセス制御を行う。109はフロッピー(登録商標)ディスク装置(FD)、ハードディスク装置(HD)、又はCD−ROM等の外部記憶装置である。HDには、文字パターンデータ(フォントデータ)やフォントデータを読み出してビットマップデータに変換する文字展開処理プログラム等が記憶してある。FD又はCD−ROM等の外部記憶装置から、アプリケーションプログラム及び関連データが供給される。
【0022】
110はネットワーク制御部(NTC)であり、ネットワーク装置(NT)111の動作を制御する。112はシステムバスであり、上述の構成要素間のデータ転送を行う。
【0023】
図3は図2のRAM103のメモリマップを示す。基本I/Oプログラムは、ROM102内のシステム起動プログラムによりRAM103に読み込まれる。外部記憶装置109としてのFD又はCD−ROMから、アプリケーションプログラム及び関連データを、一旦、HDへインストールした状態で電源がONされたときに、HDからRAM103にロードすることにより、実行することが可能となる。なお、HDへインストールせずに、直接、FD又はCD−ROMからRAM103にロードして実行することも可能である。なお、ファイルサーバ1では、後述のプリンタ情報テーブルが関連データの領域に形成されている。
【0024】
図4は図1のプリンタ5の構成を示す。プリンタ5はレーザビームプリンタ、バブルジェット(登録商標)プリンタ、又は熱転写プリンタ等のいずれのタイプでもよいが、XML形式のデータを処理できる能力を有するものである。
【0025】
プリンタ5は、CPU211と、ROM212と、RAM213と、プリンタコントローラ(PRTC)215と、プリンタエンジン(PRT)219と、ディスクコントローラ(DKC)216と、ハードディスク装置(HD)217と、ネットワークコントローラ(NTC)220と、ネットワーク装置(NT)218とが、システムバス214を介して、相互に接続してある。
【0026】
なお、DKC217およびHD218はプリンタの種類によっては存在しない場合もある。
【0027】
CPU211は装置全体を制御するものであって、RAM213をワークエリア等として利用しながら、ROM212に格納されたプログラムに従って、印刷に必要な各種の処理を実行する。システムバス214は上記各構成要素間でデータ及び制御信号を授受するための通路である。なお、ROM212には、文字パターンデータ(フォントデータ)等が格納されている。RAM213またはHD218には、Webサーバ2へ要求した文書データ、イメージデータ、又はフォントデータ等がWebサーバ2からダウンロードされ格納される。
【0028】
CPU211は、Webサーバ2から供給された文書データ、イメージデータあるいはフォントデータを、ROM212内にあるプログラムに従って文字パターンデータや画像データ(ビットマップデータ)を生成し、プリンタコントローラ215内の印刷バッファに展開する。プリンタコントローラ215は、ビットマップデータに基づいて生成した印刷コントロール信号をプリンタエンジン219に出力する。
【0029】
ネットワークコントローラ220は、ネットワーク7を介してクライアントパソコン3、4やファイルサーバ1との間でデータ送受信を行う際のネットワーク装置(NT)218の動作を制御するものである。
【0030】
図9はファイル変換処理の流れを示す。本処理はホスト側の処理とプリンタ側の処理に分かれていて、ホスト側の処理は図1のWebサーバ2上で行なわれたり、クライアントパソコン3または4で行なわれたりする。まず、ファイルサーバより、XML形式で保存されたドキュメント又はHTML形式で保存されたドキュメントを読み込み、それを一旦XHTML(Extensible Hyper Text Markup Language)の形式のデータに変換する。そして、そこから、図5に示すフローチャートに従って出力用紙サイズや解像度に基づき適正なレイアウトを行なうSVG(Scalable Vector Graphic)に変換する。しかし、その自動的にレイアウトしたドキュメントに対して、ユーザの思惑と異なる出力になっている場合が発生する。
【0031】
このとき、ユーザが所望の出力に変更できるように、パソコン画面上に自動的にレイアウトされたドキュメントの印刷イメージを表示し、その表示画面上でレイアウト自体を編集できるようにし、編集した結果を新たなSVGドキュメントとしてプリンタへ出力する。このレイアウト編集の詳細は図7のフローチャートを参照して後述する。
【0032】
なお、XHTMLおよびSVGの内容はW3Cのテクニカルレポートに記載されている。基本的にXHTMLはHTMLの文法をXML形式に従って拡張したものであり表示向きである。一方、SVGはPS(Post Script)等のページ記述の文法に似たものであり、XML拡張されたものであり、出力フォーマットに適している。したがって、HTMLやXMLの文書データを一旦XHTMLに変換し、さらにそこで出力用紙サイズや解像度を得て、SVG形式のデータに変換し、それをSVGが解釈できるプリンタへSVGファイルで転送するのである。そうすることによって、XMLやHTMLで書かれた文書データを適正にレイアウトして出力することが可能となる。
【0033】
図5は図2のROM102にストアされる制御プログラムであって、XHTML形式の文書データからSVG形式の文書データに変換する制御プログラムの一例を示すフローチャートである。ステップS501にて、変換元となるXHTML形式のデータの中から、まず変換の基準となるフォントサイズを求める。基準となるフォントサイズは、XHTMLのファイルでは特に指定されていない。したがって、各ブラウザが独自に基準フォントサイズを定めていることが多いが、ここでは出力用紙への基準フォントサイズとして10ポイント又は10.5ポイント等の値を定める。また、XHTMLドキュメントの中に基準フォントサイズが記入してあるような場合にはその値を基準フォントサイズとして定める。
【0034】
ステップS502にて、XHTMLドキュメント全体をチェックして、テーブルの属性がないかどうかを調べる。テーブルの属性がない場合には、所定の出力したい用紙や画面のサイズの横領域が各XHTML要素であるタグの横領域の基準となるサイズとなる。テーブルの属性が存在する場合には、各テーブルの内容を比較する。例えば、XHTMLの<TABLE>の要素にwidthの属性が合った場合には、その値がテーブルの幅の値となるので、その値が最大のものを選択する。<TABLE>の要素にwidthの属性がない場合には出力領域の横領域がそのテーブルの横領域となる。
【0035】
ステップS503にて、ステップS502で得られたテーブルの最大値から出力領域の拡大縮小率を計算する。計算方法は出力領域の横領域と、ステップS502で求めたテーブルの最大横領域との比率から求めることができる。つまり、拡大縮小率=出力領域の横領域/テーブルの最大横領域となる。
【0036】
そして、ステップS504以降において、各要素の配置および要素内の文字の配置位置等の計算を行なう。
【0037】
ステップS504にて、まず対象となる要素がテーブル要素なのか、テキスト要素なのか、イメージ要素なのかの判定を行なう。テーブル要素としては、<TABLE>、<TR>、<TH>、<TD>、<CAPTION>、<THEAD>、<TFOOT>、<TBODY>等がある。テキスト要素としては、<H1>〜<H6>、<P>、<Q>、<BLOCKQUOTE>、<EM>、<STRONG>、<SUP>、<SUB>等がある。そして、イメージ要素としては、<IMG>、<MAP>、<AREA>、<OBJECT>、<APPLET>等がある。それぞれの要素の意味については、http://www.w3.org/TR/xhtml1/ に記載されているXHTMLの仕様や、http://www.w3.org/TR/html40/ に記載されているHTMLの仕様を参照されたい。
【0038】
そして、ステップS504にて、対象となる要素がテーブルの要素であれば、ステップS505へ進み、ステップS505にて、テーブル内の配置を行なう。この処理の詳細は図6のフローチャートを参照して後述する。
【0039】
ステップS504にて、テキストの要素と判定した場合には、ステップS506へ進み、ステップS506にて、テキストの要素内にある個々の文字に対する配置位置を決定する。
【0040】
テキスト領域はブロック要素とインライン要素とに分かれ、ブロック要素としては、<H1>〜<H6>、<P>要素等があり、インライン要素としては、<EM>、<STRONG>等がある。このインライン要素はブロック要素の子要素として、文章中のある文字列を強調したり、色を変えたりするときに使用される。
【0041】
テキストのブロック要素の配置方法としては、まずテキスト領域の横領域を決定する。ここではテキスト要素の親要素の横領域がテキスト領域の横領域ということになる。例えば、親要素が<XHTML>であれば、それが最上位要素ということになるので、出力すべき用紙や画面のサイズの横領域がテキスト領域の横領域として設定される。
【0042】
文字の大きさに関しては、W3Cの仕様であるCSSのプロパティで指定されている場合には、その値に対して、特に文字のサイズを指定していない場合には、ステップS501で求めた標準の文字サイズに対して、ステップS503で求めた拡大縮小率をかけた値を文字サイズの大きさとする。このとき決定された文字サイズの大きさは、ステップS510で予め設定された最小サイズより大きい値に設定されているかどうかをチェックするので、保存しておく。
【0043】
そして、決定された文字サイズで文字を1文字ずつ配置していき、横領域を越えるところで文字の折り返しを行ない、次の行の先頭から続きを配置していく。
【0044】
そして、すべての文字を配置し終わったときに、そのときの行数とフォントサイズから領域の高さを計算する。このとき、行間の大きさはCSSのプロパティで指定されている場合には、それに従い、特に指定がない場合には、文字の高さに対してある一定の値を標準として、その行間の値を設定する。
【0045】
また、テキストのインライン要素の配置方法としては、インラインに指定された文字列の1つ前の文字の配置位置の終了点を基準点とし、そこから要素で指定された文字種や文字サイズで各文字のピッチ情報に従って配置していく。
【0046】
他方、ステップS504にて、イメージの要素であると判定した場合には、ステップS507へ進む。ステップS507にて、イメージ要素の領域の決定と配置位置の決定の処理を行なう。イメージ領域の大きさの決定方法は、イメージ領域の大きさがXHTMLドキュメントの中で指定してある大きさに対して、ステップS503で求めた拡大縮小率を乗算して得られた領域の大きさになる。
【0047】
そして、ステップS508において、ステップS505から507までで求めた各要素の内容をSVGデータに変換する。このとき、テキストの要素は<tspan>にイメージ要素は<image>に変換される。例えば、図11に示すようなレイアウトのデータは、図10に示すようなXHTMLのドキュメントで表され、それをSVGで表現すると、図12に示すようになる。
【0048】
ステップS509にて、すべての要素に対してステップS505からステップS507までの処理が終了したかどうかをチェックし、まだ処理が終了していない場合には、ステップS504へ戻って、各要素の配置位置の計算を行なう。すべての要素に対して処理が終了していれば、ステップS510へ進む。
【0049】
ステップS510にて、すべての要素の配置位置が計算された後、ドキュメント全体を<svg>と</svg>で囲み、必要に応じてスタイルシートを<style>要素で定義してsvgドキュメントの作成を終了する。
【0050】
図6は図5のステップS505、すなわちテーブルの内容の配置位置の計算を行なう処理をより詳細に示すフローチャートである。ステップS601にてテーブル内の各セルの横領域の計算を行なう。この計算方法は、<TR>要素で囲まれる各セルの領域の大きさを合計して、親要素であるテーブル要素の横領域を各セルの割合に応じて割り当てる。例えば、XHTMLのドキュメント内のあるテーブルの子要素としてセルが3つあり、それぞれのセルの横領域が、セル1が10、セル2が20、セル3が10で、親要素のテーブルの横領域が100である場合、セル1の横領域は100×(10/40)=25、同様に、セル2の横領域は50、セル3の横領域は25となる。
【0051】
ステップS602にて、各セルの内容をチェックする各セルの内容としては、さらにテーブルになっている場合、テキストになっている場合、又はイメージになっている場合がある。
【0052】
そして、それぞれの判定方法は、ステップS504で述べた方法と同様に、<TABLE>、<TR>、<TH>、<TD>、<CAPTION>、<THEAD>、<TFOOT>、<TBODY>等の要素であれば、テーブル要素と判定し、ステップS607に進み、拡大縮小率を再計算して、ステップS601に戻り、テーブル要素の処理を行なう。
【0053】
他方、<H1>〜<H6>、<P>、<Q>、<BLOCKQUOTE>、<EM>、<STRONG>、<SUP>、<SUB>等の要素であれば、テキスト要素と判定し、ステップS603へ進み、他方、<IMG>、<MAP>、<AREA>、<OBJECT>、<APPLET>等の要素であれば、イメージと判定し、ステップS606へ進む。
【0054】
ステップS603からステップS605までは、テキストの要素であると判定された場合であり、テキスト要素内にある個々の文字に対する配置位置の決定を行なう。
【0055】
テキスト領域のうちブロック要素とインライン要素に分かれるが、ブロック要素としては、<H1>〜<H6>、<P>要素等がある。インライン要素としては、<EM>、<STRONG>等がある。インライン要素はブロック要素の子要素として文章中のある文字列を強調したり、色を変えたりするときに使用される。
【0056】
テキストのブロック要素の配置方法としては、まずテキスト領域の横領域を取り込む。ここではステップS601で決定したセルの横領域がここで対象となるテキストの横領域となる。
【0057】
ステップS603にて文字の大きさに関して、W3Cの仕様であるCSSのプロパティで指定されている場合には、その値に対して、特に文字のサイズを指定していない場合には、ステップS501で求めた標準の文字サイズに対して、ステップS503又はステップS607で求めた拡大縮小率をかけた値を文字サイズの大きさとする。
【0058】
そして、このとき決定された文字サイズの大きさは、ステップS510で予め設定された最小サイズより大きい値に設定されているかどうかをチェックするので、保存しておく。
【0059】
そして、ステップS604において決定された文字サイズで文字を1文字ずつ配置していき、横領域を越えるところで文字の折り返しを行ない、次の行の先頭から続きを配置していく。また、テキストのインライン要素の配置方法としては、インラインに指定された文字列の一つ前の文字の配置位置の終了点を基準点とし、そこから要素で指定された文字種や文字サイズで各文字のピッチ情報に従って配置していく。
【0060】
そして、すべての文字を配置し終わったとき、ステップS605において行数とフォントサイズから領域の高さを計算する。このとき行間の大きさは、CSSのプロパティで指定されている場合には、それに従い、特に指定がない場合には、文字の高さに対してある一定の値を標準として、その行間の値を設定する。
【0061】
他方、ステップS602にてイメージの要素であると判定した場合には、ステップS606にて、イメージ要素の領域の決定と配置位置の決定の処理を行なう。イメージ領域の大きさの決定方法は、イメージ領域の大きさがXHTMLドキュメントの中で指定してある大きさの縦横比を、ステップS601で求めたセルの横領域に適用して高さを求める。
【0062】
他方、ステップS602にて、セルの中にさらにテーブルの要素があると判定された場合には、ステップS607にて、対象となるテーブルの親要素となるセルの大きさはステップS601で求めてあるので、その大きさに収まるようにテーブルのサイズを変換する必要がある。拡大縮小率は、拡大縮小率=(親要素のテーブルの拡大縮小率)×(テーブルの横サイズ)÷(親要素のセルの横幅)、から得られる。
【0063】
ステップS608にて、さらに処理すべきセルが存在するかどうかをチェックし、セルが存在する場合には、ステップS602へ戻って同様の処理を行ない、セルが存在しない場合には、処理を終了する。
【0064】
図7は印刷イメージが表示された画面上でのレイアウト編集手順の一例を示すフローチャートである。ステップS701にて、画面上に表示された現在のSVGドキュメントのレイアウトイメージに対して、テーブル、テキストやイメージの領域単位でレイアウトを編集したい場合に、図8に示すように領域をマウス等で指定する。
【0065】
そして、ステップS702では、指定された領域がテーブルの領域なのかテキストの領域なのか、あるいはイメージ領域なのかを判定する。指定した領域がテーブル領域であればステップS703へ進み、イメージ領域であればステップS705へ進み、テキスト領域であればステップS706へ進む。
【0066】
ステップS703にて、指定された領域がテーブルの場合であり、テーブル全体の領域を広げたり、小さくしたりして領域の変更を行なう。このときの領域の変更方法としては、マウスのドラッグ機能を使ってもよいし、UI画面上で直接値を入力する等の方法も考えられるが、ここでは特にその指定方法については言及しない。
【0067】
そして、ステップS704において、変更された領域に対応させてそれぞれのセルの内容を変更する。まず、変更された全体領域と変更前の全体領域を比較して拡大縮小率を求め、その拡大縮小率を各セルの内容にも反映させる。例えば、セルの内容がテキストであった場合には、各文字の配置位置やフォントサイズ等にも同様の拡大縮小率を適用する。他方、イメージの場合には、イメージ領域の縦横のサイズに対して同様の拡大縮小率を適用する。
【0068】
ステップS705にて、指定された領域がイメージの場合であり、イメージ領域を広げたり、小さくしたりして、その元のイメージ領域と変更されたイメージ領域の比率によってイメージの縦横の領域を変更する。
【0069】
ステップS706からステップS714までは、テキスト領域に関しての変更である。まず、ステップS706では、テキスト領域に関して領域の変更に関すものかどうかをチェックする。領域に関する変更であればステップS707へ進み、領域以外のフォントサイズや書体に関する変更であればステップS708へ進む。
【0070】
ステップS707はテキストの領域に関して変更があった場合であり、元のテキスト領域の大きさと変更後のテキスト領域の大きさのうち、横サイズの比率を、各文字のフォントサイズに適用する。そして、新たなフォントの大きさが定義されたので、領域の配置位置を計算し、新たな文字のサイズで配置を行なう。そして、配置し終わった後、配置後の縦領域が変更された領域の縦領域より小さい場合は、変更された縦領域を新たな縦領域として使い、配置後の縦領域が変更された縦領域より大きい場合は、配置後の縦領域を新たな縦領域として使う。
【0071】
ステップS708からステップS714までは、変更の指定が領域の変更指定ではなく、直接フォントのサイズや書体や修飾等の指定であった場合の手順である。
【0072】
ステップS708では、変更の指定がフォントサイズの指定であった場合にはステップS709へ進み、書体の変更指定であればステップS7011へ進み、ボールド体やイタリック体等への修飾文字への変更指定であればステップS713へ進む。
【0073】
ステップS709にて、変更の指定がフォントサイズの指定であった場合であり、元のテキスト領域のうち横領域は変更しない。そして、新たに指定されたフォントサイズで1文字づつ配置していく。横領域を越える場合には文字がそこで折り返される。そして、このときの元のサイズから新たな指定のサイズへの拡大縮小率は、後のステップS715において使用するためここで計算を行なっておく。そして、ステップS710において、全ての文字列が配置された後、縦領域を求め、その大きさがテキスト領域の新たな縦領域となる。ステップS715にて、ステップS709において変更されたポイントサイズに基づき、変更前のポイントサイズと変更後のポイントサイズの比率を求め、その比率で他の文字領域にある文字も同時に変更してしまう処理を行なう。この処理の詳細は図15のフローチャートを参照して後述する。
【0074】
他方、変更の指定が書体の変更の指定であった場合は、元のテキスト領域のうち横領域は変更しないが、ステップS711にて、新たに指定された書体のフォントで1文字づつ配置していき、横領域を越える場合には文字がそこで折り返す。そして、ステップS712において、全ての文字列が配置された後、縦領域を求め、その大きさがテキスト領域の新たな縦領域となる。
【0075】
他方、変更の指定がフォントの修飾としてボールド体やイタリック体へのあるいは修飾なしの文字への変更の指定であった場合は、元のテキスト領域のうち横領域は変更しないが、ステップS713にて、新たに指定された書体のフォントで1文字づつ配置していき、横領域を越える場合には文字がそこで折り返す。そして、ステップS714において、全ての文字列を配置した後、縦領域を求め、その大きさがテキスト領域の新たな縦領域となる。
【0076】
ステップS716にて、変更された領域を全体の領域に反映させて新たにページレイアウトを行なう。このときの様子を図13及び図14に示す。図13の例は、タイトルの「見出し」の文字を大きくしたことによりページ領域をオーバしたため、テーブル領域を指定した様子を示し、図14は図13でページ領域をオーバしたテーブル領域の領域を調整して1ページ内に収めた例を示す。
【0077】
そして、ステップS717にて、ユーザが現在のレイアウトで満足した場合には処理を終了し、満足しない場合にはステップS701に戻ってさらに同一の領域や他の領域等を指定し、新たな領域変換を行なっていく。
【0078】
図15は図7のステップS715すなわち他の文字領域内の文字のサイズも同時に変更する処理をより詳細に示すフローチャートである。ステップS1501にて、図16に示すようなUIを表示し、次の▲1▼〜▲3▼の3通りの方法をユーザに選択させる。▲1▼現在対象とするブロックのみ文字サイズを変更する。▲2▼<P>、<Q>、<BLOCKQUOTE>、<EM>等のテキスト要素のタグで指定されたブロック全てに対して文字サイズの変更を行なう。▲3▼ユーザが任意のタグを指定することによって、そのタグで指定されたブロックに対して文字サイズの変更を行なう。その際は、現在の設定で拡大縮小したいブロックをユーザが任意に指定することが可能となる。図16の例は全てのテキスト要素に対して処理を行なうことをユーザが指定した場合である。
【0079】
そして、ステップS1502にて、ユーザの選択が現ブロックのみか、否かの判定を行なう。現ブロックのみの場合は、そこで処理を終了し、そうでなければステップS1503へ進む。
【0080】
ステップS1503にて、現在のブロック以外にも対象とするブロックが存在する場合であるので、対象とするブロックの検索を行なう。検索の方法としては、現在対象としているタグから、ドキュメントを検索していき、次に存在するタグが対象となるタグか否かをチェックしながら検索する。図16の例では全てのテキストブロックに対して処理を適用するので、ここではテキストに関するタグか否かのチェックを行ない、テキストに関するタグが見つかった時点で新たな対象となるブロックとする。図16の例で指定するテキストブロックに対してが選択された場合には、指定されたタグが否かのチェックを行ない、指定されたタグが見つかった時点で新たな対象となるブロックとする。
【0081】
ステップS1504にて、対象とするタグが見つからなかった場合、あるいはすべての対象とするタグに対して処理を終了しているか否かのチェックを行なう。対象とするタグがもう既に存在しない場合には、そこで処理を終了し、対象とするタグが見つかっている場合にはステップS1505へ進む。
【0082】
ステップS1505にて、ステップS709で処理を行なったときと同様に、変更の指定がフォントサイズの指定であった場合である。変更サイズの割合はステップS709の拡大縮小の割合と同様の割合で処理を行なう。そして、元のテキスト領域のうち横領域は変更せず、新たに指定されたフォントサイズで1文字づつ配置していき、横領域を越える場合には文字がそこで折り返される。
【0083】
ステップS1506において、全ての文字列が配置された後、縦領域を求め、その大きさがテキスト領域の新たな縦領域となる。
【0084】
【発明の効果】
以上説明したように、本発明によれば、上記のように構成したので、一旦領域の割り当てを行なった後に領域やフォントサイズを変更することができる。
【図面の簡単な説明】
【図1】本発明の一実施の形態を示すブロック図である。
【図2】図1のクライアントパソコン3,4、ファイルサーバ1、及びWebサーバ2の概略構成を示すブロック図である。
【図3】図2のRAM103のメモリマップを示す図である。
【図4】図1のプリンタ5の構成を示すブロック図である。
【図5】図2のROM102にストアされる制御プログラムであって、XHTML形式の文書データからSVG形式の文書データに変換する制御プログラムの一例を示すフローチャートである。
【図6】図5のステップS505をより詳細に示すフローチャートである。
【図7】図7は印刷イメージが表示された画面上でのレイアウト編集手順の一例を示すフローチャートである。
【図8】レイアウト変更おける領域指定を説明するための説明図である。
【図9】ファイル変換処理の流れを示す図である。
【図10】XHTMLのドキュメントの内容を示す図である。
【図11】ドキュメントを表示したイメージ図である。
【図12】SVGのドキュメントの内容を示す図である。
【図13】レイアウト調整を説明するための説明図である。
【図14】レイアウト調整を説明するための説明図である。
【図15】図7のステップS715をより詳細に示すフローチャートである。
【図16】ユーザインタフェースの一例を示す図である。
【符号の説明】
1 ファイルサーバ
2 Webサーバ
3,4 パーソナルコンピュータ
5 プリンタ
6 モバイル端末
101 CPU
102 ROM
103 RAM
104 キーボード制御部
106 ディスプレイ制御部
107 ディスプレイ装置
108 ディスク制御部
109 フロッピー(登録商標)ディスク装置
110 ネットワーク制御部
[0001]
TECHNICAL FIELD OF THE INVENTION
The present invention relates to a document printing apparatus and method.
[0002]
[Prior art]
HTML (hypertext markup language) data is often created without being aware of the paper size and resolution at the time of output, and the data is output using an Internet Explorer (registered trademark) or a Netscape Navigator (registered trademark). When the size is changed, the layout is often defined by relative coordinate values or ratios so that the layout can be changed according to the changed area. When laying out document data described in a structured description language on a physical page, a minimum character size is detected as specific data from the document data, and a scaling factor for laying out the detected specific data is calculated. Then, the document data is subjected to conversion based on the scaling factor so that layout on a physical page is possible (for example, see Patent Document 1).
[0003]
[Patent Document 1]
JP-A-2002-91946
[0004]
[Problems to be solved by the invention]
As described above, since the data is not created in consideration of the output paper size, the output size is different from the expected one, for example, the data is not fit in the output paper size and is printed over the area. Also, there is a problem in that the characters become too small to be readable when trying to fit in the area.
[0005]
Therefore, an object of the present invention is to solve the above-mentioned problems and to provide a document printing apparatus capable of changing an area and a font size.
[0006]
[Means for Solving the Problems]
According to a first aspect of the present invention, there is provided a document printing apparatus for converting a file in a document format having an ambiguous layout into a file in a document format in which the layout is determined and printing the document, and setting means for setting an output paper size. First determining means for determining the block size of each block based on the output paper size set by the means, and determining the size of the output area and the font size based on the block size determined by the first determining means. Second deciding means, first arranging means for arranging the output area and the font having the size decided by the second deciding means, and editing means for editing the layout after being arranged by the first arranging means And when the layout is edited by the editing means, output according to the edited layout. And having a second arrangement unit for arranging the region and fonts.
[0007]
2. The editing device according to claim 1, wherein the editing unit selects one output region from all output regions arranged by the arrangement unit, and determines whether the output region selected by the selection unit is a text region. Determining means for changing the size of the text area and the size of the font for the text area when the determining means determines that the area is a text area; Designating means for designating an area to be set.
[0008]
3. The method according to claim 2, wherein the second arranging unit has an acquiring unit that acquires a font size in accordance with a ratio of the horizontal size of the changed text area to the horizontal size of the text area before the changing, and the size obtained by the obtaining unit. Can be arranged in the changed text area.
[0009]
According to a fourth aspect of the present invention, there is provided a document printing method for converting a file in a document format having an ambiguous layout into a document format in which the layout is determined and printing the converted file, when the output paper size is set, A first determining step of determining a block size of each block based on the size, a second determining step of determining an output area size and a font size based on the block size determined by the first determining step; A first arranging step of arranging the output area and the font having the size determined by the second deciding step; and, when the layout is edited after the font is arranged in the output area, the output area is determined according to the edited layout. Having a second arrangement step of arranging fonts And it features.
[0010]
5. The method according to claim 4, wherein the second arranging step has an acquiring step of acquiring a font size in accordance with a ratio of the horizontal size of the changed text area to the horizontal size of the text area before the changing, and the size obtained by the obtaining step. Can be arranged in the changed text area.
[0011]
The computer-readable storage medium according to claim 6 is a program for converting a file in a document format having an ambiguous layout into a document format in which the layout is determined and printing the converted file, wherein when an output paper size is set, A first determination procedure for determining the block size of each block based on the set output paper size, and a second determination procedure for determining the size of the output area and the font size based on the block size determined by the first determination procedure A deciding procedure, a first arranging procedure for arranging an output area and a font having the size determined by the second deciding procedure, and editing the layout after the font is arranged in the output area. The second arrangement procedure for arranging the output area and the font according to the layout is compiled. It is obtained by storing a program to be executed by the over data.
[0012]
The program stored in the computer-readable storage medium according to claim 6, wherein the second arranging step acquires the font size according to a ratio of the horizontal size of the changed text area to the horizontal size of the changed text area. And the font having the size acquired by the acquisition procedure can be arranged in the text area after the change.
[0013]
BEST MODE FOR CARRYING OUT THE INVENTION
Hereinafter, embodiments of the present invention will be described in detail with reference to the drawings.
[0014]
FIG. 1 shows an embodiment of the present invention. This is an example of a document printing system. This document printing system includes a plurality of personal computers (hereinafter referred to as “client personal computers”) 3 and 4, one file server 1, one Web server 2, and at least one XML (Extensible Markup Language). A) a printer 5 capable of processing data is interconnected via a network 7;
[0015]
A mobile terminal 6 such as a portable information terminal is connected to the printer 5 without directly connecting to the network 7 through IrDA, RS-232C, Centronics, or the like.
[0016]
Note that, instead of the client personal computers 3 and 4, an information processing device such as a word processor, a workstation, or a portable information terminal can be connected.
[0017]
The client personal computers 3 and 4 and the file server 1 store font data groups relating to a plurality of types of fonts, Web data, image data, and the like.
[0018]
The mobile terminal 6 or the client personal computer 3 or 4 issues a print request such as the URL of the Web to be printed and the number of copies to the printer 5 to the printer 5, and issues a file request from the printer 5 to the Web server. Data, font data, and the like are collected from a file server and transferred to the printer 5, and the printer 5 expands the transferred data to print.
[0019]
FIG. 2 shows a schematic configuration of the client personal computers 3 and 4, the file server 1, and the Web server 2 in FIG. In FIG. 2, reference numeral 101 denotes a central processing unit (CPU), which controls the entire apparatus and performs arithmetic processing. Reference numeral 102 denotes a ROM (read only memory), which stores a system startup program, a basic I / O program, character pattern data (font data) for converting a character code into a bit pattern, and the like. A random access memory (RAM) 103 temporarily stores data used for the operation of the CPU 101, an operation result, a character pattern data string converted from a character code for display, and the like.
[0020]
A keyboard control unit (KBC) 104 receives key input data (character codes and control codes) from a keyboard (KB) 105 and transmits the key input data to the CPU 101. Reference numeral 106 denotes a display control unit (CRTC) which reads a character pattern data string stored in the RAM 103 and transfers it to the CRT 107. A display device (CRT) 107 receives a character pattern data string from the CRTC 106 and displays it on a display screen.
[0021]
Reference numeral 108 denotes a disk control unit (DKC) that controls access to the external storage device 109. Reference numeral 109 denotes an external storage device such as a floppy (registered trademark) disk device (FD), a hard disk device (HD), or a CD-ROM. The HD stores a character expansion processing program for reading out character pattern data (font data) and font data and converting the data into bitmap data. An application program and related data are supplied from an external storage device such as an FD or a CD-ROM.
[0022]
A network control unit (NTC) 110 controls the operation of the network device (NT) 111. A system bus 112 transfers data between the above-described components.
[0023]
FIG. 3 shows a memory map of the RAM 103 in FIG. The basic I / O program is read into the RAM 103 by a system startup program in the ROM 102. The application program and related data can be executed from the FD or CD-ROM serving as the external storage device 109 by loading the application program and related data from the HD to the RAM 103 once the power is turned on in a state where the application program is installed in the HD. It becomes. It is also possible to directly load the program from the FD or CD-ROM into the RAM 103 and execute the program without installing the program on the HD. In the file server 1, a printer information table, which will be described later, is formed in a related data area.
[0024]
FIG. 4 shows the configuration of the printer 5 of FIG. The printer 5 may be any type such as a laser beam printer, a bubble jet (registered trademark) printer, or a thermal transfer printer, and has a capability of processing XML format data.
[0025]
The printer 5 includes a CPU 211, a ROM 212, a RAM 213, a printer controller (PRTC) 215, a printer engine (PRT) 219, a disk controller (DKC) 216, a hard disk device (HD) 217, and a network controller (NTC). 220 and a network device (NT) 218 are interconnected via a system bus 214.
[0026]
The DKC 217 and the HD 218 may not exist depending on the type of the printer.
[0027]
The CPU 211 controls the entire apparatus, and executes various processes necessary for printing according to a program stored in the ROM 212 while using the RAM 213 as a work area or the like. The system bus 214 is a path for exchanging data and control signals between the above components. Note that the ROM 212 stores character pattern data (font data) and the like. Document data, image data, font data, and the like requested to the Web server 2 are downloaded from the Web server 2 and stored in the RAM 213 or the HD 218.
[0028]
The CPU 211 generates character pattern data and image data (bitmap data) from the document data, image data, or font data supplied from the Web server 2 according to a program stored in the ROM 212, and develops the data into a print buffer in the printer controller 215. I do. The printer controller 215 outputs a print control signal generated based on the bitmap data to the printer engine 219.
[0029]
The network controller 220 controls the operation of the network device (NT) 218 when transmitting and receiving data to and from the client personal computers 3 and 4 and the file server 1 via the network 7.
[0030]
FIG. 9 shows the flow of the file conversion process. This processing is divided into processing on the host side and processing on the printer side. The processing on the host side is performed on the Web server 2 in FIG. 1 or performed on the client personal computer 3 or 4. First, a document stored in the XML format or a document stored in the HTML format is read from the file server, and is once converted into data in the XHTML (Extensible Hyper Text Markup Language) format. Then, it is converted into an SVG (Scalable Vector Graphic) that performs an appropriate layout based on the output paper size and resolution according to the flowchart shown in FIG. However, the output of the automatically laid-out document may be different from the user's expectation.
[0031]
At this time, a print image of the automatically laid out document is displayed on the personal computer screen so that the user can change to the desired output, the layout itself can be edited on the display screen, and the edited result is newly displayed. Output to the printer as a simple SVG document. Details of this layout editing will be described later with reference to the flowchart of FIG.
[0032]
The contents of XHTML and SVG are described in the W3C technical report. Basically, XHTML is an extension of the HTML grammar according to the XML format, and is suitable for display. On the other hand, SVG is similar to the grammar of a page description such as PS (Post Script), is XML-extended, and is suitable for an output format. Therefore, HTML or XML document data is once converted into XHTML, and then the output paper size and resolution are obtained, converted into SVG format data, and transferred to a printer that can interpret SVG as an SVG file. By doing so, it becomes possible to properly lay out and output document data written in XML or HTML.
[0033]
FIG. 5 is a flowchart showing an example of a control program stored in the ROM 102 of FIG. 2, which is a control program for converting document data in XHTML format into document data in SVG format. In step S501, a font size serving as a conversion reference is first determined from XHTML format data to be converted. The reference font size is not particularly specified in the XHTML file. Therefore, each browser often defines its own reference font size, but here, a value such as 10 points or 10.5 points is determined as the reference font size for output paper. If the reference font size is written in the XHTML document, the value is determined as the reference font size.
[0034]
In step S502, the entire XHTML document is checked to determine whether there is a table attribute. If there is no attribute of the table, the horizontal area of the size of the predetermined paper or screen to be output becomes the reference size of the horizontal area of the tag as each XHTML element. If table attributes exist, the contents of each table are compared. For example, when the attribute of width matches the <TABLE> element of XHTML, the value becomes the value of the width of the table, and the value having the largest value is selected. If the <TABLE> element has no attribute of width, the horizontal area of the output area is the horizontal area of the table.
[0035]
In step S503, the enlargement / reduction ratio of the output area is calculated from the maximum value of the table obtained in step S502. The calculation method can be obtained from the ratio between the horizontal area of the output area and the maximum horizontal area of the table obtained in step S502. That is, the enlargement / reduction ratio = the horizontal area of the output area / the maximum horizontal area of the table.
[0036]
Then, in step S504 and subsequent steps, the arrangement of each element and the arrangement position of characters in the element are calculated.
[0037]
In step S504, it is first determined whether the target element is a table element, a text element, or an image element. The table elements include <TABLE>, <TR>, <TH>, <TD>, <CAPTION>, <THEAD>, <TFOOT>, <TBODY>, and the like. Text elements include <H1> to <H6>, <P>, <Q>, <BLOCKQUAOTE>, <EM>, <STRONG>, <SUP>, <SUB>, and the like. The image elements include <IMG>, <MAP>, <AREA>, <OBJECT>, <APPLET>, and the like. For the meaning of each element, see http: // www. w3. org / TR / xhtml1 /, and the specification of XHTML and http: // www. w3. See the HTML specification at org / TR / html40 /.
[0038]
If it is determined in step S504 that the target element is an element in the table, the process proceeds to step S505. In step S505, the layout in the table is performed. Details of this processing will be described later with reference to the flowchart of FIG.
[0039]
If it is determined in step S504 that the element is a text element, the process proceeds to step S506. In step S506, an arrangement position for each character in the text element is determined.
[0040]
The text area is divided into a block element and an inline element. Block elements include <H1> to <H6> and <P> elements, and inline elements include <EM> and <STRONG>. This inline element is used as a child element of the block element when emphasizing a character string in the text or changing the color.
[0041]
As a method of arranging the block elements of the text, first, the horizontal area of the text area is determined. Here, the horizontal area of the parent element of the text element is the horizontal area of the text area. For example, if the parent element is <XHTML>, it is the top element, so the horizontal area of the size of the paper or screen to be output is set as the horizontal area of the text area.
[0042]
If the character size is specified by a CSS property that is a W3C specification, if the character size is not specified, the standard size obtained in step S501 is used. The value obtained by multiplying the character size by the enlargement / reduction ratio obtained in step S503 is defined as the character size. At this time, it is checked whether or not the determined character size is set to a value larger than the preset minimum size in step S510, and is stored.
[0043]
Then, the characters are arranged one by one at the determined character size, the characters are folded back beyond the horizontal area, and the continuation is arranged from the beginning of the next line.
[0044]
Then, when all the characters have been arranged, the height of the area is calculated from the number of lines and the font size at that time. At this time, if the size of the line spacing is specified in the CSS property, it follows the size. If not specified, a certain value for the character height is used as a standard value. Set.
[0045]
In addition, as the method of arranging inline elements of text, the end point of the arrangement position of the character immediately before the character string specified inline is used as a reference point, and each character is specified by the character type and character size specified by the element. Are arranged according to the pitch information.
[0046]
On the other hand, if it is determined in step S504 that the element is an image element, the process advances to step S507. In step S507, processing for determining the area of the image element and determining the arrangement position is performed. The size of the image area is determined by multiplying the size of the image area specified in the XHTML document by the enlargement / reduction ratio obtained in step S503. become.
[0047]
Then, in step S508, the contents of each element obtained in steps S505 to 507 are converted into SVG data. At this time, the text element is converted to <tspan> and the image element is converted to <image>. For example, the layout data as shown in FIG. 11 is represented by an XHTML document as shown in FIG. 10, and when it is represented by SVG, it becomes as shown in FIG.
[0048]
In step S509, it is checked whether or not the processing from step S505 to step S507 has been completed for all elements. If the processing has not been completed, the process returns to step S504, and the arrangement position of each element is determined. Is calculated. If the processing has been completed for all elements, the process proceeds to step S510.
[0049]
After the arrangement positions of all elements are calculated in step S510, the entire document is surrounded by <svg> and </ svg>, and a style sheet is defined by a <style> element as necessary to create an svg document. To end.
[0050]
FIG. 6 is a flowchart showing in detail the step S505 in FIG. 5, that is, the processing for calculating the arrangement position of the contents of the table. In step S601, the horizontal area of each cell in the table is calculated. In this calculation method, the sizes of the areas of the cells surrounded by the <TR> elements are summed, and the horizontal area of the table element, which is the parent element, is allocated according to the proportion of each cell. For example, there are three cells as child elements of a table in an XHTML document, and the horizontal area of each cell is 10 for cell 1, 20 for cell 2, 10 for cell 3, and the horizontal area of the table of the parent element. Is 100, the horizontal area of cell 1 is 100 × (10/40) = 25, and similarly, the horizontal area of cell 2 is 50 and the horizontal area of cell 3 is 25.
[0051]
In step S602, the contents of each cell for checking the contents of each cell may be a table, a text, or an image.
[0052]
Each of the determination methods is similar to the method described in step S504, such as <TABLE>, <TR>, <TH>, <TD>, <CAPTION>, <THEAD>, <TFOOT>, <TBODY>, etc. If it is the element, the table element is determined, the process proceeds to step S607, the enlargement / reduction ratio is recalculated, and the process returns to step S601 to process the table element.
[0053]
On the other hand, if elements such as <H1> to <H6>, <P>, <Q>, <BLOCKQUAOTE>, <EM>, <STRONG>, <SUP>, <SUB>, etc., are determined as text elements, The process proceeds to step S603. On the other hand, if the element is <IMG>, <MAP>, <AREA>, <OBJECT>, <APPLET>, or the like, it is determined to be an image, and the process proceeds to step S606.
[0054]
Steps S603 to S605 are cases where it is determined that the element is a text element, and the arrangement position for each character in the text element is determined.
[0055]
The text area is divided into a block element and an inline element. The block elements include <H1> to <H6> and <P> elements. In-line elements include <EM>, <STRONG>, and the like. The inline element is used as a child element of the block element to emphasize a certain character string in the text or change the color.
[0056]
As a method of arranging the block elements of the text, first, the horizontal area of the text area is captured. Here, the horizontal area of the cell determined in step S601 is the horizontal area of the target text.
[0057]
If the character size is specified in the CSS property that is the W3C specification in step S603, the value is calculated in step S501 if the character size is not specified particularly if the value is not specified. The value obtained by multiplying the standard character size by the enlargement / reduction ratio obtained in step S503 or S607 is defined as the character size.
[0058]
Then, it is checked whether or not the size of the character size determined at this time is set to a value larger than the preset minimum size in step S510, and is stored.
[0059]
Then, the characters are arranged one by one at the character size determined in step S604, the characters are folded back beyond the horizontal area, and the continuation is arranged from the beginning of the next line. In addition, as a method of arranging inline elements of text, the end point of the arrangement position of the character immediately before the character string specified inline is used as a reference point, and from there, each character is specified by the character type and character size specified by the element Are arranged according to the pitch information.
[0060]
When all characters have been arranged, the height of the area is calculated from the number of lines and the font size in step S605. At this time, if the size of the line is specified in the CSS property, it follows the size. If not specified, the value of the line height is set as a standard value for the character height. Set.
[0061]
On the other hand, if it is determined in step S602 that the image element is an image element, in step S606, a process of determining the area of the image element and determining the arrangement position is performed. The size of the image area is determined by applying the aspect ratio of the size of the image area specified in the XHTML document to the horizontal area of the cell obtained in step S601 to obtain the height.
[0062]
On the other hand, if it is determined in step S602 that there is another table element in the cell, then in step S607, the size of the cell serving as the parent element of the target table is obtained in step S601. Therefore, it is necessary to convert the size of the table so that it fits in that size. The enlargement / reduction ratio is obtained from the enlargement / reduction ratio = (enlargement / reduction ratio of the table of the parent element) × (horizontal size of the table) ÷ (width of the cell of the parent element).
[0063]
In step S608, it is checked whether or not there is a cell to be further processed. If there is a cell, the process returns to step S602 to perform the same processing. If there is no cell, the processing ends. .
[0064]
FIG. 7 is a flowchart illustrating an example of a layout editing procedure on a screen on which a print image is displayed. In step S701, when the layout of the current SVG document layout image displayed on the screen is to be edited in units of a table, text, or image area, the area is designated with a mouse or the like as shown in FIG. I do.
[0065]
Then, in step S702, it is determined whether the designated area is a table area, a text area, or an image area. If the designated area is a table area, the process proceeds to step S703. If the designated region is an image region, the process proceeds to step S705. If the designated region is a text region, the process proceeds to step S706.
[0066]
In step S703, the designated area is a table, and the area is changed by expanding or reducing the entire area of the table. As a method of changing the area at this time, a method of dragging the mouse may be used, or a method of directly inputting a value on the UI screen may be considered. However, the method of designating the area is not particularly described here.
[0067]
Then, in step S704, the contents of each cell are changed corresponding to the changed area. First, the changed entire area is compared with the entire area before the change to determine an enlargement / reduction ratio, and the enlargement / reduction ratio is reflected in the contents of each cell. For example, when the contents of the cell are text, the same enlargement / reduction ratio is applied to the arrangement position and font size of each character. On the other hand, in the case of an image, the same enlargement / reduction ratio is applied to the vertical and horizontal sizes of the image area.
[0068]
In step S705, the designated area is an image, and the image area is enlarged or reduced, and the vertical and horizontal areas of the image are changed according to the ratio of the original image area to the changed image area. .
[0069]
Steps S706 to S714 are changes relating to the text area. First, in step S706, it is checked whether or not the text area is related to an area change. If the change is related to an area, the process proceeds to step S707, and if the change is related to a font size or font other than the area, the process proceeds to step S708.
[0070]
Step S707 is a case where the text area is changed, and the ratio of the horizontal size of the original text area size and the changed text area size is applied to the font size of each character. Then, since the new font size is defined, the arrangement position of the area is calculated, and the arrangement is performed with the new character size. Then, after the placement is completed, if the placed vertical area is smaller than the changed vertical area, the changed vertical area is used as a new vertical area, and the placed vertical area is changed. If it is larger, the arranged vertical area is used as a new vertical area.
[0071]
Steps S708 to S714 are procedures in a case where the designation of the change is not the designation of the change of the area but directly the designation of the font size, the font, the modification, and the like.
[0072]
In step S708, if the change designation is a font size designation, the process proceeds to step S709, and if the change of the font is designated, the process proceeds to step S7011, where the change designation to the modifier character such as a bold font or an italic font is performed. If there is, the process proceeds to step S713.
[0073]
In step S709, the change is designated as the font size, and the horizontal area of the original text area is not changed. Then, the characters are arranged one by one in the newly designated font size. If it exceeds the horizontal area, the character will wrap there. Then, the enlargement / reduction ratio from the original size to the new designated size at this time is calculated here for use in later step S715. Then, in step S710, after all the character strings are arranged, a vertical area is obtained, and the size of the vertical area is used as a new vertical area of the text area. In step S715, based on the point size changed in step S709, the ratio between the point size before the change and the point size after the change is calculated, and the process of simultaneously changing the characters in other character areas at that ratio is performed. Do. Details of this processing will be described later with reference to the flowchart in FIG.
[0074]
On the other hand, if the change is designated to change the typeface, the horizontal area of the original text area is not changed, but in step S711, the characters are arranged one by one in the font of the newly specified typeface. If it goes beyond the horizontal area, the character will wrap there. Then, in step S712, after all the character strings have been arranged, a vertical region is obtained, and the size of the vertical region becomes a new vertical region of the text region.
[0075]
On the other hand, if the designation of the change is to change the font to bold or italic or to a character without modification as a font modification, the horizontal region in the original text region is not changed, but in step S713 Then, the characters are arranged one by one in the font of the newly designated typeface, and when the characters exceed the horizontal area, the characters are folded back there. Then, in step S714, after arranging all the character strings, a vertical area is obtained, and the size becomes a new vertical area of the text area.
[0076]
In step S716, a new page layout is performed by reflecting the changed area on the entire area. The situation at this time is shown in FIGS. The example of FIG. 13 shows that the table area is specified because the page area is exceeded by enlarging the character of the “heading” of the title, and FIG. 14 adjusts the area of the table area that exceeds the page area in FIG. An example is shown in which the content is stored in one page.
[0077]
Then, in step S717, if the user is satisfied with the current layout, the process ends. If not satisfied, the process returns to step S701 to further specify the same area or another area, and to perform a new area conversion. I will do.
[0078]
FIG. 15 is a flowchart showing in more detail the process of step S715 of FIG. 7, that is, the process of simultaneously changing the size of characters in another character area. In step S1501, a UI as shown in FIG. 16 is displayed, and the user is allowed to select one of the following three methods (1) to (3). {Circle around (1)} The character size is changed only for the currently targeted block. {Circle around (2)} The character size is changed for all the blocks specified by the tag of the text element such as <P>, <Q>, <BLOCKquote>, and <EM>. {Circle around (3)} When the user specifies an arbitrary tag, the character size is changed for the block specified by the tag. In this case, the user can arbitrarily specify a block to be enlarged or reduced with the current setting. The example of FIG. 16 is a case where the user specifies to perform processing on all text elements.
[0079]
Then, in step S1502, it is determined whether the user has selected only the current block. If there is only the current block, the process ends there. Otherwise, the process proceeds to step S1503.
[0080]
In step S1503, since there is a target block other than the current block, the target block is searched. As a search method, the document is searched from the tag currently targeted, and the search is performed while checking whether the next existing tag is the target tag. In the example of FIG. 16, the processing is applied to all text blocks. Therefore, here, a check is performed to determine whether or not the tag is a text-related tag. When the text block specified in the example of FIG. 16 is selected, it is checked whether or not the specified tag exists, and when the specified tag is found, the block is set as a new target block.
[0081]
In step S1504, if no target tag is found, it is checked whether the processing has been completed for all target tags. If the target tag no longer exists, the process ends there. If the target tag has been found, the process advances to step S1505.
[0082]
In step S1505, as in the case where the processing is performed in step S709, the change is designated as the font size. The processing is performed with the change size ratio being the same as the enlargement / reduction ratio in step S709. Then, the horizontal area of the original text area is not changed, and the characters are arranged one by one at the newly designated font size. When the horizontal area is exceeded, the characters are folded back there.
[0083]
In step S1506, after all the character strings have been arranged, a vertical area is obtained, and the size of the vertical area becomes a new vertical area of the text area.
[0084]
【The invention's effect】
As described above, according to the present invention, since the configuration is as described above, the area and the font size can be changed after the area is once allocated.
[Brief description of the drawings]
FIG. 1 is a block diagram showing an embodiment of the present invention.
FIG. 2 is a block diagram showing a schematic configuration of client personal computers 3, 4, a file server 1, and a Web server 2 in FIG.
FIG. 3 is a diagram showing a memory map of a RAM 103 in FIG. 2;
FIG. 4 is a block diagram showing a configuration of the printer 5 of FIG.
FIG. 5 is a flowchart showing an example of a control program stored in a ROM 102 of FIG. 2, which converts document data in XHTML format into document data in SVG format.
FIG. 6 is a flowchart showing step S505 in FIG. 5 in more detail;
FIG. 7 is a flowchart illustrating an example of a layout editing procedure on a screen on which a print image is displayed.
FIG. 8 is an explanatory diagram for describing area designation in layout change.
FIG. 9 is a diagram showing a flow of a file conversion process.
FIG. 10 is a diagram showing the contents of an XHTML document.
FIG. 11 is an image diagram showing a document.
FIG. 12 is a diagram showing the contents of an SVG document.
FIG. 13 is an explanatory diagram for explaining layout adjustment.
FIG. 14 is an explanatory diagram for explaining layout adjustment.
FIG. 15 is a flowchart showing step S715 of FIG. 7 in more detail;
FIG. 16 is a diagram illustrating an example of a user interface.
[Explanation of symbols]
1 file server
2 Web server
3,4 Personal computer
5 Printer
6 mobile terminals
101 CPU
102 ROM
103 RAM
104 Keyboard control unit
106 Display control unit
107 Display device
108 Disk control unit
109 Floppy (registered trademark) disk drive
110 Network control unit

Claims (7)

レイアウトがあいまいなドキュメントフォーマットのファイルからレイアウトが確定するドキュメントのフォーマットのファイルに変換して印刷する文書印刷装置において、
出力用紙サイズを設定するための設定手段と、
該設定手段により設定された出力用紙サイズに基づいて各ブロックのブロックサイズを決定する第1決定手段と、
該第1決定手段によって決定されたブロックサイズに基づいて出力領域のサイズとフォントのサイズを決定する第2決定手段と、
該第2決定手段により決定されたサイズの出力領域とフォントとを配置する第1配置手段と、
該第1配置手段により配置された後のレイアウトを編集するための編集手段と、
該編集手段によりレイアウトが編集された場合に、編集されたレイアウトに従って出力領域とフォントとを配置する第2配置手段と
を有することを特徴とする文書印刷装置。
In a document printing apparatus that converts a file of a document format whose layout is ambiguous to a file of a document format whose layout is determined and prints the document,
Setting means for setting the output paper size;
First determining means for determining a block size of each block based on the output paper size set by the setting means;
Second determining means for determining the size of the output area and the font size based on the block size determined by the first determining means;
First arranging means for arranging an output area and a font having the size determined by the second deciding means;
Editing means for editing the layout after being arranged by the first arrangement means;
A document printing apparatus, comprising: a second arranging means for arranging an output area and a font according to the edited layout when the layout is edited by the editing means.
請求項1において、前記編集手段は、
前記配置手段により配置された全ての出力領域から1つの出力領域を選択するための選択手段と、
該選択手段により選択された出力領域がテキスト領域かどうかを判定する判定手段と、
該判定手段によりテキスト領域と判定された場合に、当該テキスト領域に対して領域のサイズとフォントのサイズを変更するための変更手段と、
該変更手段によるテキスト領域サイズの変更対象となる領域を指定するための指定手段と
を有することを特徴とする文書印刷装置。
In claim 1, the editing means comprises:
Selecting means for selecting one output area from all output areas arranged by the arranging means;
Determining means for determining whether the output area selected by the selecting means is a text area;
Changing means for changing the size of the area and the size of the font for the text area, when the determination means determines that the text area;
A document printing apparatus comprising: a designating unit for designating an area for which a text area size is to be changed by the changing unit.
請求項2において、前記第2配置手段は、変更前のテキスト領域の横サイズに対する変更後のテキスト領域の横サイズの比率に従ってフォントサイズを取得する取得手段を有し、該取得手段により取得されたサイズのフォントを前記変更後のテキスト領域に配置することを特徴とする文書印刷装置。3. The method according to claim 2, wherein the second arranging unit has an acquiring unit that acquires a font size in accordance with a ratio of a horizontal size of the text area after the change to a horizontal size of the text area before the change. A document printing apparatus, wherein a font having a size is arranged in the text area after the change. レイアウトがあいまいなドキュメントフォーマットのファイルからレイアウトが確定するドキュメントのフォーマットにファイルを変換して印刷する文書印刷方法において、
出力用紙サイズが設定されたとき、設定された出力用紙サイズに基づいて各ブロックのブロックサイズを決定する第1決定ステップと、
該第1決定ステップによって決定されたブロックサイズに基づいて出力領域のサイズとフォントのサイズを決定する第2決定ステップと、
該第2決定ステップにより決定されたサイズの出力領域とフォントとを配置する第1配置ステップと、
出力領域にフォントが配置された後に、レイアウトが編集されたときに、編集されたレイアウトに従って出力領域とフォントとを配置する第2配置ステップとを有することを特徴とする文書印刷方法。
In a document printing method for converting and printing a file from a document format whose document layout is ambiguous to a document format whose layout is determined,
A first determining step of determining a block size of each block based on the set output paper size when the output paper size is set;
A second determining step of determining the size of the output area and the size of the font based on the block size determined by the first determining step;
A first arrangement step of arranging an output area and a font having the size determined by the second determination step;
A method of printing a document, comprising: when a layout is edited after a font is arranged in an output area, arranging the output area and the font in accordance with the edited layout.
請求項4において、前記第2配置ステップは、変更前のテキスト領域の横サイズに対する変更後のテキスト領域の横サイズの比率に従ってフォントサイズを取得する取得ステップを有し、該取得ステップにより取得されたサイズのフォントを前記変更後のテキスト領域に配置することを特徴とする文書印刷方法。5. The method according to claim 4, wherein the second arranging step includes an acquiring step of acquiring a font size in accordance with a ratio of a horizontal size of the changed text area to a horizontal size of the text area before the changing, and the font size is obtained by the obtaining step. A document printing method, wherein a font having a size is arranged in the changed text area. レイアウトがあいまいなドキュメントフォーマットのファイルからレイアウトが確定するドキュメントのフォーマットにファイルを変換して印刷するプログラムであって、
出力用紙サイズが設定されたとき、設定された出力用紙サイズに基づいて各ブロックのブロックサイズを決定する第1決定手順と、
該第1決定手順によって決定されたブロックサイズに基づいて出力領域のサイズとフォントのサイズを決定する第2決定手順と、
該第2決定手順により決定されたサイズの出力領域とフォントとを配置する第1配置手順と、
出力領域にフォントが配置された後に、レイアウトが編集されたときに、編集されたレイアウトに従って出力領域とフォントとを配置する第2配置手順と
をコンピュータに実行させるためのプログラムを記憶したコンピュータ読み取り可能な記憶媒体。
A program that converts a file in a document format with an ambiguous layout into a document format in which the layout is determined and prints the file,
A first determination step of determining a block size of each block based on the set output paper size when the output paper size is set;
A second determining step of determining the size of the output area and the font size based on the block size determined by the first determining step;
A first arrangement procedure for arranging an output area and a font having the size determined by the second determination procedure;
Computer-readable storage of a program for causing a computer to execute a second arrangement procedure for arranging an output area and a font according to the edited layout when the layout is edited after the font is arranged in the output area Storage media.
請求項6において、前記第2配置手順が、変更前のテキスト領域の横サイズに対する変更後のテキスト領域の横サイズの比率に従ってフォントサイズを取得する取得手順を有し、該取得手順により取得されたサイズのフォントを前記変更後のテキスト領域に配置するプログラムを記憶したコンピュータ読み取り可能な記憶媒体。7. The method according to claim 6, wherein the second arranging step includes an acquiring step of acquiring a font size according to a ratio of a horizontal size of the changed text area to a horizontal size of the text area before the changing. A computer-readable storage medium storing a program for arranging a font having a size in the text area after the change.
JP2002272006A 2002-09-18 2002-09-18 Document printer and its method Pending JP2004110401A (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
JP2002272006A JP2004110401A (en) 2002-09-18 2002-09-18 Document printer and its method
US10/660,639 US7797631B2 (en) 2002-09-18 2003-09-12 Document printing control apparatus and method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2002272006A JP2004110401A (en) 2002-09-18 2002-09-18 Document printer and its method

Publications (1)

Publication Number Publication Date
JP2004110401A true JP2004110401A (en) 2004-04-08

Family

ID=32269150

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2002272006A Pending JP2004110401A (en) 2002-09-18 2002-09-18 Document printer and its method

Country Status (1)

Country Link
JP (1) JP2004110401A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2006255916A (en) * 2005-03-15 2006-09-28 Seiko Epson Corp Printer
JP2012141734A (en) * 2010-12-28 2012-07-26 Canon Marketing Japan Inc Information processor, information processing method, and computer program

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2006255916A (en) * 2005-03-15 2006-09-28 Seiko Epson Corp Printer
JP4556717B2 (en) * 2005-03-15 2010-10-06 セイコーエプソン株式会社 Printer
JP2012141734A (en) * 2010-12-28 2012-07-26 Canon Marketing Japan Inc Information processor, information processing method, and computer program

Similar Documents

Publication Publication Date Title
US7797631B2 (en) Document printing control apparatus and method
US7949942B2 (en) System and method for identifying line breaks
KR100585312B1 (en) Method for printing web page
US20100123935A1 (en) Document processing apparatus and document processing method
JP4816311B2 (en) Print support system, print support program and storage medium, and print support method
JP2005149407A (en) Document processor and document processing method
JP4510232B2 (en) Information processing apparatus, information processing method, and storage medium
US9170760B2 (en) Device, method, and recording medium for outputting image
JP4289856B2 (en) Document printing system and method
JP2004110401A (en) Document printer and its method
US9019552B2 (en) Information processing apparatus, system and method for outputting data to a medium
JP2006172203A (en) Document inspection method and document output system
JP4536872B2 (en) Information processing apparatus, information processing method, and storage medium
JP2002189582A (en) Image processor, image processing method, recording medium and server device
JP5947508B2 (en) Information processing apparatus, information processing method, and program
JP2005196679A (en) Printing method and its device
JP5156545B2 (en) Information processing apparatus, information processing method, and program
JP3051496B2 (en) Document processing method and apparatus
JP4227294B2 (en) Image processing apparatus and method, and storage medium
JP3450869B2 (en) Bit image data generation device and bit image data generation method
JP4013748B2 (en) Document generator
JPH08339281A (en) Printing system and printing method therefor
JP2004240754A (en) Printing system and output control system
JP3470378B2 (en) Character information output device and method
JP4844364B2 (en) Image processing apparatus and program