JP2021086414A - Information processing apparatus, information processing method, and program - Google Patents

Information processing apparatus, information processing method, and program Download PDF

Info

Publication number
JP2021086414A
JP2021086414A JP2019215203A JP2019215203A JP2021086414A JP 2021086414 A JP2021086414 A JP 2021086414A JP 2019215203 A JP2019215203 A JP 2019215203A JP 2019215203 A JP2019215203 A JP 2019215203A JP 2021086414 A JP2021086414 A JP 2021086414A
Authority
JP
Japan
Prior art keywords
content
image
elements
layer
svg
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.)
Granted
Application number
JP2019215203A
Other languages
Japanese (ja)
Other versions
JP7395334B2 (en
Inventor
鈴木 智博
Tomohiro Suzuki
智博 鈴木
勇気 大曲
Yuki Omagari
勇気 大曲
祐樹 石田
Yuki Ishida
祐樹 石田
洋行 酒井
Hiroyuki Sakai
洋行 酒井
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 JP2019215203A priority Critical patent/JP7395334B2/en
Publication of JP2021086414A publication Critical patent/JP2021086414A/en
Application granted granted Critical
Publication of JP7395334B2 publication Critical patent/JP7395334B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Abstract

To provide an information processing apparatus which can prevent an unnecessary processing load from being generated when hybrid application is used for printing, an information processing method, and a program.SOLUTION: A print application 200 which executes an application with a script layer 217 and a native layer 218 in cooperation with each other includes: a content drawing unit 205 which generates a content to be printed including a plurality of elements; a rendering request unit 222 which issues a request for rendering a content to a web engine 224 which renders elements included in the content asynchronously, so as to render at least two elements after loading at least two of the elements included in the content; and a printer data generation unit 212 which acquires an image rendered by the web engine 224 to generate data to be printed.SELECTED DRAWING: Figure 2

Description

本発明は、印刷に関する処理を行う情報処理装置、情報処理方法、およびプログラムに関する。 The present invention relates to an information processing apparatus, an information processing method, and a program that perform processing related to printing.

近年、カメラ機能が搭載された可搬型多機能携帯端末(モバイルコンピュータ)が普及している。このようなモバイルコンピュータは、基本的には3つの要素で構成されている。即ち、コンピュータ自身であるハードウェアと、ハードウェア上で動作するオペレーティングシステム(OS)と、そのOS上で動作するアプリケーションとで構成されている。 In recent years, portable multifunctional mobile terminals (mobile computers) equipped with a camera function have become widespread. Such a mobile computer is basically composed of three elements. That is, it is composed of hardware that is the computer itself, an operating system (OS) that runs on the hardware, and an application that runs on the OS.

このようなモバイルコンピュータ上で動作するアプリケーションの形態として、いわゆるハイブリッドアプリケーションと呼ばれる形態がある。ハイブリッドアプリケーションとは、ネイティブアプリケーションの利点とウェブアプリケーションの利点とを双方保持するアプリケーションである。以後、アプリケーションのことを「アプリ」と表記することがある。 As a form of an application that operates on such a mobile computer, there is a form called a so-called hybrid application. A hybrid application is an application that retains both the advantages of a native application and the advantages of a web application. Hereinafter, the application may be referred to as an "application".

特許文献1には、ハイブリッドアプリの形態の印刷アプリによって、印刷に用いるデータが生成される技術が記載されている。特許文献1では、印刷アプリが生成したSVGコンテンツを、OSに標準的に備えられているウェブエンジンが描画し、OSのスクリーンショット機能を用いて画像化する技術が記載されている。 Patent Document 1 describes a technique for generating data used for printing by a printing application in the form of a hybrid application. Patent Document 1 describes a technique in which an SVG content generated by a print application is drawn by a web engine provided as standard in the OS and imaged using the screenshot function of the OS.

特開2018−5575号公報JP-A-2018-5575

OSに標準的に備えられているウェブエンジンでは、通常、SVGコンテンツを読み込むと、SVGコンテンツの各要素が解析され、画像データとして反映できる状態になったものから非同期的に出力される。これは、ウェブコンテンツを表示する場合には、少しずつでも画面が更新され続ける方が、体感待ち時間が短くなるので、ユーザビリティがよいとされているからである。 In the web engine provided as standard in the OS, when SVG content is read, each element of the SVG content is analyzed and output asynchronously from the state in which it can be reflected as image data. This is because when displaying web contents, it is said that usability is better if the screen is continuously updated even little by little because the waiting time for experiencing is shortened.

一方、印刷用の画像では、生成途中の画像は必要でないことが多い。しかしながら、SVGコンテンツにおいて複数の要素が含まれている場合、ウェブエンジンでは個々の要素で非同期的に描画が行われるので、再描画が必要な領域が発生することがある。このため、コンピュータに不必要な処理負荷を生じさせてしまう虞がある。 On the other hand, in the image for printing, the image in the process of being generated is often unnecessary. However, when a plurality of elements are included in the SVG content, the web engine draws the individual elements asynchronously, so that an area requiring redrawing may occur. Therefore, there is a risk of causing an unnecessary processing load on the computer.

本発明の一態様に係るプログラムは、アプリケーションの実行の際に、プロセッサによって翻訳されて実行されるスクリプト命令セットで構成された第一層と、前記プロセッサが実行可能な命令セットとして前記プロセッサとは異なるユニットにより予めコンパイルされている第二層と、を有し、前記第一層と前記第二層との連携によって前記アプリケーションを実行するためのプログラムであって、前記プロセッサを、複数の要素を含む印刷対象のコンテンツを生成する第一生成手段と、コンテンツに含まれる要素を非同期で描画する描画手段に対して、前記印刷対象のコンテンツに含まれる複数の要素のうち少なくとも2つ以上の要素がロードされた後に当該少なくとも2つ以上の要素を前記描画手段が描画するように、前記第一生成手段で生成された前記印刷対象のコンテンツの描画を依頼する依頼手段と、前記依頼手段による依頼に基づいて前記描画手段によって描画された画像を取得して印刷用のデータを生成する第二生成手段と、として機能させる。 The program according to one aspect of the present invention includes a first layer composed of a script instruction set that is translated and executed by a processor when an application is executed, and the processor as an instruction set that can be executed by the processor. A program having a second layer pre-compiled by different units and executing the application in cooperation with the first layer and the second layer, the processor, and a plurality of elements. With respect to the first generation means for generating the content to be printed to be included and the drawing means for drawing the elements included in the content asynchronously, at least two or more elements among the plurality of elements included in the content to be printed are present. A request means for requesting drawing of the content to be printed generated by the first generation means and a request by the request means so that the drawing means draws at least two or more elements after being loaded. Based on this, it functions as a second generation means that acquires an image drawn by the drawing means and generates data for printing.

本発明によれば、ハイブリッドアプリを用いて印刷を行う場合に、不必要な処理負荷が生じてしまうことを抑制することができる。 According to the present invention, it is possible to prevent an unnecessary processing load from being generated when printing is performed using a hybrid application.

情報処理装置を含むシステムの例を示すブロック図。The block diagram which shows the example of the system including the information processing apparatus. ソフトウェア構成のブロック図。Block diagram of the software configuration. ユーザーの操作手順とアプリ内部の内部処理を示すフローチャート。A flowchart showing the user's operation procedure and internal processing inside the application. SVGコンテンツを示す図。The figure which shows the SVG content. プリンタ情報取得処理の詳細を示すフローチャート。A flowchart showing the details of the printer information acquisition process. 用紙サイズを選択する設定画面の例を示す図。The figure which shows the example of the setting screen which selects a paper size. 描画される画像の例を示す図。The figure which shows the example of the image to be drawn.

以下、実施形態について、図面を参照して説明する。なお、以下の実施形態は本発明を限定するものではなく、また、本実施形態で説明されている特徴の組み合わせの全てが必須のものとは限らない。 Hereinafter, embodiments will be described with reference to the drawings. It should be noted that the following embodiments do not limit the present invention, and not all combinations of features described in the present embodiments are essential.

<ハイブリッドアプリの説明>
本実施形態の説明に先立って、ハイブリッドアプリの補足説明をする。ハイブリッドアプリとは、ネイティブアプリの利点とウェブアプリの利点とを双方保持するアプリである。以下、ネイティブアプリおよびウェブアプリをそれぞれ説明する。
<Explanation of hybrid app>
Prior to the explanation of this embodiment, a supplementary explanation of the hybrid application will be given. A hybrid app is an app that retains both the benefits of a native app and the benefits of a web app. The native application and the web application will be described below.

ネイティブアプリとは、通常、OS毎に用意される開発環境、及び、開発言語を用いて開発されるアプリである。例えば、A社が提供するOS上ではC/C++言語、B社が提供するOS上ではJava(登録商標)言語、C社が提供するOS上では更に異なる開発言語を用いる、という具合である。通常、ネイティブアプリは、各開発環境において予めコンパイルされ、人間が理解可能な、いわゆる高水準言語から、コンピュータのCPUが解釈可能なアセンブラ等の命令セット群に変換される。このように、通常のネイティブアプリでは、CPUが命令を直接解釈するので、高速動作が可能である、というメリットがある。 A native application is an application that is usually developed using a development environment and a development language prepared for each OS. For example, the C / C ++ language is used on the OS provided by the company A, the Java (registered trademark) language is used on the OS provided by the company B, and a different development language is used on the OS provided by the company C. Normally, a native application is precompiled in each development environment and converted from a so-called high-level language that can be understood by humans to an instruction set group such as an assembler that can be interpreted by a computer CPU. As described above, in a normal native application, since the CPU directly interprets the instruction, there is an advantage that high-speed operation is possible.

一方、ウェブアプリとは、近年では各コンピュータ上のOSに標準的に組み込まれているウェブブラウザ上で動作するアプリのことである。ウェブアプリは、ウェブブラウザが解釈できるように、一般的にはHTML5、CSS、またはJavaScript(登録商標)等を用いて開発される。これらはウェブ標準言語であるため、これらのウェブ標準言語でウェブアプリを一旦記述すれば、ウェブブラウザが動作する環境であれば動作可能である、というメリットがある。 On the other hand, a web application is an application that runs on a web browser that is built into the OS on each computer as standard in recent years. Web applications are generally developed using HTML5, CSS, JavaScript, etc. so that they can be interpreted by a web browser. Since these are web standard languages, there is an advantage that once a web application is written in these web standard languages, it can be operated in an environment in which a web browser operates.

ハイブリッドアプリでは、そのユーザーインターフェース(UI)の全て、あるいは大部分が、HTML5、CSS3、またはJavaScriptといったウェブの標準言語で記述されたスクリプト層により実行される。一方、OSの機能の呼び出し等のOSとの連携を行うための処理は、ハイブリッドアプリにおけるネイティブ層により実行される。ネイティブ層は、OSに応じたネイティブ言語で開発されており、またハイブリッドアプリを実行するプロセッサとは異なるユニットにより予めコンパイルされている。この構成により、例えば、ウェブ標準言語で記述された内容から、ネイティブ言語で記述された機能を利用することもできる。このように、ハイブリッドアプリは、一つのアプリ内部に、ウェブ標準言語によるスクリプト層とネイティブ層とを双方包含する構成となっている。このような構成により、ネイティブアプリの利点とウェブアプリの利点とを双方保持したソフトウェア構成とすることができる。また、ハイブリッドアプリは、スクリプト層については複数のプラットフォーム(OS等)に共通に利用することができるため、開発コストが低いという利点もある。 In a hybrid app, all or most of its user interface (UI) is executed by a script layer written in a standard web language such as HTML5, CSS3, or Javascript. On the other hand, processing for linking with the OS, such as calling an OS function, is executed by the native layer in the hybrid application. The native layer is developed in the native language according to the OS, and is pre-compiled by a unit different from the processor that executes the hybrid application. With this configuration, for example, it is possible to use a function written in a native language from a content written in a web standard language. In this way, the hybrid application has a configuration in which both the script layer and the native layer in the web standard language are included in one application. With such a configuration, it is possible to have a software configuration that retains both the advantages of the native application and the advantages of the web application. In addition, the hybrid application has an advantage that the development cost is low because the script layer can be commonly used for a plurality of platforms (OS and the like).

ここで、ハイブリッドアプリの形態の印刷アプリを用いて、ロゴ付きのコンテンツを印刷する場面を想定する。ハイブリッドアプリでは、まず、ウェブ言語を用いて、コンテンツにロゴを重畳させた印刷コンテンツを生成する。そして、印刷の際に、ウェブ言語で記述された印刷コンテンツをプリンタへ送信できる画像形式(JPEG、BMP、PNG、PDFなど)へ変換する。例えばSVGを用いるハイブリッドアプリの印刷コンテンツとしては、下記のようなSVGが例として挙げられる。SVG(Scalable Vecgor Graphics)とは、ウェブ標準言語で利用可能な、グラフィックを表示するための記述方法の一つである。
----------------------------------------------
[[SVG記述例1]]
<svg>
<image xlink:href=”写真” />
<g>ロゴ</g>
</svg>
----------------------------------------------
Here, it is assumed that a printing application in the form of a hybrid application is used to print content with a logo. The hybrid application first uses a web language to generate print content with a logo superimposed on the content. Then, at the time of printing, the print content described in the web language is converted into an image format (JPEG, BMP, PNG, PDF, etc.) that can be transmitted to the printer. For example, as the print content of the hybrid application using SVG, the following SVG can be mentioned as an example. SVG (Scalable Vector Graphics) is one of the description methods for displaying graphics, which can be used in a web standard language.
----------------------------------------------
[[SVG description example 1]]
<svg>
<image xlink: href = "photo"/>
<g> logo </ g>
</ svg>
----------------------------------------------

SVG記述例1では、簡略化のため細かい情報は省いている。SVG記述例1は、後述する図4(a)のように、全面に配された写真401と、写真401の一部に重畳されるロゴ402と、が含まれるSVGコンテンツ400を表している。このように、SVGコンテンツでは、複数の要素からなるコンテンツがあり得る。 In SVG description example 1, detailed information is omitted for simplification. The SVG description example 1 represents an SVG content 400 including a photo 401 arranged on the entire surface and a logo 402 superimposed on a part of the photo 401, as shown in FIG. 4A described later. As described above, in SVG content, there may be content composed of a plurality of elements.

ハイブリッドアプリの形態の印刷アプリによって、SVG記述例1のようなSVGコンテンツが生成されると、OSに標準的に備えられているウェブエンジンがSVGコンテンツを描画する。そして、印刷アプリは、OSのスクリーンショット機能を用いて画像化して得られた画像データを用いてプリンタに印刷データを送信し、プリンタで印刷が行われる。 When the SVG content as in SVG description example 1 is generated by the print application in the form of a hybrid application, the web engine provided as standard in the OS draws the SVG content. Then, the print application transmits the print data to the printer using the image data obtained by imaging using the screenshot function of the OS, and the printer prints.

ここで、OSに標準的に備えられているウェブエンジンでは、通常、SVG記述例1のようなSVGコンテンツを読み込むと、SVGコンテンツの各要素が解析され、画像データとして反映できる状態になったものから非同期的に出力される。ウェブコンテンツを表示する場合には、少しずつでも画面が更新され続ける方が、体感待ち時間が短くなるので、ユーザビリティがよいとされているからである。 Here, in the web engine provided as standard in the OS, when SVG content such as SVG description example 1 is read, each element of the SVG content is analyzed and can be reflected as image data. Is output asynchronously from. This is because when displaying web content, it is said that usability is better if the screen is continuously updated even little by little because the waiting time for experiencing is shortened.

例えば、SVG記述例1のように、複数の要素からなるSVGコンテンツがあり、その複数の要素が重畳されるような画像が描画されることを想定する。すると、最背面に位置する要素の領域は、最前面に位置する要素で覆われることになるので、本来は、描画不要な領域である。図4(a)の例では、ロゴ402の背面に位置する写真401の領域は、本来、描画不要な領域である。SVGコンテンツの最背面に存在する要素から描画がなされると、新しい要素の描画のたびに重複した領域の再描画が発生してしまう。また、それらが透過度設定を持っていた場合、その都度、透過属性を考慮した画素値を算出する必要があり、処理負荷が増大してしまう。 For example, as in SVG description example 1, it is assumed that there is SVG content composed of a plurality of elements, and an image in which the plurality of elements are superimposed is drawn. Then, the area of the element located at the backmost surface is covered with the element located at the frontmost surface, so that it is originally an area that does not require drawing. In the example of FIG. 4A, the area of the photograph 401 located on the back surface of the logo 402 is originally an area that does not require drawing. If drawing is performed from the element existing at the back of the SVG content, the overlapping area will be redrawn every time a new element is drawn. Further, when they have a transparency setting, it is necessary to calculate a pixel value in consideration of the transparency attribute each time, which increases the processing load.

そこで、以下で説明する実施形態では、ハイブリッドアプリの形態の印刷アプリを用いる場合において、コンピュータに不必要な処理負荷を生じさせないように処理を制御する例を説明する。 Therefore, in the embodiment described below, when a print application in the form of a hybrid application is used, an example of controlling the processing so as not to cause an unnecessary processing load on the computer will be described.

<ハードウェア構成の説明>
図1は、本実施形態の情報処理装置115を含むシステムの例を示すブロック図である。情報処理装置115は、例えば、スマートフォンまたは携帯電話等の携帯型情報端末である。情報処理装置115は、CPU100、ROM101、RAM102、2次記憶装置103、ディスプレイ104、タッチセンサ105、加速度センサ106を有する。また、外部I/F107〜109、内部撮像デバイス110、制御バス/データバス116、およびバッテリ117を有する。尚、情報処理装置115は、図1に示す全ての構成を備えていなくてもよいし、図1に示す以外の構成を備えていてもよい。
<Explanation of hardware configuration>
FIG. 1 is a block diagram showing an example of a system including the information processing apparatus 115 of the present embodiment. The information processing device 115 is, for example, a portable information terminal such as a smartphone or a mobile phone. The information processing device 115 includes a CPU 100, a ROM 101, a RAM 102, a secondary storage device 103, a display 104, a touch sensor 105, and an acceleration sensor 106. It also has an external I / F 107-109, an internal imaging device 110, a control bus / data bus 116, and a battery 117. The information processing device 115 may not have all the configurations shown in FIG. 1, or may have configurations other than those shown in FIG.

CPU100は、中央演算装置(プロセッサ)であり、以下で説明する各種処理をプログラムに従って実行する。図1においてCPU100は1つであるが、複数のCPUまたはCPUコアによって構成されていてもよい。ROM101には、CPU100により実行されるプログラムが記憶されている。RAM102は、CPU100によるプログラムの実行時に、各種情報を一時的に記憶するためのメモリである。 The CPU 100 is a central processing unit (processor), and executes various processes described below according to a program. Although the number of CPUs 100 is one in FIG. 1, it may be composed of a plurality of CPUs or CPU cores. The ROM 101 stores a program executed by the CPU 100. The RAM 102 is a memory for temporarily storing various information when the CPU 100 executes a program.

2次記憶装置103は、ハードディスクまたはフラッシュメモリ等の記憶装置であり、ファイルまたは画像解析等の処理結果を保持するデータベース等のデータ、および、各種プログラムを記憶する。ディスプレイ104は、各種処理を実現するための操作を受け付けるためのUI(ユーザインタフェース)、および、実行された処理による処理結果等の各種情報を表示する。ディスプレイ104は、タッチセンサ105を備えてもよい。 The secondary storage device 103 is a storage device such as a hard disk or a flash memory, and stores data such as a database that holds processing results such as a file or image analysis, and various programs. The display 104 displays various information such as a UI (user interface) for receiving operations for realizing various processes and processing results of the executed processes. The display 104 may include a touch sensor 105.

内部撮像デバイス110による撮像によって得られた画像データは、所定の画像処理を経た後、2次記憶装置103に保存される。また、画像データは、外部I/F(インタフェース)108を介して接続された外部撮像デバイス111から読み込むこともできる。 The image data obtained by imaging by the internal imaging device 110 is stored in the secondary storage device 103 after undergoing predetermined image processing. The image data can also be read from the external imaging device 111 connected via the external I / F (interface) 108.

情報処理装置115は、外部I/F109を備え、インターネット等のネットワーク113を介して通信を行うことができる。情報処理装置115は、外部I/F109を介して、ネットワーク113に接続されたサーバ114から画像データを取得することもできる。 The information processing device 115 includes an external I / F 109 and can perform communication via a network 113 such as the Internet. The information processing device 115 can also acquire image data from the server 114 connected to the network 113 via the external I / F 109.

情報処理装置115は、加速度センサ106を備え、情報処理装置115自身の位置姿勢に関する加速度情報を取得することができる。情報処理装置115は、外部I/F107を介してプリンタ112と接続されており、画像データ等のデータをプリンタ112に出力することができる。 The information processing device 115 includes an acceleration sensor 106, and can acquire acceleration information regarding the position and orientation of the information processing device 115 itself. The information processing device 115 is connected to the printer 112 via an external I / F 107, and can output data such as image data to the printer 112.

プリンタ112は、ネットワーク113にも接続されており、外部I/F109経由で、プリンタに必要なデータを送受信することができる。 The printer 112 is also connected to the network 113, and can send and receive data necessary for the printer via the external I / F 109.

外部I/F107〜109は、有線通信および無線通信のうち、少なくともいずれかの通信形態を有するインタフェースであり、利用する通信形態に応じて外部デバイス(プリンタ112あるいはサーバ114)との通信を行う。有線通信には、例えば、USB、イーサネット(登録商標)等があり、無線通信には、無線LAN、NFC、Bluetooth(登録商標)、赤外線通信等がある。また、無線通信として、無線LANを利用する場合には、装置同士が直接接続する形態もあれば、無線LANルータ等の中継装置を介して接続する形態もある。また、外部I/F107〜109は、図では別々に構成されているが、一体となって構成されていてもよい。 The external I / Fs 107 to 109 are interfaces having at least one of wired communication and wireless communication, and communicate with an external device (printer 112 or server 114) according to the communication mode to be used. Wired communication includes, for example, USB, Ethernet (registered trademark), and wireless communication includes wireless LAN, NFC, Bluetooth (registered trademark), infrared communication, and the like. Further, when using a wireless LAN as wireless communication, there are a form in which the devices are directly connected to each other, and a form in which the devices are connected via a relay device such as a wireless LAN router. Further, although the external I / Fs 107 to 109 are separately configured in the figure, they may be integrally configured.

情報処理装置115の動作に必要な電源は、バッテリ117によって供給される。情報処理装置115が備える各種構成要素は、制御バス/データバス116を介して相互に接続され、CPU100は、この制御バス/データバス116を介して、各種構成要素を制御する。 The power supply required for the operation of the information processing apparatus 115 is supplied by the battery 117. The various components included in the information processing device 115 are connected to each other via the control bus / data bus 116, and the CPU 100 controls the various components via the control bus / data bus 116.

尚、本実施形態では、情報処理装置115が、情報処理装置115が備える制御部(CPU100)によって実行されるプログラム等のソフトウェアの実行場所(ソフトウェア実行環境)となる。 In the present embodiment, the information processing device 115 serves as an execution place (software execution environment) for software such as a program executed by the control unit (CPU 100) included in the information processing device 115.

<ソフトウェアのブロック図>
図2は、情報処理装置115で動作するソフトウェア構成のブロック図である。情報処理装置115は、スクリプト層217、ネイティブ層218、及びOS層219のプログラムを実行する。これらの各層は、CPU100がROM101または2次記憶装置103に記憶されている対応するプログラムを読み出し実行することにより実現される。
<Software block diagram>
FIG. 2 is a block diagram of a software configuration that operates in the information processing device 115. The information processing device 115 executes the programs of the script layer 217, the native layer 218, and the OS layer 219. Each of these layers is realized by the CPU 100 reading and executing the corresponding program stored in the ROM 101 or the secondary storage device 103.

スクリプト層217は、画像取得部201、コンテンツ描画部205、画像処理制御部206、データ変換部207、コンテンツ操作部210、プリンタ制御部211、およびレンダリング依頼部222を有する。 The script layer 217 includes an image acquisition unit 201, a content drawing unit 205, an image processing control unit 206, a data conversion unit 207, a content operation unit 210, a printer control unit 211, and a rendering request unit 222.

ネイティブ層218は、画像読み込み部202、データ変換部203、データ保持部204、画像処理部208、プリンタデータ生成部212、レンダリング部216、データ保存部220、および外部デバイス通信部221を有する。 The native layer 218 includes an image reading unit 202, a data conversion unit 203, a data holding unit 204, an image processing unit 208, a printer data generation unit 212, a rendering unit 216, a data storage unit 220, and an external device communication unit 221.

OS層219は、タッチイベント209、プリンタ通信部213、インタプリタ214、および状態検知部223を有する。インタプリタ214は、ウェブエンジン224を有する。 The OS layer 219 includes a touch event 209, a printer communication unit 213, an interpreter 214, and a state detection unit 223. Interpreter 214 has a web engine 224.

スクリプト層217(第一層)は、HTML5、CSS3、またはJavaScript等のウェブ標準言語を使って、テキストデータで命令セット(コンテンツの描画、画像の表示、または動画の再生等)が記述されているプログラム層である。この命令セットを、スクリプト命令セットといい、スクリプト命令セットは、プロセッサ(例えばCPU100)によって実行可能な命令セットである。スクリプト層217では、アプリケーション実行環境上で、そのアプリケーション実行環境に存在するプロセッサ(CPU100)を用いて、テキストデータの各種命令セットを翻訳して実行することになる。その実行形態としては、実行の度に命令文を一行ずつ動的に翻訳する場合、アプリケーションを起動したときに翻訳する場合、または、アプリケーションを情報処理装置115にインストールしたときに翻訳する場合等が考えられる。 The script layer 217 (first layer) describes an instruction set (drawing content, displaying an image, playing a moving image, etc.) with text data using a web standard language such as HTML5, CSS3, or Javascript. It is a program layer. This instruction set is called a script instruction set, and the script instruction set is an instruction set that can be executed by a processor (for example, CPU 100). In the script layer 217, various instruction sets of text data are translated and executed on the application execution environment by using the processor (CPU100) existing in the application execution environment. The execution form includes dynamically translating the instruction statement line by line each time it is executed, translating it when the application is started, or translating it when the application is installed on the information processing device 115. Conceivable.

以後、スクリプト層217で処理すること、および、スクリプト層217の処理内容を「スクリプト」と呼ぶ。スクリプトの命令を情報処理装置115内で翻訳する形態の例として、ネイティブ層218またはOS層219が備えるインタプリタの機能を使用することが挙げられる。尚、本実施形態においては、アプリケーションのUIの大部分が、スクリプト層217で記述されていることを想定している。 Hereinafter, the processing by the script layer 217 and the processing content of the script layer 217 will be referred to as a "script". An example of a form in which a script instruction is translated in the information processing apparatus 115 is to use an interpreter function provided in the native layer 218 or the OS layer 219. In this embodiment, it is assumed that most of the UI of the application is described in the script layer 217.

ネイティブ層218は、アプリケーション実行環境以外で予め翻訳(コンパイル)された命令セットが記述されているプログラム層である。形態としては、CまたはC++といった高水準言語で記述されたコードが、予めアプリケーションの開発者のPCまたはサーバ上でコンパイルされ、CPU100が解釈可能な命令の集合体となっている。以後、ネイティブ層218で処理すること、ネイティブ層218の処理内容、および、後述するOS層219の機能をネイティブ層218から呼び出すことを「ネイティブ」と呼ぶ。尚、ネイティブ層218の別の実装系として、Java(登録商標)が挙げられる。Javaは、C/C++と類似の高水準言語であり、予めアプリケーション開発時の開発環境上で中間コードに翻訳される。翻訳された中間コードは、各OSが備えるJava仮想環境上で動作する。本実施形態においては、このようなプログラム形態も、ネイティブ層218の一種に含める。 The native layer 218 is a program layer in which an instruction set pre-translated (compiled) other than the application execution environment is described. As a form, code written in a high-level language such as C or C ++ is compiled in advance on the PC or server of the developer of the application, and is a set of instructions that can be interpreted by the CPU 100. Hereinafter, processing by the native layer 218, processing contents of the native layer 218, and calling the functions of the OS layer 219 described later from the native layer 218 are referred to as "native". As another mounting system of the native layer 218, Java (registered trademark) can be mentioned. Java is a high-level language similar to C / C ++, and is translated into intermediate code in advance in the development environment at the time of application development. The translated intermediate code operates in the Java virtual environment provided in each OS. In the present embodiment, such a program form is also included in a kind of native layer 218.

OS層219は、情報処理装置115のオペレーティングシステム(Operating System:OS)に対応する。OS層219は、ハードウェア機能の使用をアプリケーションに提供する役割及び固有の機能を有する。OS層219は、APIを備え、スクリプト層217およびネイティブ層218は、APIを介してOS層219の機能を使用することができる。 The OS layer 219 corresponds to the operating system (OS) of the information processing device 115. The OS layer 219 has a role and a unique function of providing the application with the use of the hardware function. The OS layer 219 includes an API, and the script layer 217 and the native layer 218 can use the functions of the OS layer 219 via the API.

本実施形態では、スクリプト層217からネイティブ層218の呼び出しを可能にすることを「バインディング」または「バインド」と呼ぶ。ネイティブ層218は、APIを備え、APIをスクリプトが呼び出すことで、スクリプトが各種ネイティブの機能を使用することができる。このようなバインディング機能は、通常、各種OSが標準的に備えている機能である。 In the present embodiment, enabling the call of the native layer 218 from the script layer 217 is referred to as "binding" or "binding". The native layer 218 includes an API, and the script can use various native functions by calling the API. Such a binding function is usually a function that various OSs have as standard.

本実施形態では、スクリプト層217とネイティブ層218とを含むアプリのことをハイブリッドアプリと呼ぶ。また、ハイブリッドアプリは、OS層219の機能を使用するアプリでもある。本実施形態におけるハイブリッドアプリは、例えば写真などの第一画像にロゴなどの第二画像を重畳してプリンタ112に印刷をさせることが可能な印刷アプリ200であるものとする。また、印刷アプリでは、この重畳済みの画像をプレビュー表示することも可能である。以上がソフトウェアの各層の概要の説明である。以後では、図2の各ブロックの説明を行う。 In the present embodiment, an application including a script layer 217 and a native layer 218 is referred to as a hybrid application. The hybrid application is also an application that uses the functions of the OS layer 219. The hybrid application in the present embodiment is a printing application 200 capable of superimposing a second image such as a logo on a first image such as a photograph and causing the printer 112 to print. In addition, the print application can also preview the superimposed image. The above is an overview of each layer of software. Hereinafter, each block of FIG. 2 will be described.

スクリプト層217の画像取得部201は、ネイティブ層218に対して、例えば印刷対象となる画像データの取得を依頼する。画像取得部201の依頼は、例えば、画像のパスを指定する方法、または、ダイアログ表示を促す方法等が挙げられる。 The image acquisition unit 201 of the script layer 217 requests the native layer 218 to acquire image data to be printed, for example. The request of the image acquisition unit 201 includes, for example, a method of designating an image path, a method of prompting a dialog display, and the like.

ネイティブ層218の画像読み込み部202は、画像データ群215から画像データを取得する。画像データ群215からの画像データの取得方法は、スクリプト層217の画像取得部201の依頼方法に依存する。依頼方法は、UI上に提供されているダイアログボックスから選択する、または、画像のパスから直接画像を選択する等が挙げられる。画像読み込み部202は、画像読み込み時には、画像のパスをスクリプト層217に返却してもよいし、Base64形式でスクリプト層217に返却してもよい。他にも画像に対して一意なIDを割り当て、画像を指定する場合はこのIDを利用する形態を用いてもよい。また画像読み込み部202は、OS層219に、2次記憶装置103に記憶されている画像の一覧を表示させてもよい。そして、その一覧表示においてユーザーにより選択された画像を、OS層219を介して、読み込んでもよい。 The image reading unit 202 of the native layer 218 acquires image data from the image data group 215. The method of acquiring the image data from the image data group 215 depends on the request method of the image acquisition unit 201 of the script layer 217. The request method includes selecting from the dialog box provided on the UI, or selecting the image directly from the image path. When reading an image, the image reading unit 202 may return the image path to the script layer 217, or may return the image path to the script layer 217 in Base64 format. In addition, when a unique ID is assigned to the image and the image is specified, a form using this ID may be used. Further, the image reading unit 202 may display a list of images stored in the secondary storage device 103 on the OS layer 219. Then, the image selected by the user in the list display may be read via the OS layer 219.

ネイティブ層218のデータ変換部203は、ネイティブ層218のデータをスクリプト層217で利用できる形式のデータに変換する。ネイティブ層218のデータは、例えばバイナリ形式の画像データまたはパラメータである。スクリプト層で利用できる形式のデータは、例えばテキスト形式(Base64)の画像データまたはJSONなどである。JSONは、JavaScript Object Notationの略である。一方で、ネイティブ層218のデータ変換部203は、スクリプト層217から送られてきたデータをネイティブ層218で利用できる形式のデータにする変換も行う。 The data conversion unit 203 of the native layer 218 converts the data of the native layer 218 into data in a format that can be used by the script layer 217. The data in the native layer 218 is, for example, image data or parameters in binary format. The format data that can be used in the script layer is, for example, text format (Base64) image data or JSON. JSON is an abbreviation for Javascript Object Notation. On the other hand, the data conversion unit 203 of the native layer 218 also converts the data sent from the script layer 217 into data in a format that can be used by the native layer 218.

スクリプト層217のデータ変換部207は、スクリプト層217のデータ(例:テキスト形式の処理パラメータ)をネイティブ層218で利用できる形式のデータ(例:テキスト形式(JSON形式)の処理パラメータまたは文字列)に変換する。 The data conversion unit 207 of the script layer 217 uses the data of the script layer 217 (example: text format processing parameters) as the data in a format that can be used by the native layer 218 (example: text format (JSON format) processing parameters or character strings). Convert to.

ネイティブ層218のデータ保持部204は、画像読み込み部202で読み込んだ画像データ、画像処理部208で画像処理が施された画像データ、および分割した画像群を保持する。保持される画像データは、例えば、RGB画像データに展開されており、画像処理が実行できる形式になっている。 The data holding unit 204 of the native layer 218 holds the image data read by the image reading unit 202, the image data processed by the image processing unit 208, and the divided image group. The retained image data is expanded into, for example, RGB image data, and is in a format in which image processing can be executed.

スクリプト層217のコンテンツ描画部205は、印刷のためのコンテンツを、ウェブ標準言語を利用して記述する。この記述には、コンテンツ操作部210で編集操作されたスクリプトも反映される。コンテンツ描画部205で記述されたコンテンツのスクリプトは、OS層219のインタプリタ214で解釈され、ディスプレイ104に表示される。近年のPC、および、モバイルコンピュータは、基本的にHTMLおよびJavaScriptを解析するインタプリタ214を備えている。インタプリタ214は、ウェブ言語のインタプリタであるウェブエンジン224を有する。本例では、特に明言しない限り、ウェブエンジンは、レンダリングエンジンまたはウェブブラウザと、同様の意味で用いることとする。 The content drawing unit 205 of the script layer 217 describes the content for printing by using a web standard language. This description also reflects the script edited and operated by the content operation unit 210. The content script described by the content drawing unit 205 is interpreted by the interpreter 214 of the OS layer 219 and displayed on the display 104. Recent PCs and mobile computers basically include an interpreter 214 that analyzes HTML and Javascript. The interpreter 214 has a web engine 224, which is a web language interpreter. In this example, unless otherwise stated, the web engine is used interchangeably with the rendering engine or web browser.

スクリプト層217の画像処理制御部206は、ネイティブ層218における画像処理に用いる補正パラメータと、処理対象となる画像とを決定し、ネイティブ層218の画像処理部208に画像処理を依頼する。補正パラメータは、スクリプト層217のデータ変換部207でネイティブ層へ送信できる形式に変換された後、ネイティブ層218に送信される。 The image processing control unit 206 of the script layer 217 determines the correction parameters used for image processing in the native layer 218 and the image to be processed, and requests the image processing unit 208 of the native layer 218 to perform image processing. The correction parameter is converted into a format that can be transmitted to the native layer by the data conversion unit 207 of the script layer 217, and then transmitted to the native layer 218.

ネイティブ層の画像処理部208は、画像処理制御部206で指定された画像に対し画像処理を施す。その際、どのような画像処理を施すかは、画像処理制御部206で設定されたパラメータにより決定される。画像の指定については、先述のとおりIDを利用する方法に加え、スクリプト層から画像のパスを受け取る、画像データごと受け取る方法などが考えられる。 The image processing unit 208 of the native layer performs image processing on the image specified by the image processing control unit 206. At that time, what kind of image processing is performed is determined by the parameters set by the image processing control unit 206. Regarding the designation of the image, in addition to the method of using the ID as described above, a method of receiving the image path from the script layer, a method of receiving the entire image data, and the like can be considered.

なお、画像のIDを利用する方法では、ネイティブ層218からスクリプト層217に、画像および画像IDが送信される。そして、スクリプト層217からネイティブ層218へは、画像は送信されず、画像IDや画像処理制御部206で設定されたパラメータが送信されてもよい。そして、ネイティブ層218の画像読み込み部202は、画像IDにより特定された画像を読み込み、画像処理制御部206は、読み込まれた画像に対して、当該パラメータに従って画像処理を実行する。また画像読み込み部202で読み込まれる画像が、画素数の多い画像と、同内容で画素数の少ないサムネイル画像を含むファイルである場合、ネイティブ層218からスクリプト層217へはサムネイル画像が送信されてもよい。そして、画像処理制御部206が画像処理を実行する画像として、画像読み込み部202は、画像IDに従って画像を読み込んでもよい。これにより、ネイティブ層218からスクリプト層217に、画素数が多く、データ量の多い画像が送信されるのを防ぐことができる。 In the method using the image ID, the image and the image ID are transmitted from the native layer 218 to the script layer 217. Then, the image is not transmitted from the script layer 217 to the native layer 218, and the image ID and the parameters set by the image processing control unit 206 may be transmitted. Then, the image reading unit 202 of the native layer 218 reads the image specified by the image ID, and the image processing control unit 206 executes image processing on the read image according to the parameter. If the image read by the image reading unit 202 is a file containing an image having a large number of pixels and a thumbnail image having the same content and a small number of pixels, even if the thumbnail image is transmitted from the native layer 218 to the script layer 217. Good. Then, as an image for which the image processing control unit 206 executes image processing, the image reading unit 202 may read the image according to the image ID. As a result, it is possible to prevent an image having a large number of pixels and a large amount of data from being transmitted from the native layer 218 to the script layer 217.

OS層219のタッチイベント209は、ディスプレイ104のタッチに関する情報を取得する。タッチに関する情報とは、ディスプレイ104のタッチ検知、および、タッチされた位置情報等が挙げられる。取得したタッチに関する情報は、ネイティブ層218経由でスクリプト層217のコンテンツ操作部210に送信される。 The touch event 209 of the OS layer 219 acquires information regarding the touch of the display 104. Examples of the touch-related information include touch detection of the display 104, touched position information, and the like. The acquired information regarding the touch is transmitted to the content operation unit 210 of the script layer 217 via the native layer 218.

スクリプト層217のコンテンツ操作部210は、例えば、画像取得依頼の結果としてネイティブ層218から画像データが返却された際、その画像データを反映すべく、スクリプト命令を変更する。例えば、後述するように、DOM(Document Object Model)ツリーと呼ばれる階層モデルに変換する。また、コンテンツ操作部210は、コンテンツがウェブエンジン224で非同期的に描画されないように、スクリプト命令を変更する。詳細は後述する。 The content operation unit 210 of the script layer 217 changes the script command in order to reflect the image data when the image data is returned from the native layer 218 as a result of the image acquisition request, for example. For example, as will be described later, it is converted into a hierarchical model called a DOM (Document Object Model) tree. Further, the content operation unit 210 changes the script instruction so that the content is not drawn asynchronously by the web engine 224. Details will be described later.

スクリプト層217のプリンタ制御部211は、プリンタ検知の依頼、プリンタ設定画面の表示、ならびに、プリント情報の生成および送信を制御する。プリンタ設定画面では、用紙のサイズ、用紙の種類、およびカラー・モノクロ等のプリンタ設定がされる。ここで設定された項目を基に、ネイティブ層218のプリンタデータ生成部212でプリンタデータが生成される。 The printer control unit 211 of the script layer 217 controls the request for printer detection, the display of the printer setting screen, and the generation and transmission of print information. On the printer setting screen, the printer settings such as paper size, paper type, and color / monochrome are set. Based on the items set here, the printer data generation unit 212 of the native layer 218 generates printer data.

ネイティブ層218のプリンタデータ生成部212は、スクリプト層217のプリンタ制御部211からの依頼を基に、プリンタ通信に必要なデータおよびコマンドを生成する。プリンタ通信に必要なデータとは、通信プロトコルに則ったデータである。プリンタ通信に必要なコマンドとは、印刷またはスキャン等、プリンタの動作を決定するためのデータである。このように、プリンタデータ生成部212は、プリンタの動作を決定するためのコマンドを含むプリンタデータを生成する。プリンタの動作を決定するためのコマンドには、印刷用の画像データが含まれる。また、プリンタにプリンタ情報の送信を依頼するコマンドが含まれる。 The printer data generation unit 212 of the native layer 218 generates data and commands necessary for printer communication based on a request from the printer control unit 211 of the script layer 217. The data required for printer communication is data according to the communication protocol. The command required for printer communication is data for determining the operation of the printer, such as printing or scanning. In this way, the printer data generation unit 212 generates printer data including commands for determining the operation of the printer. The command for determining the operation of the printer includes image data for printing. It also includes a command that asks the printer to send printer information.

ネイティブ層218の外部デバイス通信部221は、プリンタなどの情報処理装置115と接続している外部デバイスとの通信を行うためのインタフェース(IF)である。ネイティブ層218の外部デバイス通信部221は、プリンタデータ生成部212から受け取ったデータを送信したり、プリンタ112からの情報を受信したりする。本実施形態では、外部デバイス通信部221は、OS層219のプリンタ通信部213を介して通信するが、外部デバイス通信部221が直接、外部IF107へデータを送信してもよい。尚、OS層219のプリンタ通信部213が、外部デバイスが用いる通信プロトコルに対応していれば、外部デバイス通信部221は、その機能を使えば良い。プリンタ通信部213が、外部デバイスが用いる通信プロトコルに対応していなければ、外部デバイス通信部221が、その通信プロトコルに従って通信する。 The external device communication unit 221 of the native layer 218 is an interface (IF) for communicating with an external device connected to the information processing device 115 such as a printer. The external device communication unit 221 of the native layer 218 transmits the data received from the printer data generation unit 212 and receives the information from the printer 112. In the present embodiment, the external device communication unit 221 communicates via the printer communication unit 213 of the OS layer 219, but the external device communication unit 221 may directly transmit data to the external IF 107. If the printer communication unit 213 of the OS layer 219 supports the communication protocol used by the external device, the external device communication unit 221 may use the function. If the printer communication unit 213 does not support the communication protocol used by the external device, the external device communication unit 221 communicates according to the communication protocol.

OS層219のインタプリタ214は、スクリプト層217で生成されたウェブ標準言語で記述された命令を解釈・実行する。例えば、画像の描画等の命令は、インタプリタ214(ウェブエンジン224)を通して実行される。 The interpreter 214 of the OS layer 219 interprets and executes the instruction written in the web standard language generated by the script layer 217. For example, instructions such as drawing an image are executed through interpreter 214 (web engine 224).

画像データ群215は、画像データを保持している領域である。データ保存部220は、必要に応じて、データ保持部204が保持する画像データを画像データ群215に保存させるために機能する。 The image data group 215 is an area that holds image data. The data storage unit 220 functions to store the image data held by the data storage unit 204 in the image data group 215, if necessary.

スクリプト層217のレンダリング依頼部222は、ネイティブ層218のレンダリング部216にレンダリング(描画)の依頼をする。その際、レンダリング依頼部222は、コンテンツ描画部205で記述されている内容をデータ変換部207で変換してからレンダリング部216部に受け渡す。レンダリング部216に受け渡す前に必要な処理があれば、レンダリング依頼部222は、コンテンツ操作部210を利用して、コンテンツ記述を編集してもよい。また、コンテンツ記述を直接編集するとUIに影響がある場合、コンテンツ記述の複製を生成して、複製したコンテンツ記述を編集してもよい。 The rendering request unit 222 of the script layer 217 requests the rendering unit 216 of the native layer 218 to render (draw). At that time, the rendering requesting unit 222 converts the content described by the content drawing unit 205 by the data conversion unit 207 and then delivers it to the rendering unit 216. If there is a necessary process before passing it to the rendering unit 216, the rendering requesting unit 222 may edit the content description by using the content operation unit 210. If editing the content description directly affects the UI, a duplicate of the content description may be generated and the duplicated content description may be edited.

レンダリング部216は、レンダリング依頼部222から受け取った内容から、プリンタへ送信するため画像データを生成するためのレンダリングを行う。このレンダリングには、例えば、スクリプト層217においてプリンタ112への出力解像度で画像を生成することが含まれる。レンダリング部216がコンテンツから画像を生成する工程では、レンダリング部216は、ウェブエンジン224の機能も利用する。尚、ネイティブ層218におけるレンダリング結果、及び、生成途中の画像はディスプレイ104に表示されない。 The rendering unit 216 performs rendering for generating image data for transmission to the printer from the contents received from the rendering requesting unit 222. This rendering includes, for example, generating an image at the output resolution to the printer 112 at the script layer 217. In the process in which the rendering unit 216 generates an image from the content, the rendering unit 216 also utilizes the function of the web engine 224. The rendering result in the native layer 218 and the image being generated are not displayed on the display 104.

OS層219の状態検知部223は、利用しているデバイスの状態を検知する。例えば、アプリケーションを利用している状態で、着信などの他の通知があった場合、そのイベントの発生または状態変化をネイティブ層218へ送信する。 The state detection unit 223 of the OS layer 219 detects the state of the device being used. For example, when there is another notification such as an incoming call while using the application, the occurrence or state change of the event is transmitted to the native layer 218.

<フローチャート>
以下では、モバイルコンピュータの一種であるスマートフォンが、SVGコンテンツを生成する手順、および、生成したSVGコンテンツを画像に変換しプリンタ112に印刷指示する手順を説明する。
<Flowchart>
Hereinafter, a procedure in which a smartphone, which is a type of mobile computer, generates SVG content and a procedure for converting the generated SVG content into an image and instructing the printer 112 to print it will be described.

図3は本実施形態におけるフローチャートである。図3(a)は、アプリに対するユーザーの操作手順を示したフローチャートであり、図3(b)は、ユーザー操作に対応するアプリ内部の内部処理を記載したフローチャートである。ユーザー操作と内部処理とが1対多の関係にある場合も存在する。例えばS304の用紙サイズ選定では、内部処理としてS304_1とS304_2の二つの処理を行っている。このように、一つのユーザー操作に対して複数の内部処理が発生する場合は操作手順の番号に加えアンダーバーで副番号を付加している。図3(b)の処理は、CPU100が、ROM101または2次記憶装置103内に格納されたプログラムを読み込んでRAM102に展開し、これをCPU100が実行することで実現される。例えば、CPU100が、印刷アプリ200として機能する。尚、各処理の説明における記号「S」は、当該フローチャートにおけるステップであることを意味する。 FIG. 3 is a flowchart of the present embodiment. FIG. 3A is a flowchart showing a user operation procedure for the application, and FIG. 3B is a flowchart describing internal processing inside the application corresponding to the user operation. There is also a case where the user operation and the internal processing have a one-to-many relationship. For example, in the paper size selection of S304, two processes, S304_1 and S304_2, are performed as internal processes. In this way, when a plurality of internal processes occur for one user operation, a sub number is added with an underscore in addition to the operation procedure number. The process of FIG. 3B is realized when the CPU 100 reads the program stored in the ROM 101 or the secondary storage device 103, expands the program into the RAM 102, and the CPU 100 executes the program. For example, the CPU 100 functions as a print application 200. The symbol "S" in the description of each process means a step in the flowchart.

本実施形態では最終的に図4(a)のような写真一枚にロゴ一つが重畳されたコンテンツ(SVGコンテンツともいう)を生成し、印刷することを想定する。図4(a)のSVGコンテンツ400は、写真401の前面の一部にロゴ402が重畳して配されている例を示している。図4(b)は、印刷アプリ200によって、情報処理装置115のディスプレイ104に表示されるUI画面の例を示している。以下では、まず、SVGコンテンツの生成を説明する。 In the present embodiment, it is assumed that a content (also referred to as SVG content) in which one logo is superimposed on one photo as shown in FIG. 4A is finally generated and printed. The SVG content 400 of FIG. 4A shows an example in which the logo 402 is superimposed on a part of the front surface of the photo 401. FIG. 4B shows an example of a UI screen displayed on the display 104 of the information processing apparatus 115 by the print application 200. In the following, first, the generation of SVG content will be described.

ハイブリッドアプリである印刷アプリ200では、前述のとおり、ロゴが重畳されたコンテンツを、ウェブ言語を用いて生成する。本実施形態では、HTMLの一部として利用可能なSVGで印刷コンテンツを生成する例を説明する。もちろんHTMLで印刷コンテンツを生成してもよい。 As described above, the print application 200, which is a hybrid application, generates the content on which the logo is superimposed by using the web language. In this embodiment, an example of generating print content with SVG that can be used as a part of HTML will be described. Of course, print content may be generated by HTML.

近年のプリンタは、非常に高画質に印刷することが可能であり、それに伴い印刷時に必要な画像サイズは、2000px×3000pxなどのように非常に大きなサイズを要する。このサイズはスマートフォンの画面からはみ出るほど大きい。よって、SVGコンテンツを生成している途中の過程においては、基本的にUI用の小さなサイズでディスプレイ104の画面にコンテンツの表示が行われる。本例では、UI用に表示するSVGサイズを600px×400pxとして説明を行う。600px×400pxのSVGコンテンツのひな形は下記のようになる。
----------------------------------------------
[[SVG記述例2]]
<svg width=400 height=600 viewBox=”0 0 400 600”>
</svg>
----------------------------------------------
Recent printers can print with very high image quality, and accordingly, the image size required for printing requires a very large size such as 2000 px × 3000 px. This size is so large that it extends beyond the screen of the smartphone. Therefore, in the process of generating SVG content, the content is basically displayed on the screen of the display 104 in a small size for UI. In this example, the SVG size displayed for the UI will be 600px × 400px. The template of 600px x 400px SVG content is as follows.
----------------------------------------------
[[SVG description example 2]]
<svg width = 400 height = 600 viewBox = ”0 0 400 600”>
</ svg>
----------------------------------------------

図3のフローチャートは、このSVGコンテンツのひな形を印刷アプリ200が読み込んだ時点で処理がスタートする。具体的には、S301では、ユーザーが印刷アプリ200を起動し、印刷アプリ200がSVGコンテンツのひな型を読み込む(S301_1)。S301_1では、例えば図4(b)のうちのSVGコンテンツ400がディスプレイ104の画面に表示されていない状態の画面が表示される。 The flow chart of FIG. 3 starts processing when the print application 200 reads the template of the SVG content. Specifically, in S301, the user activates the print application 200, and the print application 200 reads the template of the SVG content (S301_1). In S301_1, for example, a screen in which the SVG content 400 in FIG. 4B is not displayed on the screen of the display 104 is displayed.

SVGは、XML(Extensible Markup Language)の一種であり、特定の開始タグ(<svg>)から終了タグ(</svg>)までのひとまとまりが要素である。要素を追加していくことでコンテンツが生成される。 SVG is a kind of XML (Extension Markup Language), and a group from a specific start tag (<svg>) to an end tag (</ svg>) is an element. Content is generated by adding elements.

S302においてユーザーは、コンテンツの一部として、画像を追加する。ここでは、写真401を追加するものとする。即ち、印刷アプリ200は、S302_1で、ユーザー操作に基づいて画像をSVGコンテンツに追加する。画像の追加は画像追加ボタン403(図4(b))の押下をトリガーとし、スマートフォン端末内から、ユーザーが画像を選択することで行われる。画像選択および取得は、バインディング機能を用いて各OSが用意しているネイティブ層のAPIを利用してもよいし、HTML標準の機能を利用してもよい。例えばHTMLであれば<input type=“file” 以下略 />のようにinputタグを用いることで端末内へのファイルアクセス、および、データの取得が可能であることは周知である。当然、ネットワークを通じてSNS、クラウド、またはウェブサイトから画像取得が行われてもよい。 In S302, the user adds an image as part of the content. Here, it is assumed that Photo 401 is added. That is, the print application 200 adds an image to the SVG content based on the user operation in S302_1. The image is added by the user selecting an image from the smartphone terminal, triggered by pressing the image addition button 403 (FIG. 4B). For image selection and acquisition, the API of the native layer prepared by each OS may be used by using the binding function, or the HTML standard function may be used. For example, in the case of HTML, it is well known that file access and data acquisition can be performed in the terminal by using an input tag such as <input type = "file" or less />. Of course, the image may be acquired from the SNS, the cloud, or the website through the network.

取得した画像をSVGコンテンツに追加すると、上記のSVG記述例2は、下記のようになる。
----------------------------------------------
[[SVG記述例3]]
<svg width=400 height=600 viewBox=”0 0 400 600”>
<image width=400 height=600 xlink:href=”画像データ”></image>
</svg>
----------------------------------------------
When the acquired image is added to the SVG content, the above SVG description example 2 becomes as follows.
----------------------------------------------
[[SVG description example 3]]
<svg width = 400 height = 600 viewBox = ”0 0 400 600”>
<image width = 400 height = 600 xlink: href = "image data"></image>
</svg>
----------------------------------------------

image要素は、SVGの開始タグから終了タグの間に挿入されている。XMLは、このように階層構造的にコンテンツを記述することが可能である。この例の場合、image要素は、svg要素の子要素と表現できる。逆にsvg要素は、image要素の親要素と表現できる。このように、階層構造で記述された要素は、子要素、または、親要素などと表現される。SVGの要素には、色またはフォントの種類等、様々な設定が可能である。このとき、親要素は、子要素の設定値の影響は受けず、子要素は、親要素の設定値の影響を受けるように構成されている。 The image element is inserted between the start tag and the end tag of SVG. XML can describe contents in such a hierarchical structure. In the case of this example, the image element can be expressed as a child element of the svg element. Conversely, the svg element can be expressed as the parent element of the image element. In this way, the elements described in the hierarchical structure are expressed as child elements, parent elements, and the like. Various settings such as color or font type can be set for the SVG element. At this time, the parent element is not affected by the set value of the child element, and the child element is configured to be affected by the set value of the parent element.

SVG記述例3において、image要素は、横幅(width)が600px、縦幅(height)が400pxとして設定されている。SVGも同様の数値が設定されているため、このSVGでは、写真がSVGコンテンツ中の全面に表示されることになる。image要素内の「画像データ」は、画像を示すパスでもよいし、Base64形式の画像でもよい。 In the SVG description example 3, the image element is set with a width (wise) of 600 px and a height (height) of 400 px. Since the same numerical value is set for SVG, the photograph is displayed on the entire surface of the SVG content in this SVG. The "image data" in the image element may be a path indicating an image or an image in Base64 format.

ここで、ウェブブラウザにおける考え方であるDOM(Document Object Model)を説明する。DOMとは、XMLで記述したSVGなどのコンテンツを管理するためのモデルである。先述のようなSVGコンテンツは、単なる文字列であり、このままではJavaScriptによって操作することができない。そのため、ウェブブラウザでは、HTMLまたはSVGなどのXMLを解析し、DOMツリーと呼ばれる階層構造を持ったモデルに変換し、管理することが行われている。これにより、SVGの要素に対しJavaScriptからアクセスすることが可能となり、SVGの内容の変更等の操作することが可能となる。 Here, the DOM (Document Object Model), which is a concept in a web browser, will be described. The DOM is a model for managing contents such as SVG described in XML. The SVG content as described above is just a character string and cannot be operated by Javascript as it is. Therefore, the web browser analyzes XML such as HTML or SVG, converts it into a model having a hierarchical structure called a DOM tree, and manages it. As a result, the elements of SVG can be accessed from Javascript, and operations such as changing the contents of SVG can be performed.

本実施形態では説明を簡単にするため、変更されたSVGをXML形式の文字列で表記している。実際のアプリでは、JavaScriptを実行させ、DOMとして要素の追加が行われる。即ち、SVG記述例2で示す空のSVGコンテンツに対して画像を追加する場合、JavaScriptを実行させ、DOMとして要素の追加が行われることになる。具体的にはコンテンツ操作部210が、「image要素の生成」、「image要素に設定値を追加」、「svgへ追加」をJavaScriptで実行することになる。例えば、SVGコンテンツへの要素の追加は、下記のようにして実装される。
----------------------------------------------
[[JavaScriptの実行例]]
var xmlns = “ http://www.w3.org/2000/svg ”;
var xlink = “ http://www.w3.org/1999/xlink “
var img = document.createElementNS(xmlns, “image”);
img.setAttributeNS(xlink, “href”, “画像データ”);
img.setAttribute(“width”, 400);
img.setAttribute(“height”, 600);
var svg = document.querySelector(“svg”);
svg.appendChild(img);
----------------------------------------------
In this embodiment, the modified SVG is represented by a character string in XML format for the sake of simplicity. In the actual application, Javascript is executed and the element is added as DOM. That is, when an image is added to the empty SVG content shown in SVG description example 2, Javascript is executed and an element is added as a DOM. Specifically, the content operation unit 210 executes "generation of image element", "add setting value to image element", and "add to svg" with Javascript. For example, adding an element to SVG content is implemented as follows.
----------------------------------------------
[[Example of Javascript execution]]
var xmlns = “http: //www.w3.org/2000/svg” ;
var xlink = “http: //www.w3.org/1999/xlink”
var img = document. createElementNS (xmlns, “image”) ;
img. setAttributeNS (xlink, “href”, “image data”) ;
img. setAttribute (“width”, 400) ;
img. setAttribute (“height”, 600) ;
var svg = document. querySelector (“svg”) ;
svg. appendChild (img) ;
----------------------------------------------

次にS303で、ユーザーは、図4(b)のロゴ追加ボタン404を押下してロゴを選択し、図4(a)に示すように、S302で追加した写真401にロゴ402を追加する。即ち、S302_1において印刷アプリ200は、ロゴ402を追加する。ロゴの追加は、S302_1と同じ手順で実現できる。ただし、ロゴに関しては画面の右下に小さく表示するものとし、それを表すと下記のようなSVGとなる。
----------------------------------------------
[[SVG記述例4]]
<svg width=400 height=600 viewBox=”0 0 400 600”>
<image width=400 height=600 xlink:href=”画像データ”></image>
<image x=300 y=550 width=100 height=50 xlink:href=”画像データ”></image>
</svg>
----------------------------------------------
Next, in S303, the user presses the logo addition button 404 in FIG. 4B to select a logo, and adds the logo 402 to the photo 401 added in S302 as shown in FIG. 4A. That is, in S302_1, the print application 200 adds the logo 402. The logo can be added by the same procedure as in S302_1. However, the logo shall be displayed in a small size at the lower right of the screen, and it may be represented as SVG as shown below.
----------------------------------------------
[[SVG description example 4]]
<svg width = 400 height = 600 viewBox = ”0 0 400 600”>
<image width = 400 height = 600 xlink: href = "image data"></image>
<image x = 300 y = 550 width = 100 height = 50 xlink: href = "image data"></image>
</svg>
----------------------------------------------

SVG記述例4では、新たに「x」「y」が登場している。これらはx座標、y座標のことであり、指示した数値だけ二次元平面を平行移動することになる。これにより、写真401の前面の右下の位置にロゴ402が重畳されたSVGコンテンツ400が完成する。 In SVG description example 4, "x" and "y" are newly introduced. These are the x-coordinate and the y-coordinate, and the two-dimensional plane is translated by the specified numerical value. As a result, the SVG content 400 in which the logo 402 is superimposed on the lower right position on the front surface of the photo 401 is completed.

次に、印刷アプリ200は、プリンタ112と通信を行い、印刷に用いる用紙サイズを決定し、レンダリングに必要な画像の画素数を取得する処理を行う。まず、用紙サイズの選定が行われる。S304でユーザーは、図4(b)に示す印刷設定ボタン405を押下する。これを受けて印刷アプリ200は、S304_1においてプリンタからプリンタ情報を取得し、S305_2において印刷アプリ200は、サイズリストをディスプレイ104に表示する。S304_1およびS305_2の処理の詳細を、図5を用いて説明する。 Next, the print application 200 communicates with the printer 112, determines the paper size used for printing, and performs a process of acquiring the number of pixels of the image required for rendering. First, the paper size is selected. In S304, the user presses the print setting button 405 shown in FIG. 4 (b). In response to this, the print application 200 acquires printer information from the printer in S304_1, and the print application 200 displays the size list on the display 104 in S305_2. The details of the processing of S304_1 and S305_2 will be described with reference to FIG.

<印刷設定の詳細>
図5は、プリンタ情報取得処理の詳細を示すフローチャートである。S501およびS509〜S511は、情報処理装置115のCPU100がスクリプト層217で実行する処理である。また、S502、S504、S505、S507、およびS508は、情報処理装置115のCPU100がネイティブ層218で実行する処理である。また、S503およびS506は、外部デバイスであるプリンタ112が実行する処理である。
<Details of print settings>
FIG. 5 is a flowchart showing the details of the printer information acquisition process. S501 and S509 to S511 are processes executed by the CPU 100 of the information processing apparatus 115 in the script layer 217. Further, S502, S504, S505, S507, and S508 are processes executed by the CPU 100 of the information processing apparatus 115 in the native layer 218. Further, S503 and S506 are processes executed by the printer 112, which is an external device.

S501で、スクリプト層217は、ネイティブ層218にプリンタ情報取得を依頼する。依頼の方法は、画像選択時と同様に、バインディング機能によりスクリプトからネイティブ固有のAPIを呼び出す。ネイティブ層218には、スクリプト層217から直接呼び出せる関数もしくはその関数を間接的に呼び出す、いわゆる、ラッパが予め用意されている。例えば、GetPrinterInfoというネイティブ関数を用意しておき、スクリプト側からその関数を呼び出す。このようにして、ネイティブ層218はスクリプト層217からの外部デバイスとの通信の要求を取得する。 In S501, the script layer 217 requests the native layer 218 to acquire printer information. The request method is the same as when selecting an image, the native API is called from the script by the binding function. The native layer 218 is provided with a so-called wrapper that can be called directly from the script layer 217 or indirectly calls the function. For example, a native function called GetPrinterInfo is prepared, and the function is called from the script side. In this way, the native layer 218 acquires the request for communication with the external device from the script layer 217.

通常、スクリプト層217からは、セキュリティ上の制限で外部デバイスと直接通信することはできない。そのため、上記のように、スクリプト層217は、一旦、ネイティブ層218へ外部デバイス情報の取得を依頼し、ネイティブ層218を介して外部デバイスと通信を行う。ネイティブ層218は、OS層219を介して、外部デバイス(例えば、プリンタ112)と通信する機能を備えている。 Normally, the script layer 217 cannot directly communicate with an external device due to security restrictions. Therefore, as described above, the script layer 217 once requests the native layer 218 to acquire the external device information, and communicates with the external device via the native layer 218. The native layer 218 has a function of communicating with an external device (for example, a printer 112) via the OS layer 219.

ネイティブ層218は、上記のような関数を呼び出されると、S502においてプリンタの検出、いわゆるディスカバリーを行う。例えば、ネイティブ層218は、同一無線LANルータで繋がっているプリンタを検出する。ここでは、通信可能なプリンタの検出を行うため、例えば、Bonjour(登録商標)などのプロトコルにより、ブロードキャストまたはマルチキャスト等の方法を用いてプリンタに対して通信を試みる。 When the above function is called, the native layer 218 performs printer detection, so-called discovery, in S502. For example, the native layer 218 detects printers connected by the same wireless LAN router. Here, in order to detect a printer that can communicate, for example, a protocol such as Bonjour (registered trademark) is used to attempt communication with the printer using a method such as broadcast or multicast.

S503において、プリンタ112は、S502で送られた要求に応じて、応答する。 In S503, the printer 112 responds to the request sent in S502.

S504においてネイティブ層218は、応答があったプリンタのIPアドレスを検知して記憶する。次に、S505でネイティブ層218は、応答があったプリンタのIPアドレスに、プリンタ情報の提供を要求する。応答があったプリンタが複数の場合、ネイティブ層218は、全てのプリンタに対して情報の提供を要求する。ネイティブ層218では、プリンタの情報を取得するためのコマンドを生成する。そのコマンドは、プリンタの動作を指定する命令であり、一例として、以下のようなXMLで表現されるコマンドである。
----------------------------------------------
[[プリンタ情報取得コマンド例]]
01: <?xml version="1.0" encoding="utf-8" ?>
02: <cmd xmlns:trans="http://www.xxxx/yyyyy/">
03: <contents>
04: <operation>GetInformation</operation>
05: </contents>
06: </cmd>
----------------------------------------------
In S504, the native layer 218 detects and stores the IP address of the printer that responded. Next, in S505, the native layer 218 requests the IP address of the printer that responded to provide the printer information. If there are multiple printers responding, the native layer 218 requests all printers to provide information. In the native layer 218, a command for acquiring printer information is generated. The command is a command that specifies the operation of the printer, and as an example, is a command expressed in XML as shown below.
----------------------------------------------
[[Printer information acquisition command example]]
01: <? Xml version = "1.0" encoding = "utf-8"?>
02: <cmd xmlns: trans = "http: //www.xxxx/yyyyy/">
03: <contents>
04: <operation> GetInformation </ operation>
05: </ contents>
06: </ cmd>
----------------------------------------------

上記各行の左側に書かれている「01:」等の数値は、説明を行うために付加した行番号であり、本来のXML形式のテキストには記載されない点に留意されたい。 It should be noted that the numerical values such as "01:" written on the left side of each of the above lines are line numbers added for explanation and are not described in the original XML format text.

1行目は、ヘッダであり、XML形式で記述していることを表している。2行目のcmdは、コマンドの開始を意味する。xmlnsで名前空間を指定し、コマンドの解釈の定義を指定している。尚、6行目の</cmd>でコマンドの終了を示している。 The first line is a header, which indicates that it is described in XML format. The cmd on the second line means the start of the command. The namespace is specified by xmlns, and the definition of command interpretation is specified. The end of the command is indicated by </ cmd> on the 6th line.

3行目は、以後に内容を記載する宣言であり、5行目でその終了を示している。 The third line is a declaration that describes the contents thereafter, and the fifth line indicates the end.

4行目には要求する命令が記載されており、<operation>と</operation>との間に実際の命令文言が存在する。命令文言であるGetInformationは、外部デバイスであるプリンタの情報を取得する命令である。例えば、プリンタが対応している用紙種類、サイズ、縁なし印刷機能の有無、および印刷品位等のケーパビリティ情報を提供するよう要求する。 The required instruction is described on the fourth line, and the actual instruction wording exists between <operation> and </ operation>. The command wording, Get Information, is a command for acquiring information on a printer, which is an external device. For example, it is required to provide capability information such as the paper type, size, borderless printing function, and print quality supported by the printer.

尚、プリンタ情報取得コマンドの生成は、例えば、ROM101に予め記憶した固定のテキストを読み込んでもよい。また、XML等のテキスト形式に限らず、バイナリ形式で記述し、それに沿ったプロトコルで通信してもよい。生成したプリンタ情報取得コマンドは、HTTP等のプリンタが対応している通信プロトコルに従った形式で、外部デバイス通信部221を介してプリンタ112へ送信される。 To generate the printer information acquisition command, for example, a fixed text stored in advance in the ROM 101 may be read. Further, the description is not limited to a text format such as XML, but may be described in a binary format and communication may be performed using a protocol according to the description. The generated printer information acquisition command is transmitted to the printer 112 via the external device communication unit 221 in a format according to a communication protocol supported by the printer such as HTTP.

また、通信方法はこれに限定されるものではない。Wi−Fi Direct(登録商標)、Bluetooth(登録商標)、赤外線通信、電話回線、有線LAN、またはUSBを用いた接続でもよく、その方法に沿ったプロトコルで通信を行えば同様の効果を得ることができる。 Moreover, the communication method is not limited to this. Wi-Fi Direct (registered trademark), Bluetooth (registered trademark), infrared communication, telephone line, wired LAN, or connection using USB may be used, and the same effect can be obtained by communicating using a protocol according to the method. Can be done.

尚、図5の例では、ネイティブ層218で、コマンドを生成する構成としているが、スクリプト層217で、コマンドを生成する構成でも、同様の効果が得られる。その場合、スクリプト層217で、例えば、上記のXML形式の命令文を含むコマンドを生成し、ネイティブ層218へ渡す。それを受けて、ネイティブ層218は、通信プロトコルに従った形式でプリンタ112へそのコマンドを送信すればよい。 In the example of FIG. 5, the native layer 218 is configured to generate commands, but the script layer 217 is configured to generate commands, and the same effect can be obtained. In that case, the script layer 217 generates, for example, a command including the above XML format statement and passes it to the native layer 218. In response, the native layer 218 may send the command to the printer 112 in a format according to the communication protocol.

プリンタ112は、情報処理装置115からコマンドを受信すると、S506で、デバイス情報であるプリンタ情報をXML形式で通信プロトコルに沿って、情報処理装置115へ送信する。以下に、プリンタの情報の一例を示す。
----------------------------------------------
[[プリンタ情報の例]]
01: <?xml version="1.0" encoding="utf-8" ?>
02: <cmd xmlns:trans="http://www.xxxx/yyyyy/">
03: <contents>
04: <device id=”Printer001” />
05: <memory receive= 7680000 />
06: <mode = 1>
07: <media>GlossyPaper</media>
08: <size>A4</size>
09: <quality>1</quality>
10: <border>no</border>
11: <pixels>
12: <width>4000</width>
13: <height>6000</height>
14: </pixels>
15: </mode>
16: <mode = 2>
〜中略〜
</mode>
<mode = 3>
〜中略〜
</mode>

〜中略〜

</contents>
</cmd>
----------------------------------------------
When the printer 112 receives a command from the information processing device 115, the printer 112 transmits the printer information, which is the device information, to the information processing device 115 in the XML format according to the communication protocol in S506. An example of printer information is shown below.
----------------------------------------------
[[Example of printer information]]
01: <? Xml version = "1.0" encoding = "utf-8"?>
02: <cmd xmlns: trans = "http: //www.xxxx/yyyyy/">
03: <contents>
04: <device id = ”Printer001” />
05: <memory receive = 7680000 />
06: <mode = 1>
07: <media> Glossy Paper </ media>
08: <size> A4 </ size>
09: <quality> 1 </ quality>
10: <border> no </ border>
11: <pixels>
12: <width> 4000 </ width>
13: <height> 6000 </ height>
14: </ pixels>
15: </ mode>
16: <mode = 2>
~ Omitted ~
</ Mode>
<Mode = 3>
~ Omitted ~
</ Mode>

~ Omitted ~

</ Contents>
</ cmd>
----------------------------------------------

1行目はヘッダであり、XML形式で記述していることを表している。2行目のcmdは、コマンドの開始を意味する。xmlnsで名前空間を指定し、コマンドの解釈の定義を指定している。尚、最下行の</cmd>でコマンドの終了を示している。 The first line is a header, which indicates that it is described in XML format. The cmd on the second line means the start of the command. The namespace is specified by xmlns, and the definition of command interpretation is specified. The bottom line </ cmd> indicates the end of the command.

3行目は、以後に内容を記載する宣言であり、下の</contents>までその内容は継続する。4行目は、デバイスIDを示している。ここでは、プリンタ112の機種名が「Printer001」であることを表している。6行目以降は、プリンタ112が有する各モードについての記述である。<mode>から</mode>までで、1つのモードにおける情報が記述されている。6行目では、モードの番号が1である。以降の<media>は印刷用紙の種類、<size>は用紙サイズ、<quality>は印刷品位、<border>は縁あり/なしの情報をそれぞれ記述している。11行目の<pixels>は、印刷に必要な入力画像のサイズを表しており、印刷時には横方向が4000[px]、縦方向が6000[px]の画像が必要であることを示している。 The third line is a declaration that describes the content after that, and the content continues until </ contents> below. The fourth line shows the device ID. Here, it means that the model name of the printer 112 is "Printer001". The sixth and subsequent lines are descriptions of each mode of the printer 112. Information in one mode is described from <mode> to </ mode>. In the sixth line, the mode number is 1. Subsequent <media> describes the type of printing paper, <size> describes the paper size, <quality> describes the print quality, and <border> describes information with / without borders. <Pixels> on the 11th line represents the size of the input image required for printing, and indicates that an image of 4000 [px] in the horizontal direction and 6000 [px] in the vertical direction is required at the time of printing. ..

15行目以降は、他のモードであるモード2についての情報が記述されている。このように、プリンタ112の機種名と、そのプリンタが対応している全てのモードとが、XMLに記述されている。尚、プリンタ情報の記述方法はこれに限定されることはなく、タグ形式でないテキスト、または、バイナリ形式等の他の形式であってもよい。 From the 15th line onward, information about the other mode, mode 2, is described. In this way, the model name of the printer 112 and all the modes supported by the printer are described in XML. The method of describing the printer information is not limited to this, and may be a text other than the tag format or another format such as a binary format.

また、プリンタ情報の例としては、上記の示すものに限られない。例えば、プリンタが処理可能な画像処理および解析処理、静かに印刷するモードの有無、メモリカードの利用有無、ならびにインク残量などのステータスの情報を受け渡ししてもよい。画像処理の例としては、モノクロ、セピア、もしくは彩度強調などの色変換、複数画像のレイアウト、ホワイトバランス補正、ノイズ除去、または、その他自動で写真を好ましい色もしくは輝度に補正する処理などが挙げられる。 Further, the example of the printer information is not limited to the one shown above. For example, status information such as image processing and analysis processing that can be processed by the printer, the presence / absence of a quiet printing mode, the presence / absence of a memory card, and the remaining amount of ink may be passed. Examples of image processing include color conversion such as monochrome, sepia, or saturation enhancement, multiple image layout, white balance correction, noise removal, or other processing that automatically corrects a photo to a preferred color or brightness. Be done.

S507でネイティブ層218は、プリンタ112からプリンタ情報を取得する。即ち、ネイティブ層218は、受信したプリンタ情報から、例えば、プリンタ112が有する全てのモードにおける印刷用紙の種類、サイズ、印刷品位、縁あり/なしの項目、および項目数等を取得する。 In S507, the native layer 218 acquires printer information from the printer 112. That is, the native layer 218 acquires, for example, the type, size, print quality, bordered / non-rimmed items, number of items, and the like of the printing paper in all modes of the printer 112 from the received printer information.

S508でネイティブ層218は、受信したプリンタ情報をスクリプト層217が解釈可能な形式に変換して、スクリプト層217へ送信する。具体的には、ネイティブ関数を設けておき、バインディング機能を用いる。あるいは、受け取ったXML形式のプリンタ情報で送信したり、タグなしのテキスト形式に変えて送信したりする等の方法を用いてもよい。スクリプト層217から特定のネイティブ関数を呼び出す毎に、その戻り値として情報を提供してもよい。ネイティブ関数に取得するモードなどの引数を渡し、その戻り値として情報を提供してもよい。上述のJSON文字列を用いた受け渡しをしてもよいし、データ変換部207、203を用いてBase64等の文字列で受け渡しを行ってもよい。 In S508, the native layer 218 converts the received printer information into a format that can be interpreted by the script layer 217, and transmits the received printer information to the script layer 217. Specifically, a native function is provided and the binding function is used. Alternatively, a method such as transmitting with the received XML format printer information or changing to a untagged text format may be used. Information may be provided as a return value each time a specific native function is called from the script layer 217. You may pass an argument such as the mode to be acquired to the native function and provide the information as the return value. The above-mentioned JSON character string may be used for delivery, or the data conversion units 207 and 203 may be used for delivery using a character string such as Base64.

本実施形態ではJSON(JavaScript Object Notation)形式としてスクリプト層へ送信することとする。例えば、下記のような情報となる。
----------------------------------------------
[[JSON形式の例]]
PrinterInfo = {
“deviceID”: “Printer001”,
“memoryRecieve”: “7680000”,
“mode”: [ {
“media”: “光沢紙”,
“size”: “A4”,
“quality”: 1,
“border”: “no”,
“pixels”: {
“width”:4000,
“height”:6000
}
},
//モードの数だけ配列にする
]
}
----------------------------------------------
In this embodiment, it is transmitted to the script layer as JSON (Javascript Object Notation) format. For example, the information is as follows.
----------------------------------------------
[[Example of JSON format]]
PrinterInfo = {
“DeviceID”: “Printer001”,
“MemoryRecieve”: “7680000”,
“Mode”: [{
“Media”: “Glossy paper”,
“Size”: “A4”,
“Quality”: 1,
“Border”: “no”,
“Pixels”: {
“Width”: 4000,
“Height”: 6000
}
},
// Array as many as the number of modes
]
}
----------------------------------------------

S509で、スクリプト層217は、ネイティブ層218から受信したプリンタ情報に基づいて、用紙サイズを選択する設定画面を表示する。図6は、用紙サイズを選択する設定画面の例を示す図である。本実施形態では一番初めに見つかったプリンタから情報を取得し表示することとする。当然、接続可能なプリンタが複数ある場合はプリンタ名を表示し、ユーザーに印刷するプリンタを選択させるという処理を行ってもよい。尚、プリンタの選択は、上記に限らず、より機能が多いプリンタ、または、印刷ジョブが混雑していないプリンタを選択する、等の方法も考えられる。 In S509, the script layer 217 displays a setting screen for selecting a paper size based on the printer information received from the native layer 218. FIG. 6 is a diagram showing an example of a setting screen for selecting a paper size. In this embodiment, information is acquired from the printer found first and displayed. Of course, if there are a plurality of printers that can be connected, the printer name may be displayed and the user may be allowed to select the printer to print. The selection of the printer is not limited to the above, and a method such as selecting a printer having more functions or a printer in which the print job is not congested can be considered.

図6のような用紙サイズ設定画面の形成方法としては、HTMLのラジオボタン機能を用いればよい。ラジオボタンを用いることで複数の選択候補602の中から一つだけチェック601を入れることが可能なUIを簡単に構築できる。 As a method of forming the paper size setting screen as shown in FIG. 6, the radio button function of HTML may be used. By using a radio button, it is possible to easily construct a UI in which only one check 601 can be checked from a plurality of selection candidates 602.

図6の「L版」、「A4」などの文言および表現は、プリンタから送られてきた情報と結び付けてネイティブ層218が決定する。例えば、プリンタから送られてきた情報より取り出した用紙サイズの値が「L」であった場合、表示するテキストは「L版」と決定する。決定の方法として、ネイティブ層218は、これらの対応表を予め保持しておき、その対応表に沿ってテキストを決定すればよい。この対応表を切り替えることで、多言語の対応が可能となる。 Words and expressions such as "L version" and "A4" in FIG. 6 are determined by the native layer 218 in association with the information sent from the printer. For example, if the value of the paper size extracted from the information sent from the printer is "L", the text to be displayed is determined to be "L version". As a method of determination, the native layer 218 may hold these correspondence tables in advance and determine the text according to the correspondence table. By switching this correspondence table, it is possible to support multiple languages.

尚、上記では、用紙サイズのみ設定を行っているが、用紙種類、印刷品位、縁あり/なし、両面/片面、カラー/モノクロ、または、画像補正のオン/オフ等の他の設定が行われてもよい。また、前述のように印刷機能のみではなく、プリンタが処理可能な画像処理もしくは解析処理、静かに印刷するモードの有無、メモリカードの利用有無、またはインク残量などのステータスの情報を表示してもよい。 In the above, only the paper size is set, but other settings such as paper type, print quality, bordered / non-rimmed, double-sided / single-sided, color / monochrome, or image correction on / off are made. You may. In addition to the printing function as described above, status information such as image processing or analysis processing that can be processed by the printer, the presence / absence of a quiet printing mode, the presence / absence of a memory card, or the remaining amount of ink is displayed. May be good.

S510で、スクリプト層217は、表示されているラジオボタンを介してユーザーから用紙サイズの選択を受け付ける。即ち、ユーザーは、複数の選択候補602の中からラジオボタンにチェック601を入れ、決定ボタン603を押下する。 In S510, the script layer 217 accepts a paper size selection from the user via the displayed radio button. That is, the user puts a check 601 in the radio button from the plurality of selection candidates 602 and presses the enter button 603.

S511では、ユーザーによる選択に従って用紙サイズが決定され、処理を終了する。決定ボタン603が押下された場合、印刷アプリ200は、決定した用紙サイズと紐づいている入力画像サイズを、レンダリングのサイズとして決定する。以上が図5の説明である。次に、図3に戻り説明を続ける。 In S511, the paper size is determined according to the selection by the user, and the process ends. When the decision button 603 is pressed, the print application 200 determines the input image size associated with the determined paper size as the rendering size. The above is the description of FIG. Next, the description will be continued by returning to FIG.

S305において、ユーザーは、印刷ボタン406を押下して印刷指示を入力する。印刷指示を受けて、印刷アプリ200は、印刷処理を開始する。印刷処理が開始されると、生成したSVGコンテンツの画像化から印刷までの処理(S305_1〜S305_7)が順番に実行される。 In S305, the user presses the print button 406 and inputs a print instruction. Upon receiving the print instruction, the print application 200 starts the print process. When the printing process is started, the processes (S305_1 to S305_7) from the imaging of the generated SVG content to the printing are executed in order.

S305_1において印刷アプリ200は、SVGサイズを修正する。即ち、コンテンツ操作部210は、UI用に生成されていたSVGのサイズを、印刷用のサイズに変換する。印刷用のサイズは、用紙サイズ設定画面で決定した情報に基づいて決定される。本実施形態では、上述したように、A4サイズが選択され、レンダリングで生成される画像の最終出力サイズは、横幅4000px、縦幅6000pxとなる。レンダリングとは、SVGコンテンツから印刷に用いる画像データを生成することを意味している。本実施形態では、特に区別しない場合、レンダリングと描画とは同等の意味で用いる。以下で説明するように、本実施形態では、描画が完了した画像をスクリーンショットして得られた画像データを用いて印刷が行われることになる。 In S305_1, the print application 200 modifies the SVG size. That is, the content operation unit 210 converts the size of the SVG generated for the UI into the size for printing. The size for printing is determined based on the information determined on the paper size setting screen. In the present embodiment, as described above, the A4 size is selected, and the final output size of the image generated by rendering is 4000 px in width and 6000 px in height. Rendering means generating image data to be used for printing from SVG contents. In the present embodiment, unless otherwise specified, rendering and drawing are used with the same meaning. As will be described below, in the present embodiment, printing is performed using the image data obtained by taking a screenshot of the drawn image.

尚、本実施形態では、SVGコンテンツに、描画判定用のマーカーを付す。マーカーは、SVGコンテンツの描画完了前の時点でスクリーンショットして得られた画像が印刷用の画像として用いられることがないように、SVGコンテンツに付与される。即ち、マーカーの有無で描画完了の判定が行われる。本明細書において描画(レンダリング)は、解析したSVGコンテンツを画像データとして出力できる状態を示しており、ディスプレイへの表示、非表示は問わない。 In this embodiment, a marker for drawing determination is attached to the SVG content. Markers are added to the SVG content so that the image obtained by screenshot before the completion of drawing the SVG content is not used as an image for printing. That is, the completion of drawing is determined by the presence or absence of the marker. In the present specification, drawing (rendering) indicates a state in which the analyzed SVG content can be output as image data, and it does not matter whether it is displayed or hidden on the display.

スクリプト層217からネイティブ層218に送信するSVGコンテンツは、マーカーを含めた4005px×6000pxのSVGとなる。ここでマーカーを付加したSVGは、下記のようになる。
----------------------------------------------
[[SVG記述例5]]
<svg width=4005 height=6000 viewBox=”0 0 4005 6000”>
<svg width=4000 height=6000 viewBox=”0 0 400 600”>
<image width=400 height=600 xlink:href=”画像データ”></image>
<image x=300 y=550 width=100 height=50 xlink:href=”画像データ”></image>
</svg>
<rect x=4000 y=0 width=5 height=6000 fill=”red”></rect>
</svg>
----------------------------------------------
The SVG content transmitted from the script layer 217 to the native layer 218 is an SVG of 4005px × 6000px including the marker. Here, the SVG to which the marker is added is as follows.
----------------------------------------------
[[SVG description example 5]]
<svg width = 4005 height = 6000 viewBox = ”0 0 4005 6000”>
<svg width = 4000 height = 6000 viewBox = ”0 0 400 600”>
<image width = 400 height = 600 xlink: href = "image data"></image>
<image x = 300 y = 550 width = 100 height = 50 xlink: href = "image data"></image>
</svg>
<rect x = 4000 y = 0 width = 5 height = 6000 fill = ”red”></rect>
</svg>
----------------------------------------------

図7は、描画される画像の例を示す図である。図7(a)は、スクリーンショットで最終的に取得したい画像の一例を示している。上記のSVGでは、図7(a)に示すように、印刷サイズより横幅をさらに5px分広く設定し、その領域の色を全て赤色にするコンテンツとしている。この拡張した領域が、マーカーに相当する。 FIG. 7 is a diagram showing an example of an image to be drawn. FIG. 7A shows an example of an image that is finally desired to be acquired as a screenshot. In the above SVG, as shown in FIG. 7A, the width is set to be 5 px wider than the print size, and the color of the area is all red. This expanded area corresponds to a marker.

S305_2で印刷アプリ200は、SVGコンテンツを修正する。即ち、コンテンツ操作部210は、SVGコンテンツの非同期処理が行われないように、SVGコンテンツを修正する。非同期処理とは、ウェブエンジン224で描画が行われる際に、SVGコンテンツの各要素が随時解析され、画像データとして反映できる状態になった要素から非同期的に描画されて出力される処理である。非同期処理が行われると、印刷画像に不要な画像も随時生成されるため、無駄な負荷が発生する。本実施形態では、非同期処理を制御するために、SVGコンテンツを修正する。例えば、本実施形態では、ウェブエンジン224にデータの同期描画(同時描画)を行わせるために、ウェブエンジン22への設定項目である表示ON・OFFを制御する記述をSVGコンテンツに埋め込む。ウェブエンジン224は、ウェブページを表示する機能を有するものであり、ウェブページを表示する際に、上述したように、描画処理を行って画像化を行うものである。本実施形態では、表示をさせない命令をSVGコンテンツに追加することで、ウェブエンジン224において、直ちに描画処理を行わせないように、即ち、非同期処理を行わせないように制御する。上述したSVG記述例5に、このような修正を適用したSVGは、下記のようになる。
----------------------------------------------
[[SVG記述例6]]
<svg width=4005 height=6000 viewBox=”0 0 4005 6000” style=”display:none;”onload=”(function(){ this.style.display='block';}.bind(this))();”>
<svg width=4000 height=6000 viewBox=”0 0 400 600”>
<image width=400 height=600 xlink:href=”画像データ”></image>
<image x=300 y=550 width=100 height=50 xlink:href=”画像データ”></image>
</svg>
<rect x=4000 y=0 width=5 height=6000 fill=”red”></rect>
</svg>
----------------------------------------------
In S305_2, the print application 200 modifies the SVG content. That is, the content operation unit 210 modifies the SVG content so that the asynchronous processing of the SVG content is not performed. The asynchronous process is a process in which each element of the SVG content is analyzed at any time when drawing is performed by the web engine 224, and the element is asynchronously drawn and output from the element that can be reflected as image data. When asynchronous processing is performed, unnecessary images are generated at any time as print images, which causes a wasteful load. In this embodiment, the SVG content is modified in order to control asynchronous processing. For example, in the present embodiment, in order to cause the web engine 224 to perform synchronous drawing (simultaneous drawing) of data, a description for controlling display ON / OFF, which is a setting item for the web engine 22, is embedded in the SVG content. The web engine 224 has a function of displaying a web page, and when displaying the web page, the web engine 224 performs drawing processing to perform image formation as described above. In the present embodiment, by adding a command not to be displayed to the SVG content, the web engine 224 is controlled so that the drawing process is not immediately performed, that is, the asynchronous process is not performed. The SVG to which such a modification is applied to the above-mentioned SVG description example 5 is as follows.
----------------------------------------------
[[SVG description example 6]]
<svg width = 4005 height = 6000 viewBox = ”0 0 4005 6000” style = ”display: none ;” onload = ”(function () {this.style.display ='block' ;} .bind (this)) ( ) ; ”>
<svg width = 4000 height = 6000 viewBox = ”0 0 400 600”>
<image width = 400 height = 600 xlink: href = "image data"></image>
<image x = 300 y = 550 width = 100 height = 50 xlink: href = "image data"></image>
</svg>
<rect x = 4000 y = 0 width = 5 height = 6000 fill = ”red”></rect>
</svg>
----------------------------------------------

上記SVGでは、「display:none」の命令を追加することにより画面上に表示をさせない設定を追加している。後述するように、本実施形態では、オフスクリーンにおいて表示された画像のスクリーンショットで得られた画像データが、印刷用のデータとして扱われる。要素ごとの描画が非同期で行われるウェブエンジン224では、要素の解析が終了次第、要素ごとに画像が描画される。一方、ウェブエンジン224では、全ての要素の配置関係が特定できる状態で描画する場合、配置関係を考慮して描画処理が行われる。このため、ウェブエンジン224に非同期処理を行わせないように制御することで、無駄な描画処理がなされず、情報処理装置115の処理負荷を低減させることができる。 In the above SVG, a setting that does not display on the screen is added by adding a command of "display: none". As will be described later, in the present embodiment, the image data obtained by the screenshot of the image displayed on the off-screen is treated as the data for printing. In the web engine 224 in which drawing for each element is performed asynchronously, an image is drawn for each element as soon as the analysis of the element is completed. On the other hand, in the web engine 224, when drawing in a state where the arrangement relationship of all the elements can be specified, the drawing process is performed in consideration of the arrangement relationship. Therefore, by controlling the web engine 224 so as not to perform asynchronous processing, unnecessary drawing processing is not performed, and the processing load of the information processing device 115 can be reduced.

上記のSVGのように「display:none」を追加すると、ウェブエンジン224では、描画自体が行われない。つまり、ウェブエンジン224では、画像を取得した時に「display:none」が記述された要素は、存在しない状態になる。この非表示命令は、より詳細には、インタプリタ214で解釈され、ウェブエンジン224で実現される。 If "display: none" is added as in the above SVG, the drawing itself is not performed in the web engine 224. That is, in the web engine 224, the element in which "display: one" is described does not exist when the image is acquired. This hidden instruction is, in more detail, interpreted by the interpreter 214 and implemented by the web engine 224.

また、上記SVGでは、「onload」(読み込み完了)を検知したタイミングで、非表示設定を取り消すスクリプトを埋め込んでいる。即ち、「display:block」に変更する命令を埋め込んでいる。尚、display:blockとは、要素を表示することを意味する。SVGには、JavaScriptと連携する機能が備わっている。onloadは、その要素におけるDOMの解析およびリソース取得が終了し、要素に対するJavaScript操作および描画の準備が整ったタイミングで、ウェブブラウザ(ウェブエンジン224)から発行される。つまり、onloadは、ウェブブラウザ(ウェブエンジン224)から発行されるロード完了通知である。上記の例のように、onloadにスクリプトを紐づけておくことによって、onload発行のタイミングで任意のスクリプトを実行させることが可能である。 Further, in the above SVG, a script for canceling the non-display setting is embedded at the timing when "onload" (reading is completed) is detected. That is, an instruction to change to "display: block" is embedded. Note that display: block means to display an element. SVG has a function to cooperate with Javascript. The onload is issued from the web browser (web engine 224) when the DOM analysis and resource acquisition of the element are completed and the Javascript operation and drawing for the element are ready. That is, onload is a load completion notification issued from a web browser (web engine 224). By associating a script with onload as in the above example, it is possible to execute an arbitrary script at the timing of issuing onload.

尚、onloadは、子要素(image要素2つとも)のロードが完了した場合にそれぞれ発行されるが、親要素のonloadの場合、子要素のonloadが全て終了してから発行される。本例では、親要素のonloadの場合の処理を規定している。このため、子要素のonloadが全て終了してから発行される親要素のonloadは、印刷用の描画の準備が整った状態であることを意味する。つまり、本実施形態では、onload発行を、描画の同期処理の準備が完了したトリガーとして扱う。 Note that onload is issued when the loading of child elements (both image elements) is completed, but in the case of parent element onload, it is issued after all child element onloads are completed. In this example, the processing in the case of onload of the parent element is specified. Therefore, the onload of the parent element, which is issued after all the onloads of the child elements are completed, means that the drawing for printing is ready. That is, in the present embodiment, onload issuance is treated as a trigger in which preparation for drawing synchronization processing is completed.

通常、ウェブエンジン224は、ユーザビリティの観点からコンテンツの要素を非同期的に描画するように構成されている。もし、ウェブエンジン224が、解析を完了した要素から非同期的に描画する場合、不要な描画処理が何度も実行されることになり、パフォーマンスに影響を与える。例えば、図7(a)の画像を取得したいにも関わらず、図7(b)のようにロゴが反映されていない、いわば生成途中の画像の生成を経由したのち、図7(a)の画像が生成されることになる。図7(b)は、写真の画像のみが反映された生成途中の画像の例を示している。ここで、図7(b)のロゴの領域には、所望とする画像領域ではなく、別の画像領域(つまり、図7(a)ではロゴによって上書きされることで、本来は不要な画像領域)が描画されている。この場合、再度ロゴの画像領域を上書きする必要がある。これは無駄な描画を行っている以外の何ものでもなく、避けるべき状態である。 Normally, the web engine 224 is configured to asynchronously draw the elements of the content from the viewpoint of usability. If the web engine 224 draws asynchronously from the element that has completed the analysis, unnecessary drawing processing will be executed many times, which affects the performance. For example, although it is desired to acquire the image of FIG. 7 (a), the logo is not reflected as shown in FIG. 7 (b), so to speak, after passing through the generation of an image in the process of being generated, in FIG. 7 (a). An image will be generated. FIG. 7B shows an example of an image in the process of being generated in which only the image of the photograph is reflected. Here, the logo area of FIG. 7B is not a desired image area, but another image area (that is, an image area that is originally unnecessary by being overwritten by the logo in FIG. 7A). ) Is drawn. In this case, it is necessary to overwrite the image area of the logo again. This is nothing more than a useless drawing and is a condition to avoid.

