Note content export method, electronic device and storage medium

By setting the layer object to a preset number of pixels for placeholding when exporting PDF files, the problem of gradually getting bigger in export PDF files is solved, and the effect of reducing file size and improving export speed is achieved.

CN119357136BActive Publication Date: 2025-05-09HONOR DEVICE CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411788218.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-12-06
Publication Date
2025-05-09
Estimated Expiration
2044-12-06

AI Technical Summary

Technical Problem

When exporting PDF files, the prior art causes the file to gradually become larger, affecting the export speed and occupying storage space, mainly because after editing and saving the notes, it is impossible to effectively remove unreferenced attributes or objects.

Method used

When exporting PDF files, set the layer object to a preset number of pixels for placeholding. When new content is added to the notes, you only need to update the corresponding layer object without adding new layer object and attribute information to avoid the generation of redundant objects.

Benefits of technology

Effectively reduce the size of PDF files, improve the speed of exporting PDF files, and reduce the use of device storage space.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119357136B_ABST
    Figure CN119357136B_ABST
Patent Text Reader

Abstract

The embodiment of the present application provides a method for exporting note content, an electronic device, and a storage medium, the method comprising: displaying a first interface of a note application, the first interface including a new option; in response to a first operation for the new option, displaying a second interface of the newly created first note, the second interface including a background image; in response to a second operation of exporting the first note to a file in a preset format, generating a first file, the first file including a first object and a second object, the first object corresponding to the background image, and the second object corresponding to a preset number of pixels. The problem that the PDF file exported page by page will gradually become larger as the number of edits increases is solved, thereby greatly reducing the size of the PDF file, thereby increasing the speed of exporting the PDF file and reducing the storage space occupied by the device.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of terminal technology, and in particular to a method for exporting note content, an electronic device, and a storage medium. Background Art

[0002] In order to achieve seamless sharing of note content on different electronic devices, users need to export the note content to a Portable Document Format (PDF) file so that they can share it with others and open and browse it on various devices. At present, the relevant technology uses the existing capabilities of the Android pdfium library to add or remove an object in the note content. However, after the object is removed, its attribute information cannot be directly removed, resulting in a large number of unreferenced attributes or objects in the PDF files exported page by page after frequent editing and saving of the note content, which causes the exported PDF file to gradually increase in size as the number of edits increases, which in turn affects the speed of exporting PDF files and occupies too much storage space on the device. Summary of the invention

[0003] The embodiments of the present application provide a method for exporting note content, an electronic device, and a storage medium, which can solve the problem that a PDF file exported page by page will gradually become larger as the number of edits increases.

[0004] In a first aspect, an embodiment of the present application provides a method for exporting note content, the method comprising:

[0005] Displaying a first interface of a note-taking application, the first interface includes a new option; in response to a first operation on the new option, displaying a second interface of a newly created first note, the second interface includes a background image; in response to a second operation of exporting the first note to a file in a preset format, generating a first file, the first file includes a first object and a second object, the first object corresponds to the background image, and the second object corresponds to a preset number of pixels.

[0006] In some embodiments, the method also includes: displaying a third interface of the note application, the third interface including an identifier of the first note, the identifier being used to open the first note; in response to a third operation on the identifier, displaying the second interface of the first note; in response to a fourth operation of writing on the second interface, displaying a fourth interface, the fourth interface including the background image and multiple writing tracks; in response to a second operation of exporting the first note to a file in a preset format, generating a second file, the second file including the first object and a third object, the first object corresponding to the background image, the third object including multiple sub-objects, and the multiple sub-objects corresponding to the multiple writing tracks.

[0007] In some embodiments, the product of the height and the width of the second object is the preset number.

[0008] In some embodiments, the first file includes four objects, and the four objects correspond to a background layer object, an element layer object, a highlighter layer object, and a handwriting layer object, respectively.

[0009] In some embodiments, the hierarchical order corresponding to the four objects is background layer object, element layer object, highlighter layer object and handwriting layer object, wherein the background layer object is the bottom layer and the handwriting layer object is the top layer; the blending modes of the background layer object, the element layer object and the handwriting layer object are respectively the first mode, and the blending mode of the highlighter layer object is the second mode, and the first mode is different from the second mode.

[0010] In some embodiments, based on the fact that the element layer object does not contain any sub-objects, the element layer object is set to a preset number of transparent pixels, and the element layer object is used as the second object.

[0011] In some embodiments, the background layer object includes one of a background image, a PDF page, and a background grid line.

[0012] In some embodiments, the note application is capable of importing a first PDF file, which is a file that was last exported from the first note to PDF format; generating the first file in response to the second operation of exporting the first note to a file in a preset format includes: creating a second PDF file; if the first PDF file contains a second page corresponding to a first page in the first note and the first page has not changed relative to the second page, inserting the second page into the second PDF file, the first page includes each page in the first note, and the universal unique identifier of the second page is the same as the universal unique identifier of the first page; generating the first file based on the second PDF file.

[0013] In some embodiments, the method further includes: if the first PDF file does not include the second page, creating the second page, configuring the second page with a layer object based on the layer object in the first page, and inserting the second page with the layer object configured into the second PDF file; if the first PDF file includes the second page and the first page changes relative to the second page, using the background image in the first PDF file as the background layer object in the second page, configuring the second page with a layer object based on the layer object in the first page, and inserting the second page with the layer object configured into the second PDF file.

[0014] In some embodiments, the layer objects include background layer objects, element layer objects, highlighter layer objects, and handwriting layer objects; the configuring the layer objects of the second page based on the layer objects in the first page includes: if the background layer object of the first page is a PDF page, adding the second page to the second PDF file; configuring the element layer objects of a third page in the second PDF file according to the element layer objects in the first page, configuring the highlighter layer objects of the third page according to the highlighter layer objects in the first page, and configuring the handwriting layer objects of the third page according to the handwriting layer objects in the first page, the third page being a page obtained by adding the second page to the second PDF file.

[0015] In some embodiments, before configuring the layer objects of the second page based on the layer objects in the first page, it also includes: performing color space conversion on the first page; configuring the layer objects of the second page based on the layer objects in the first page includes: configuring the layer objects of the second page based on the layer objects in the first page after the color space conversion.

[0016] In some embodiments, the color space conversion of the first page includes: determining a target color component pair to be converted in the first page, the target color component pair being color components whose positions are interchanged between a first color space used by the first page and a second color space used by the second PDF file; and performing color component conversion on bitmap data on element layer objects, highlighter layer objects, and handwriting layer objects in the first page according to the target color component pair.

[0017] In some embodiments, before configuring the layer objects of the second page based on the layer objects in the first page, it also includes: converting the transparency of the first page; configuring the layer objects of the second page based on the layer objects in the first page includes: configuring the layer objects of the second page based on the layer objects in the first page after the transparency conversion.

[0018] In some embodiments, the transparency conversion of the first page includes: obtaining the transparency ratio corresponding to the bitmap data of each layer object in the first page; and dividing the color component corresponding to the pixel point of the bitmap data by the transparency ratio.

[0019] In a second aspect, an embodiment of the present application provides an electronic device, including:

[0020] a memory and a processor, the memory being coupled to the processor;

[0021] The memory stores program instructions, and when the program instructions are executed by the processor, the electronic device executes the aforementioned method.

[0022] In a third aspect, an embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the processor implements the aforementioned method.

[0023] The above-mentioned embodiments provide a method for exporting note content, an electronic device, and a computer-readable storage medium. When the element layer object, the highlighter layer object, and the handwriting layer object in the first note do not contain sub-objects, the element layer object, the highlighter layer object, and the handwriting layer object can be set to a preset number of pixels when generating the first file, thereby realizing the place-taking of the element layer object, the highlighter layer object, and the handwriting layer object in the first file. When the note content is exported to a PDF file again after adding handwriting track content, highlighter track content, and element content, it is only necessary to replace the layer object of the corresponding level with the modified layer object of the corresponding level, without adding new layer objects and layer object attribute information and adjusting the hierarchical relationship between each layer object. This can avoid the existence of redundant objects in the exported PDF file, and solve the problem that the PDF file exported page by page will gradually increase with the number of edits, thereby greatly reducing the size of the PDF file, thereby increasing the speed of exporting the PDF file and reducing the storage space occupied by the device.

[0024] It should be understood that the second to third aspects of the embodiments of the present application are consistent with the technical solutions of the first aspect of the embodiments of the present application, and the beneficial effects achieved by each aspect and the corresponding feasible implementation methods are similar and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS

[0025] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0026] Figure 1a It is a schematic diagram of the hardware structure of an electronic device provided in an embodiment of the present application;

[0027] Figure 1b It is a software structure block diagram of an electronic device provided in an embodiment of the present application;

[0028] Figure 2 is a schematic diagram of a business architecture of a note-taking application provided in an embodiment of the present application;

[0029] Figure 3 is a schematic block diagram of exporting note content to a PDF file provided in an embodiment of the present application;

[0030] Figure 4 is a schematic diagram of a layer structure of a PDF page provided in an embodiment of the present application;

[0031] Figure 5 It is a schematic diagram of a single-page PDF export process provided in an embodiment of the present application;

[0032] Figure 6 It is a schematic diagram of an object reuse logic in the related art;

[0033] Figure 7 is a schematic diagram of another object reuse logic provided in an embodiment of the present application;

[0034] Figure 8 It is a schematic diagram of the related technology to export notes to PDF files;

[0035] Figure 9-14 is a schematic diagram of the third page provided in the embodiment of the present application;

[0036] Fig.15 It is an internal interaction schematic diagram of saving note content to a PDF file provided by an embodiment of the present application;

[0037] Fig.16 is a schematic diagram of a main interface of an electronic device provided in an embodiment of the present application;

[0038] Fig.17 is a schematic diagram of a main interface of a note-taking application provided in an embodiment of the present application;

[0039] Fig.18 is a schematic flow chart of a method for exporting note content provided in an embodiment of the present application;

[0040] Fig.19 is a schematic diagram of a first note provided in an embodiment of the present application;

[0041] Fig. 20 is a schematic diagram of a layer structure of a first file provided in an embodiment of the present application;

[0042] Fig.21 is a schematic flow chart of a second method for exporting note content provided in an embodiment of the present application;

[0043] Fig. 22 is a schematic diagram of a second first note provided in an embodiment of the present application;

[0044] Fig.23is a schematic diagram of another layer structure of a first file provided in an embodiment of the present application;

[0045] Fig.24 is a schematic flowchart of sub-steps for generating a first file provided in an embodiment of the present application;

[0046] Figure 25-28 is a schematic diagram of another first note provided in an embodiment of the present application;

[0047] Fig.29 It is a schematic block diagram of a chip system provided in an embodiment of the present application. DETAILED DESCRIPTION

[0048] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions 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 creative work are within the scope of protection of this application.

[0049] The flowcharts shown in the accompanying drawings are only examples and do not necessarily include all the contents and operations / steps, nor must they be executed in the order described. For example, some operations / steps may also be decomposed, combined or partially merged, so the actual execution order may change according to actual conditions.

[0050] It should be understood that the terms used in this application specification are only for the purpose of describing specific embodiments and are not intended to limit the application. As used in this application specification and the appended claims, unless the context clearly indicates otherwise, the singular forms "a", "an" and "the" are intended to include plural forms.

[0051] With the rapid development of Internet technology, some electronic devices can export or export the user's note content in the note APP (Application) or other APP to PDF files so that they can be shared with others and opened and browsed seamlessly on various devices. Since the note content includes various pen handwritings, inserted text, picture elements, various template backgrounds, and imported PDF page backgrounds, in order to make the overlay effect between the contents in the exported PDF file exactly the same as the overlay effect in the note content, it is necessary to add multiple layer objects in the exported PDF file to carry the content in the note content.

[0052] Currently, the relevant technology is to use the existing capabilities of the Android pdfium library to add or remove an object in the note content. However, after removing the object, its attribute information cannot be directly removed, resulting in a large number of unreferenced attributes or objects in the PDF files exported page by page after frequent editing and saving of the note content. As a result, the exported PDF files will gradually become larger as the number of edits increases, which will affect the speed of exporting PDF files and occupy too much storage space on the device.

[0053] Among them, the Android pdfium library is a high-performance PDF rendering component that supports opening PDF encrypted files, obtaining PDF document information, author, title, subtitle, creation date, etc.

[0054] In view of this, the embodiments of the present application provide a method for exporting note content, an electronic device, and a readable storage medium. In the process of exporting note content to a PDF file, when a layer object in the generated PDF file has no child objects, the layer object is set to a preset number of pixels to achieve placeholders, so that when the note content is subsequently edited and exported to a PDF file multiple times, it is only necessary to modify the content in the layer object in the PDF file, and no new layer objects and layer object attribute information are added, thereby greatly reducing the size of the PDF file, thereby increasing the speed of exporting PDF files and reducing the storage space occupied by the device. The following is a detailed description of the method for exporting note content provided by the embodiments of the present application.

[0055] The method for exporting note content provided in the embodiment of the present application is executed by an electronic device, and the electronic device may include but is not limited to smart phones, tablet computers, laptop computers, desktop computers, televisions (smart screens), wearable devices, etc.

