Method for displaying PDF (Portable Document Format) on dictionary pen, application and graphic framework on dictionary pen and dictionary pen
By calling the PDF rendering engine and application and graphics framework on the operating system of the dictionary pen, the problem that the dictionary pen cannot display PDF files is solved, and the function of displaying PDF files on the dictionary pen is realized, which simplifies the operation process.
Patent Information
- Application Number
- CN202411773835.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-04
- Publication Date
- 2025-03-28
AI Technical Summary
The existing dictionary pen operating system does not provide the function of displaying PDF files, which makes it impossible to display PDF files on the dictionary pen.
By calling the PDF rendering engine on the operating system of the dictionary pen, and combining the application and graphics framework, receiving display instructions and displaying target files on the display screen, the function of displaying PDF files on the dictionary pen is realized.
It realizes the effect of displaying PDF files on the dictionary pen, without installing additional application software, simplifying the operation process.
Smart Images

Figure CN119718096A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of dictionary pens, and in particular to a method for displaying PDF on a dictionary pen, an application and graphic framework on a dictionary pen, and a dictionary pen. Background Art
[0002] PDF (Portable Document Format) is a file format developed by Adobe Systems for presenting and exchanging documents. PDF files present information in a device-independent way and can present the same appearance on multiple operating systems, such as Android system, Windows operating system, etc.
[0003] However, the operating system of the existing dictionary pen is different from the Android system and the Windows operating system, and the operating system of the dictionary pen currently does not provide a function of displaying PDF. Summary of the invention
[0004] The present application provides a method for displaying PDF on a dictionary pen, an application and a graphic framework on a dictionary pen, and a dictionary pen, so as to solve the technical problem that the dictionary pen cannot display PDF files.
[0005] In a first aspect, the present application provides a method for displaying PDF on a dictionary pen, comprising: receiving a display instruction, wherein the display instruction is used to control the dictionary pen to display a target file, and the target file is in PDF format; and displaying the target file on the display screen of the dictionary pen.
[0006] In one example, before displaying the target file on the display screen of the dictionary pen, the method further includes: calling a PDF rendering engine through an application and a graphics framework on the operating system of the dictionary pen; and having the PDF rendering engine parse the number of pages of the target file and the width and height of each page.
[0007] In one example, displaying the target file on the display screen of the dictionary pen includes: rendering, by the PDF rendering engine, the parsed target page of the target file into a bitmap in the memory of the dictionary pen according to the width and height, wherein the target page is the page requested to be displayed by the display instruction; and displaying the target page of the target file on the display screen by drawing the target page in the bitmap.
[0008] In one example, displaying the target page of the target file on the display screen by drawing the target page in the bitmap includes: obtaining the width and height of the bitmap through a custom user interface component in the application and graphics framework, wherein the custom user interface component inherits from a native user interface component of the application and graphics framework; and drawing the bitmap into a layer of the dictionary pen according to the width and height by the custom user interface component to display the target page on the display screen of the dictionary pen.
[0009] In one example, before calling the PDF rendering engine through the application and graphics framework on the operating system of the dictionary pen, the method also includes: downloading the PDF rendering engine, wherein the PDF rendering engine is a binary file, and introducing the header file of the PDF rendering engine in the application and graphics framework on the operating system of the dictionary pen; or, obtaining the source code and third-party dependent code of the PDF rendering engine; configuring the environment variables of the PDF rendering engine and specifying a cross-compiler; using the build script in the source code of the PDF rendering engine, using the cross-compiler to compile the PDF rendering engine, and introducing the compiled header file of the PDF rendering engine in the application and graphics framework on the operating system of the dictionary pen.
[0010] In one example, the method also includes: when calling the PDF rendering engine through the application and graphics framework on the operating system of the dictionary pen, calling the initialization function of the PDF rendering engine to initialize the PDF rendering engine, and releasing the memory resources occupied by the PDF rendering engine when the target file is displayed on the display screen of the dictionary pen.
[0011] In one example, releasing the memory resources occupied by the PDF rendering engine after the target file is displayed on the display screen of the dictionary pen includes: before releasing the memory resources occupied by the PDF rendering engine, storing the page information of the target file and the bitmap of the target file in the local storage of the dictionary pen; releasing the memory resources occupied by the PDF rendering engine.
[0012] In the second aspect, the present application provides a dictionary pen, comprising: a display screen, used to receive display instructions, and display a target file on the display screen of the dictionary pen, wherein the display instructions are used to control the dictionary pen to display the target file, and the target file is in PDF format; a processor, used to respond to the display instructions and process the target file.
[0013] In the third aspect, the present application provides an application and graphic framework on a dictionary pen, including: an instruction receiving module for receiving display instructions, wherein the above display instructions are used to control the above dictionary pen to display the target file, and the above target file is in PDF format; a display module for displaying the above target file on the display screen of the above dictionary pen.
[0014] In a fourth aspect, the present application provides an electronic device comprising: at least one communication interface; at least one bus connected to the at least one communication interface; at least one processor connected to the at least one bus; and at least one memory connected to the at least one bus, wherein the memory stores a computer program, and the processor is configured to implement any one of the above-mentioned methods of displaying a PDF on a dictionary pen when executing the computer program.
[0015] In a fifth aspect, the present application further provides a computer storage medium storing computer executable instructions, wherein the computer executable instructions are used to execute the method of displaying PDF on a dictionary pen as described in any one of the above items of the present application.
[0016] The above technical solution provided by the embodiment of the present application has the following advantages compared with the prior art: the present application receives a display instruction, wherein the above display instruction is used to control the above dictionary pen to display a target file, and the above target file is in PDF format; the above target file is displayed on the display screen of the above dictionary pen, so that files in PDF format can be displayed on the dictionary pen, thereby achieving the effect of the dictionary pen displaying PDF files. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the invention and, together with the description, serve to explain the principles of the invention.
[0018] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0019] One or more embodiments are exemplarily described by pictures in the corresponding drawings, and these exemplified descriptions do not constitute limitations on the embodiments. Elements with the same reference numerals in the drawings represent similar elements, and unless otherwise stated, the figures in the drawings do not constitute proportional limitations.
[0020] Figure 1 A flowchart of a method for displaying PDF on a dictionary pen provided in an embodiment of the present application;
[0021] Figure 2 A schematic diagram of displaying PDF on a dictionary pen provided in an embodiment of the present application;
[0022] Figure 3 A schematic diagram of displaying PDF on another dictionary pen provided in an embodiment of the present application;
[0023] Figure 4 A schematic diagram of the division of areas of a dictionary pen display screen provided in an embodiment of the present application;
[0024] Figure 5 A flowchart of a method for displaying PDF on a dictionary pen provided in an embodiment of the present application;
[0025] Figure 6 A schematic diagram of the structure of a dictionary pen provided in an embodiment of the present application;
[0026] Figure 7 A schematic diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0027] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of this application.
[0028] The disclosure below provides many different embodiments or examples to implement different structures of the present invention. In order to simplify the disclosure of the present invention, the parts and settings of specific examples are described below. Of course, they are only examples, and the purpose is not to limit the present invention. In addition, the present invention can repeat reference numbers and / or letters in different examples. This repetition is for the purpose of simplification and clarity, and does not itself indicate the relationship between the various embodiments and / or settings discussed.
[0029] In order to solve the technical problem in the prior art that a dictionary pen cannot display PDF files, the present application provides a method for displaying PDF on a dictionary pen, which can achieve the effect of a dictionary pen displaying PDF files.
[0030] Figure 1 The present invention provides a flowchart of a method for displaying PDF on a dictionary pen. Figure 1 As shown, the method for displaying PDF on the dictionary pen includes:
[0031] S102, receiving a display instruction, wherein the display instruction is used to control the dictionary pen to display a target file, and the target file is in PDF format;
[0032] S104, displaying the target file on the display screen of the dictionary pen.
[0033] The present application proposes a method for displaying a PDF file on a dictionary pen. Since PDF files cannot be displayed on a dictionary pen in the prior art, the present application achieves the effect of displaying a PDF file on a dictionary pen.
[0034] In this embodiment, the display of PDF files on the dictionary pen relies on the application and graphic framework and PDF rendering engine on the dictionary pen's operating system to realize the display of PDF files. This is different from the way of displaying PDF files by installing application software on the operating system. Because the application software is installed on the system, the application software needs to be downloaded and installed to display PDF files through the application software. The application and graphic framework on the operating system of the dictionary pen in this application are the frameworks that come with the dictionary pen after the operating system is installed through the flashing operation. There is no need to install other application software to realize the display of PDF files.
[0035] In the embodiment of the present application, there are multiple ways to trigger the display instruction. For example, it can be triggered by the user, or by the dictionary pen. If it is triggered by the user, it may be that the user wants to display a PDF file, so the user initiates the instruction to display the PDF file. If it is triggered by the dictionary pen, it may be triggered when the dictionary pen receives a PDF file, or when the dictionary pen is turned on, when the screen is turned on, when the dictionary pen's camera is used to scan, or when scanning preview is performed.
[0036] When the display instruction is triggered, the PDF file can be displayed on the display screen in response to the display instruction.
[0037] The present application receives a display instruction, wherein the display instruction is used to control the dictionary pen to display a target file, the target file being in PDF format; the target file is displayed on the display screen of the dictionary pen, so that files in PDF format can be displayed on the dictionary pen, thereby achieving the effect of the dictionary pen displaying PDF files.
[0038] In one example, when displaying a target file on the display screen of a dictionary pen, a target page in the target file can be displayed, wherein the target page is a page of a PDF file in the target file; or, the target page in the target file and at least a part of the first page in the target file can be displayed, wherein the first page is any page other than the target page.
[0039] That is, in this embodiment, one page of the PDF file can be displayed. If one page is displayed, the page of the PDF file can occupy the entire display screen of the dictionary pen. As another example, one page of the PDF file and a portion of at least one other page can also be displayed on the display screen. For example, the target page is displayed on the display screen, and a portion of other pages is displayed at the same time, or multiple pages of the PDF document are displayed. For example, Figure 2 As shown, Figure 2 Schematic diagram of displaying a page of PDF file. The dictionary pen can be displayed in horizontal or vertical screen (determined by the user's holding state). Regardless of the state, a single-page PDF file 202 is displayed on the display screen 201 (the largest box is 201, which is the range of the display screen. The white part is the PDF file, and the black part can be filled with a solid color. In the vertical screen state, the entire display screen is filled with the PDF file). For the case of displaying multiple pages of PDF files, you can do the following. Figure 3 As shown, the entire display screen 301 is occupied by a multi-page PDF file. In the horizontal screen state, a certain page 302-2 of the PDF file is displayed, 302-1 is the previous page of 302-2, and the back part is displayed, and 302-3 is the next page of 302-2, and the front part is displayed. When receiving an instruction to turn the page, such as turning the page down, 302-3 can be displayed at the position of 302-2, and the right part of 302-2 is displayed on the left side of 302-2, and the left part of 302-4 is displayed on the right side of 302-3. In the vertical screen state, a single page 303-2 is displayed, and the lower part of 303-1 and the upper part of 303-3 are displayed at the same time. If the page is turned, such as turning the page down, 303-3, the lower part of 303-2, and the upper part of 303-4 can be displayed.
[0040] In one example, whether one page or multiple pages of a PDF file is displayed, the PDF file can be turned. Turning a page means turning the current page to the previous page or the next page. For example, when a down page instruction is received, the current displayed page of the target file can be jumped to the next page of the current displayed page; when a previous page instruction is received, the current displayed page of the target file can be jumped to the previous page of the current displayed page.
[0041] There are many ways to trigger a next page turn instruction or a previous page turn instruction, for example, it can be triggered by a button on the dictionary pen, or by a sensor on the dictionary pen collecting the status data of the dictionary pen and triggering according to the status data, or it can be triggered by a touch action on the display screen of the dictionary pen. If triggered by a touch action, the touch area of the touch operation can be determined. For example, when the display screen of the dictionary pen receives a touch operation, the touch area of the touch operation is determined; when the touch area is the first area, it is determined that the previous page turn instruction is received; when the touch area is the second area, it is determined that the next page turn instruction is received.
[0042] For example, Figure 4 As shown, the display screen 401 can be divided into two parts. In the horizontal screen state, the left part can turn the page up when receiving a touch command, and the right part can turn the page down when receiving a touch command. In the vertical screen state, it can be divided into upper and lower parts. The upper part can turn the page up when receiving a touch command, and the lower part can turn the page down when receiving a touch command.
[0043] In this embodiment, for touch operation, it can be determined based on the touch area whether a page-up instruction or a page-down instruction is received. By turning pages up and down, the currently displayed page of the PDF file can be adjusted. For example, in the case where the above-mentioned display screen displays a target page, the previous page or the next page of the target page can be displayed. When the display screen displays the target page and at least a portion of the first page, the page-up and page-down can be turned from the currently displayed target page and a portion of the first page to display the entire next page and the lower portion of the target page, or to display the previous page and the upper portion of the target page.
[0044] In one embodiment, when the page turn down or page turn up is determined by the touch operation, the page can be turned continuously by pressing and holding. For example, the above touch operation also includes a touch state. After the target file is displayed on the display screen of the dictionary pen, when the touch area is the first area and the touch state is a single contact, it is determined that a page turn up instruction is received; when the touch area is the second area and the touch state is a single contact, it is determined that a page turn down instruction is received; when the touch area is the first area and the touch state is a continuous contact, it is determined that multiple page turn up instructions are received; when the touch area is the second area and the touch state is a continuous contact, it is determined that multiple page turn down instructions are received. In other words, if the user presses the second area that generates the page turn down instruction, the page turn down instruction is continuously generated, and the PDF file will continue to turn pages until the user releases or turns to the last page.
[0045] Through the above method, the effect of flexibly displaying PDF files on the display screen of the dictionary pen according to display requirements is achieved.
[0046] In one example, in order to achieve the above effect of displaying a PDF file on the display screen of the dictionary pen, a PDF rendering engine can be built into the dictionary pen. The PDF rendering engine is used to read the PDF file and render it. In other words, if the dictionary pen does not have a built-in PDF rendering engine, the dictionary pen cannot recognize files in PDF format.
[0047] The PDF rendering engine can be pre-built into the dictionary pen, or it can be temporarily downloaded and built into the dictionary pen when the PDF file is displayed for the first time.
[0048] As for the method of downloading the PDF rendering engine, you can directly download the binary file of the PDF rendering engine from the provider of the PDF rendering engine, and then introduce the header file of the PDF rendering engine into the application and graphics framework on the operating system of the dictionary pen. If you download the source code and third-party dependent code of the PDF rendering engine from the provider of the PDF rendering engine, you can configure the environment variables of the PDF rendering engine and specify the cross-compiler; use the build script in the source code of the PDF rendering engine, use the cross-compiler to compile the PDF rendering engine, and then introduce the compiled header file of the PDF rendering engine into the application and graphics framework on the operating system of the dictionary pen.
[0049] By introducing the header file of the PDF rendering engine in the application and graphics framework, the PDF rendering engine can be automatically called to render the PDF file when the application and graphics framework are called.
[0050] When rendering a PDF file, you can call the PDF rendering engine to parse the number of pages of the target file and the width and height of each page. For the pages of the target file, the width and height of each PDF page must be obtained, as well as the total number of pages in a PDF file. After parsing all the pages of the PDF file, the PDF rendering engine can render the target page to be displayed into the bitmap of the memory of the dictionary pen. Rendering the target page to be displayed into the bitmap here is to cooperate with the above-mentioned dictionary pen to display a single-page PDF file. If it is the case of displaying multiple pages of PDF files, you can here After reducing the multiple PDF files according to the ratio of width and height, render them into the bitmap. For example, in the case of displaying a page of PDF, the width and height of a page of PDF are 1000*800 respectively (the data is only an example), then the page of PDF is rendered into the bitmap according to the width and height. A single page can be displayed on the display screen, and the single page occupies the entire display screen. If multiple pages of PDF are displayed at the same time, such as displaying Figure 2 In the case on the left side of the figure, the PDF is scaled down in proportion, and the original width is used as the current length. For example, after being scaled down, it is reduced to 800*640. Other areas are filled with blanks or solid colors and rendered into the bitmap. The bitmap can be drawn to the display screen, so that the PDF file in the bitmap is displayed on the display screen of the dictionary pen, forming Figure 2 The style on the left. And for Figure 3 In the style on the left, you can reduce a page of a PDF file to 800*640, and then use another PDF file that is also reduced to 800*640 to select a part to fill the left and right sides of the PDF file, and render it to the bitmap. The size of the bitmap remains unchanged. By adjusting the size of the PDF file and then rendering it to the bitmap, you can achieve the display effect of displaying multiple pages of PDF files.
[0051] In one example, a custom user interface component can be preset in the operating system of the dictionary pen. The custom user interface component inherits from the native user interface component of the application and graphics framework. The custom function of the custom user interface component is to draw the bitmap into the layer of the dictionary pen according to the width and height of the bitmap. Since the PDF file is rendered in the bitmap, the bitmap is drawn into the layer, thereby completing the operation of displaying the PDF file on the display screen of the dictionary pen.
[0052] In one example, the PDF rendering engine calls the initialization function of the PDF rendering engine to initialize the PDF rendering engine each time it is called, displays the target file on the display screen of the dictionary pen, and releases the memory resources occupied by the PDF rendering engine. The purpose of this is to initialize the PDF rendering engine when calling the rendering engine to render a PDF file, without pre-initializing it and causing it to be re-initialized each time it is rendered. Releasing the memory resources occupied by the PDF rendering engine after the target file is displayed on the display screen can avoid the occupation of memory resources.
[0053] In one example, after the PDF rendering engine renders the PDF file, the page information of the PDF file and the bitmap of the target file can be stored in the local storage of the dictionary pen. In this way, after the PDF rendering engine releases the memory, when the PDF file is displayed again, there is no need to call the PDF rendering engine, but directly obtain the bitmap from the current storage according to the display instruction and draw it on the display screen. This can avoid the same PDF file being repeatedly rendered by the PDF rendering engine every time it is displayed, wasting resources.
[0054] Figure 5 : is a flow chart of displaying a PDF file in this embodiment. The specific display process is as follows:
[0055] First, prepare the binary PDFium library, named libpdfium.so, and call it in the Linux system. The PDFium library is a standard Linux shared library, which is used to parse PDF files, that is, the PDF rendering engine mentioned above. You can download it from the official website or compile it yourself. If you download it from the official website, you can directly download the compiled binary file from the official website.
[0056] If you compile it yourself, you can download the source code of the PDF rendering engine and third-party dependent code. When downloading, you can use tools to download the source code. Generally, code control tools such as git are used, or other downloaders can also be used. The synchronization of third-party dependent code is required because the PDFium library is very large and it itself relies on some third-party code to run. After downloading the source code and third-party dependent code, you can configure the environment variables and specify the cross-compiler to compile. When compiling, use the build script in the source code and execute the gn compilation command according to the specified compiler.
[0057] For the PDF rendering engine, the header files are introduced into the application and graphics framework, so that the functions provided by libpdfium.so can be used when running the application and graphics framework. When using libpdfium.so, libpdfium.so needs to be initialized, and the initialization function can be called to initialize libpdfium.so. Since the memory of the dictionary pen is small and the resources are limited, the PDF rendering engine can be initialized before opening the PDF each time, and the PDF rendering engine can be controlled to release resources after closing the PDF. In this way, the memory is used reasonably so that it can be used smoothly on a platform with limited resources.
[0058] When rendering a PDF file, use the initialized libpdfium.so to parse the information of the PDF file, including the number of pages, page width and height, etc., and load the specified page to be displayed (index). By default, the first page is loaded (index = 0). Render the page to the bitmap in memory. Bitmap can be regarded as an image file, but it is data in memory instead of being displayed on the screen. This is also the function provided by libpdfium.so.
[0059] Finally, the Bitmap is rendered to the screen. Bitmap is similar to an image, but it has multiple encodings or arrangements, such as RGBA8888 or RGB565 (image format). To draw the Bitmap in memory to the screen, you can use the self-rendering capabilities provided by applications and graphics frameworks (such as HaaSUI). For example, in HaaSUI, you can customize the native component named PDFView, which inherits from View. In this way, PDFView has the ability to render the component canvas and the ability to receive user events. When rendering, tell the canvas the width, height, and image arrangement information of the Bitmap. When rendering (automatically initiated by the framework), use canvas to draw the bitmap into the layer. In this way, you can render to the screen and observe the PDF view, which is the basic capability provided by canvas. In order to speed up rendering, for the same PDF file, cache the page information of the PDF and the bitmap to local storage. In this way, there is no need to load it repeatedly later, just read the file.
[0060] For user input, it is also necessary to combine the HaaSUI framework. In this framework, if the user generates a touch event, the framework will receive a notification message: dispatchTouchEvent, with an event information event. After receiving the event, you can determine the coordinate position, pressed or lifted state of the event. Therefore, the design can be as follows:
[0061] When the user clicks on the lower part of the page, the next page operation is performed: the current page + 1, reload the page and render, and the page can be turned. Click on the upper part of the page to perform the previous page operation: the current page - 1, reload and render. Finally, when the user clicks the close button of the page, the PDF rendering engine releases resources.
[0062] Figure 6 This is a schematic diagram of the structure of a dictionary pen provided in an embodiment of the present application. Figure 6 As shown, the dictionary pen comprises:
[0063] Display screen 602, used to receive display instructions and display the target file on the display screen of the dictionary pen, wherein the display instruction is used to control the dictionary pen to display the target file, and the target file is in PDF format;
[0064] The processor 604 is used to respond to the display instruction and process the target file.
[0065] In this embodiment, the PDF file is displayed on the dictionary pen by relying on the application and graphic framework and PDF rendering engine on the operating system of the dictionary pen to realize the display of the PDF file, which is different from the way of displaying PDF files by installing application software on the operating system. Because the application software is installed on the system and the PDF file is displayed through the application software, the application software needs to be downloaded and installed. The application and graphic framework on the operating system of the dictionary pen in this application are the frameworks that come with the dictionary pen after the operating system is flashed, and the display of PDF files can be realized without installing other application software.
[0066] In the embodiment of the present application, there are multiple ways to trigger the display instruction. For example, it can be triggered by the user, or by the dictionary pen. If it is triggered by the user, it may be that the user wants to display a PDF file, so the user initiates the instruction to display the PDF file. If it is triggered by the dictionary pen, it may be triggered when the dictionary pen receives a PDF file, or when the dictionary pen is turned on, when the screen is turned on, when the dictionary pen's camera is used to scan, or when scanning preview is performed.
[0067] When the display instruction is triggered, the PDF file can be displayed on the display screen in response to the display instruction.
[0068] The present application receives a display instruction, wherein the display instruction is used to control the dictionary pen to display a target file, the target file being in PDF format; the target file is displayed on the display screen of the dictionary pen, so that files in PDF format can be displayed on the dictionary pen, thereby achieving the effect of the dictionary pen displaying PDF files.
[0069] For other examples of this embodiment, please refer to the above examples and will not be described in detail here.
[0070] The present application embodiment also provides an application and graphic framework on a dictionary pen, including:
[0071] The instruction receiving module is used to receive the display instruction, wherein the display instruction is used to control the dictionary pen to display the target file, and the target file is in PDF format;
[0072] The display module is used to display the target file on the display screen of the dictionary pen.
[0073] In this embodiment, the PDF file is displayed on the dictionary pen by relying on the application and graphic framework and PDF rendering engine on the operating system of the dictionary pen to realize the display of the PDF file, which is different from the way of displaying PDF files by installing application software on the operating system. Because the application software is installed on the system and the PDF file is displayed through the application software, the application software needs to be downloaded and installed. The application and graphic framework on the operating system of the dictionary pen in this application are the frameworks that come with the dictionary pen after the operating system is flashed, and the display of PDF files can be realized without installing other application software.
[0074] In the embodiment of the present application, there are multiple ways to trigger the display instruction. For example, it can be triggered by the user, or by the dictionary pen. If it is triggered by the user, it may be that the user wants to display a PDF file, so the user initiates the instruction to display the PDF file. If it is triggered by the dictionary pen, it may be triggered when the dictionary pen receives a PDF file, or when the dictionary pen is turned on, when the screen is turned on, when the dictionary pen's camera is used to scan, or when scanning preview is performed.
[0075] When the display instruction is triggered, the PDF file can be displayed on the display screen in response to the display instruction.
[0076] The present application receives a display instruction, wherein the display instruction is used to control the dictionary pen to display a target file, the target file being in PDF format; the target file is displayed on the display screen of the dictionary pen, so that files in PDF format can be displayed on the dictionary pen, thereby achieving the effect of the dictionary pen displaying PDF files.
[0077] like Figure 7 As shown, an embodiment of the present application provides an electronic device, including a processor 111, a communication interface 112, a memory 113 and a communication bus 114, wherein the processor 111, the communication interface 112, and the memory 113 communicate with each other through the communication bus 114.
[0078] Memory 113, used for storing computer programs;
[0079] In one embodiment of the present application, the processor 111 is used to implement the method of displaying PDF on the dictionary pen provided by any one of the aforementioned method embodiments when executing the program stored in the memory 113.
[0080] An embodiment of the present application also provides a computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, the method for displaying PDF on a dictionary pen provided in any of the aforementioned method embodiments is implemented.
[0081] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0082] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a general hardware platform, and of course, by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the relevant technology can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.
[0083] It should be understood that the terms used herein are only for the purpose of describing specific example embodiments and are not intended to be limiting. Unless the context clearly indicates otherwise, the singular forms "one", "an" and "said" as used herein may also be meant to include plural forms. The terms "include", "comprise", "contain", and "have" are inclusive, and therefore specify the existence of stated features, steps, operations, elements and / or parts, but do not exclude the existence or addition of one or more other features, steps, operations, elements, parts, and / or combinations thereof. The method steps, processes, and operations described herein are not interpreted as necessarily requiring them to be performed in the specific order described or illustrated, unless the execution order is clearly indicated. It should also be understood that additional or alternative steps may be used.
[0084] The foregoing is merely a specific embodiment of the present invention, which enables those skilled in the art to understand or implement the present invention. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention will not be limited to the embodiments shown herein, but rather to the widest scope consistent with the principles and novel features claimed herein.
Claims
1. A method for displaying PDF on a dictionary pen, characterized in that: include: receiving a display instruction, wherein the display instruction is used to control the dictionary pen to display a target file, and the target file is in PDF format; The target file is displayed on a display screen of the dictionary pen.
2. The method according to claim 1, characterized in that The step of displaying the target file on the display screen of the dictionary pen comprises: Displaying a target page in the target file on the display screen, wherein the target page is a page of a PDF file in the target file; or, A target page in the target file and at least a portion of a first page in the target file are displayed on the display screen, wherein the first page is any page except the target page.
3. The method according to claim 1, characterized in that After displaying the target file on the display screen of the dictionary pen, the method further includes: When receiving a next page instruction, jumping from the current displayed page of the target file to the next page of the current displayed page; When a page-up instruction is received, the current displayed page of the target file is jumped to the previous page of the current displayed page.
4. The method according to claim 3, characterized in that After displaying the target file on the display screen of the dictionary pen, the method further includes: When the display screen of the dictionary pen receives a touch operation, determining a touch area of the touch operation; When the touch area is the first area, it is determined that the page-up instruction is received; when the touch area is the second area, it is determined that the page-down instruction is received.
5. The method according to claim 4, characterized in that The touch operation also includes a touch state. After the target file is displayed on the display screen of the dictionary pen, the method further includes: When the touch area is the first area and the touch state is a single contact, determining that the page-up instruction is received once; When the touch area is the second area and the touch state is a single contact, determining that the page-down instruction is received once; When the touch area is the first area and the touch state is continuous contact, determining that multiple page-turning instructions are received; When the touch area is the second area and the touch state is continuous contact, it is determined that the page-down instructions are received multiple times.
6. The method according to any one of claims 1 to 5, characterized in that: Before displaying the target file on the display screen of the dictionary pen, the method further includes: Calling a PDF rendering engine through an application and a graphics framework on the operating system of the dictionary pen; The PDF rendering engine parses the number of pages of the target file and the width and height of each page.
7. A dictionary pen, characterized in that: include: A display screen, used for receiving a display instruction and displaying a target file on the display screen of the dictionary pen, wherein the display instruction is used to control the dictionary pen to display the target file, and the target file is in PDF format; The processor is used to respond to the display instruction and process the target file.
8. An application and graphic framework on a dictionary pen, characterized in that: Used to receive a display instruction, wherein the display instruction is used to control the dictionary pen to display a target file, the target file is in PDF format; and display the target file on the display screen of the dictionary pen.
9. An electronic device, characterized in that: include: at least one communication interface; at least one bus connected to the at least one communication interface; at least one processor coupled to the at least one bus; At least one memory connected to the at least one bus, wherein the memory stores a computer program, and when the processor executes the computer program, the method for displaying PDF on a dictionary pen as described in any one of claims 1 to 6 is implemented.
10. A computer-readable storage medium storing computer-executable instructions for executing the method for displaying PDF on a dictionary pen as described in any one of claims 1 to 6 of the present application.