このような状態を避けるためには、画像として取得したい要素を描画させるタイミングの同期処理を図ることが好ましい。本実施形態では、まず、印刷に必要な要素を非表示にし、画像として取得したい要素のロード完了を検知してから表示設定に切り替える制御を組み込んでいる。先述のとおり、親要素に非表示を指示すれば子要素にも非表示が適応されるため、親要素であるSVG要素に対してスクリプトおよび非表示設定を追加している。尚、子要素にそれぞれ非表示設定を追加して制御する形態を採用してもよい。 In order to avoid such a state, it is preferable to synchronize the timing of drawing the element to be acquired as an image. In the present embodiment, first, the elements necessary for printing are hidden, and control is incorporated to switch to the display setting after detecting the completion of loading of the elements to be acquired as an image. As described above, if the parent element is instructed to be hidden, the child element is also hidden. Therefore, a script and a hide setting are added to the SVG element which is the parent element. It should be noted that a mode may be adopted in which a hidden setting is added to each child element for control.

このように、リソースの読み込みおよびDOMツリーの構築が全て完了したタイミングで表示設定に変更することで、通常の非同期的な描画から、要素の同期的な描画処理が可能となる。これにより、ウェブエンジン224が、描画可能な要素から描画するという描画処理の繰り返しを実行することを抑制することができる。この結果、スマートフォンなどの情報処理装置115の無駄な負荷を避けることができる。 In this way, by changing the display setting at the timing when the resource reading and the DOM tree construction are all completed, it is possible to perform the synchronous drawing process of the element from the normal asynchronous drawing. As a result, it is possible to prevent the web engine 224 from executing the repetition of the drawing process of drawing from the drawable element. As a result, it is possible to avoid unnecessary load on the information processing device 115 such as a smartphone.