[0056] See also Figure 1a , Figure 1a 1 is a schematic diagram of the hardware structure of an electronic device 100 provided in an embodiment of the present application. It should be noted that: Figure 1a The electronic device 100 shown is only one example of an electronic device, and the electronic device 100 may have more or fewer components than shown in the figure, may combine two or more components, or may have a different configuration of components. Figure 1a The various components shown in the EMBODIMENTS 2000 may be implemented in hardware, software, or a combination of hardware and software, including one or more signal processing and / or application specific integrated circuits.

[0057] like Figure 1aAs shown, the electronic device 100 may include: a processor 110, an external memory interface 120, an internal memory 121, a Universal Serial Bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, an earphone interface 170D, a sensor module 180, a button 190, a motor 191, an indicator 192, a camera 193, a display screen 194 and a Subscriber Identification Module (SIM) card interface 195, etc.

[0058] The processor 110 may include one or more processing units, for example, the processor 110 may include an application processor (AP), a modem processor, a graphics processor (GPU), an image signal processor (ISP), a controller, a memory, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU), etc. Among them, different processing units may be independent devices or integrated in one or more processors.

[0059] The processor 110 may be the nerve center and command center of the electronic device 100. The processor 110 may generate an operation control signal according to the instruction operation code and the timing signal to complete the control of fetching and executing instructions. The processor 110 may also include a memory for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory.

[0060] The external memory interface 120 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the electronic device 100. The external memory card communicates with the processor 110 via the external memory interface 120 to implement a data storage function.

[0061] The internal memory 121 can be used to store computer executable program codes, and the executable program codes include instructions. The processor 110 executes various functional applications and data processing of the electronic device 100 by running the instructions stored in the internal memory 121, such as enabling the electronic device 100 to implement the method for exporting the note content in the embodiment of the present application. The internal memory 121 may include a program storage area and a data storage area. Among them, the program storage area may store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc. The data storage area may store data created during the use of the electronic device 100 (such as audio data, a phone book, etc.), etc. In addition, the internal memory 121 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, a universal flash storage (Universal Flash Storage, UFS), etc.

[0062] The USB interface 130 is an interface that complies with the USB standard specification, and may be a Mini USB interface, a Micro USB interface, a USB Type C interface, etc. The USB interface 130 may be used to connect a charger to charge the electronic device 100, or may be used to transfer data between the electronic device 100 and a peripheral device. It may also be used to connect headphones to play audio through the headphones. The USB interface 130 may also be used to connect other electronic devices, such as AR devices, etc.

[0063] The charging management module 140 is used to receive charging input from a charger. The charger can be a wireless charger or a wired charger. In some wired charging scenarios, the charging management module 140 can receive charging input from the wired charger through the USB interface 130. In some wireless charging scenarios, the charging management module 140 can receive wireless charging input through the wireless charging coil of the electronic device 100. While the charging management module 140 is charging the battery 142, it can also power the electronic device 100 through the power management module 141.

[0064] The power management module 141 is used to connect to the battery 142, and the charging management module 140 is connected to the processor 110. The power management module 141 receives input from the battery 142 and / or the charging management module 140, and provides power to the processor 110, the internal memory 121, the external memory, the display screen 194, the camera 193, and the wireless communication module 160.

[0065] The wireless communication function of the electronic device 100 can be implemented through the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, the modem processor, the baseband processor, and the like.

[0066] Antenna 1 and antenna 2 are used to transmit and receive electromagnetic wave signals. Each antenna in electronic device 100 can be used to cover a single or multiple communication frequency bands. Different antennas can also be reused to improve the utilization of antennas. For example, antenna 1 can be reused as a diversity antenna for a wireless local area network. In some other embodiments, the antenna can be used in combination with a tuning switch.

[0067] The mobile communication module 150 may provide solutions for wireless communications including 2G / 3G / 4G / 5G, etc., applied to the electronic device 100. The mobile communication module 150 may include at least one filter, a switch, a power amplifier, and a low noise amplifier (Low Noise Amplifier, LNA), etc.

[0068] The wireless communication module 160 can provide wireless communication solutions for application in the electronic device 100, including Wireless Local Area Networks (WLAN) (such as Wi-Fi network), Bluetooth (BT), Global Navigation Satellite System (GNSS), Frequency Modulation (FM), Near Field Communication (NFC) and Infrared (IR).

[0069] In some embodiments, antenna 1 of electronic device 100 is coupled to mobile communication module 150 , and antenna 2 is coupled to wireless communication module 160 , so that electronic device 100 can communicate with other devices.

[0070] The electronic device 100 can implement audio functions such as music playing and recording through the audio module 170, the speaker 170A, the receiver 170B, the microphone 170C, the headphone jack 170D and the application processor.

[0071] The audio module 170 is used to convert digital audio information into analog audio signal output, and is also used to convert analog audio input into digital audio signals. The audio module 170 can also be used to encode and decode audio signals. In some embodiments, the audio module 170 can be arranged in the processor 110, or some functional modules of the audio module 170 can be arranged in the processor 110.

[0072] The speaker 170A, also called a "speaker", is used to convert an audio electrical signal into a sound signal. The electronic device 100 can listen to music or listen to a hands-free call through the speaker 170A. In some embodiments, the electronic device 100 can be provided with a plurality of speakers 170A.

[0073] The receiver 170B, also called a "earpiece", is used to convert audio electrical signals into sound signals. When the electronic device 100 receives a call or voice message, the voice can be received by placing the receiver 170B close to the human ear.

[0074] Microphone 170C, also called "microphone" or "microphone", is used to convert sound signals into electrical signals. When making a call or sending a voice message, the user can speak by putting their mouth close to microphone 170C to input the sound signal into microphone 170C. The electronic device 100 can be provided with at least one microphone 170C. In some embodiments, the electronic device 100 can include two microphones 170C, which can not only collect sound signals but also realize noise reduction function. In other embodiments, the electronic device 100 can also be provided with three, four or more microphones 170C to collect sound signals, reduce noise, identify the source of sound, realize directional recording function, etc.

[0075] The earphone interface 170D is used to connect a wired earphone and can be a USB interface 130 or a 3.5 mm Open Mobile Terminal Platform (OMTP) standard interface or a Cellular Telecommunications Industry Association of the USA (CTIA) standard interface.

[0076] The sensor module 180 may include a pressure sensor, a gyro sensor, an acceleration sensor, a temperature sensor, a motion sensor, an air pressure sensor, a magnetic sensor, a distance sensor, a proximity light sensor, a fingerprint sensor, a touch sensor, an ambient light sensor, a bone conduction sensor, and the like.

[0077] Among them, the pressure sensor is used to sense the pressure signal and can convert the pressure signal into an electrical signal. In some embodiments, the pressure sensor can be set on the display screen 194. The electronic device 100 can also calculate the position of the touch based on the detection signal of the pressure sensor. The touch sensor is also called a "touch panel". The touch sensor can be set on the display screen 194, and the touch sensor and the display screen 194 form a touch screen, also called a "touch screen". The touch sensor is used to detect touch operations acting on or near it. The touch sensor can pass the detected touch operation to the application processor to determine the type of touch event.

[0078] The electronic device 100 can realize the display function through a GPU, a display screen 194, and an application processor. The GPU is a microprocessor for image processing, which connects the display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. The processor 110 may include one or more GPUs, which execute program instructions to generate or change display information.

[0079] The display screen 194 is used to display images or videos, etc. The display screen 194 includes a display panel. In some embodiments, the electronic device 100 may include 1 or N display screens 194, where N is a positive integer greater than 1.

[0080] In the embodiment of the present application, the display screen 194 can display a shooting preview interface and a photo image interface, etc. It should be noted that in the embodiment of the present application, the shooting preview interface refers to an interface where a user can view images captured in real time by the lamp camera through the display screen 194 .

[0081] The electronic device 100 can realize the shooting function through the ISP, the camera 193, the video codec, the GPU, the display screen 194 and the application processor.

[0082] ISP is used to process the data fed back by camera 193. For example, when taking a photo, the shutter is opened, and the light is transmitted to the camera photosensitive element through the lens. The light signal is converted into an electrical signal, and the camera photosensitive element transmits the electrical signal to ISP for processing and converts it into an image visible to the naked eye. ISP can also perform algorithm optimization on the noise, brightness, and skin color of the image. ISP can also optimize the exposure, color temperature and other parameters of the shooting scene. In some embodiments, ISP can be set in camera 193.

[0083] The camera 193 is used to capture still images or videos. The object generates an optical image through the lens and projects it onto the photosensitive element. The photosensitive element can be a charge coupled device (CCD) or a complementary metal oxide semiconductor (CMOS) phototransistor. The photosensitive element converts the optical signal into an electrical signal, and then transmits the electrical signal to the ISP to convert it into a digital image signal. The ISP outputs the digital image signal to the digital signal processor DSP for processing. The digital signal processor DSP converts the digital image signal into an image signal in a standard RGB, YUV or other format.

[0084] The digital signal processor DSP is used to process digital signals, and can process not only digital image signals but also other digital signals. For example, when the electronic device 100 is selecting a frequency point, the digital signal processor DSP is used to perform Fourier transform on the frequency point energy.

[0085] In some embodiments, the electronic device 100 may include 1 or N cameras 193 , where N is a positive integer greater than 1.

[0086] The indicator 192 may be an indicator light, which may be used to indicate the charging status, power changes, messages, missed calls, notifications, etc.

[0087] Motor 191 can generate vibration prompts. Motor 191 can be used for incoming call vibration prompts, and can also be used for touch vibration feedback. For example, touch operations acting on different applications (such as taking pictures, audio playback, etc.) can correspond to different vibration feedback effects.

[0088] The key 190 includes a power key (or power key), a volume key, etc. The key 190 can be a mechanical key or a touch key. The electronic device 100 can receive key input and generate key signal input related to user settings and function control of the electronic device 100.

[0089] The software system of the electronic device 100 may adopt a layered architecture, which may be an event-driven architecture, a micro-core architecture, a micro-service architecture, or a cloud architecture. The embodiment of the present application takes the Android system of the layered architecture as an example to exemplify the software structure of the electronic device 100.

[0090] See also Figure 1b , Figure 1b It is a software structure block diagram of an electronic device 100 provided in an embodiment of the present application.

[0091] The layered architecture of the electronic device 100 divides the software into several layers, each with a clear role and division of labor. The layers communicate with each other through software interfaces. In some embodiments, the Android system is divided into five layers, from top to bottom, namely, the application layer, the application framework layer, the system layer, the HAL layer (Hardware Abstract Layer) and the kernel layer.

[0092] The application layer can include a series of application packages. Figure 1b As shown, the application package can include gallery, call, video, Bluetooth, camera, WLAN, smart space, note application, point reading application, etc. The application package can also include calendar, map, WIFI, navigation, music, SMS and other applications.

[0093] Among them, the smart space is used to discover and register IOT devices. In some embodiments, the smart space can be used to bind IOT devices such as desk lamps. The note application can be used to provide users with editing and saving note content. For example, the note content can be edited, shared, and exported to PDF files through the note application. In some embodiments, the note application can generate a PDF file of the note content when saving the note content. The point reading application can be used to provide users with online education functions, such as online word recognition, online reading, online homework submission, etc. In some embodiments, the point reading application can access preset devices on IOT devices such as desk lamps.

[0094] The application framework layer provides an application programming interface (API) and a programming framework for the applications in the application layer. The application framework layer includes some predefined functions.

[0095] like Figure 1b As shown, the application framework layer may include authentication (AUTH) service, device management software development kit (DMSDK) service, Magic Link service, DVSDK, and interconnection service.

[0096] Among them, the AUTH service, which can be called an authentication service, is used to authenticate interface calls and provide security permission management capabilities. For example, when an application in the application layer calls an API interface provided by the application framework layer, the AUTH service can authenticate the application that calls the API interface to confirm whether the application has the interface call permission.

[0097] The DMSDK service, which can be called the device management service, can be used for IoT device discovery and management, providing far-field (i.e., cloud) IoT device information and near-field (i.e., nearby connectable) IoT device information for applications such as point-and-read applications.

[0098] The Magic Link service, which can be called a transmission management service, can be used to establish a physical transmission channel and provide data transmission capabilities. For example, the electronic device 100 can establish a physical transmission channel with the Magic Link service in other electronic devices through the Magic Link service to transmit data exchanged between the electronic device 100 and the other electronic devices.

[0099] The DVSDK is used to provide the capability interface provided to the application layer as the entrance to the first interconnected service platform. Through the capability interface provided by the DVSDK, the application layer can use the virtualization service provided by the first interconnected service platform. Optionally, the DVSDK can also perform interface access security permission management. The DVSDK at least provides a device virtualization tool, and the application can use the virtualization service provided by the first interconnected service platform by calling the device virtualization tool. In an embodiment of the present application, the DVSDK can provide a device virtualization tool, and the device virtualization tool can provide an entrance to the first interconnected service platform for the application.

[0100] The interconnection service, which may be referred to as an interconnection service platform, may be used to establish a logical transmission channel between the electronic device 100 and other electronic devices and provide virtualization capabilities. The interconnection service platform in the electronic device 100 may be referred to as a first interconnection service platform, and the interconnection service platform in other electronic devices may be referred to as a second interconnection service platform.

