Information processing device, information processing method, and program
The solution allows local generation and display of image data using native libraries within the information processing device, addressing network-dependent delays in WebView applications by processing images directly on the device.
Patent Information
- Application Number
- JP2020129210
- Authority / Receiving Office
- JP · JP
- Patent Type
- Patents
- Current Assignee / Owner
- Filing Date
- 2020-07-30
- Publication Date
- 2024-09-09
- Estimated Expiration
- 2040-07-30
AI Technical Summary
Conventional technologies using WebView to display application screens face delays in processing image data due to network traffic when generating preview images from locally stored files, as they rely on server-side generation or client-side processing, which is affected by network conditions.
An information processing device equipped with a storage means, native library, and display means that allows image data generation and display on the device side using WebView, by calling native libraries via scripts to process locally stored files without network dependency.
Enables efficient and timely processing of image data without network delays by generating and displaying images locally, reducing reliance on server traffic and network conditions.
Smart Images

Figure 0007547106000007 
Figure 0007547106000004 
Figure 0007547106000013
Abstract
Description
[Technical field]
[0001] The present invention relates to an information processing device that displays an operation screen provided by a Web server, Reason Regarding the law and the program. [Background technology]
[0002] There is a system in which an information processing device such as a personal computer (PC) or a mobile phone connects to a Web server on a network and displays an operation screen provided by a Web application on the Web server on the information processing device. In this type of system, the Web browser of the information processing device first requests an operation screen from the Web application on the Web server. Then, in response to the request from the information processing device, the Web application responds to the information processing device with HTML data for displaying the operation screen on the Web browser. The Web browser analyzes the received HTML data and displays an operation screen based on the description of the HTML data. When a user inputs an instruction via the operation screen displayed on the Web browser, the Web browser notifies the Web server of the input instruction. The Web application that receives the notification executes processing according to the content of the notification.
[0003] There is a component called WebView that has the same functions as a web browser and can be used as a GUI element that configures applications on an information processing device. By using WebView, applications on information processing devices can achieve the same expressions and functions as those of a web browser. Information processing devices such as mobile terminals and smartphones are equipped with the above-mentioned WebView.
[0004] Some WebViews are equipped with a binding mechanism for directly calling native library functions of information processing devices from Javascript (registered trademark) executed in web applications. Native library functions refer to functions provided by the operating system (OS) or language processing system of the information processing device.
[0005] Patent Document 1 proposes a technology for displaying an operation screen of a game application on a mobile terminal using a WebView. [Prior art documents] [Patent documents]
[0006] [Patent Document 1] JP 2016-143416 A Summary of the Invention [Problem to be solved by the invention]
[0007] By displaying the operation screen of an application using WebView, it is possible to update the application simply by rewriting HTML. In this type of application, it is sometimes desirable to use WebView to display image data based on a file stored in an information processing device in which the application is installed. For example, it is sometimes desirable to use WebView to preview a locally stored file before printing it.
[0008] However, because this type of application uses a WebView to display the operation screen, conventional technology is unable to generate image data (such as a preview image) on the client side based on a file stored locally (on the client side) and display it on the operation screen. Note that in a configuration in which a request is made to generate a preview image on the server side and the preview image generated on the server is displayed, image data and the like is sent and received over a network, which can be affected by traffic in the network environment and can cause delays in the display process.
[0009] The present invention has been made to solve the above problems, and aims to provide a mechanism for enabling an application that realizes display of an operation screen by WebView to generate and display image data of a file stored in an information processing device on which the application is installed. [Means for solving the problem]
[0010] The present invention comprises a storage means for storing one or more files and a native library, an acquisition means for acquiring web content from a server, a display means for displaying on a display an operation screen generated by having a WebView process the acquired web content, a generation means for calling the native library using a script included in the web content when a predetermined instruction is given on the operation screen, and causing the called native library to generate image data corresponding to a file selected by a user from the one or more stored files, and a control means for displaying the image data generated by the native library on the operation screen. an information processing device, wherein, in the native library, when the format of the selected file is not a predetermined format, image data indicating that the format of the selected file is an unsupported format is set as the image data generated by the native library; It is characterized by: Effect of the Invention
[0011] According to the present invention, an application that realizes display of an operation screen by WebView can generate and display image data of a file stored in an information processing device in which the application is installed. As a result, image data can be processed without transmitting it to a server, and can be processed without being affected by traffic in a network environment and without delay. [Brief description of the drawings]
[0012] [Figure 1] FIG. 1 is a diagram showing the configuration of a system to which an information processing apparatus according to an embodiment of the present invention can be applied. [Diagram 2] 1 is a diagram showing the configuration of an information processing apparatus, a server, and an MFP according to an embodiment of the present invention. [Diagram 3]FIG. 2 is a diagram for explaining the configuration of software installed in the information processing apparatus of the embodiment. [Figure 4] FIG. 13 is a diagram showing an example of Java code of a native library that is bound by a Javascript core. [Diagram 5] FIG. 2 is a diagram showing an example of HTML and Javascript code included in Web content. [Figure 6] A diagram showing an example of a Java class binding to Javascript. [Figure 7] FIG. 13 is a diagram showing an example of JavaScript and HTML called from a Java native library. [Figure 8] 5A to 5C are diagrams showing an example of a transition of an operation screen in the information processing apparatus of the present embodiment. [Figure 9] FIG. 11 is a sequence diagram illustrating the process flow from file selection, to display of a preview image, to uploading a print job. [Figure 10] 10 is a flowchart showing details of a preview image generating process. [Figure 11] 10 is a flowchart showing details of a file type determination process. [Figure 12] 11 is a flowchart showing details of an image generation process. [Figure 13] FIG. 11 is a diagram showing an example of a print setting UI. [Figure 14] 10 is a flowchart showing details of a job transmission process. [Figure 15] FIG. 4 is a diagram showing an example of a job ticket. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS
[0013] Hereinafter, the embodiments of the present invention will be described with reference to the drawings. Note that the following embodiments do not limit the invention according to the claims, and all of the combinations of features described in the embodiments are not necessarily essential to the solution of the invention.
[0014] <System configuration example> FIG. 1 is a diagram showing an example of the configuration of a system to which an information processing device according to an embodiment of the present invention can be applied.
[0015] This system includes an information processing apparatus 101 connected to the Internet 103 via a network 100 such as a LAN, and a server 102 and an MFP (Multi Function Printer) 104 also connected to the Internet 103 .
[0016] The network 100 is a platform for communication between devices, and is connected to the Internet 103. The information processing device 101 may be any device having a Web browser or WebView function, and may be, for example, a mobile terminal such as a smartphone, a personal computer (PC), or the like.
[0017] The server 102 has a function of distributing Web content via a network, and returns Web content in response to a request from the information processing device 101. The Web content includes HTML including Javascript (registered trademark; hereinafter, the fact that it is a registered trademark will be omitted) executed on the information processing device 101. The MFP 104 is a multifunction peripheral having functions of a printer, etc. The MFP 104 is not limited to an MFP and may be a server or the like as long as it has a function of storing print jobs.
[0018] <Configuration example of information processing device> Fig. 2 is a diagram showing an example of the configuration of the information processing device 101, the server 102, and the MFP 104. Note that the MFP 104 further includes components for reading and printing images in addition to the components shown in Fig. 2, but these are omitted in the figure.
[0019] Although the following description will be given using the information processing device 101, the same applies to the server 102 and the MFP 104. The information processing device 101 includes a CPU 201 that executes programs including an operating system (OS), applications, scripts, and the like in addition to the program according to this embodiment.
[0020] The information processing device 101 also includes a ROM 202 that stores programs and data executed by the CPU 201, and a RAM 203 that provides a work area for expanding the programs and data executed by the CPU 201. The information processing device 101 also includes a storage unit 204 (which may be an HDD, SSD, NVRAM, or the like) that stores the programs and various settings according to this embodiment.
[0021] The information processing device 101 further includes a user input unit 205 through which the user inputs commands, a UI display unit 206 that displays screens such as a user interface screen, and a network unit 207 that communicates with other devices via a network. The information processing device also includes a main bus 200 that connects the various components.
[0022] Unless otherwise specified, in the information processing device 101, the server 102, and the MFP 104, the CPU 201 controls the ROM 202, the RAM 203, the storage unit 204, the user input unit 205, the UI display unit 206, and the network unit 207 via the main bus 200. The UI display unit 206 may also function as the user input unit 205, like a touch panel display. The MFP 104 may also have an image reading unit and an image printing unit connected to the main bus 200.
[0023] <Software configuration example> Fig. 3 is a diagram for explaining the configuration of software installed in the information processing device 101. Each functional unit shown in Fig. 3 is realized by the CPU 201 of the information processing device 101 executing a program.
[0024] Several types of applications are installed in the information processing device 101. The first type is an application 300 that acquires Web content from the server 102 and executes the script included in the Web content by binding it with the native function of the information processing device 101. The second type is an application 308 that does not use Web content.
[0025] The application 300 acquires Web content 301 from the server 102 via the network unit 207, which is a module that performs communication using the HTTP protocol. The acquired Web content 301 can be displayed in a WebView 302 shared by the application 300.
[0026] The WebView 302 (or a web browser) is an application component that can be used in the information processing device 101, such as an Android (registered trademark) terminal or an iOS (registered trademark) terminal. The WebView 302 provides the running application 300 with a function (web display function) of displaying an operation screen based on web content acquired from the server 102 via a network. The WebView 302 enables the information processing device 101 to display an operation screen using web content and to accept user operations. For example, the WebView 302 can execute a device function (not shown) of the information processing device 101 based on an input operation (e.g., file selection) by a user via the operation screen. This can be realized by using a library of device functions (native library 307) from a script using a binding function described later.
[0027] The WebView 302 can render the Web content 301 using a Web engine 304 and display the results. The Web engine 304 has a Web core 306 and a Javascript core 305 as components.
[0028] The Web core 306 renders HTML included in the Web content 301. The Javascript core 305 interprets and executes Javascript included in HTML. The Javascript core 305 has a function of interpreting Javascript and executing a native library 307. Note that a native library refers to functions provided by the operating system of an information processing device, a language processing system (implemented in Java, C language, etc.), and a program that combines these functions (described in detail later). The Javascript core 305 has a binding function that binds Javascript to a native library (e.g., a Java class) in response to a command from the application 300.
[0029] The window control module 309 manages and controls the display state of the operation screen of each application 300 , 308 . The information processing device 101 has a platform including an engine (not shown) for executing applications written in Java (registered trademark; hereinafter, the fact that it is a registered trademark will be omitted). Of the components shown in FIG. 3, the WebView 302, Web engine 304, and native library 307 are included in the platform. If the application 300 is written in Java, the information processing device 101 can execute the application 300 via the platform. The executed application 300 can display Web content using the WebView 302, and can use Java objects by Javascript included in the Web content.
[0030] <Application and script code examples> First, using Figures 4 and 5, we will explain the code that calls the Java method bound to the HTML data via JavaScript.
[0031] 4 is a diagram showing an example of Java code of the native library 307 to which the application 300 binds via the JavaScript core 305. Note that the numbers written to the left of the Java code indicate the line numbers of the code.
[0032] The block shown on lines 1 to 11 is a definition of an object class that can be used from Javascript in application 300. In this example, the getImage method of the WebApp class (lines 2 to 5) and the cb_getImage method for the callback function (lines 7 to 10) are defined (details will be described later).
[0033] In line 13 of Figure 4, the addJavascriptInterface method is called for the WebView class, which creates a Javascript object that allows Javascript and Java to communicate with each other. By executing the code in Figure 4, Javascript can execute the Java WebApp.getImage method by calling the corresponding method of the nativeApp object.
[0034] 5 is a diagram showing an example of HTML and JavaScript code included in the Web content 301. Note that the numbers written to the left of the code indicate the line numbers of the code.
[0035] The first line in Figure 5 is the code for creating a button that calls up Javascript, and in the example in Figure 5, it is written in HTML. Specifically, a "Preview" button is displayed on the web screen, and when that button is pressed, the block shown in lines 5 to 11, defined in "btn_id_getImage", is executed.
[0036] Line 8 defines a Java method to be called from Javascript when the "Preview" button defined as "btn_id_getImage" is pressed. Here, the callback function name and file path (file path of the original image for generating a preview image) are set as arguments to the getImage method of the WebApp class defined as a Java class that can be read from Javascript in FIG. 4, and called. The callback function name is a method that is called to notify the result when the processing of a method (such as "getImage" in the block shown in lines 2 to 5 of FIG. 4) is completed. In FIG. 5, the Java class is called by nativeApp.getImage using the name nativeApp set by the webView.addJavascriptInterface method in FIG. 4. In this way, when Javascript is executed, the Javascript core 305 can call and execute the method of the Java class bound in FIG. 4. As described above, by calling the getImage method with the callback function name 'cb_getImage' as an argument, the cb_getImage method is called to notify the result when the getImage method is completed.
[0037] Next, using Figures 6 and 7, we will explain the code that reflects the processing results from a Java class bound to Javascript to HTML via Javascript.
[0038] FIG. 6 shows an example of a Java class that is bound to Javascript, and is executed when the cb_getImage method is called.
[0039] In the first line of Figure 6, the evaluateJavascript method is called for the WebView class in order to call a method in Javascript from a Java method. The cb_getImage method in the first line is the callback function mentioned in Figure 5, defined in the WebApp class in Figure 4. In other words, when processing of the Java getImage method is completed, "cb_getImage" in Javascript is called. At this time, the preview image data converted to a string representation is passed.
[0040] FIG. 7 shows an example of JavaScript and HTML called from Java in the native library 307, and is included in the Web content 301 in the same way as in FIG.
[0041] When cb_getImage is executed by the evaluateJavascript method of the WebView class in FIG. 6, the Javascript process in line 7 in FIG. 7 is called. Then, the preview image data is stored in a string representation in the json passed as an argument. In this embodiment, this preview image data can be called by json.imgdata64. Furthermore, in line 10, this preview image is saved in the local storage (window.localStorage) 303 on the WebView 302. To display this preview image, it is necessary to set the image data in the src of the img tag in HTML, and the image data (json.imgdata64) is set in the src of the img tag in the Javascript in line 11. As a result, the preview image is displayed in the HTML location of the WebView 302 (the location defined in line 2 in FIG. 7).
[0042] <Example of screen transition> FIG. 8 is a diagram showing an example of a transition of an operation screen in the information processing device 101. As shown in FIG. An operation screen 801 is an operation screen displayed by the WebView 302. A "Select File" button 802 is displayed based on HTML code (not shown) in the Web content 301. When the "Select File" button is pressed here, a Java method bound to Javascript is executed, and the screen transitions to a file selection screen 805.
[0043] Any file can be selected on the file selection screen 805. For example, the file may be a file managed in a local folder of the information processing device 101 or a file managed on an external web server (not shown). This time, when the file selection on the file selection screen 805 is completed, the screen returns to the operation screen 801.
[0044] "Preview" button 803 is displayed based on the HTML code in Fig. 5. When "Preview" button 803 is pressed, file information selected on file selection screen 805 is notified to getImage bound to Javascript in Figs. 4 and 5, and preview image data is generated. When the preview image data is generated, it is notified to Javascript by cb_getImage, and when the image information is set in the HTML img tag, the preview image is displayed in area 806 on operation screen 801. Even if the file selected on operation screen 805 is made up of multiple pages, the preview image displayed in area 806 is assumed to be the preview image of one of those pages.
[0045] <Process flow from file selection to preview image display and job upload> 9 is a sequence diagram explaining the flow of processing from file selection to displaying a preview image and uploading a print job. That is, the WebView 302 detects that the application 300 is in a display state, and displays a preview image using the native library 307 bound to the application 300 via the JavaScript core 305. This corresponds to the sequence up to uploading the displayed image data as a print job.
[0046] In step 901, the window control module 309 detects switching of the application 300. The information processing device 101 switches the application based on the screen display of the display control unit 205 and the input information by the user operation of the input control unit 206. Specifically, when multiple applications are being executed, the application selected by the user operation is displayed on the screen as active, and the screens of the other applications are not displayed. The window control module 309 can monitor information indicating the display state of the application and obtain the display state by accessing the information. If there is a transition of the display state, it is detected. When the window control module 309 detects that the application displayed on the information processing device 101 has been switched to the application 300, in step 902 it notifies the WebView 302 of this.
[0047] In step 903, the WebView 302 displays the Web content 301 of the application 300. Here, the WebView 302 notifies the Web engine 304 of information on the Web content 301 (including HTML and Javascript), and causes the WebView 302 to display the Web content.
[0048] In step 904, the WebView 302 detects an operation on the Web content displayed in the WebView 302. When the WebView 302 detects that the "Select File" button 802 shown in FIG. 8 has been pressed, in step 905 the WebView 302 notifies the Web engine 304 of information that the "Select File" button has been pressed.
[0049] In step 906, the Javascript core 305 of the Web engine 304 receives the notification of the button press in step 905 above, executes the corresponding Javascript, and calls the function bound to the native library 307. As a result, the file selection function of the native library 307 is called.
[0050] In response to the call in step 906, the native library 307 executes a file selection process in step 907. In this embodiment, the file selection process uses a known technology provided by the OS (Storage Access Framework: illustrated in 805 in FIG. 8), and therefore will not be described in detail here.
[0051] The user selects a file from a folder that can be viewed from the information processing device 101. Then, in step 908, the identifier (for example, the file path) of the file selected as the processing result is notified to the JavaScript bound from the native library 307. In response to this notification, in step 909, the Javascript core 305 notifies the WebView 302 that the processing is complete.
[0052] In step 910, similar to step 904, the WebView 302 detects an operation on the web content displayed in the WebView 302. Here, upon detecting that the "Preview" button 803 shown in Fig. 8 has been pressed, in step 911 the WebView 302 notifies the Web engine 304 of information that the "Preview" button has been pressed.
[0053] In step 912, the Javascript core 305 of the Web engine 304 receives the button press notification in step 911 above, executes the corresponding Javascript, and calls the function bound to the native library 307. This calls the preview image generation function of the native library 307 (the function provided by the getImage method in FIG. 4).
[0054] In response to the call in step 912, the native library 307 executes a preview image generation process in step 913. Note that details of this process will be described later with reference to Figs. 10 to 12. After the preview image generation process, the native library 307 notifies the bound JavaScript of the preview image data generated in the preview image generation process as the processing result in step 914. This notification is realized by the cb_getImage method described above.
[0055] In step 915, the Javascript core 305 stores the preview data received by the Javascript in the storage (local storage) 303 of the WebView 302. In step 916, the WebView 302 sets the preview image data stored in the local storage 303 to the src of the Image tag in the preview display area of the Web content, and displays it in the WebView 302.
[0056] In step 917, WebView 302 detects an operation on the Web content displayed in WebView 302, similar to step 910. Here, when it is detected that the print button shown in Fig. 8 has been pressed, in step 918, WebView 302 switches the displayed Web content to a print setting screen display shown in Fig. 13, which will be described later.
[0057] In step 919, the WebView 302 detects an operation on the web content in the same manner as in step 917. If the WebView 302 detects that the "Upload" (print data registration) button 1301 shown in FIG. In step 920, WebView 302 notifies the Web engine 304 of the information regarding the pressing of the "Upload" (print data registration) button. At that time, WebView 302 notifies the Web engine 304 of the print setting data in which each setting item is linked to the attribute data set in the setting item as print settings, together with the file identifier (e.g., file path) received in step 909 above.
[0058] In step 921, the Javascript core 305 of the Web engine 304 receives the button press notification in step 920 above, executes the corresponding Javascript, and calls the function bound to the native library 307. As a result, the job generation function of the native library 307 is called.
[0059] In response to the call in step 921, in step 922, the native library 307 executes a job generation process. When the job generation process in step 922 above is completed, in step 923, the native library 307 performs a job transmission process. Here, the job data generated in step 922 above is transmitted to the MFP 104 using a data transmission function of the native library 307. Note that the transmission destination of the MFP 104 (e.g., IP address) may be registered in the system in advance, or may be switchable on a UI screen. The transmission destination may be a print server, but the following description will be given assuming that it is the MFP 104. Note that details of the processes in steps 922 and 923 above will be described later with reference to FIG. 14.
[0060] In step 924 , the MFP 104 performs registration processing for the job received from the native library 307 . In step 925, the MFP 104 notifies the native library 307 of the result of the job registration process as a completion notice. In response to the notification in step 925, in step 926, the native library 307 notifies the WebView 302 of the completion notification via the bound JavaScript. As described above, the print job is registered in the MFP 104 through steps 917 to 926.
[0061] <Details of preview image generation process> Fig. 10 is a flowchart showing details of the preview image generation process performed by the native library 307 in step 913 in Fig. 9, where a preview image is generated from the file path of the image file notified in step 912. The processes shown in Fig. 10 and Figs. 11 and 12 described below are executed by the preview image generation function of the native library 307, and will be mainly described below with reference to the "native library 307."
[0062] In step 1001, the native library 307 checks the existence of the file from the file path of the image file notified in step 912 of Fig. 9. If the file does not exist (No in step 1001), the native library 307 proceeds to step 1006, sets the processing result as an error (step 1006), and ends the processing of this flowchart.
[0063] On the other hand, if it is determined that the file exists (Yes in step 1001 ), the native library 307 advances the process to step 1002 . In step 1002, the native library 307 sets the output area size. In this embodiment, the output area size is the size of the display area of the preview image to be displayed in the WebView 302, and the preview image is generated so as to fit within this area.
[0064] In step 1003, the native library 307 determines the type of the file whose existence was confirmed in step 1001. The file type indicates the type of file, such as PDF, JPEG, PNG, etc., and the determination is made so that the method of generating a preview image can be switched depending on the file type. Details will be described later with reference to FIG.
[0065] Next, in step 1004, the native library 307 generates a preview image from the image data whose file type has been determined, as will be described in detail later with reference to FIG. In step 1005, the image data generated in step 1004 above is converted to Base64 so that it can be notified as image data in step 914 of Fig. 9. The reason for converting to Base64 is that there are cases in which image data cannot be processed unless it is treated as data in character string format in WebView 302. After the process of step 1005, the native library 307 ends the process of this flowchart.
[0066] FIG. 11 is a flowchart showing the details of the file type determination process in step 1003 in FIG. In step 1101, the native library 307 determines whether the file has an extension such as “XXX.jpg.” If the file does not have an extension (Yes in step 1101), the native library 307 advances the process to step 1102. On the other hand, if the file has an extension (No in step 1101 ), the native library 307 advances the process to step 1104 .
[0067] In step 1102, the native library 307 reads several tens of bytes of information (header information) from the beginning of the file to determine the file type. Here, if the read header information area contains file type identification information such as %PDF, the file is determined to be a PDF file. Next, in step 1103 , the native library 307 adds an extension corresponding to the file type determined in the above step to the file name, and proceeds to step 1104 .
[0068] Next, in step 1104, the native library 307 determines the file type from the file extension by performing a reverse lookup using the extension as a key from file type determination data that previously associates the extension with the file type. For example, if there is file type determination data as shown in Table 1, and the extension is jpg, the file type will be image / jpg. [Table 1]
[0069] In step 1004, the native library 307 generates a preview image from the image data whose file type has been determined, and ends the processing of this flowchart.
[0070] FIG. 12 is a flowchart showing the details of the image generation process in step 1004 of FIG. In step 1201, the native library 307 checks whether the file type determined in the file type determination process in step 1003 of Fig. 10 (Fig. 11) is "image". Here, it is determined whether the determined file type name includes "image". If the file type name includes "image" (Yes in step 1201), the native library 307 proceeds to step 1203 and processes the file as image data (single page). In step 1203, the native library 307 reads image attributes (image size, image information such as Exif) of the image data, and the process proceeds to step 1206. Note that Exif stands for Exchangeable image file format.
[0071] On the other hand, if the determined file type name does not include “image” (No in step 1201 ), the native library 307 advances the process to step 1202 . In step 1202, the native library 307 determines whether the file type determined in step 1003 of Fig. 10 includes "pdf". If the file type name includes "pdf" (Yes in step 1203), the native library 307 proceeds to step 1204. In step 1204, the native library 307 reads the image data and image attributes (image size) of the first page of the PDF file as PDF data, and proceeds to step 1206. Because a PDF file is a file format that can be composed of multiple pages, only the image data of the first page of the PDF file is read here, but all pages may be read.
[0072] On the other hand, if the determined file type name does not include “pdf” (No in step 1202), the native library 307 determines that the file format is not a specified format such as image or PDF, and proceeds to step 1205. In step 1205, the native library 307 determines that the file type is unsupported, and reads image data and image attributes (image size) of an image file (default icon, etc.) for which preview is not supported that is defined in advance in the process. Then, the process proceeds to step 1206.
[0073] In this embodiment, the file types compatible with preview image generation are image and PDF for the sake of convenience. However, the file types that can be supported may be expanded to other file types by adding a similar determination process and a process for reading image data and image attributes.
[0074] In step 1206 , the native library 307 obtains the image size from the image attributes read in step 1203 , 1204 or 1205 above. 10 and the image size read in the above step 1206. If the image size is larger than the output area size (Yes in step 1207), the native library 307 advances the process to step 1208.
[0075] In step 1208, the native library 307 calculates the scaling ratio of the image. In this step, the scaling ratio (reduction ratio) of the image is calculated so that the preview image fits within the output area size. A specific example will be given. Assume that the output area size has a width and height of 200×200 pixels, and the image size has a width and height of 800×400 pixels. In this case, since the width of the image size is larger than the height, the scaling ratio is 200 / 800=0.25 so that the width fits within the output area size. In other words, the scaling ratio is calculated so that the size of the generated preview image is 200 in width and 100 in height (400 pixels multiplied by a scaling ratio of 0.25) while maintaining the aspect ratio of the image. After the process of step 1208 , the native library 307 proceeds to step 1210 .
[0076] On the other hand, if the image size is not larger than the output area size (No in step 1207 ), the native library 307 advances the process to step 1209 . In step 1209 , the native library 307 sets the image scaling ratio to 1 (same size) and proceeds to step 1210 .
[0077] In step 1210, the native library 307 adds the rotation direction of the image to the scaling ratio. In step 1210, the native library 307 determines whether there is information about the image orientation (e.g., Exif information) in the image attributes read in step 1203, 1204, or 1205. If there is data about the image orientation (Yes in step 1210), the native library 307 proceeds to step 1211.
[0078] In step 1211, the native library 307 determines the rotation direction of the image from information about the image orientation. For example, images taken with the camera function of a smartphone or the like are generally saved in landscape orientation. Therefore, if a preview image is generated in this state, it will be landscape, so image rotation is necessary. Here, an affine coefficient is determined by multiplying the scaling ratio determined in step 1208 above by the image rotation direction. In other words, the image rotation direction is incorporated into the scaling ratio. Note that the affine coefficient (transformation) is a known technique and will not be described in detail here. After the process of step 1211 , the native library 307 advances the process to step 1212 .
[0079] On the other hand, if there is no data regarding the image orientation (No in step 1210 ), the native library 307 advances the process to step 1212 .
[0080] In step 1212, the native library 307 reads the image data according to the scaling ratio determined as described above for the image data, saves the image data in a file, and ends the processing of this flowchart.
[0081] 10 to 12 are completed, the processing results and the Base64 converted image data are notified to the WebView 302 from the native library 307 via steps 914 and 915 in FIG. 9, and a preview image is displayed.
[0082] <Print settings UI example> 13 is a diagram showing an example of a UI for print settings. Here, a method for displaying options that can be set for each item of print settings and allowing the user to set the item will be described as an example.
[0083] For the setting item CopiesCount in Figure 13, available options such as 1, 2, and 3 are displayed, and the user selects and sets one of them. Similarly, available options are displayed for the setting items Color, Duplex, Output Size, and Collate, and the user selects and sets one of them. In this way, the user can configure print settings by selecting an option for each setting item, and for setting items that are not selected, the default setting displayed on the UI is treated as the option set. Print settings configured in this way are saved as print setting data, with the setting item and the selected option paired, for example, Copies: 1, Color: Automatic, ...
[0084] <From job creation to sending process> Fig. 14 is a flowchart showing details of the job transmission process performed by the native library 307 in steps 922 and 923 in Fig. 9. The process shown in Fig. 14 is executed by the data transmission function of the native library 307, and will be described below mainly with respect to the "native library 307."
[0085] In step 1401, the native library 307 monitors for a job generation process call notification in step 921 of Fig. 9 (data reception waiting process). If the above notification is received, the native library 307 advances the process to step 1402.
[0086] In step 1402, the native library 307 converts the print setting data received in the notification into a job ticket that can be interpreted by the printer. Here, conversion into JDF (Job Definition Format) is performed as a specific example. However, the conversion is not limited to JDF as long as it is into a job ticket that can be interpreted by the printer. In recent years, JDF has become more compatible with printing devices and is essentially the standard format in the printing industry, allowing for the description of work information throughout the printing process.
[0087] FIG. 15 is a diagram showing an example of a job ticket written in JDF. For example, in this embodiment, in step 1402, the received print settings are embedded in a fill-in-the-blank format into a job ticket template written in JDF that has been prepared in advance. Specifically, if the number of copies to be printed is "1", Amount="1" is set in the Amount section of Fig. 14, which is the item corresponding to the number of copies in the JDF. Other settings are also set, such as Sides="OneSided" for single-sided printing and Sides="TwoSided" for double-sided printing, and a job ticket is generated.
[0088] Next, in step 1403, the native library 307 checks whether the print image data exists. In detail, the native library 307 checks the file identifier (file path) passed in steps 920 and 921 of Fig. 9, and checks whether the print image data exists. If the print image data does not exist (No in step 1403), the native library 307 ends the processing of this flowchart.
[0089] On the other hand, if print image data exists (Yes in step 1403 ), the native library 307 advances the process to step 1404 . In step 1404, the native library 307 reads the print image data confirmed in step 1404 above.
[0090] Next, in step 1405, the native library 307 packs the print setting data and print image data into one file to create a print job. Specifically, the native library 307 generates a print job by packing the print setting data (JDF) and print data (converted to Base64) into one file in MIME format. Note that the creation of a print job in MIME format is described in the JDF specifications and is a well-known technology, so it will not be described in detail here.
[0091] Next, in step 1406 (corresponding to step 923 in FIG. 9), the native library 307 transmits the print job generated in step 1405 to the MFP 104 using a protocol such as HTTP. When the transmission of the print job is completed, a response thereto is notified from the MFP 104.
[0092] In step 1407, the native library 307 performs a response reception process, receives the processing result, and ends the process of this flowchart. The native library 307 notifies the result of the process in step 1407 above, or the result in the case where an error occurs in step 1403 because the print image data does not exist, as a completion notification (step 925 in FIG. 9).
[0093] As described above, in this embodiment, when performing display processing of a preview image of a file to be displayed in WebView302, a preview image generation process implemented in the native library 307 is called from Javascript. In the preview image generation process of the native library 307, preview image data is generated and converted to Base64. When the preview image generation process is completed, the native library 307 notifies the bound Javascript of the preview image data. The preview data received by Javascript is stored in the local storage 303 of WebView302. Then, the preview image data stored in the local storage 303 is set to the src of the Image tag in the preview display area in the Web content, and is configured to be displayed in WebView302. That is, for display processing of a preview image of a file to be displayed in WebView302, a preview image process implemented in the native library is called from Javascript, and processing is performed without transmitting and receiving image data to the server 102. With such a configuration, the information processing device can display and process a preview image without transmitting and receiving image data to and from the server, and processing can be performed without being affected by traffic in the network environment and without delay.
[0094] It goes without saying that the configurations and contents of the various data described above are not limited to those described above, and the data may have various configurations and contents depending on the application and purpose. Although one embodiment has been described above, the present invention can be embodied, for example, as a system, an apparatus, a method, a program, a storage medium, etc. Specifically, the present invention may be applied to a system composed of multiple devices, or may be applied to an apparatus composed of a single device. Furthermore, any combination of the above-described embodiments is also included in the present invention.
[0095] (Other embodiments) The present invention can also be realized by a process in which a program for implementing one or more of the functions of the above-described embodiments is supplied to a system or device via a network or a storage medium, and one or more processors in a computer of the system or device read and execute the program. The present invention can also be realized by a circuit (e.g., ASIC) that implements one or more of the functions. Furthermore, the present invention may be applied to a system made up of a plurality of devices, or to an apparatus made up of a single device. The present invention is not limited to the above-mentioned embodiment, and various modifications (including organic combinations of the embodiments) are possible based on the spirit of the present invention, and are not excluded from the scope of the present invention. In other words, the present invention includes all configurations that combine the above-mentioned embodiments and their modifications. [Explanation of symbols]
[0096] 100 Network 101 Information processing device 102 Server 103 Internet 104 MFP
Claims
1. storage means for storing one or more files and a native library; An acquisition means for acquiring web content from a server; a display means for displaying, on a display, an operation screen generated by processing the acquired web content using a WebView; a generating means for calling the native library using a script included in the web content when a predetermined instruction is given on the operation screen, and causing the called native library to generate image data corresponding to a file selected by a user from the one or more saved files; a control means for displaying the image data generated by the native library on the operation screen; An information processing device having An information processing device characterized in that, in the native library, if the format of the selected file is not a specified format, image data indicating that the format of the selected file is an unsupported format is used as the image data generated by the native library.
2. 2 . The information processing apparatus according to claim 1 , wherein the image data generated by the native library is a preview image of the selected file.
3. A storage means for storing one or more files and a native library; An acquisition means for acquiring web content from a server; a display means for displaying, on a display, an operation screen generated by processing the acquired web content using a WebView; a generating means for calling the native library using a script included in the web content when a predetermined instruction is given on the operation screen, and causing the called native library to generate image data corresponding to a file selected by a user from the one or more saved files; a control means for displaying the image data generated by the native library on the operation screen; An information processing device having An information processing apparatus characterized in that, in the native library, when the selected file is a file consisting of multiple pages, image data based on a first page is regarded as the image data generated by the native library.
4. 4. The information processing apparatus according to claim 3, wherein the file made up of a plurality of pages is a PDF file.
5. 5. The information processing apparatus according to claim 1, wherein the native library is a program provided by an OS of the information processing apparatus, or a shared library pre-installed in the information processing apparatus.
6. An information processing method executed by an information processing device, An acquisition step of acquiring web content from a server; a display step of displaying an operation screen generated by processing the acquired web content with a WebView on a display of the information processing device; a generating step of calling a native library in the information processing device using a script included in the web content when a predetermined instruction is given on the operation screen, and causing the called native library to generate image data corresponding to a file selected by a user from one or more files stored in the information processing device; a control step of displaying the image data generated by the native library on the operation screen; having An information processing method characterized in that, in the native library, if the format of the selected file is not a specified format, image data indicating that the format of the selected file is an unsupported format is used as the image data generated by the native library.
7. An information processing method executed by an information processing device, comprising: An acquisition step of acquiring web content from a server; a display step of displaying an operation screen generated by processing the acquired web content with a WebView on a display of the information processing device; a generating step of calling a native library in the information processing device using a script included in the web content when a predetermined instruction is given on the operation screen, and causing the called native library to generate image data corresponding to a file selected by a user from one or more files stored in the information processing device; a control step of displaying the image data generated by the native library on the operation screen; having An information processing method characterized in that, in the native library, when the selected file is a file consisting of multiple pages, image data based on the first page is used as the image data generated by the native library.
8. A program for causing a computer to function as each of the means according to any one of claims 1 to 5.
Citation Information
Patent Citations
Thumbnail image display method and display device
JP2009081866A
Information processing program, information processor and information processing method
JP2012203740A
Information processing apparatus, control method, and software program
JP2016014917A
Information processing method
JP2016143416A
Information processor, control method of information processor, and program
JP2017097662A