尚、表示設定の変更は、先述のdisplay:blockだけとは限らない。他にもvisivility:hiddenのような属性を用いて非表示にし、visivility:visibleで表示するようにしてもよい。別の方法としては、始めにSVGコンテンツのx座標およびy座標を表示領域外に指定する。そして、onloadが検知できたタイミングで表示領域内に戻すという方法でもよい。つまり、ウェブブラウザが、要素をディスプレイへ表示しない状態へ変更し、その後で、要素をディスプレイに表示する状態へ変更するといった挙動をウェブブラウザに行わせるような命令が含まれていれば何でもよい。この場合でも、非同期的な描画を抑制することができる。 It should be noted that the change of the display setting is not limited to the above-mentioned display: block. Alternatively, it may be hidden by using an attribute such as visibility: hidden and displayed by visibility: visible. As another method, first, the x-coordinate and the y-coordinate of the SVG content are specified outside the display area. Then, it may be returned to the display area at the timing when onload can be detected. In other words, any command may be included as long as the web browser includes a command that causes the web browser to perform a behavior such as changing the element to the state of not displaying it on the display and then changing the element to the state of displaying it on the display. Even in this case, asynchronous drawing can be suppressed.

S305_3において、スクリプト層217は、修正後のSVGコンテンツをネイティブ層218に送信し、ネイティブ層218においてオフスクリーンの生成が行われる。尚、印刷アプリ200でSVGコンテンツを操作する場合は、前述したように、DOMの形態をとっているため、そのままではネイティブ層218に送信できない。そのため一旦XMLの文字列形式に変換する。DOMを文字列に変換する機能にはJavaScriptに用意されているため、それを用いればよい。例えばDOMの「innerHTML」、または、XMLSerializerのserializeToString機能などを用いれば、DOMからSVGの文字列(即ち、SVGコンテンツ)としてデータを取得することができる。この変換を行ったのち、スクリプト層217は、文字列化したSVGコンテンツを、バインディング機能を用いてネイティブ層218に送信する。 In S305_3, the script layer 217 transmits the modified SVG content to the native layer 218, and offscreen generation is performed in the native layer 218. When operating the SVG content with the print application 200, as described above, since it is in the form of DOM, it cannot be transmitted to the native layer 218 as it is. Therefore, it is once converted to the XML character string format. Since Javascript has a function to convert DOM into a character string, it may be used. For example, by using the "innerHTML" of the DOM or the serializeToString function of the XMLSerializer, data can be acquired from the DOM as an SVG character string (that is, SVG content). After performing this conversion, the script layer 217 transmits the SVG content converted into a character string to the native layer 218 by using the binding function.