[0101] The interconnection service platform can be a Distribute Mobile Sensing Development Platform (DMSDP). DMSDP is a service of the application framework layer. When DVSDK initiates a connection with other electronic devices, DVSDK can pull up the first DMSDP service, and then the first DMSDP service can realize the control session and data session transmission in the process of connecting other electronic devices.

[0102] The control session is used to transmit control commands between the electronic device 100 and other electronic devices, such as requests to use the cameras of other electronic devices, photo commands, video commands, control commands to adjust the shooting effects, etc. The data session is used to transmit streams returned by other electronic devices, such as preview streams, photo streams, video streams, etc.

[0103] like Figure 1b As shown, the interconnection service may include a data processing module, a transmission channel module, a flow control module, and a capability acquisition module. Among them, the data processing module can be used to process the video frame according to the requirements of the underlying layer, such as format conversion. The transmission channel module is used to configure the logical transmission channel. The flow control module is used to cache the video stream. The capability acquisition module is used to obtain the device capabilities (such as camera capabilities) reported by other electronic devices, so as to confirm whether other electronic devices have the capabilities required by the target application based on the device capabilities of other electronic devices.

[0104] The system library and runtime layer (ie, the system layer) includes the system library and the Android runtime (Android Runtime).

[0105] Android Runtime includes core libraries and virtual machines. Android Runtime is responsible for the scheduling and management of the Android system.

[0106] The core library consists of two parts: one is the function that the Java language needs to call, and the other is the Android core library. The application layer and the application framework layer run in the virtual machine. The virtual machine executes the Java files of the application layer and the application framework layer as binary files. The virtual machine is used to perform object life cycle management, stack management, thread management, security and exception management, and garbage collection.

[0107] In the embodiment of the present application, Android Runtime also includes a virtual camera adaptation layer, which provides the capability of virtual camera registration.

[0108] The system library in the system layer can include multiple functional modules, such as multimedia platform, audio framework, graphics and image processing library, codec, etc.

[0109] Among them, the multimedia platform can be used to manage multimedia, support a variety of commonly used audio and video format playback and recording, as well as static image files, etc. The multimedia platform can support a variety of audio and video encoding formats, such as: MPEG4, H.264, MP3, AAC, AMR, JPG, PNG, etc.

[0110] The audio framework is responsible for the collection and output of audio data, the control of audio streams, the management of audio devices, volume adjustment, etc.

[0111] The graphics and image processing library can be used to implement graphics drawing, image rendering, compositing, and layer processing.

[0112] Codecs can be used to implement encoding and decoding operations on audio data and video data.

[0113] The HAL layer is an interface layer between the operating system kernel and the hardware circuit. The HAL layer includes but is not limited to: audio HAL, sensor HAL, modem HAL, camera HAL, virtual camera HAL, etc.

[0114] The audio HAL is used to process the audio stream, for example, to perform noise reduction, directional enhancement, etc. on the audio stream. The camera HAL is used to process the image stream corresponding to the camera of the electronic device 100, and the virtual camera HAL is used to process the image stream corresponding to the virtual camera registered by the electronic device 100, that is, to process the image stream collected by the camera on the IOT device side.

[0115] The kernel layer is the layer between hardware and software. The kernel layer includes at least display driver, camera driver, audio driver, network driver (such as Wi-Fi driver), CPU driver, USB driver, storage driver and print driver, etc. Among them, the hardware includes at least processor, display screen, Wi-Fi module, etc.

[0116] Understandably, Figure 1b The layers in the software structure shown and the components included in each layer do not constitute a specific limitation on the electronic device 100. In other embodiments of the present application, the electronic device 100 may include more or fewer layers than shown, and each layer may include more or fewer components, which is not limited in the present application.

[0117] It is understandable that in order to implement the method for exporting the note content in the embodiment of the present application, the electronic device 100 includes hardware and / or software modules corresponding to the execution of each function. In combination with the algorithm steps of each example described in the embodiment disclosed herein, the present application can be implemented in the form of hardware or a combination of hardware and computer software. Whether a function is executed in the form of hardware or computer software driving hardware depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application in combination with the embodiments, but such implementation should not be considered to be beyond the scope of the present application.

[0118] See also Figure 2 , Figure 2 This is a schematic diagram of the business architecture of a note-taking application provided in an embodiment of the present application. The business architecture of the note-taking application includes a note business layer, a Java SDK Interface layer, a JNI layer, and a native pdfium.so layer. Among them, the note business layer is responsible for implementing the main control logic of each business, the Java SDK Interface layer encapsulates the java methods of each business, connects the JNI layer and the note business layer, and the JNI layer is used to expose the so library capabilities to the Java SDK Interface layer to implement the generation logic of each business. The native pdfium.so layer is used to provide native interfaces and extended interfaces.

[0119] The note service layer may include a series of service options provided by the note application. Figure 2 As shown, the note business layer can include background layer / partial loading, home page thumbnail, search / highlight, copy / paste page, PDF sharing export, cloud synchronization PC display, foreground layer, page management thumbnail, printing, low version compatibility and other business options.

[0120] Among them, the background layer / partial loading option is used to load the entire background of the note content or load the background of a certain page in the note content. In some embodiments, the background of the note content can be loaded or replaced by clicking the background layer / partial loading option.

[0121] The homepage thumbnail option is used to set the homepage of multiple note contents to be displayed as thumbnails.

[0122] The search / highlight option is used to search for important information in the note content based on keywords, or to highlight specified content in the note content.

[0123] The copy / paste page option is used to copy and paste a specified page in the note content. For example, the user can select the page to be copied and paste it to a specified location in the note content or other files.

[0124] The PDF sharing export option is used to export note content to a PDF file. For example, users can export edited note content to a PDF file.

[0125] The cloud sync PC display option is used to synchronize the note content to the PC. For example, users can synchronize the note content on their mobile phone or tablet to the computer.

[0126] The foreground layer option is used to load or set the foreground of the note content. The page management thumbnail option is used to set each page in the note content as a thumbnail for display, so as to facilitate browsing the note content.

[0127] The print option is used to print the note content. For example, the note content can be sent to a printer, and the printer prints the note content.

[0128] The low version compatibility option is used to set the current version of the note application to be backward compatible with the note content generated by the low version of the note application, so as to avoid the phenomenon that the note content generated by the low version of the note application cannot be opened.

[0129] The Java SDK (Software Development Kit) Interface layer is used to provide corresponding software development kits for each business in the note business layer. The Java SDK Interface layer can include toolkits such as rendering, text extraction, search, outline extraction, encryption / decryption, annotation addition / deletion, merging / splitting / page-by-page merging, inserting new pages, and MetaData writing.

[0130] The rendering toolkit has functions such as full page rendering, partial rendering, and thumbnail rendering. For example, when background layer / partial loading, homepage thumbnail, or page management thumbnail is required, the rendering toolkit can call the corresponding generation logic in the JNI layer to implement background rendering, partial content rendering, and thumbnail rendering.

[0131] The text extraction toolkit is used to extract the entire page of note content and extract a specified range of content. For example, when you need to copy a page of note content or a paragraph of text on a page, you can call the text extraction toolkit to achieve this.

[0132] The search toolkit is used to obtain search results and return a rectangular box with a relative width and height. For example, when you need to search for important information in the note content, you can use the search toolkit to return the search results.

[0133] The Outline Extraction Toolkit is used to extract outlines from note content. The Encryption / Decryption Toolkit is used to encrypt or decrypt note content. The Annotation Add / Delete Toolkit is used to add or delete annotations in note content. The Merge / Split / Merge by Page Toolkit is used to merge, split, or merge by page when exporting note content to a PDF file. The Insert New Page Toolkit is used to create a new PDF page when exporting note content to a PDF file. The MetaData Writing Toolkit is used to write page metadata, doc metadata, etc. in the note content.

[0134] The JNI (Java Native Interface) layer, namely the Java local interface, is a feature of Java calling Native languages. Applications can integrate C / C++ codes into Java programs through the JNI layer. Exemplarily, the JNI layer may include generation logic for implementing rendering / local content rendering / thumbnail rendering, text extraction, search / highlighting, outline extraction, encryption / decryption, annotation addition / deletion, merging / splitting / page-by-page merging, background layer / element layer / highlighter layer / handwriting layer addition, MetaData writing, etc. Among them, MetaData writing may include page metadata reading and writing and doc metadata reading and writing.

[0135] The public interfaces in the native pdfium.so layer may include native interfaces and extended interfaces. Among them, the native interfaces may include rendering, layout, text extraction, annotation processing, encryption and decryption, etc., and the extended interfaces may include: MetaData read and write interfaces in docment, MetaData read and write interfaces in page, outline data write interface, store page content data, do not create default graphic attribute interface, import page by page, implement object reuse interface, etc.

[0136] In some embodiments, in the application scenario of PDF sharing and exporting, the note business layer is responsible for the interaction of sharing and exporting, including the master control logic of generating PDF files. The Java SDK Interface layer encapsulates the Java methods for operating PDF files and is used to connect the note business layer and the JNI layer. The JNI layer is used to expose the so library capabilities to the Java SDK Interface layer to implement the PDF single page generation logic. The native pdfium.so layer is used to provide the basic capabilities of creating, parsing, modifying, and saving PDF files.

[0137] See also Figure 3 , Figure 3 This is a schematic block diagram of exporting note content to a PDF file provided by an embodiment of the present application. After editing the note content, the note content can be exported to a PDF file page by page when saving the note content, or when sharing the note content, the note content can be exported to a PDF file. The export process may include the following steps:

[0138] S200: Display the first note in the note application.

[0139] Optionally, the first note is a handwritten note, which refers to a file in which a user inserts a text box, an image, draws with a highlighter, or writes text or tracks with a pen or pencil according to actual needs. The following will take the first note as an example to explain how to export the note content in the first note to a PDF file.

[0140] S201. Query all pages of the first note and sort the pages by page number.

[0141] Exemplarily, a user opens a first note in a note application, and the first note includes at least one page. When it is detected that the user needs to export part or all of the note content in the first note, all pages in the first note are queried, and the pages in the first note are sorted according to page numbers.

[0142] S202: Create a second PDF file.

[0143] Exemplarily, a new PDF file may be created, referred to as a second PDF file.

[0144] S203: Detect whether there is a first PDF file corresponding to the first note.

[0145] Optionally, the first PDF file may be a historically exported PDF file, for example, the first PDF file is a file obtained by exporting the first note to a PDF file last time.

[0146] Exemplarily, based on the file name of the first note, it can be detected whether there is a first PDF file historically exported from the first note in the database or local disk of the electronic device. If the electronic device has the first PDF file historically exported, steps S203 to S213 are executed. If the electronic device does not have the first PDF file historically exported, steps S209 to S213 are executed.

[0147] For the convenience of description, in the embodiment of the present application, the historically exported PDF file is referred to as a first PDF file, and the newly created PDF file is referred to as a second PDF file.

[0148] S204: Open the first PDF file, and save the file handle corresponding to the first PDF file into a cache.

[0149] It should be noted that in file I / O, to read data from a file, the application must first call the operating system function and pass the file name, and select a path to the file to open the file. The function retrieves a sequence number, namely the file handle, which is the only identification basis for the open file. For example, when an application reads a piece of data from a file, it needs to call the file handle and pass the address of the file handle in the cache and the number of bytes to be copied to the operating system. When the task is completed, the file is closed by calling the system function.

[0150] By saving the file handle corresponding to the first PDF file in the cache, it is convenient to read the page content in the first PDF file through the file handle later.

[0151] After step S204, all pages in the first note may be looped through and exported to the second PDF file page by page. Optionally, step S205 may be included. In step S205, all pages in the first note may be looped through and exported to the second PDF file page by page. For each page, steps S206 to S213 may be performed. For ease of explanation, the following will take the first page in the first note as an example to explain how to export the first page to the second PDF file.

[0152] S206: Determine whether the first PDF file includes a second page corresponding to the first page in the first note.

[0153] If the first PDF file includes the second page corresponding to the first page, step S207 is executed; if the first PDF file does not include the second page corresponding to the first page, step S209 is executed.

[0154] The second page refers to the page in the first PDF file whose UUID (Universally Unique Identifier) ​​is the same as the UUID of the first page. It should be noted that when exporting the first note to a PDF file, the UUID of the page in the first note needs to be recorded in the MetaData of the PDF file, so it can be determined by the UUID whether the first PDF file has a second page corresponding to the first page in the first note.

[0155] S207: Determine whether the first page has changed.

[0156] Specifically, the first page and the second page may be compared in content. If the first page and the second page differ in content, it may be determined that the first page has changed. If the first page has not changed, steps S208 and S213 are executed. If the first page has changed, steps S210 to S213 are executed.

[0157] S208: Insert the second page into the second PDF file.

[0158] After step 208, step S213 may be executed.

[0159] In an embodiment of the present application, by detecting whether there is a first PDF file exported historically, if there is a first PDF file, it is further determined whether there is a second page in the first PDF file that is identical to the first page in the first note. When the first PDF file has a second page that is identical to the first page in the first note and the content in the first page has not changed relative to the content in the second page, the second page can be reused and directly inserted into the second PDF file, thereby exporting the first page in the first note to the second PDF file. By reusing the corresponding pages in the first PDF file, the number of times the pages are generated in real time can be reduced, thereby effectively improving the speed of exporting PDF files.