尚、本実施形態はスクリプト層217でSVGコンテンツの修正を行う例を説明したが、ネイティブ層218でSVGの修正を行ってもよい。ネイティブ層では、文字列のSVGを受け取るが、XMLを解析してネイティブで操作することは既存の技術でありオープンソースなども存在する。したがって、DOMおよびSVGコンテンツの編集は、スクリプト層217に限定されるわけでなく、必要に応じてネイティブ層218とで処理を分散させてもよい。 In this embodiment, an example of modifying the SVG content in the script layer 217 has been described, but the SVG may be modified in the native layer 218. In the native layer, SVG of a character string is received, but parsing XML and operating it natively is an existing technology, and open source and the like also exist. Therefore, the editing of the DOM and SVG contents is not limited to the script layer 217, and the processing may be distributed among the native layers 218 as needed.

引き続き、S305_3でネイティブ層218は、レンダリング用のWebViewを用意する。WebViewとは、ウェブ言語で記述されたコンテンツを描画するための領域である。本来ウェブブラウザは、WWW(World Wide Web)を利用するためのツールであり、ウェブ言語で記述されたコンテンツを表示するために用いられる。それだけでなく、ウェブブラウザには、サイトを検索するための機能、ページの戻るボタン、または更新ボタンなども通常は用意されている。それに対してWebViewは、あくまでウェブ言語で記述されたコンテンツを描画する領域であり、戻るボタンなどのブラウジングにおける補助的な機能までは含まない。つまりWebViewは、ウェブエンジン224の機能を利用し、ウェブ言語における結果を描画するだけの領域である。そのため、例えば透過度を指定することにより、ユーザーからは見えない(表示はしない)が、画像データは取得できるというオフスクリーンWebViewを実現できる。本実施形態では、ネイティブ層218においてウェブコンテンツをスクリーンショットするために利用するViewを、WebViewとする。 Subsequently, in S305_3, the native layer 218 prepares WebView for rendering. WebView is an area for drawing content written in a web language. Originally, a web browser is a tool for using WWW (World Wide Web), and is used for displaying contents written in a web language. Not only that, web browsers usually also have features for searching sites, page back buttons, or refresh buttons. On the other hand, WebView is an area for drawing content written in the Web language, and does not include auxiliary functions in browsing such as a back button. That is, WebView is an area that only draws the result in the Web language by using the function of the Web engine 224. Therefore, for example, by specifying the transparency, it is possible to realize an off-screen WebView that the image data can be acquired although it is not visible to the user (not displayed). In the present embodiment, the View used for taking a screenshot of the Web content in the native layer 218 is referred to as WebView.

本例においてネイティブ層218は、スクリプト層217から送信されてきたSVGと同じサイズのWebViewを用意する。つまり、マーカーのサイズも含む4005px×6000pxのWebViewを用意する。WebViewのサイズがSVGのサイズより小さい場合、描画されるコンテンツがはみ出して描画されない領域が発生してしまうのを抑制するためである。尚、小さいWebViewとその領域に合わせた分割SVGとを用いて、小領域ずつ処理を行ってもよい。小領域ずつ処理を行うと、利用するRAMが少なくなるためメモリ負荷が小さくなるという利点もある。本実施形態では、簡単のため、WebViewのサイズとSVGとは同じサイズで処理を行う。また、WebViewは、表示されない位置に配置する、もしくは、透過設定をするなど、ユーザーに見えない所謂オフスクリーンにしておきユーザーに見えないように処理を進める。 In this example, the native layer 218 prepares a WebView of the same size as the SVG transmitted from the script layer 217. That is, a WebView of 4005px × 6000px including the size of the marker is prepared. This is because when the size of WebView is smaller than the size of SVG, it is possible to prevent the drawn content from protruding and an area where it is not drawn is generated. It should be noted that the processing may be performed for each small area by using the small WebView and the divided SVG suitable for the area. Performing processing in small areas at a time has the advantage that the memory load is reduced because the amount of RAM used is reduced. In this embodiment, for the sake of simplicity, the WebView size and the SVG are processed in the same size. In addition, WebView is placed in a position where it is not displayed, or is set to be transparent, so that it is invisible to the user, so-called off-screen, and processing is advanced so that the user cannot see it.