[0160] S209: Create a second page.

[0161] After step 209, step S211 may be executed.

[0162] When the first PDF file does not include a second page corresponding to the first page in the first note, a new blank page may be created as the second page.

[0163] S210, using the background image in the first PDF file as a background layer object in the second page, and executing step S211.

[0164] It can be understood that although the content of the second page changes relative to the first page, since the first PDF file is exported from the first note to the PDF file, the background image of the first PDF file is the same as the background image of the first note. Therefore, the background image in the first PDF file can be directly used as the background layer object in the second page.

[0165] S211. Based on the layer objects in the first page, configure layer objects for the second page.

[0166] Exemplarily, the layer objects of the second page may be configured based on the layer objects in the first page, and then the second page with the configured layer objects may be inserted into the second PDF file. Alternatively, the second page may be added to the second PDF file first, and then the layer objects of the second page in the second PDF file may be configured based on the layer objects in the first page.

[0167] It should be noted that configuring the layer objects of the second page may include adding sub-objects in each layer object in the first page to the corresponding layer objects in the second page, and configuring the properties of the layer objects in the second page, wherein, when a layer object in the first page does not contain a sub-object, the corresponding layer object in the second page is set to a preset number of pixels.

[0168] like Figure 4 As shown, the PDF page in the PDF file includes at least one layer object among a background layer object, an element layer object, a highlighter layer object and a handwriting layer object. The first note includes at least one of a background layer object, an element layer object and a handwriting layer object, wherein in the first note, the handwriting layer object may include at least one of a highlighter layer object and a handwriting layer object.

[0169] Exemplarily, the background layer object may include one of the background image, background grid line, and PDF page. The element layer object is used to store sub-objects such as pictures and text boxes. The highlighter layer object is used to store highlighter tracks, where the highlighter tracks refer to tracks drawn using a highlighter. The handwriting layer object is used to store writing tracks, such as text written in pencil or sub-objects such as line segments and curves drawn.

[0170] In some embodiments, when the second page is a newly created blank page, configuring objects on the second page based on the objects in the first page may include: adding layer objects such as background layer objects, element layer objects, highlighter layer objects, and handwriting layer objects in the first page to the second page, and configuring attribute information between the background layer objects, element layer objects, highlighter layer objects, and handwriting layer objects, wherein the attribute information includes the hierarchical order and blending mode of each layer object.

[0171] In other embodiments, when the background image in the second page is the same as the background image in the first page, configuring objects in the second page based on the objects in the first page may include: adding layer objects such as element layer objects, highlighter layer objects, and handwriting layer objects in the first page to the second page, and configuring attribute information between the background layer objects, element layer objects, highlighter layer objects, and handwriting layer objects, wherein the attribute information includes the hierarchical order and blending mode of each layer object.

[0172] For example, Figure 4 As shown, the hierarchical order of each layer object in the second page can be configured as a background layer object, an element layer object, a highlighter layer object, and a handwriting layer object, wherein the background layer object is the bottom layer. The blending mode (Blend Mode) of the background layer object can be configured as the first mode, the blending mode of the element layer object can be configured as the first mode, the blending mode of the highlighter layer object can be configured as the second mode, and the blending mode of the handwriting layer object can be configured as the first mode.

[0173] It should be noted that the blending mode is used to configure the display effect after the pixels of multiple images are superimposed. The first mode is different from the second mode. The first mode refers to a mode in which the top image pixels are covered on the bottom image pixels, and the second mode refers to a mode in which the top image pixels are compared with the bottom image pixels and the image pixels with darker colors are displayed. For example, when the element layer object is in the first mode, the sub-objects in the element layer object will be covered on the background layer object. For another example, when the highlighter layer object is in the second mode, if the image pixels of the sub-objects in the highlighter layer object are larger than the image pixels of the sub-objects in the element layer object, the sub-objects in the highlighter layer object will be displayed.

[0174] In the above embodiment, by configuring the hierarchical order of each layer object on the second page, not only can the overlay effect of each layer object in the exported PDF file be ensured to be the same as that in the first note, but also there is no need to configure the hierarchical order of each layer object again when re-exporting the PDF file later, which can effectively improve the speed of exporting the PDF file; by configuring the blending mode of each layer object in the second page, it can be achieved that when the first note is exported to the PDF file again after adding writing track content, highlighter track content or element content, it only needs to update the corresponding sub-objects in the layer object, and there is no need to add the attribute information of the layer object, thereby greatly reducing the size of the PDF file.

[0175] S212: Add the second page where the layer object is configured to the second PDF file.

[0176] Optionally, the second page with the layer object configured can be inserted into the second PDF file, and step S213 is performed. When the second page has been added to the second PDF file in step S211, step S212 is not performed.

[0177] S213: Save the second PDF file.

[0178] Exemplarily, based on the layer objects in the first page, the layer objects are configured on the second page, the second page with the configured layer objects is added to the second PDF file, and the second PDF file is saved. Then, the above steps S206 to S213 are executed repeatedly to export all pages in the first note to the second PDF file.

[0179] See also Figure 5 , Figure 5 It is a schematic diagram of a single-page PDF export process provided in an embodiment of the present application. In the process of exporting pages in the first note to PDF files page by page, it is necessary to generate PDF pages for each page in the first note one by one. It can be understood that step S211 in the above embodiment is based on the layer object in the first page. The specific process of configuring the layer object on the second page can adopt the single-page PDF export process provided in this embodiment.

[0180] The following will take the export of the first page in the first note to a PDF file as an example. The export process of a single PDF page can include the following steps:

[0181] S300: Perform data structure conversion on the first page in the first note.

[0182] Data structure conversion refers to converting the data content of the first page of the first note from a first data structure to a second data structure, wherein the first data structure is a data structure in the Java SDK Interface layer, and the second data structure is a data structure in the JNI layer and the native pdfium.so layer.

[0183] For example, when converting the data structure of the first page in the first note, the data content of the first page can be converted from the first data structure to the second data structure. The specific process of data structure conversion can be referred to in the related art, and the specific process is not repeated here.

[0184] It should be noted that if Figure 2As shown, since the data structure corresponding to the Java SDK Interface layer is mainly defined in Java language, and the data structure corresponding to the JNI layer and the native pdfium.so layer is mainly defined in C or C++ language, the data structure corresponding to the Java SDK Interface layer cannot be directly used in the JNI layer and the native pdfium.so layer, so it is necessary to convert the data structure of the Java SDK Interface layer into a structure that can be directly used by the JNI layer and the native pdfium.so layer. Among them, the data structure corresponding to the JNI layer is the same as the data structure corresponding to the native pdfium.so layer.

[0185] By converting the data structure of the first note, it can be ensured that the data content in the first note can be read and used normally between different layers of the business architecture.

[0186] S301: Perform color space conversion on a first page.

[0187] It should be noted that step S301 is optional and may not be performed. Performing color space conversion on the first page refers to performing color space conversion on the bitmap data on the layer object in the first page.

[0188] It should be noted that when the FPDF Bitmap color space used in the PDFium library is different from the Android Bitmap color space, there will be color differences between the element layer objects, highlighter layer objects, and handwriting layer objects in the exported PDF file and the corresponding layer objects in the first page. For example, when the color component order of the FPDF Bitmap color space used in the PDFium library is BGRA, and the color component order of the Android Bitmap color space is RGBA, for pixel 1, the pixel value of pixel 1 in the first page is 0XRRGGBBAA. If pixel 1 is directly exported to a PDF file, the pixel value of pixel 1 in the PDF file is 0XRRGGBBAA. Since the color component order used by the FPDF Bitmap color space and the Android Bitmap color space is different, the values ​​of color component R and color component B in the FPDF Bitmap color space change relative to the Android Bitmap color space, resulting in color differences between pixel 1 in the first page and the PDF file. To solve this problem, after the image of the Android layer in the first page is transferred to the JNI layer, the embodiment of the present application needs to perform color space conversion on the bitmap data (Bitmap) on the element layer object, highlighter layer object, and handwriting layer object in the first page.

[0189] In some embodiments, the first page performs color space conversion, including: when a first color space used by the first page is different from a second color space used by the second PDF file, determining a target color component pair to be converted in the first page, the target color component pair being color components whose positions are interchanged in the first color space and the second color space in the first page; and performing color component conversion on the bitmap data in the first page according to the target color component pair.

[0190] Optionally, the first color space is an Android Bitmap color space, and the second color space is an FPDF Bitmap color space.

[0191] Exemplarily, for each layer object in the first page, when the color component order of the FPDF Bitmap color space used in the PDFium library is BGRA, and the color component order of the Android Bitmap color space is RGBA, the pixel points of the bitmap data on the layer object can be traversed to swap the color component B and the color component R of each pixel point. For example, for pixel point 1 of the bitmap data on the layer object, if the pixel value of pixel point 1 is 0XRRGGBBAA, then after swapping the color component B and the color component R, the pixel value of pixel point 1 becomes 0XBBGGRRAA. And so on, the color component conversion is performed on the bitmap data on each layer object in the first page.

[0192] In the above embodiment, when the first color space used by the first page is different from the second color space used by the second PDF file, a target color component pair to be converted is determined, and color component conversion is performed on the bitmap data in the first page according to the target color component pair, so that the color component sequence used by the bitmap data after the color component conversion is consistent with the color component sequence corresponding to the color space used by the PDF file, thereby avoiding changes in the pixel values ​​of the bitmap data in the first page after being exported to the PDF file, and ensuring that the image effect of the exported second PDF file is the same as that of the first page.

[0193] S302: Perform transparency conversion on the first page.

[0194] It should be noted that step S302 is optional and may not be performed.

[0195] Since the bitmap data corresponding to the element layer objects, highlighter layer objects and handwriting layer objects in the first page are transparent, and the FPDF Bitmap color space uses Device RGB, when the first page is exported to the second PDF file, the bitmap data in the first page will be multiplied by the transparency ratio to filter out the transparency of the bitmap data. As a result, the bitmap data corresponding to the element layer objects, highlighter layer objects and handwriting layer objects in the generated second PDF file will have color difference relative to the bitmap data in the first page.

[0196] In some embodiments, performing transparency conversion on the first page may include: obtaining a transparency ratio corresponding to the bitmap data of each layer object in the first page; and performing transparency conversion on the bitmap data of each layer object according to the transparency ratio.

[0197] Exemplarily, the transparency conversion is performed on the bitmap data of each layer object according to the transparency ratio. The pixel points of the bitmap data of the corresponding layer object can be traversed, and the color component of each pixel point is divided by the transparency ratio.

[0198] In other embodiments, when the transparency ratios of the bitmap data corresponding to the layer objects in the first page are different, the transparency of the corresponding bitmap data can be converted according to the transparency ratios of the bitmap data corresponding to the layer objects.

[0199] In the above embodiment, by converting the transparency of the bitmap data in the first page according to the transparency ratio, it is possible to divide the color component of each pixel by the transparency ratio in advance. In the subsequent process of exporting the first page to the second PDF file, the bitmap data obtained by multiplying the color component of the pixel corresponding to the bitmap data in the first page by the transparency ratio can still maintain the original transparency, thereby avoiding color difference in the bitmap data corresponding to the element layer objects, highlighter layer objects and handwriting layer objects in the generated second PDF file.

[0200] S303: Determine whether the background layer object of the first page is a PDF page.

[0201] If the background layer object of the first page is a PDF page, step S304 is executed; otherwise, step S315 is executed.

[0202] It should be noted that the embodiment of the present application can be applied to the scenario where an external first PDF file is imported into a note application for the first time or the first PDF file in the first note is saved and exported again, and the background layer of the first page is a PDF page. When the first page in the first note is exported to the second PDF file, the corresponding page in the first PDF file can be reused, and adaptive modification can be performed when the corresponding page changes.

[0203] S304: Export each page in the first PDF file to a second PDF file.

[0204] It should be noted that the first PDF file refers to a PDF file imported into the note application, and the second page refers to a page in the first PDF file whose UUID is the same as the UUID of the first page.

[0205] It should be noted that in the application scenario of importing the pages of the first PDF file generated last time into the second PDF file, since the relevant technology uses the native PDF export interface, sub-object reuse can only be achieved within a single page range, and sub-object reuse cannot be achieved between different pages. When exporting the first PDF file to the second PDF file through the note application, it must be exported page by page. Therefore, the sub-objects that have been reused in the PDF pages in the first PDF file cannot implement the reuse logic in the exported second PDF file, which will cause the sub-objects reused in the PDF pages in the first PDF file to generate new sub-objects for each page when exported to the second PDF file, which will cause the second PDF file exported from the note application to be larger than the first PDF file even if the first PDF file is not modified.