WebViewの用意が完了したら、ネイティブ層218は、スクリプト層217から送信されてきたSVGコンテンツを、用意したWebViewに読み込ませ、S305_4へ進む。 When the preparation of WebView is completed, the native layer 218 loads the SVG content transmitted from the script layer 217 into the prepared WebView, and proceeds to S305_4.

S305_4で、ネイティブ層218は、OSのスクリーンショット機能を用いて画像データを取得する。スクリーンショット機能とは、WebViewから画像データを取得する機能のことである。各OSには、用意したViewから画像データを取得する機能が備わっている。Viewとは、ディスプレイ104に何かしらのデータを表示するための領域のことであり、OSによって呼び方は違うが、ImageViewまたはWebViewなどが存在する。例えばImageViewは、読み込んだ標準フォーマットの画像(JPEG画像、PNG画像)を表示する領域であり、WebViewは、ウェブ言語で記述されたコンテンツを表示する領域である。このように読み込ませるデータは様々だが、何かしらのデータを読み込ませディスプレイ104に表示させるための領域を規定するものがViewである。 In S305_4, the native layer 218 acquires image data using the screenshot function of the OS. The screenshot function is a function for acquiring image data from WebView. Each OS has a function to acquire image data from the prepared View. View is an area for displaying some data on the display 104, and although the name is different depending on the OS, ImageView or WebView exists. For example, ImageView is an area for displaying a read standard format image (JPEG image, PNG image), and WebView is an area for displaying contents described in a web language. There are various types of data to be read in this way, but View defines an area for reading some data and displaying it on the display 104.