[0206] like Figure 6 As shown, the first PDF file includes PDF1 page, PDF2 page and PDF3 page, the sub-objects contained in PDF1 page are objptr1, objptr2, objptr3, objptr4, the sub-objects contained in PDF2 page are objptr1, objptr2, objptr3, objptr4, the sub-objects contained in PDF3 page are objptr1, objptr2, objptr3, objptr4, wherein PDF2 page and PDF3 page can reuse the same sub-objects in PDF1 page; when the related technology exports the first PDF file to the second PDF file through the note application, it must be exported page by page, and the sub-objects in the first PDF file are The sub-objects that have been reused in the PDF page cannot implement the reuse logic in the exported second PDF file, that is, the PDF2 page in the generated second PDF file needs to create new sub-objects objptr5, objptr6, objptr7, and objptr8 based on the sub-objects objptr1, objptr2, objptr3, and objptr4, and the PDF3 page in the second PDF file needs to create new sub-objects objptr9, objptr10, objptr11, and objptr12 based on the sub-objects objptr1, objptr2, objptr3, and objptr4, which leads to the increase of the exported second PDF file.

[0207] In order to solve this problem, the embodiment of the present application provides a newly added page-by-page export interface. In the scenario where a second page corresponding to a first page in a first PDF file is added to a second PDF file or multiple pages in a first PDF file are exported to a second PDF file page by page, sub-objects in different PDF pages can be reused based on object reuse logic. Therefore, when the same sub-object exists on different pages of the first PDF file, there is no need to create a new sub-object, thereby reducing redundant objects and avoiding the exported second PDF file from being too large.

[0208] In the embodiment of the present application, the sub-object refers to the object contained in the layer object, which may include but is not limited to font objects, graphic objects, annotation objects, document header objects, etc.

[0209] In some embodiments, when adding a second page corresponding to the first page in the first PDF file to the second PDF file, the method may include: sequentially determining each sub-object included in the element layer object in the first page as a first sub-object; determining whether the first sub-object is in a preset object reuse variable; if the first sub-object is in the object reuse variable, adding the first sub-object in the object reuse variable to the element layer object in the third page; if the first sub-object is not in the object reuse variable, creating a second sub-object identical to the first sub-object on the element layer object in the third page, and adding the second sub-object to the object reuse variable. The preset object reuse variable may be represented as m_ObjectCachedObjMap.

[0210] like Figure 7 As shown, the src variable is used to store the sub-objects contained in each page of the first PDF file. When the first PDF file is imported into the first notebook, the sub-objects of each page in the first PDF file can be stored in the src variable. For example, the sub-objects contained in the PDF1 page are objptr1, objptr2, objptr3, and objptr4. The sub-objects contained in the PDF1 page are objptr1, objptr2, objptr3, and objptr4. m_ObjectCachedObjMap maps the corresponding sub-objects through the memory address to store the sub-objects reused when the first PDF file is imported into the first notebook, for example, at the memory address <srcpdf1,<objptr1,newobjptr1> >, objptr1 is the sub-object contained in the PDF1 page in the first PDF file, and newobjptr1 is the sub-object created based on the sub-object objptr1 when the PDF1 page is imported into the first note, that is, the reused sub-object.

[0211] For example, Figure 7As shown, when exporting the PDF1 page in the first PDF file to the PDF1 page in the second PDF file, for the objptr1 sub-object, it can be determined whether the newobjptr1 sub-object corresponding to the objptr1 sub-object is in the m_ObjectCachedObjMap; if the newobjptr1 sub-object is in the m_ObjectCachedObjMap, the newobjptr1 sub-object in the m_ObjectCachedObjMap is added to the PDF1 page in the second PDF file. If the newobjptr1 sub-object corresponding to the objptr1 sub-object is not in the m_ObjectCachedObjMap, a new newobjptr1 sub-object is created in the element layer object of the PDF1 page in the second PDF file, and the new newobjptr1 sub-object is added to the m_ObjectCachedObjMap. When the objptr1 sub-object contained in the element layer of the PDF2 page in the first PDF file is to be exported to the PDF2 page in the second PDF file, since the newobjptr1 sub-object corresponding to the objptr1 sub-object in the PDF2 page in the first PDF file exists in m_ObjectCachedObjMap, the newobjptr1 sub-object in m_ObjectCachedObjMap can be added to the PDF2 page in the second PDF file without creating a new sub-object. By analogy, the sub-objects contained in each page in the first PDF file can be exported to each page in the created second PDF file.

[0212] In the above embodiment, by determining whether the first sub-object is in the preset object reuse variable, and when the first sub-object is in the object reuse variable, reusing the first sub-object from the object reuse variable to the third page, the sub-objects in the first PDF file are reused, which can reduce redundant objects and avoid the exported PDF file being too large. By creating a second sub-object corresponding to the first sub-object in the second PDF file when the first sub-object is not in the object reuse variable, and adding the second sub-object to the object reuse variable, the second sub-object can be reused from the object reuse variable next time, which can also reduce redundant objects and avoid the exported PDF file being too large.

[0213] S305: Adjust page parameters of the second PDF file.

[0214] Optionally, before step 304 or after step S304, step S305 may be further performed. Exemplarily, the page parameters corresponding to each page in the second PDF file may be adjusted according to the page parameters (e.g., width, height, and direction) of the first page, and the sub-objects corresponding to the layer objects in the second PDF file may be scaled, cropped, translated, etc. according to the layer objects in the first page, so as to ensure that the background of the second PDF file is consistent with the background of the first note. The page parameters may include one or more parameters such as width, height, and direction.

[0215] Optionally, after step S304, step S306 is further included:

[0216] S306: Determine whether there is a previous element layer object on the third page in the second PDF file corresponding to the second page in the first PDF file.

[0217] It should be noted that the third page refers to a page obtained by adding the second page in the first PDF file to the second PDF file. In order to distinguish the second page in the first PDF file from the second page in the second PDF file, the second page in the second PDF file is referred to as the third page below.

[0218] After inserting the second page into the second PDF file, it is necessary to determine whether the third page has the previous element layer object, highlighter layer object, and handwriting layer object. It should be noted that when the first PDF file is imported into the note application for the first time and saved and exported to the second PDF file, the third page in the second PDF file does not have the previous element layer object; when the PDF file in the note application is saved again and exported, the third page in the second PDF file has the previous element layer object.

[0219] Exemplarily, it is possible to first determine whether the element layer object exists on the third page in the second PDF file, and to perform different steps according to different determination results. If the element layer object does not exist on the third page, step S307 is performed, otherwise step S308 is performed. For example, when the third page in the second PDF file has a level corresponding to the element layer object, it is determined whether the third page has an element layer object.

[0220] It can be understood that after importing the second page in the first PDF file into the second PDF file, since the page content of the third page in the second PDF file is the same as that of the second page in the first PDF file, the first note is a note that re-imports the first PDF file into the note application, and the page content of the first page in the first note may be modified by the user, resulting in the page content in the third page being the same as or different from the page content of the first page in the first note. Therefore, when exporting the first page to the second PDF file, it is necessary to set a layer object or update a layer object for the third page based on the first page. The following will explain in detail the setting of layer objects and the updating of layer objects.

[0221] S307: Set an element layer object in the third page.

[0222] Exemplarily, setting the element layer object in the third page means that when the element layer object in the first page contains a sub-object, the sub-object contained in the element layer object is added to the element layer object in the third page, and the attribute information of the element layer object in the third page is marked; when the element layer object in the first page does not contain a sub-object, the element layer object in the third page is set to a preset number of transparent pixels, wherein the preset number is less than the number of pixels in the third page, for example, the preset number is 1, 2, 3, and so on. The sub-objects corresponding to the element layer object may include pictures and / or text boxes. Among them, the attribute information of the element layer object may include the level and blending mode to which the element layer object belongs.

[0223] It should be noted that, in the related technology, after multiple edits of a note, the text attributes or graphic attributes in the note cannot be directly removed. When exporting the multiple edited notes to a PDF file, there will be a large number of unreferenced attributes or objects in the PDF file, which will cause the exported PDF file to gradually increase in size as the number of edits increases. In addition, since the related technology does not configure the hierarchical order between the layer objects, it is necessary to reconfigure the hierarchical order between the layer objects after adding a layer object. Not only does it require the attribute information of the layer object, making the exported PDF file too large, but each time a PDF file is exported, it takes a certain amount of time to configure the hierarchical order between the layer objects, resulting in a low speed in exporting the PDF file. Please refer to Figure 8 , Figure 8 This is a schematic diagram of the related technology to export notes to PDF files, such as Figure 8 As shown, when text is entered in the notes and exported to a PDF file, the first layer object in the resulting PDF file contains text 1; when text is entered in the notes again and exported to a PDF file, the newly created second layer object in the PDF file includes text 1 and text 2, and the original first layer object is retained and includes text 1.

[0224] In order to solve the problem of redundant layer objects when the note content is saved and exported to a PDF file after multiple edits, the embodiment of the present application can insert the corresponding layer object into the PDF page in the PDF file and set the layer object to a preset number of pixels when exporting the note content to the PDF file, even if there is no handwritten content, highlighter content, or element content in the note content, so as to occupy the place of each layer object in the PDF page and mark the level and attributes of each layer object. When the note content is exported to the PDF file again after adding handwritten track content, highlighter track content, and element content, it is only necessary to replace the layer object of the corresponding level with the modified layer object of the corresponding level, without adding new layer objects and layer object attribute information and adjusting the hierarchical relationship between each layer object, thereby avoiding the exported PDF file from being too large.

[0225] For example, Fig. 9 As shown, you can first create a PDF file containing 4 layer objects, the first object corresponds to the background image, the second object is 1 pixel, that is, the element layer object, the highlighter layer object and the handwriting layer object are 1 pixel respectively; when the note adds text 1 and generates a PDF file, you can add a text image to the element layer object of the PDF file. At this time, you do not need to create a new PDF page or a new element layer object; when the note adds text 2 again and generates a PDF file, you can add a text image to the element layer object of the PDF file. At this time, you do not need to create a new PDF page or a new element layer object. In this way, you can avoid the exported PDF file from being too large, and at the same time, you can increase the speed of exporting PDF files.

[0226] S308: Update the element layer objects in the third page.

[0227] Exemplarily, the element layer object in the third page may be updated based on the sub-objects contained in the element layer object in the first page, so that the sub-objects contained in the element layer object in the third page are the same as the sub-objects contained in the element layer object in the first page. For example, after the user adds or modifies a picture or a text box in the first page, the element layer object in the third page needs to be updated based on the element layer object in the first page.

[0228] It should be noted that the element layer object in the third page is a picture object, which corresponds to a picture generated by all sub-objects contained in the element layer object in the first page. When the picture or text box in the first page changes, the entire element layer object in the second page needs to be replaced.

[0229] In addition, when the element layer object in the first page does not include a child object, the element layer object in the third page is set to 1 pixel.

[0230] In some application scenarios, after the user deletes all pictures and text boxes in the first page, the element layer object in the first page does not contain sub-objects. When updating the element layer object in the third page based on the sub-objects contained in the element layer object in the first page, the element layer object in the third page needs to be set to 1 pixel.

[0231] like Fig.10 As shown, when the user deletes text 1 and text 2 in the first page, the element layer object in the first page does not contain a child object, and when the element layer object in the third page is updated, the element layer object in the third page is set to 1 pixel.

[0232] It should be noted that since the user has deleted the image and text box in the first page, the element layer object in the first page does not contain any sub-objects at this time. Therefore, in order to reduce the space occupied by the third page, the element layer object in the third page needs to be set to 1 pixel. At the same time, the layer position and rendering properties of the element layer object in the third page can also be retained to avoid the need to add element layer objects and attribute information of element layer objects to the third page in the second PDF file when the element layer object in the first page is subsequently saved to the second PDF file after adding sub-objects. This can reduce the size of the generated second PDF file.

[0233] Optionally, after step S305, steps S309 to S311 may be included. Of course, steps S309 to S311 may also be performed after step S308, and steps S309 to S311 may also be performed after step S314.

[0234] S309: Determine whether the last highlighter layer object exists on the third page.

[0235] Different steps are executed according to different judgment results. If the last highlighter layer object does not exist on the third page, step S310 is executed; otherwise, step S311 is executed.

[0236] S310, setting a highlighter layer object in the third page.

[0237] Exemplarily, setting the highlighter layer object in the third page means that when the highlighter layer object in the first page contains a sub-object, the sub-object contained in the highlighter layer object is added to the highlighter layer object in the third page, and the attribute information of the highlighter layer object in the third page is marked; when the highlighter layer object in the first page does not contain a sub-object, the highlighter layer object in the third page is set to 1 pixel, and of course it can also be set to other numbers of pixels, such as at least 2. The sub-object contained in the highlighter layer object can be a highlighter track. Among them, the attribute information of the highlighter layer object can include the level and blending mode to which the highlighter layer object belongs.

[0238] For example, Fig.11 As shown, when the first page adds a new highlighter track 1 and generates a PDF file, the highlighter track image can be added to the highlighter layer object of the PDF file. At this time, there is no need to create a new PDF page or a new highlighter layer object; when the first page adds a new highlighter track 2 again and generates a PDF file, the highlighter track image can be added to the highlighter layer object of the PDF file. At this time, there is no need to create a new PDF page or a new highlighter layer object. In this way, the exported PDF file can be prevented from being too large and the speed of exporting PDF files can be improved.

[0239] S311. Update the highlighter layer object in the third page.

[0240] Exemplarily, the last highlighter layer object in the third page may be updated based on the sub-objects contained in the highlighter layer object in the first page, so that the sub-objects contained in the highlighter layer object in the third page are the same as those contained in the highlighter layer object in the first page.