S305_5でネイティブ層218は、取得した画像データから印刷画像として用いる画像を決定する。本例では、S305_2でSVGコンテンツを同期描画させる修正とマーカーの付与とが行われている。このため、WebViewから取得した画像データにマーカーが存在すれば、描画終了として判定できる。ただし、マーカー自体は印刷に不要なデータである。よって、マーカーの存在が確認したことを条件に、ネイティブ層218は、印刷に必要な領域4000px×6000pxのみをトリミングし、これを画像データとして決定する。このようにS305_5の画像データ決定とは、取得した画像データに必要な情報が揃っているかを確認し、所定の後処理が必要であれば後処理を行う工程である。もし、取得した画像がRGBAデータの配列であり、最終的に欲しい画像がJPEGフォーマットであれば、JPEGフォーマットへ変換する処理が行われてもよい。尚、先述のトリミングする領域は、予め右端5pxは不要領域にするなど規定しておけばよい。それ以外にも、必要な領域をスクリプト層217から引数として送信してもよい。他にも、修正したSVGコンテンツの一番目の子要素の領域だけを必要領域として扱うなどの方法を用いてもよい。 In S305_5, the native layer 218 determines an image to be used as a print image from the acquired image data. In this example, S305_2 is modified to synchronously draw SVG content and a marker is added. Therefore, if the marker exists in the image data acquired from WebView, it can be determined as the end of drawing. However, the marker itself is data unnecessary for printing. Therefore, on condition that the existence of the marker is confirmed, the native layer 218 trims only the area 4000px × 6000px necessary for printing, and determines this as image data. As described above, the image data determination of S305_5 is a step of confirming whether the acquired image data has necessary information and performing post-processing if predetermined post-processing is necessary. If the acquired image is an array of RGBA data and the image finally desired is in JPEG format, a process of converting to JPEG format may be performed. It should be noted that the above-mentioned trimming area may be defined in advance such that the right end 5px is an unnecessary area. In addition, the required area may be transmitted from the script layer 217 as an argument. Alternatively, a method such as treating only the area of the first child element of the modified SVG content as a necessary area may be used.

ここで、S305_5でマーカーの存在が検知できなかった場合は、再度S305_4の操作から繰り返す。この繰り返しは、マーカーの存在が確認できなかったらすぐにやり直してもよいし、一定時間後にやり直してもよい。また、S305_5の画像データ取得のタイミングは、どの時点から開始してもよく、任意のタイミングから始めて一定時間おきに確認してもよい。 Here, if the presence of the marker cannot be detected in S305_5, the operation of S305_4 is repeated again. This repetition may be repeated immediately if the presence of the marker cannot be confirmed, or may be repeated after a certain period of time. Further, the timing of acquiring the image data of S305_5 may be started from any time point, or may be started from an arbitrary timing and confirmed at regular intervals.

また、本実施形態ではマーカーの存在を画像データの決定に用いているが、他の方法を用いてもよい。例えばSVGを読み込ませる前に画像データを取得しておき、SVGを読み込ませた後の画像変化を検知したタイミングで、画像データとして決定してもよい。また、実施形態中のコンテンツ修正は、SVGの中にonloadを検知して表示設定を行うスクリプトを埋め込んでいるが、SVGコンテンツの表示制御は、この例に限られない。例えばネイティブ層218からWebViewに対してSVGコンテンツを操作する指示を出してもよい。それは下記のようなJavaScriptを用意することで実現できる。
----------------------------------------------
[[JavaScriptの記述例]]
function(){
var svg = document.querySelector(“svg”); // svgの取得
svg.style.display = “none”; // svgを非表示設定
setTimeout(function(){
svg.style.display = “block”; // 1秒後にsvgを表示設定
callNativeMethod(); // ネイティブ層に表示設定をしたことを通知する
}, 1000);
}
----------------------------------------------
Further, although the presence of the marker is used for determining the image data in the present embodiment, other methods may be used. For example, the image data may be acquired before the SVG is read, and the image data may be determined at the timing when the image change after the SVG is read is detected. Further, the content modification in the embodiment embeds a script that detects onload and sets the display in the SVG, but the display control of the SVG content is not limited to this example. For example, the native layer 218 may issue an instruction to WebView to operate the SVG content. It can be realized by preparing the following Javascript.
----------------------------------------------
[[Example of Javascript description]]
function () {
var svg = document. querySelector (“svg”) ; // Get svg
svg. style. display = “none” ; // Set to hide svg
setTimeout (function () {
svg. style. display = “block”; // Set to display svg after 1 second
callNativeMethod (); // Notify the native layer that the display settings have been made.
}, 1000);
}
----------------------------------------------

このように、表示・非表示設定の方法は、SVG中にスクリプトを埋め込むことに限らない。画像化に必要な要素の表示・非表示が制御できればどのような方法でもよい。 As described above, the display / non-display setting method is not limited to embedding the script in SVG. Any method can be used as long as the display / non-display of the elements required for imaging can be controlled.

S305_6でネイティブ層218は、印刷コマンドの生成を行う。印刷コマンドの生成とは、画像データを印刷する指示と画像データに関する情報とを含めたデータを生成することである。以下にその一例を示す。
----------------------------------------------
[[印刷コマンドの例]]
01: <?xml version="1.0" encoding="utf-8" ?>
02: <cmd xmlns:trans="http://www.xxxx/yyyyy/">
03: <contents>
04: <operation>Print</operation>
05: <size>A4</size>
06: <quality>high</quality>
07: <file>
08: <format>JPEG</format>
09: <data>画像データ本体…
</data>
… </file>
</contents>
</cmd>
----------------------------------------------
In S305_6, the native layer 218 generates a print command. The generation of a print command is to generate data including an instruction to print the image data and information about the image data. An example is shown below.
----------------------------------------------
[[Example of print command]]
01: <? Xml version = "1.0" encoding = "utf-8"?>
02: <cmd xmlns: trans = "http: //www.xxxx/yyyyy/">
03: <contents>
04: <operation> Print </ operation>
05: <size> A4 </ size>
06: <quality> high </ quality>
07: <file>
08: <format> JPEG </ format>
09: <data> Image data body ...
</ Data>
… </ File>
</ Contents>
</ cmd>
----------------------------------------------

4行目のPrintは、プリンタに対し印刷を実行せよという命令である。5行目は、A4サイズであること、6行目は、印刷品位であり高品位モードで印刷することを命令している。7行目から10行目が画像データに関する情報である。8行目は、画像がJPEGフォーマットであることを表している。9行目以降に画像データ本体が格納されている。 Print on the fourth line is an instruction to print to the printer. The fifth line indicates that the size is A4, and the sixth line indicates that the print quality is high and that printing is performed in the high quality mode. The 7th to 10th lines are information related to the image data. The eighth line shows that the image is in JPEG format. The image data body is stored in the 9th and subsequent lines.

S305_7でネイティブ層218は、生成した印刷コマンドをプリンタ112へ送信する。プリンタ112は、これを受けてプリンタ112は与えられた情報に基づいて印刷を実行する。 In S305_7, the native layer 218 transmits the generated print command to the printer 112. In response to this, the printer 112 executes printing based on the given information.

以上説明したように、本実施形態によれば、ハイブリッドアプリを用いて印刷を行う場合に、不必要な処理負荷が生じてしまうことを抑制することができる。 As described above, according to the present embodiment, it is possible to prevent an unnecessary processing load from being generated when printing is performed using the hybrid application.