[0241] In one embodiment, after the user uses a highlighter to draw a highlighter track in the first page, it is necessary to update the highlighter layer object in the third page based on the highlighter layer object in the first page.

[0242] It should be noted that the highlighter layer object in the third page is a picture object, which corresponds to a picture generated by all sub-objects in the highlighter layer object in the first page. When the highlighter track in the first page changes, the entire highlighter layer object in the third page needs to be replaced.

[0243] In another embodiment, when the highlighter layer object in the first page does not contain a sub-object, the highlighter layer object in the third page is set to 1 pixel. Fig.12 As shown, after the user deletes all highlighter tracks in the first page, the highlighter layer object in the first page does not contain sub-objects. When updating the highlighter layer object in the third page based on the sub-objects contained in the highlighter layer object in the first page, the highlighter layer object in the third page needs to be set to 1 pixel.

[0244] It should be noted that, since the user has deleted all highlighter tracks in the first page, the highlighter layer object in the first page does not contain any sub-objects at this time. Therefore, in order to reduce the space occupied by the third page, the highlighter layer object in the third page needs to be set to 1 pixel. At the same time, the layer position and rendering properties of the highlighter layer object in the third page can also be retained to avoid the need to add highlighter layer objects and their attribute information to the third page in the second PDF file when the highlighter layer object in the first page is subsequently saved to the second PDF file after adding sub-objects. This can reduce the size of the generated second PDF file.

[0245] Optionally, after step S311, steps S312 to S314 may be included. Of course, steps S312 to S314 may also be performed after step S308, and steps S312 to S314 may also be performed after step S305.

[0246] S312: Determine whether the last handwriting layer object exists on the third page.

[0247] Exemplarily, when determining whether the third page has the previous handwriting layer object, different steps may be performed according to different determination results. If the third page does not have the handwriting layer object, step S313 is performed; if the third page has the handwriting layer object, step S314 is performed.

[0248] S313: Set a handwriting layer object in the third page.

[0249] Exemplarily, setting the handwriting layer object in the third page means that when the handwriting layer object in the first page contains a sub-object, the sub-object contained in the handwriting layer object is added to the handwriting layer object in the third page, and the attribute information of the handwriting layer object in the third page is marked; when the handwriting layer object in the first page does not contain a sub-object, the handwriting layer object in the third page is set to 1 pixel, and of course it can also be set to other numbers of pixels, such as at least 2. The sub-object corresponding to the handwriting layer object may include a writing track. Among them, the attribute information of the handwriting layer object may include the level and blending mode to which the handwriting layer object belongs.

[0250] For example, Fig.13As shown, when the first page adds writing track 1 and generates a PDF file, the writing track can be added to the handwriting layer object of the PDF file. At this time, there is no need to create a new PDF page or a new handwriting layer object; when the first page adds writing track 2 again and generates a PDF file, the writing track can be added to the handwriting layer object of the PDF file. At this time, there is no need to create a new PDF page or a new writing layer object. In this way, the exported PDF file can be prevented from being too large and the speed of exporting PDF files can be improved.

[0251] S314: Update the handwriting layer object in the third page.

[0252] Exemplarily, the handwriting layer object in the third page may be updated based on the sub-objects contained in the handwriting layer object in the first page, so that the sub-objects contained in the handwriting layer object in the third page are the same as the sub-objects contained in the handwriting layer object in the first page.

[0253] In one embodiment, after the user adds a new writing track or modifies a writing track in the first page, the handwriting layer object in the third page needs to be updated.

[0254] It should be noted that the handwriting layer object in the third page is a picture object, which corresponds to a picture generated by all writing tracks in the handwriting layer object in the first page. When the writing track in the first page changes, the entire handwriting layer object in the third page needs to be replaced.

[0255] In another embodiment, when the handwriting layer object in the first page does not contain a sub-object, the handwriting layer object in the third page is set to 1 pixel. Fig.14 As shown, after the user deletes all writing traces on the first page, the handwriting layer object in the first page does not contain any sub-objects. When updating the handwriting layer object in the third page based on the sub-objects contained in the handwriting layer object in the first page, the handwriting layer object in the third page needs to be set to 1 pixel.

[0256] It should be noted that, since the user has deleted the writing trace in the first page, the handwriting layer object in the first page does not contain any sub-objects at this time. Therefore, in order to reduce the space occupied by the third page, the handwriting layer object in the third page needs to be set to 1 pixel. At the same time, the layer position and rendering properties of the handwriting layer object in the third page can also be retained to avoid the need to add the handwriting layer object and the attribute information of the handwriting layer object to the third page in the second PDF file when a sub-object is added to the handwriting layer object in the first page and it is saved again to the second PDF file, thereby reducing the size of the generated second PDF file.

[0257] After the handwriting layer object in the third page is updated, step S322 is performed to add the third page to the second PDF file.

[0258] After step S303 , when it is determined that the background layer object of the first page is not a PDF page, steps S315 to S322 may be further included.

[0259] S315: Determine whether the background layer object of the first page is a background image.

[0260] It should be noted that since the background layer object is one of the background image, PDF page and background grid line, when the background layer object of the first page is not a PDF page, it means that the background layer object of the first page is a background image or background grid line. At this time, it is necessary to further determine whether the background layer object of the first page is a background image. When the background layer object of the first page is not a background image, it can be confirmed that the background layer object of the first page is a background grid line.

[0261] Specifically, if the background layer object of the first page is a background image, step S316-step S319 is executed; if the background layer object of the first page is not a background image, step S320 and step S321 are executed first, and then step S317-step S319 is executed.

[0262] S316. Set a background layer object in the third page.

[0263] Optionally, when the background layer object of the first page is a background image, step S316 is executed to set the background layer object in the third page.

[0264] Exemplarily, setting the background layer object in the third page means adding the background image in the first page to the background layer object in the third page, and marking attribute information such as the level and blending mode to which the background layer object belongs.

[0265] It should be noted that after step S316, steps S317 to S319 may be executed. The embodiment of the present application does not limit the execution order of step S317, step S318, and step S319. For example, step S317 may be executed first, then step S318, and finally step S319. For example, step S318 may be executed first, then step S317, and finally step S319. For another example, step S319 may be executed first, then step S317, and finally step S318.

[0266] S317. Set an element layer object in the third page.

[0267] Exemplarily, setting the element layer object means that when the element layer object in the first page contains sub-objects, the sub-objects contained in the element layer object are added to the element layer object in the third page, and the attribute information of the element layer object is marked; when the element layer object in the first page does not contain sub-objects, the element layer object in the third page is set to 1 pixel.

[0268] S318. Set a highlighter layer object in the third page.

[0269] Exemplarily, setting the highlighter layer object in the third page means that when the highlighter layer object in the first page contains sub-objects, the sub-objects contained in the highlighter layer object are added to the highlighter layer object in the third page, and the attribute information of the highlighter layer object is marked; when the highlighter layer object in the first page does not contain sub-objects, the highlighter layer object in the third page is set to 1 pixel, and of course it can also be set to other numbers of pixels, such as at least 2.

[0270] S319: Setting a handwriting layer object in the third page.

[0271] Exemplarily, setting the handwriting layer object in the third page means that when the handwriting layer object in the first page contains a sub-object, the sub-object contained in the handwriting layer object is added to the handwriting layer object in the third page, and the attribute information of the handwriting layer object is marked; when the handwriting layer object in the first page does not contain a sub-object, the handwriting layer object in the third page is set to 1 pixel, and of course it can also be set to other numbers of pixels, such as at least 2. The sub-object corresponding to the handwriting layer object may include a writing track. Among them, the attribute information of the handwriting layer object may include the level and blending mode to which the handwriting layer object belongs.

[0272] Exemplarily, after the handwriting layer object is set in the third page, step S322 is performed to add the third page to the second PDF file.

[0273] S320: Create background grid lines.

[0274] Optionally, when the background layer object of the first page is not a background image, step S320 is executed.

[0275] It should be noted that when the background layer object of the first page is neither a PDF page nor a background image, it means that the background layer object of the first page is a background grid line. At this time, a background grid line can be created and then the constructed background grid line is added to the third page.

[0276] Exemplarily, a path-type background grid line image can be created based on the background grid lines in the first page. It is understandable that, since all data are presented as objects in a PDF file, a path-type background grid line suitable for a PDF file needs to be constructed.

[0277] S321. Add background grid lines to the third page.

[0278] Exemplarily, after creating the background grid lines of the path type, the background grid lines are added to the third page as a background layer object in the third page, and then steps S317 to S319 are executed.

[0279] S322. Add the third page to the second PDF file.

[0280] Exemplarily, after completing the above steps S304 to S314 or steps S315 to S321, the third page may be added to the second PDF file.

[0281] It should be noted that after completing the export of the first page in the first note to the second PDF file through the above steps S300 to S322, and by analogy, the operations in steps S300 to S322 are performed on the other pages in the first note respectively to export each page in the first note to the second PDF file page by page.

[0282] Combine the following Fig.15 , describes a method for an electronic device to save or export note content to a PDF file through internal interaction. Fig.15 It is an internal interaction diagram for saving note content to a PDF file provided in an embodiment of the present application. Fig.15 The electronic device shown includes a UI rendering layer, a PDF generation task service, a Java SDK Interface layer, a JNI layer, and a native pdfium.so layer. Figure 3 and Figure 5 The specific steps of the method for exporting note content to a PDF file are as follows:

[0283] S401 . In response to a user triggering a save or share operation, the UI rendering layer sends a save request to a PDF generation task service.

[0284] In the embodiment of the present application, the first note will be taken as an example to illustrate how to export the first note to a PDF file.

[0285] For example, the first note in the note application can be displayed, and the user can edit and save or share the first note. When it is detected that the user triggers the save or share operation, the UI rendering layer sends a save request to the PDF generation task service.

[0286] S402: The PDF generation task service sends a request for creating a PDF generation task to the PDF generation task management service according to the save request.

[0287] S403: The PDF generation task management service returns an instruction for executing the creation PDF generation task to the PDF generation task service.

[0288] S404: The PDF generation task service queries all pages in the first note and sorts the pages by page numbers.

[0289] Step S404 corresponds to the above-mentioned step S201.

[0290] S405: The PDF generation task service saves the file handle corresponding to the first PDF file into a cache.

[0291] Step S405 corresponds to the above-mentioned step S204.

[0292] Exemplarily, the PDF generation task service may detect whether there is a first PDF file that has been exported historically. If the electronic device has a first PDF file that has been exported historically, the PDF generation task service saves the file handle corresponding to the first PDF file into a cache.

[0293] S406: The PDF generation task service requests the creation of a second PDF file to be exported.

[0294] Steps S406 to S410 correspond to the above-mentioned step S202.

[0295] S407. The Java SDK Interface layer sends a PDF file creation instruction to the JNI layer through a PDF file creation function.

[0296] Among them, the function of creating a PDF file can be expressed as newSdk.createPdf().

[0297] S408. The JNI layer requests the native pdfium.so layer to create a PDF file according to the instruction to create a PDF file.

[0298] S409. The native pdfium.so layer creates a second PDF file through a PDF file creation interface, and returns the second PDF file to the PDF generation task service.

[0299] S410 : The PDF generation task service caches the second PDF file.

[0300] It should be noted that steps S411 to S415 correspond to the above-mentioned steps S205 to S208.

[0301] S411 , the PDF generation task service traverses all pages in the first note, and exports each page to a second PDF file.

[0302] Exemplarily, all pages in the first note can be traversed in a loop and exported to the second PDF file page by page. The following will take the first page in the first note as an example to explain how to export the first page to the second PDF file.

[0303] S412: If the first PDF file includes a second page corresponding to the first page in the first note, and the first page has not changed, insert the second page into the second PDF file.

[0304] Exemplarily, when determining that the first PDF file contains the second page corresponding to the first page in the first note, if the first PDF file has a page whose UUID is the same as the UUID of the first page, the PDF generation task service determines that the first PDF file contains the second page corresponding to the first page in the first note. Then, the PDF generation task service can further determine whether the first page has changed, and if the first page has not changed relative to the second page, reuse the second page in the first PDF file and insert the second page into the second PDF file.

[0305] By reusing the second page in the first PDF file when exporting the first page in the first note to the second PDF file, the number of times the page is generated in real time can be reduced, thereby effectively improving the speed of exporting the PDF file.

[0306] S413. The Java SDK Interface layer calls the insert page function to send a create insert page instruction to the JNI layer.

[0307] In the embodiment of the present application, the second page can be inserted into the second PDF file through the Java SDK Interface layer, the JNI layer and the native pdfium.so layer.

[0308] S414. The JNI layer requests the native pdfium.so layer to insert a page according to the insert page instruction.

[0309] S415, the native pdfium.so layer calls the insert page interface.

[0310] Exemplarily, the native pdfium.so layer calls the insert page interface to insert the second page in the first PDF file into the second PDF file.

[0311] It should be noted that steps S416 to S417 correspond to the above-mentioned step S209.

[0312] S416: If the first PDF file does not include a second page corresponding to the first page, request to create the second page.

[0313] Exemplarily, when the first PDF file does not include a second page corresponding to the first page, the PDF generation task service requests the Java SDK Interface layer to create the second page.

[0314] S417, call the create page function.

[0315] Exemplarily, the Java SDK Interface layer calls a create page function and sends a create page instruction to the JNI layer to instruct the JNI layer to create the second page.

[0316] It should be noted that steps S418 to S420 correspond to the above steps S300 to S302.

[0317] S418: Perform data conversion on the first page.

[0318] It should be noted that step S418 corresponds to the above step S300.

[0319] Optionally, when the JNI layer receives the create page instruction from the Java SDK Interface layer, it may first execute steps S418 to S420 and then execute step S421. Of course, it may also first execute step S421 and then execute steps S418 to S420.

[0320] Exemplarily, the data of the first page in the first note can be converted first. For example, the page data of the JavaSDK Interface layer can be used to initialize the page structure data defined by the JNI layer and the native pdfium.so layer. By converting the data of the first page, it can be ensured that the note content in the first page can be read and used normally between different layers of the business architecture.

[0321] S419: Perform color space conversion on the first page.

[0322] It should be noted that step S419 corresponds to the above step S301. Step S419 is optional and may not be performed.

[0323] Exemplarily, when the first color space used by the first note is different from the second color space used by the PDF file, the JNI layer can also perform color space conversion on the first note. The specific process of performing color space conversion on the first page can refer to the detailed description of step S301 above, which will not be repeated here.

[0324] S420: Perform transparency conversion on the first page.

[0325] It should be noted that step S420 corresponds to the above step S302. Step S420 is optional and may not be performed.

[0326] Exemplarily, the JNI layer may also perform transparency conversion on the bitmap data in the first page. The specific process of performing transparency conversion on the first page may refer to the detailed description of the above step S302, which will not be described in detail here.

[0327] S421. Request to create a page.

[0328] Steps S420 to S421 correspond to the above-mentioned step S209.

[0329] Exemplarily, the JNI layer requests the native pdfium.so layer to create a page, and obtains the second page.

[0330] S422, calling the create page interface.

[0331] The native pdfium.so layer can call the create page interface to create the second page and return the second page to the JNI layer.

[0332] S423. Based on the layer objects in the first page, configure the layer objects in the second page.

[0333] It should be noted that steps S423 to S424 correspond to the above-mentioned steps S211 to S212.

[0334] The JNI layer can configure the layer objects on the second page based on the layer objects on the first page. It should be noted that the specific process of configuring the layer objects on the second page based on the layer objects on the first page can be described in detail in the above steps 303 to 321.

[0335] S424: Insert the second page with the configured layer object into the second PDF file.

[0336] The JNI layer can insert the second page after completing the configuration of the layer object into the second PDF file, and return the second PDF file to the PDF generation task service.

[0337] S425. Save the second PDF file.

[0338] It should be noted that step S425 corresponds to the above-mentioned step S213.

[0339] The PDF generation task service saves the second PDF file and sends a message of saving completion to the UI rendering layer. Accordingly, the UI rendering layer receives the message of saving completion. In some embodiments, the UI rendering layer can prompt the user that the PDF file has been generated, for example, the UI rendering layer prompts the user through text that the PDF file has been generated.

[0340] In order to enable those skilled in the art to more clearly understand the solution of the present application, the application scenario of the technical solution of the embodiment of the present application is first described below.

[0341] See also Fig.16 , Fig.16 Schematic diagram of a main interface of an electronic device provided in an embodiment of the present application. Fig.16 As shown, the electronic device 100 can install various applications (Application, APP), such as note application, map application, camera application, music application, video application and file application. In some embodiments, the user can open the note application on the main interface and add note content through the note application. In addition, the main interface of the electronic device can also display thumbnails of all notes corresponding to the note application, for example, Fig.16 As shown, the thumbnail shows that there are 10 handwritten notes in the note application, and the user can directly add a handwritten note through the "+" button in the thumbnail.

[0342] See also Fig.17 , Fig.17 is a schematic diagram of the main interface of a note-taking application provided in an embodiment of the present application. Fig.17 As shown, the main interface of the note application can display the total number of note contents, which can include text notes and handwritten notes. Among them, handwritten notes refer to notes added by users with various handwriting, text boxes, picture elements and various template backgrounds, and text notes refer to notes containing text content.

[0343] The following will explain how to export a PDF file from a note application in combination with the user's interactive operations on the note application in the interface.

[0344] See also Fig.18 , Fig.18 is a schematic flow chart of a method for exporting note content provided in an embodiment of the present application, such as Fig.18 As shown, the method for exporting note content includes steps S501 to S503.

[0345] Step S501: Display the first interface of the note application, where the first interface includes a new option.

[0346] For example, Fig.16 As shown, when the user opens the note application, the first interface of the note application is displayed on the electronic device, such as Fig.17 The main interface of the note-taking application is shown, wherein the first interface includes a new option, which is used to create a new note.

[0347] Step S502: In response to the first operation on the new option, display the second interface of the newly created first note, where the second interface includes a background image.

[0348] It should be noted that step S502 corresponds to the above step S200.

[0349] For example, the user can Fig.17 The New option in the Create a new handwritten note or text note, called the first note. Of course, users can also use Fig.16 When it is detected that the user triggers the first operation of the new option, the second interface of the newly created first note can be displayed in response to the first operation of triggering the new option, and the second interface includes the background layer object. Fig.19 As shown, the newly created first note is now a blank note, including a background image. Of course, the background of the newly created first note can also be set to the background grid lines; when a PDF file is imported into the first note, the background of the first note is the PDF page.

[0350] Step S503: In response to the second operation of exporting the first note into a file in a preset format, a first file is generated, the first file including a first object and a second object, the first object corresponds to the background image, and the second object corresponds to a preset number of pixels.

[0351] It should be noted that step S503 corresponds to the above-mentioned steps S201 to S213.

[0352] Exemplarily, after creating a new first note, the user can directly export the first note as a preset format file, or can edit the first note and then export it as a preset format file. When exporting a blank first note as a preset format file, the generated first file contains a first object and a second object, wherein the first object corresponds to a background layer object, and the second object corresponds to a preset number of transparent pixels. The preset number is less than the number of pixels of the first interface, wherein the preset number can be set according to actual conditions, and the specific value is not limited. For example, the preset number can be 1 or other values.

[0353] In some embodiments, Fig. 20As shown, the first file includes four objects, which respectively correspond to the background layer object, the element layer object, the highlighter layer object and the handwriting layer object.

[0354] Exemplarily, the first object may be a background layer object, and the second object may be an element layer object, a highlighter layer object, and a handwriting layer object. The preset format file may be a PDF format file, or may be other types of files.

[0355] Exemplarily, the background layer object is one of a background image, a PDF page, or a background grid line.

[0356] In some embodiments, the product of the height and width of the second object is a preset number. Exemplarily, when the height of the second object is 1 and the width is 2, the second object is 2 pixels.

[0357] Exemplarily, based on the fact that the element layer object does not contain a sub-object, the element layer object is set to a preset number of transparent pixels, and the element layer object is used as the second object. For example, the element layer object is set to 1 transparent pixel. Exemplarily, when the highlighter layer object does not contain a sub-object, the highlighter layer object is set to 1 transparent pixel, and the highlighter layer object is used as the second object. When the handwriting layer object does not contain a sub-object, the handwriting layer object is set to 1 transparent pixel, and the handwriting object is used as the second object.

[0358] It should be noted that when the element layer object, highlighter layer object and handwriting layer object in the first note do not contain sub-objects, the element layer object, highlighter layer object and handwriting layer object can be set to a preset number of transparent pixels when generating the first file, so as to achieve the placeholder for the element layer object, highlighter layer object and handwriting layer object in the first file. When the note content is exported to a PDF file again after adding handwriting track content, highlighter track content and element content, it is only necessary to replace the layer object of the corresponding level with the modified layer object, without adding new layer objects, layer object attribute information and adjusting the hierarchical relationship between each layer object, which can avoid the existence of redundant objects in the exported PDF file and solve the problem that the PDF file exported page by page will gradually increase with the number of edits, thereby greatly reducing the size of the PDF file, thereby increasing the speed of exporting PDF files and reducing the storage space occupied by the device.

[0359] In some embodiments, Figure 4As shown, in the first file, the hierarchical order of the four objects is background layer object, element layer object, highlighter layer object and handwriting layer object, wherein the background layer object is the bottom layer and the handwriting layer object is the top layer. The blending modes of the background layer object, element layer object and handwriting layer object are all the first mode, and the blending mode of the highlighter layer object is the second mode, and the first mode is different from the second mode. The first mode refers to a mode in which the top image pixels are covered on the bottom image pixels, and the second mode refers to a mode in which the top image pixels are compared with the bottom image pixels and the image pixels with darker colors are displayed.

[0360] In the above embodiment, by configuring the hierarchical order of each layer object in the first file, not only can the overlay effect of each layer object in the exported first file be ensured to be the same as that in the first note, but also there is no need to configure the hierarchical order of each layer object again when re-exporting the PDF file later, which can effectively improve the speed of exporting the PDF file; by configuring the blending mode of each layer object in the first file, it can be achieved that when the first note is exported to the PDF file again after adding writing track content, highlighter track content or element content, it only needs to update the corresponding sub-objects in the layer object, and there is no need to add the attribute information of the layer object, thereby greatly reducing the size of the PDF file.

[0361] See also Fig.21 , Fig.21 is a schematic flow chart of a second method for exporting note content provided in an embodiment of the present application, such as Fig.21 As shown, after step S503, the method for exporting the note content may further include steps S601 to S604.

[0362] Step S601: display a third interface of the note application, where the third interface includes an identifier of a first note, and the identifier is used to open the first note.

[0363] For example, when the user opens the note application, the third interface of the note application may be displayed, the third interface including an identifier of the first note, the identifier being used to open the first note, wherein the identifier is as follows: Fig.17 The third interface may be the same as the first interface or may be different from the first interface.

[0364] Step S602: In response to a third operation on the mark, display a second interface of the first note.

[0365] It should be noted that step S602 corresponds to the above step S200.

[0366] When the user triggers the mark corresponding to the first note, the second interface of the first note can be displayed, such as Fig.19 shown.

[0367] Step S603: In response to a fourth operation of writing on the second interface, a fourth interface is displayed, where the fourth interface includes a background image and a plurality of writing tracks.

[0368] For example, a user can use Fig.19 Write on the second interface with a pen or pencil, such as Fig. 22 As shown, the fourth interface includes a background image and multiple writing tracks.

[0369] Step S604: In response to the second operation of exporting the first note as a file in a preset format, a second file is generated, the second file includes a first object and a third object, the first object corresponds to a background image, the third object includes multiple sub-objects, and the multiple sub-objects correspond to multiple writing tracks.

[0370] It should be noted that step S604 corresponds to the above-mentioned steps S201 to S213.

[0371] For example, after the user finishes writing in the first note, the user can export the first note into a file in a preset format to obtain a second file. Fig.23 As shown, the handwriting layer object in the second file includes multiple writing tracks, and the element layer object and the highlighter layer object are preset numbers of transparent pixels. For example, the element layer object and the highlighter layer object are both 1 transparent pixel.

[0372] In the above embodiment, when the first note is exported to a PDF file again after adding a writing track, it only needs to update the corresponding sub-object in the handwriting layer object, and there is no need to add the attribute information of the handwriting layer object, thereby greatly reducing the size of the PDF file.

[0373] See also Fig.24 , Fig.24 is a schematic flow chart of sub-steps for generating a first file provided in an embodiment of the present application, such as Fig.24 As shown, step S503 may include steps S701 to S703.

[0374] Step S701: Create a second PDF file.

[0375] It should be noted that step S701 corresponds to the above step S202.

[0376] Exemplarily, when exporting the first note to a file in a preset format, a new PDF file, referred to as a second PDF file, may be created first.

[0377] Step S702: If the first PDF file contains a second page corresponding to the first page in the first note and the first page has not changed relative to the second page, then the second page is inserted into the second PDF file, the first page includes all pages in the first note, and the universal unique identifier of the second page is the same as the universal unique identifier of the first page.

[0378] In an embodiment of the present application, the note application can import a first PDF file, and the first PDF file is a file that was last exported from the first note in PDF format. It should be noted that in the scenario where the first note is saved as a PDF file again after the first note in the note application is exported as a PDF file, the PDF page in the first PDF file that was last exported from the first note can be imported into the second PDF file, and then the PDF page in the second PDF file is updated based on the page content in the first note, so as to reuse the PDF page, reduce the number of real-time page generation times, and thus effectively improve the speed of exporting the PDF file. The following will take the example of saving the first note in the note application as a first PDF file and then saving the first note as a PDF file again as an example. Since there are multiple pages that need to be exported for the first note, for the sake of convenience, each page in the first note can be determined as the first page in turn. The following will take the first page as an example to explain how to export the first page to a PDF file, and the method of exporting other pages in the first note to a PDF file is the same as the method of exporting the first page to a PDF file.

[0379] Exemplarily, step S702 corresponds to Figure 3 In step S206 to step S208, when inserting the second page into the second PDF file, it can be determined whether the first PDF file contains the second page corresponding to the first page in the first note. When the first PDF file contains the second page corresponding to the first page in the first note, it is determined whether the first page has changed. If the first page has not changed relative to the second page, the second page is inserted into the second PDF file. The second page refers to the page in the first PDF file whose UUID is the same as the UUID of the first page.