尚、本実施形態では、写真とロゴのみの単純なSVGコンテンツを想定したが、当然要素は3つ以上でもよい。本実施形態では全要素に対して表示設定の切り替えを記載しているが、要素の一部にのみ適応させてもよい。即ち、SVGコンテンツの要素が2つ以上で構成されている場合において、少なくとも2つの要素における表示設定の切り替えを行う処理としてよい。このような場合であっても、不要な描画命令が削減されるため、パフォーマンスの改善につながる。また、写真にロゴが重畳するSVGコンテンツを例に説明したが、各要素が重畳しないようなコンテンツであってもよい。 In this embodiment, a simple SVG content containing only a photo and a logo is assumed, but of course, three or more elements may be used. In the present embodiment, the switching of the display setting is described for all the elements, but it may be applied to only a part of the elements. That is, when the elements of the SVG content are composed of two or more elements, the process of switching the display settings in at least two elements may be performed. Even in such a case, unnecessary drawing instructions are reduced, which leads to an improvement in performance. Further, although the SVG content in which the logo is superimposed on the photograph has been described as an example, the content may be such that the elements are not superimposed.

なお、印刷する画像の大きさの指定方法は、図6に示した方法に限らない。例えば、印刷により得たい画像の実サイズとして、「〇〇mm×△△mm」等の数値をユーザーが画面上で入力するための画面を印刷アプリが表示してもよい。このような画面で入力されたサイズが、スクリプト層217からネイティブ層218に通知される。そしてネイティブ層218の画像処理部208は、そのサイズに合うように、画像の変倍およびトリミングを行う。そして、このように変倍およびトリミングが実行された画像がプリンタ通信部213を介してプリンタ112に送信され、印刷される。そのため、ユーザーが上記の画面で指定したサイズの画像が印刷される。 The method of specifying the size of the image to be printed is not limited to the method shown in FIG. For example, the print application may display a screen for the user to input a numerical value such as "○○ mm × △△ mm" on the screen as the actual size of the image to be obtained by printing. The size input on such a screen is notified from the script layer 217 to the native layer 218. Then, the image processing unit 208 of the native layer 218 performs scaling and trimming of the image so as to fit the size. Then, the image obtained by scaling and trimming in this way is transmitted to the printer 112 via the printer communication unit 213 and printed. Therefore, an image of the size specified by the user on the above screen is printed.

この変倍およびトリミングは、S305_1において、SVGコンテンツに対して実行されてもよいし、S305_4において取得された画像データに対して実行されてもよい。また、上述の例では印刷アプリがハイブリッドアプリの場合について説明したが、これに限らず、印刷アプリがネイティブアプリの場合であってもよい。 This scaling and trimming may be performed on the SVG content in S305_1 or on the image data acquired in S305_1. Further, in the above example, the case where the print application is a hybrid application has been described, but the present invention is not limited to this, and the print application may be a native application.

<<その他の実施形態>>
本発明は、上述の実施形態の1以上の機能を実現するプログラムを、ネットワーク又は記憶媒体を介してシステム又は装置に供給し、そのシステム又は装置のコンピュータにおける1つ以上のプロセッサがプログラムを読出し実行する処理でも実現可能である。また、1以上の機能を実現する回路(例えば、ASIC)によっても実現可能である。
<< Other Embodiments >>
The present invention supplies a program that realizes one or more functions of the above-described embodiment to a system or device via a network or storage medium, and one or more processors in the computer of the system or device reads and executes the program. It can also be realized by the processing to be performed. It can also be realized by a circuit (for example, ASIC) that realizes one or more functions.

Claims (16)

アプリケーションの実行の際に、プロセッサによって翻訳されて実行されるスクリプト命令セットで構成された第一層と、前記プロセッサが実行可能な命令セットとして前記プロセッサとは異なるユニットにより予めコンパイルされている第二層と、を有し、前記第一層と前記第二層との連携によって前記アプリケーションを実行するためのプログラムであって、
前記プロセッサを、
複数の要素を含む印刷対象のコンテンツを生成する第一生成手段と、
コンテンツに含まれる要素を非同期で描画する描画手段に対して、前記印刷対象のコンテンツに含まれる複数の要素のうち少なくとも2つ以上の要素がロードされた後に当該少なくとも2つ以上の要素を前記描画手段が描画するように、前記第一生成手段で生成された前記印刷対象のコンテンツの描画を依頼する依頼手段と、
前記依頼手段による依頼に基づいて前記描画手段によって描画された画像を取得して印刷用のデータを生成する第二生成手段と、
として機能させるためのプログラム。
The first layer consists of a set of script instructions that are translated and executed by the processor when the application is executed, and the second layer that is pre-compiled by a unit different from the processor as an instruction set that can be executed by the processor. A program having a layer and executing the application in cooperation with the first layer and the second layer.
The processor
The first generation means to generate printable content containing multiple elements,
The drawing means for asynchronously drawing the elements included in the content, the drawing means for drawing the at least two or more elements after at least two or more elements among the plurality of elements included in the content to be printed are loaded. A requesting means for requesting drawing of the content to be printed generated by the first generation means so that the means draws, and a requesting means for requesting drawing.
A second generation means that acquires an image drawn by the drawing means based on a request by the request means and generates data for printing.
A program to function as.
前記依頼手段は、前記少なくとも2つ以上の要素がロードされた後に当該少なくとも2つ以上の要素を前記描画手段が描画するように、前記第一生成手段で生成された前記印刷対象のコンテンツを修正し、修正後のコンテンツの描画を前記描画手段に依頼することを特徴とする請求項1に記載のプログラム。 The requesting means modifies the content to be printed generated by the first generation means so that the drawing means draws the at least two or more elements after the at least two or more elements are loaded. The program according to claim 1, wherein the drawing means is requested to draw the modified content. 前記依頼手段は、前記少なくとも2つ以上の要素を非表示にし、かつ、前記2つ以上の要素のロードが完了した後に表示が行われるように、前記印刷対象のコンテンツを修正することを特徴とする請求項2に記載のプログラム。 The requesting means is characterized in that the content to be printed is modified so that the at least two or more elements are hidden and the display is performed after the loading of the two or more elements is completed. The program according to claim 2. 前記依頼手段は、前記少なくとも2つ以上の要素を、表示領域とは別の領域に表示させ、かつ、前記2つ以上の要素のロードが完了した後に、前記表示領域に表示するように、前記コンテンツを修正することを特徴とする請求項2に記載のプログラム。 The requesting means displays the at least two or more elements in an area different from the display area, and displays the two or more elements in the display area after the loading of the two or more elements is completed. The program according to claim 2, wherein the content is modified. 前記描画手段は、OSのウェブエンジンであることを特徴とする請求項1から4のいずれか一項に記載のプログラム。 The program according to any one of claims 1 to 4, wherein the drawing means is an OS web engine. 前記第二生成手段は、OSのスクリーンショット機能を用いて前記画像を取得することを特徴とする請求項1から5のいずれか一項に記載のプログラム。 The program according to any one of claims 1 to 5, wherein the second generation means acquires the image by using the screenshot function of the OS. 前記第一層は、HTMLまたはJavaScriptで記述されていることを特徴とする請求項1から6のいずれか一項に記載のプログラム。 The program according to any one of claims 1 to 6, wherein the first layer is described in HTML or Javascript. 前記印刷対象のコンテンツは、少なくとも1つ以上の要素が他の要素の少なくとも一部に重畳していることを特徴とする請求項1から7のいずれか一項に記載のプログラム。 The program according to any one of claims 1 to 7, wherein the content to be printed has at least one or more elements superimposed on at least a part of other elements. 前記複数の要素は所定のマーカーを含み、前記第二生成手段は、前記描画手段によって描画された画像が、前記所定のマーカーを含むことを条件に、前記画像を取得することを特徴とする請求項1から8のいずれか一項に記載のプログラム。 The plurality of elements include a predetermined marker, and the second generation means acquires the image on condition that the image drawn by the drawing means includes the predetermined marker. The program according to any one of items 1 to 8. 前記複数の要素の全てが前記描画手段によって描画された後に、前記第二生成手段は、前記画像を取得することを特徴とする請求項1から9のいずれか一項に記載のプログラム。 The program according to any one of claims 1 to 9, wherein the second generation means acquires the image after all of the plurality of elements have been drawn by the drawing means. 前記印刷対象のコンテンツは、SVGを利用して記述されていることを特徴とする請求項1から10のいずれか一項に記載のプログラム。 The program according to any one of claims 1 to 10, wherein the content to be printed is described using SVG. 前記第二生成手段は、前記生成した画像に所定の処理を行った後に、前記印刷用のデータを生成することを特徴とする請求項1から11のいずれか一項に記載のプログラム。 The program according to any one of claims 1 to 11, wherein the second generation means generates data for printing after performing a predetermined process on the generated image. 印刷される画像のサイズの数値をユーザーが入力するための画面を表示手段に表示させる表示制御手段と、
前記表示制御手段により表示された画面において入力された数値に応じて、前記印刷対象のコンテンツまたは前記描画手段により描画された画像を変倍する変倍手段と、
として前記プロセッサをさらに機能させるための請求項1から12のいずれか1項に記載のプログラム。
A display control means that causes the display means to display a screen for the user to input a numerical value of the size of the image to be printed.
A scaling means for scaling the content to be printed or an image drawn by the drawing means according to a numerical value input on the screen displayed by the display control means.
The program according to any one of claims 1 to 12 for further functioning the processor.
前記表示手段により表示された画面において入力された数値に応じて、前記印刷対象のコンテンツまたは前記描画手段により描画された画像にトリミングを実行するトリミング手段として前記プロセッサをさらに機能させるための請求項13に記載のプログラム。 13. Claim 13 for further functioning the processor as a trimming means for performing trimming on the content to be printed or the image drawn by the drawing means according to the numerical value input on the screen displayed by the display means. The program described in. プロセッサと、
アプリケーションの実行の際に、前記プロセッサによって翻訳されて実行されるスクリプト命令セットで構成された第一層と、前記プロセッサが実行可能な命令セットとして前記プロセッサとは異なるユニットにより予めコンパイルされている第二層と、を有し、前記第一層と前記第二層との連携によって前記アプリケーションを実行するためのプログラムを記憶する記憶媒体と、
を備えた情報処理装置であって、
前記プロセッサが前記記憶媒体に記憶されている前記プログラムを実行することで前記プロセッサが、
複数の要素を含む印刷対象のコンテンツを生成する第一生成手段と、
コンテンツに含まれる要素を非同期で描画する描画手段に対して、前記印刷対象のコンテンツに含まれる複数の要素のうち少なくとも2つ以上の要素がロードされた後に当該少なくとも2つ以上の要素を前記描画手段が描画するように、前記第一生成手段で生成された前記印刷対象のコンテンツの描画を依頼する依頼手段と、
前記依頼手段による依頼に基づいて前記描画手段によって描画された画像を取得して印刷用のデータを生成する第二生成手段と、
として機能することを特徴とする情報処理装置。
With the processor
A first layer composed of a script instruction set translated and executed by the processor when the application is executed, and a first layer pre-compiled by a unit different from the processor as an instruction set that can be executed by the processor. A storage medium having two layers and storing a program for executing the application in cooperation with the first layer and the second layer.
It is an information processing device equipped with
When the processor executes the program stored in the storage medium, the processor can be
The first generation means to generate printable content containing multiple elements,
The drawing means for asynchronously drawing the elements included in the content, the drawing means for drawing the at least two or more elements after at least two or more elements among the plurality of elements included in the content to be printed are loaded. A requesting means for requesting drawing of the content to be printed generated by the first generation means and a requesting means for drawing the content to be printed so that the means draws.
A second generation means that acquires an image drawn by the drawing means based on a request by the request means and generates data for printing.
An information processing device characterized by functioning as.
アプリケーションの実行の際に、プロセッサによって翻訳されて実行されるスクリプト命令セットで構成された第一層と、前記プロセッサが実行可能な命令セットとして前記プロセッサとは異なるユニットにより予めコンパイルされている第二層と、の連携によって前記アプリケーションを実行して行われる情報処理方法であって、
複数の要素を含む印刷対象のコンテンツを生成する第一生成ステップと、
コンテンツに含まれる要素を非同期で描画する描画手段に対して、前記印刷対象のコンテンツに含まれる複数の要素のうち少なくとも2つ以上の要素がロードされた後に当該少なくとも2つ以上の要素を前記描画手段が描画するように、前記第一生成ステップで生成された前記印刷対象のコンテンツの描画を依頼する依頼ステップと、
前記依頼ステップによる依頼に基づいて前記描画手段によって描画された画像を取得して印刷用のデータを生成する第二生成ステップと、
を有することを特徴とする情報処理方法。
The first layer consists of a set of script instructions that are translated and executed by the processor when the application is executed, and the second layer that is pre-compiled by a unit different from the processor as an instruction set that can be executed by the processor. It is an information processing method performed by executing the application in cooperation with the layer.
The first generation step to generate printable content containing multiple elements,
The drawing means for asynchronously drawing the elements included in the content, the drawing means for drawing the at least two or more elements after at least two or more elements among the plurality of elements included in the content to be printed are loaded. A request step for requesting drawing of the content to be printed generated in the first generation step so that the means draws, and a request step.
A second generation step of acquiring an image drawn by the drawing means based on a request by the request step and generating data for printing, and a second generation step.
An information processing method characterized by having.
JP2019215203A 2019-11-28 2019-11-28 Information processing device, information processing method, and program Active JP7395334B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2019215203A JP7395334B2 (en) 2019-11-28 2019-11-28 Information processing device, information processing method, and program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2019215203A JP7395334B2 (en) 2019-11-28 2019-11-28 Information processing device, information processing method, and program

Publications (2)

Publication Number Publication Date
JP2021086414A true JP2021086414A (en) 2021-06-03
JP7395334B2 JP7395334B2 (en) 2023-12-11

Family

ID=76087853

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2019215203A Active JP7395334B2 (en) 2019-11-28 2019-11-28 Information processing device, information processing method, and program

Country Status (1)

Country Link
JP (1) JP7395334B2 (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2015064904A (en) * 2014-12-22 2015-04-09 セイコーエプソン株式会社 Control method of network system, control method of script for print control, and script for print control
JP2018005575A (en) * 2016-07-01 2018-01-11 キヤノン株式会社 Information processing device, information processing method, and program
JP2018055184A (en) * 2016-09-26 2018-04-05 富士ゼロックス株式会社 Image forming apparatus and program

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2015064904A (en) * 2014-12-22 2015-04-09 セイコーエプソン株式会社 Control method of network system, control method of script for print control, and script for print control
JP2018005575A (en) * 2016-07-01 2018-01-11 キヤノン株式会社 Information processing device, information processing method, and program
JP2018055184A (en) * 2016-09-26 2018-04-05 富士ゼロックス株式会社 Image forming apparatus and program

Also Published As

Publication number Publication date
JP7395334B2 (en) 2023-12-11

Similar Documents

Publication Publication Date Title
US10296267B2 (en) Information processing apparatus, information processing method, and storage medium
US9436413B2 (en) Information processing apparatus, information processing method, and storage medium storing program
US10318213B2 (en) Information processing apparatus, information processing method, and storage medium storing program
JP6478487B2 (en) Information processing apparatus, information processing method, and program
JP6381319B2 (en) Information processing apparatus, processing method, and program
JP6138088B2 (en) Information processing apparatus, control method, and software program
US10075620B2 (en) Information processing apparatus, control method for information processing apparatus, and non-transitory computer-readable storage medium
US10620892B2 (en) Information processing apparatus that displays a print setting screen based on information of a printing apparatus in a format interpretable in a first program layer and processing method thereof
JP6799396B2 (en) Information processing equipment, information processing methods and programs
US9575702B2 (en) Information processing apparatus, information processing method, and storage medium storing program having a layered structure
US10228890B2 (en) Apparatus, method, and non-transitory computer-readable storage medium
JP6786342B2 (en) Information processing equipment, information processing methods and programs
JP6649832B2 (en) Information processing apparatus, control method therefor, and program
JP7395334B2 (en) Information processing device, information processing method, and program

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20221117

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20230712

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20230718

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20230914

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

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20231031

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20231129

R151 Written notification of patent or utility model registration

Ref document number: 7395334

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R151