[0380] It should be noted that, by judging whether there is a second page in the first PDF file that is identical to the first page in the first note, when there is a second page in the first PDF file that is identical to the first page in the first note and the content in the first page has not changed relative to the content in the second page, the second page can be reused and directly inserted into the second PDF file to achieve exporting the first page in the first note to the second PDF file. By reusing the corresponding pages in the first PDF file, the number of times pages are generated in real time can be reduced, thereby effectively improving the speed of exporting PDF files.

[0381] In some embodiments, if the first PDF file does not contain the second page, a second page is created, a layer object is configured for the second page based on the layer object in the first page, and the second page with the configured layer object is inserted into the second PDF file. Figure 3 The specific process of layer object configuration in steps S206, S208, S211 and S212 can be referred to the detailed description of the above embodiment and will not be described in detail here.

[0382] In other embodiments, Figure 3 As shown in steps S206, S207, S210, S211 and S212 in the first PDF file, if the first PDF file contains the second page and the first page changes relative to the second page, the background image in the first PDF file is used as the background layer object in the second page, the layer object of the second page is configured based on the layer object in the first page, and the second page with the configured layer object is inserted into the second PDF file. It should be noted that the embodiment of the present application corresponds to the above Figure 3 The specific process of layer object configuration in steps S206, S207, S210, S211 and S212 can be referred to the detailed description of the above embodiment and will not be described in detail here.

[0383] Among them, configuring the layer object of the second page based on the layer object in the first page may include: if the background layer object of the first page is a PDF page, adding the second page to the second PDF file; configuring the element layer object of the third page in the second PDF file according to the element layer object in the first page, configuring the highlighter layer object of the third page according to the highlighter layer object in the first page, and configuring the handwriting layer object of the third page according to the handwriting layer object in the first page, the third page being a page obtained by adding the second page to the second PDF file.

[0384] For example, Figure 5 As shown in steps S303 to S314 in , when determining whether the background layer object of the first page is a PDF page, the second page is added to the second PDF file. Of course, other pages in the first PDF file can also be exported to the second PDF file. When the second page is added to the second PDF file, the above-mentioned object reuse logic can be used to realize the reuse of sub-objects in different PDF pages.

[0385] After the second page is added to the second PDF file, the element layer object configuration, the highlighter layer object configuration, and the handwriting layer object configuration can be performed on the third page in the second PDF file, respectively. Exemplarily, the element layer object configuration is performed on the third page in the second PDF file, and it can be determined whether the third page corresponding to the second page of the first PDF file in the second PDF file has the last element layer object. When the third page does not have the last element layer object, the element layer object is set in the third page, wherein the specific process of setting the element layer object in the third page can refer to the detailed description of the above step S307. When the third page has the last element layer object, the element layer object in the third page is updated, wherein the specific process of updating the element layer object in the third page can refer to the detailed description of the above step S308. In addition, the specific process of the highlighter layer object configuration can refer to the detailed description of the above steps S309 to S311, and the specific process of the handwriting layer object configuration can refer to the detailed description of the above steps S312 to S314, which will not be repeated here.

[0386] Step S703: Generate a first file according to the second PDF file.

[0387] It should be noted that step S703 corresponds to the above-mentioned step S213.

[0388] Exemplarily, when all pages in the first note have not changed relative to the corresponding pages in the first PDF file, the pages in the first PDF file can be inserted into the second PDF file, and then the obtained second PDF file is determined as the first file. When the first page changes relative to the second page in the first PDF file, it is necessary to configure the layer object of the second page based on the layer object in the first page, and insert the second page with the configured layer object into the second PDF file. Of course, the second page can also be added to the second PDF file first, and then the layer object of the third page in the second PDF file can be configured based on the layer object in the first page, and the second PDF file with the configured layer object can be determined as the first file.

[0389] In an application scenario, such as Fig.25 As shown, the interface of the first note includes text content, a background image, and a toolbar, wherein the toolbar may include buttons such as pen, pencil, highlighter, insert text, insert formula, erase, insert picture, zoom in, and settings. For example, a user can insert a picture into the first note through the insert picture button. In addition, the user can use a pen or pencil to add handwritten text or handwritten tracks to the first note, or use a highlighter to highlight part of the content in the first note, and so on.

[0390] In an application scenario, such as Fig.26 As shown, the toolbar may also include buttons such as edit, share, favorite, and delete. After completing the editing of the first note, the user may trigger the share button to share the first note as a document or a picture. The document may be a PDF file, or other types of files.

[0391] In another application scenario, Fig. 27 As shown, the user can choose to share the first note as a PDF file. In some embodiments, the user can also share the edited first note via Bluetooth, WLAN direct connection, email, etc., and can also share the edited first note to nearby devices. In some embodiments, the user can save the first note, print the first note, and add the first note to the collection space.

[0392] In another application scenario, Fig.28 As shown, users can import PDF files into the note application through the import button; Fig. 27 As shown in the figure, after completing the editing of the PDF file in the note application, the user can trigger the save button to save the edited PDF file as a new PDF file. Of course, the user can also share the edited PDF file via Bluetooth, WLAN, email, etc., and can also share the edited PDF file to nearby devices.

[0393] Some embodiments of the present application provide an electronic device, which may include: a touch screen, a memory, and one or more processors. The touch screen, the memory, and the processor are coupled. The memory is used to store computer program code, and the computer program code includes computer instructions. When the processor executes the computer instructions, the electronic device can perform the various functions or steps performed by the electronic device in the above method embodiment. The structure of the electronic device can refer to Figure 1a The structure of the electronic device 100 is shown.

[0394] The present application also provides a chip system, such as Fig.29 As shown, the chip system includes at least one processor 1101 and at least one interface circuit 1102. The processor 1101 and the interface circuit 1102 can be interconnected via lines. For example, the interface circuit 1102 can be used to receive signals from other devices (such as a memory of an electronic device). For another example, the interface circuit 1102 can be used to send signals to other devices (such as a processor 1101 or a touch screen of an electronic device). Exemplarily, the interface circuit 1102 can read instructions stored in the memory and send the instructions to the processor 1101. When the instruction is executed by the processor 1101, the electronic device can execute the various steps in the above embodiments. Of course, the chip system may also include other discrete devices, which are not specifically limited in the embodiments of the present application.

[0395] An embodiment of the present application also provides a computer-readable storage medium, which includes computer instructions. When the computer instructions are executed on the above-mentioned electronic device, the electronic device executes each function or step executed by the electronic device in the above-mentioned method embodiment.

[0396] The embodiment of the present application also provides a computer program product. When the computer program product is run on an electronic device, the electronic device executes each function or step executed by the electronic device in the above method embodiment.

[0397] Among them, the electronic device (such as a tablet, a mobile phone, etc.), computer-readable storage medium, computer program product or chip provided in this embodiment is used to execute the corresponding method provided above. Therefore, the beneficial effects that can be achieved can refer to the beneficial effects in the corresponding method provided above, and will not be repeated here.

[0398] Through the description of the above implementation methods, technical personnel in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional modules is used as an example. In actual applications, the above-mentioned functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above.

[0399] In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic, for example, the division of modules or units is only a logical function division, and there may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another device, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0400] The units described as separate components may or may not be physically separated, and the components shown as units may be one physical unit or multiple physical units, that is, they may be located in one place or distributed in multiple different places. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.

[0401] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0402] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a readable storage medium. Based on this understanding, the technical solution of the embodiment of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium, including several instructions to enable a device (which can be a single-chip microcomputer, chip, etc.) or a processor (processor) to perform all or part of the steps of the various embodiments of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read only memory (ROM), random access memory (RAM), disk or optical disk and other media that can store program code.

[0403] The above contents are only specific implementation methods of the present application, but the protection scope of the present application is not limited thereto. Any changes or substitutions within the technical scope disclosed in the present application shall be included in the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.

Claims

1. A method for exporting note content, characterized in that: The method comprises: Display a first interface of the note application, wherein the first interface includes a new option; In response to a first operation on the new creation option, displaying a second interface of the newly created first note, wherein the second interface includes a background image and does not include a writing track; In response to a second operation of exporting the first note into a file in a preset format, generating a first file, the first file including a first object and a second object, the first object corresponding to the background image, and the second object corresponding to a preset number of pixels; Displaying a third interface of the note application, wherein the third interface includes an identifier of the first note, and the identifier is used to open the first note; In response to a third operation on the identifier, displaying the second interface of the first note; In response to a fourth operation of writing on the second interface, displaying a fourth interface, wherein the fourth interface includes the background image and a plurality of writing tracks; In response to a second operation of exporting the first note as a file in a preset format, a second file is generated, the second file contains the first object and the third object, the second file does not contain the second object, the first object corresponds to the background image, the third object includes multiple sub-objects, and the multiple sub-objects correspond to the multiple writing tracks.

2. The method for exporting note content according to claim 1, characterized in that: The product of the height and width of the second object is the preset number.

3. The method for exporting note content according to claim 1, characterized in that: The first file includes four objects, which respectively correspond to a background layer object, an element layer object, a highlighter layer object, and a handwriting layer object.

4. The method for exporting note content according to claim 3, characterized in that: The hierarchical order of the four objects is background layer object, element layer object, highlighter layer object and handwriting layer object, wherein the background layer object is the bottom layer and the handwriting layer object is the top layer; The blending modes of the background layer object, the element layer object and the handwriting layer object are all the first mode, and the blending mode of the highlighter layer object is the second mode, and the first mode is different from the second mode.

5. The method for exporting note content according to claim 3, characterized in that: Based on the fact that the element layer object does not contain any sub-object, the element layer object is set to a preset number of transparent pixels, and the element layer object is used as the second object.

6. The method for exporting note content according to claim 3, characterized in that: The background layer object includes one of a background image, a PDF page, and a background grid line.

7. The method for exporting note content according to claim 1, characterized in that: The note application is capable of importing a first PDF file, where the first PDF file is a file that was last exported from the first note into PDF format; In response to the second operation of exporting the first note into a file in a preset format, generating a first file includes: Create a second PDF file; If the first PDF file includes a second page corresponding to a first page in the first note and the first page is unchanged relative to the second page, inserting the second page into the second PDF file, the first page includes all pages in the first note, and the universal unique identifier of the second page is the same as the universal unique identifier of the first page; The first file is generated according to the second PDF file.

8. The method for exporting note content according to claim 7, characterized in that: The method further comprises: If the first PDF file does not include the second page, creating the second page, configuring the layer objects for the second page based on the layer objects in the first page, and inserting the second page with the configured layer objects into the second PDF file; If the first PDF file includes the second page and the first page changes relative to the second page, the background image in the first PDF file is used as the background layer object in the second page, the layer object of the second page is configured based on the layer object in the first page, and the second page with the configured layer object is inserted into the second PDF file.

9. The method for exporting note content according to claim 8, characterized in that: The layer objects include a background layer object, an element layer object, a fluorescent pen layer object and a handwriting layer object; The configuring the layer objects of the second page based on the layer objects in the first page includes: If the background layer object of the first page is a PDF page, adding the second page to the second PDF file; The third page in the second PDF file is configured with element layer objects according to the element layer objects in the first page, the third page is configured with fluorescent pen layer objects according to the fluorescent pen layer objects in the first page, and the third page is configured with handwriting layer objects according to the handwriting layer objects in the first page, and the third page is a page obtained by adding the second page to the second PDF file.

10. The method for exporting note content according to claim 8, characterized in that: Before configuring the layer objects of the second page based on the layer objects in the first page, the method further includes: Performing color space conversion on the first page; The configuring the layer objects of the second page based on the layer objects in the first page includes: The layer objects of the second page are configured based on the layer objects in the first page after the color space conversion.

11. The method for exporting note content according to claim 10, characterized in that: The converting the color space of the first page includes: Determine a target color component pair to be converted in the first page, where the target color component pair is a color component whose position is interchanged between a first color space adopted by the first page and a second color space adopted by the second PDF file; Color component conversion is performed on the bitmap data on the element layer object, the fluorescent pen layer object, and the handwriting layer object in the first page according to the target color component pair.

12. The method for exporting note content according to claim 8, characterized in that: Before configuring the layer objects of the second page based on the layer objects in the first page, the method further includes: Performing transparency conversion on the first page; The configuring the layer objects of the second page based on the layer objects in the first page includes: The second page is configured with layer objects based on the layer objects in the first page after the transparency conversion.

13. The method for exporting note content according to claim 12, characterized in that: The performing transparency conversion on the first page includes: Obtaining the transparency ratio corresponding to the bitmap data of each layer object in the first page; The color component corresponding to the pixel point of the bitmap data is divided by the transparency ratio.

14. An electronic device, characterized in that: include: a memory and a processor, the memory being coupled to the processor; The memory stores program instructions, and when the program instructions are executed by the processor, the electronic device executes the method according to any one of claims 1 to 13.

15. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the processor implements the method according to any one of claims 1 to 13.

Citation Information

Patent Citations

  • Writing note data storage method and device, terminal and storage medium

    CN108763320A

  • Page display method, electronic equipment and storage medium

    CN117421088A