PDF document screenshot method
By using pre-configured PDF document templates and keyword parameters, the system automatically locates and batches target areas in PDF documents, solving the problems of low screenshot efficiency and poor consistency in existing technologies. This achieves efficient and accurate batch screenshots, applicable to various document types and fields.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-18
- Publication Date
- 2026-03-10
AI Technical Summary
In the existing technology, PDF document screenshotting is inefficient, cumbersome to operate manually, and the technical problems that cannot be effectively solved are: in the existing technology, PDF document screenshotting is inefficient, cumbersome to operate manually, and the screenshot results are inconsistent, which affects subsequent analysis and processing.
By using pre-configured PDF document templates and employing target keywords and screenshot area parameters, the system can automatically locate and batch-capture target areas within PDF documents, achieving efficient and accurate batch screenshots of documents or multiple documents.
It enables efficient and accurate batch screenshotting of PDF documents, reduces human error, improves screenshot efficiency and consistency, simplifies user operations, and is suitable for various document types and fields.
Smart Images

Figure CN121639705A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] One or more embodiments of the present specification relate to the technical field of data processing, in particular to a PDF document screenshot method. BACKGROUND
[0002] A PDF (Portable Document Format) file belongs to a layout document, and pages are relatively independent, so that the document layout can be accurately described and the document layout can be presented. In document processing such as medical test reports, contract review, test paper review, financial statements, etc., users often need to capture image regions related to specific indicators or clauses.
[0003] In some related technologies, users manually search for keywords through a PDF reader, browse the pages where the keywords are located one by one, manually determine the target region, and then use a screenshot tool to capture and save as pictures one by one. SUMMARY
[0004] One or more embodiments of the present specification describe a PDF document screenshot method.
[0005] In a first aspect of the present specification, a PDF document screenshot method is provided. The method includes obtaining a user screenshot request, the user screenshot request including a target keyword, a PDF document template, and one or more target PDF documents, the PDF document template being configured with a plurality of groups of screenshot region parameters determined based on different keywords, and the target PDF documents having the same format as the PDF document template. The method includes locating a plurality of target screenshot regions from the one or more target PDF documents based on the target keyword and the PDF document template. In addition, the method includes batch generating a plurality of screenshots based on the plurality of target screenshot regions.
[0006] In a second aspect of the present specification, a PDF document screenshot device is provided. The device includes an acquisition module configured to obtain a user screenshot request, the user screenshot request including a target keyword, a PDF document template, and one or more target PDF documents, the PDF document template being configured with a plurality of groups of screenshot region parameters determined based on different keywords, and the target PDF documents having the same format as the PDF document template. The device includes a positioning module configured to locate a plurality of target screenshot regions from the one or more target PDF documents based on the target keyword and the PDF document template. In addition, the device includes a generation module configured to batch generate a plurality of screenshots based on the plurality of target screenshot regions.
[0007] In a third aspect of this specification, an electronic device is provided. This electronic device includes a processor and a memory, the processor being connected to the memory. The memory stores executable program code. The processor reads the executable program code stored in the memory to run a program corresponding to that executable program code, in order to perform the methods described above.
[0008] In a fourth aspect of this specification, a computer-readable storage medium is provided having a computer program stored thereon that, when executed by a processor, implements the methods described above.
[0009] It should be understood that the description in the Summary of the Invention section is not intended to limit the key or essential features of the embodiments of this disclosure, nor is it intended to restrict the scope of this disclosure. Other features of this disclosure will become readily apparent from the following description. Attached Figure Description
[0010] To more clearly illustrate the technical solutions in the embodiments of this specification, the accompanying drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this specification. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0011] Figure 1 A schematic diagram of an example environment in which several embodiments of this specification may be implemented is shown;
[0012] Figure 2 Flowcharts illustrating PDF document screenshot methods of some embodiments of this specification are shown;
[0013] Figure 3 A schematic diagram illustrates an example process for configuring a PDF document template according to some embodiments of this specification;
[0014] Figure 4 A schematic diagram illustrates an example process for batch screenshotting PDF documents according to some embodiments of this specification;
[0015] Figure 5a A schematic diagram of an example document page is shown, illustrating the location of a target screenshot area on a page of a PDF document according to some embodiments of this specification;
[0016] Figure 5b It shows Figure 5a An example screenshot of a Chinese document page;
[0017] Figure 6a This illustration shows a schematic diagram of another example document page for locating a target screenshot area on a page of a PDF document according to some embodiments of this specification;
[0018] Figure 6b It shows Figure 6a Another example screenshot of a Chinese document page;
[0019] Figure 7 A schematic diagram of another example process for configuring a PDF document template according to some embodiments of this specification is shown;
[0020] Figure 8 A schematic diagram of another example process for batch taking screenshots of PDF documents according to some embodiments of this specification is shown;
[0021] Figure 9a This illustration shows a schematic diagram of another example document page for locating a target screenshot area on a page of a PDF document according to some embodiments of this specification;
[0022] Figure 9b It shows Figure 9a Another example screenshot of a Chinese document page;
[0023] Figure 10 A schematic diagram of a display interface for batch screenshots after taking screenshots according to some embodiments of this specification is shown;
[0024] Figure 11 A schematic diagram illustrating a process for generating a report based on a screenshot according to some embodiments of this specification is shown;
[0025] Figure 12 Example block diagrams of PDF document screenshot devices according to some embodiments of this specification are shown. Detailed Implementation
[0026] The technical solutions in the embodiments of this specification will be clearly and completely described below with reference to the accompanying drawings.
[0027] The terms "first," "second," "third," etc., in the description, claims, and accompanying drawings are used to distinguish different objects, not to describe a specific order. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or apparatus that includes a series of steps or units is not limited to the listed steps or units, but may optionally include steps or units not listed, or may optionally include other steps or units inherent to such processes, methods, products, or apparatus.
[0028] As mentioned above, PDF documents are a common file format widely used in work and daily life. In some related technologies, users open a PDF document with a PDF reader, manually search for keywords, and browse the pages containing those keywords to determine the target screenshot area. Once determined, they manually select the area using a screenshot tool, capture the screenshot, and save it as an image. Then, they continue browsing subsequent pages and taking screenshots in the same manner. When a PDF document contains multiple target screenshot areas, this process needs to be repeated multiple times to capture all areas. The more pages a PDF document has, the more times it needs to be captured, resulting in low efficiency. If the same area needs to be captured from multiple PDF documents of the same format, it requires manual operation for each file and each keyword, leading to extremely low efficiency. Furthermore, due to manual screenshotting, even images with the same content will differ in appearance because the position and size of the selected screenshot area vary each time. Additionally, when subsequent analysis is performed based on these screenshots to generate related reports, the differences in the images necessitate fine-tuning the report layout according to the screenshots.
[0029] Other related technologies utilize scripts that compile screenshot code to capture target areas of PDF documents. While this can automate the process, it requires compiling corresponding code for each different screenshot area. During batch screenshotting, the PDF document is traversed page by page, locating a specific screenshot area and performing the screenshot operation, repeating this process until all areas are captured, resulting in low efficiency. If the screenshot results are problematic, the code needs to be adjusted and the screenshot operation re-executed, making the overall process complex. Furthermore, script compilation requires a high level of user expertise, making it unsuitable for all users.
[0030] Therefore, this specification proposes a PDF document screenshotting scheme. This specification utilizes a pre-configured PDF document template to perform batch screenshots of target PDF documents with the same format as the template, either within the document itself or across multiple documents. Specifically, target keywords are used to locate the approximate location of the area to be screenshotted within all pages of the document. Combined with screenshot area parameters, the specific target screenshot area can be located, thus determining the screenshot location and size. This allows for batch screenshotting based on all located screenshot areas.
[0031] This method utilizes pre-configured PDF document templates with pre-defined keywords and screenshot area parameters to automatically locate target screenshot areas in a PDF document. It automates efficient and accurate batch screenshotting of multiple areas within a document and across multiple areas within a document. Furthermore, this method is simple to implement and highly versatile. Users simply input keywords, select a PDF document template, and upload the target PDF document. The system then outputs batch screenshots that meet the user's requirements upon request, resulting in high screenshot efficiency. Additionally, screenshots of the same type capture consistent positions and ranges, which is beneficial for subsequent document analysis and processing.
[0032] Figure 1 A schematic diagram of an example environment 100 in which several embodiments of this specification may be implemented is shown. (See attached diagram.) Figure 1 As shown, environment 100 includes computing device 104, which is configured with PDF screenshot software to respond to user screenshot requests and perform screenshot operations. This computing device 104 can be a desktop computer, laptop computer, tablet computer, handheld device, mobile phone, or other similar device. Figure 1 As shown, user 102 inputs information to computing device 104, for example, uploading a PDF document 106 (i.e., the target PDF document referred to herein) to be screenshotted using client software, inputting target keywords 108 via keyboard, and selecting a PDF document template 112 from PDF template library 110 (or uploading a PDF document template). PDF template library 110 pre-stores multiple PDF document templates in different formats. In some implementations, different PDF document templates are configured according to different application scenarios, such as contract document templates, medical testing document templates, financial document templates, etc. Furthermore, various templates are further subdivided according to the type of document content; for example, medical testing document templates may include chromatographic analysis document templates, mass spectrometry identification document templates, bioanalytical document templates, etc. Each PDF document template is configured with multiple sets of screenshot area parameters determined based on different keywords; for example, keyword 1 corresponds to screenshot area parameter 1, and keyword N corresponds to screenshot area parameter N.
[0033] like Figure 1 As shown, after the user inputs the above information and confirms the screenshot operation, the computing device 104 obtains the user's screenshot request and responds to the request to execute an automated screenshot operation. First, based on the target keyword 108, the screenshot area parameter 114 corresponding to the target keyword is matched from the PDF document template 112. For example, if the target keyword 108 is the same as keyword 1, the matched screenshot area parameter 114 is screenshot area parameter 1. Next, based on the target keyword 108 and the screenshot area parameter 114, the target screenshot area 116 is located for one or more target PDF documents. Then, a batch screenshot operation is performed on all target screenshot areas 116 in one or more target PDF documents to obtain all screenshots 118 (one dashed box corresponds to one target PDF document). The client software of the computing device displays all screenshots 118 on the interface to show to the user 102. The user 102 can also download all screenshots 118 in image format (such as PNG or JPG) and save images belonging to the same target PDF document in a folder or compressed package (see Figure 120, all images are downloaded together).
[0034] This method enables responses to user screenshot requests, utilizing pre-configured PDF document templates with pre-defined screenshot area parameters to automate a standardized batch screenshot process for single or multiple target documents, resulting in high screenshot efficiency. Furthermore, the embodiments described in this manual are user-friendly and easy to operate. By inputting information according to requirements, users can locate the screenshot areas of all relevant pages within a document using keywords and PDF document templates, and concurrently perform batch screenshots of all pages, providing a user-friendly and excellent experience.
[0035] Figure 2 A flowchart illustrating a PDF document screenshot method 200 according to some embodiments of this specification is shown. Method 200 can, for example, be derived from... Figure 1 The computing device 104 in the environment 100 shown performs the operation. For example... Figure 2 As shown in box 202, method 200 can obtain a user screenshot request. The user screenshot request includes target keywords, a PDF document template, and one or more target PDF documents. The PDF document template is configured with multiple sets of screenshot area parameters determined based on different keywords. The target PDF documents and the PDF document template have the same format. The same format mainly refers to consistent layout styles, including identical page settings, font and paragraph styles, consistent heading and body text levels, identical headers and footers, consistent chart and object formats, consistent style templates, and identical text formats. For example, the target PDF documents and their corresponding PDF document templates are of the same type, such as report documents of the same detection type, such as chromatographic analysis document templates, mass spectrometry identification document templates, and bioanalytical document templates. In one example, instrument A can perform four types of detection: A, B, C, and D, and can obtain four types of report documents. The format of each type of report document is fixed, but the formats of different types of report documents are different, requiring the configuration of corresponding PDF document templates for the four types of report documents. When performing operations on the target PDF document, it is necessary to select a PDF document template of the same type according to the type of the target PDF document. For example, a category A PDF document template can be selected for the target PDF document. In some implementations, the user selects a PDF document template on the computing device's client, uploads the target PDF document to be screenshotted and keywords, and then initiates a screenshot request. The computing device receives and parses the user's screenshot request and performs subsequent screenshot operations.
[0036] In some implementations, the computing device 104 responds to user requests for screenshots of different types of documents by pre-configuring screenshot area parameters for each document type and saving them as PDF document templates. Based on subsequent data processing needs, keywords that can locate the screenshot position are determined, and the screenshot starting point and size are determined based on these keywords (i.e., the screenshot area parameters are determined). Different screenshots are configured with a keyword and its corresponding screenshot area parameters.
[0037] In box 204, method 200 can locate multiple target screenshot regions from one or more target PDF documents based on target keywords and PDF document templates. In some implementations, screenshot region parameters corresponding to the target keywords are matched from the PDF document template. The target keywords are searched in the target PDF documents, and the areas near the target keywords are located as target screenshot regions according to the screenshot region parameters, thereby locating multiple target screenshot regions from multiple pages of a target PDF document. In other implementations, multiple target PDF documents are processed in parallel according to the previous implementation, locating multiple target screenshot regions from multiple pages of each document. Alternatively, each target PDF document is processed sequentially according to the previous implementation, locating multiple target screenshot regions from multiple pages of each document.
[0038] In one or more embodiments of this specification, there may be multiple target keywords. Different screenshot area parameters are matched from the PDF document template based on different target keywords, and then the screenshot process is executed sequentially for each target keyword. In one example, target keyword 1 is searched in the target PDF document, and the area near target keyword 1 is located as the target screenshot area according to screenshot area parameter 1. One or more target screenshot areas are located in one target PDF document in this way, and screenshots are taken in batches. Then, target keyword 2 is searched in the target PDF document, and the area near target keyword 2 is located as the target screenshot area according to screenshot area parameter 2. One or more target screenshot areas are located in one target PDF document in this way, and screenshots are taken in batches. This process is repeated until the relevant areas of all target keywords are screenshotted.
[0039] In one or more embodiments of this specification, to ensure accurate screenshot area positioning, auxiliary keywords can be used for query positioning. The screenshot request also includes one or more auxiliary keywords, mainly used to uniquely locate the target screenshot by combining with the target keyword, excluding screenshots with the same target keyword that do not meet the user's needs. Then, based on the screenshot area parameters, the area near the target keyword is located as the target screenshot area. This method is used to locate multiple target screenshot areas from multiple pages of a target PDF document. Furthermore, the positioning of target screenshot areas for multiple target PDF documents can be processed sequentially or in parallel according to the single document positioning process.
[0040] In box 206, method 200 can generate multiple screenshots in batches based on multiple target screenshot regions. In some implementations, multiple screenshot operations are performed concurrently on multiple target screenshot regions located within the same target PDF document to generate multiple screenshots in batches. Subsequently, multiple target screenshot regions located in other target PDF documents are sequentially batch-captured. In some implementations, multiple target PDF documents are batch-captured in parallel using multi-threading.
[0041] This method enables automated and standardized batch screenshotting of target areas in one or more target PDF documents using target keywords and PDF document templates. It is highly efficient and user-friendly.
[0042] Figure 3 A schematic diagram of an example process 300 for configuring a PDF document template according to some embodiments of this specification is shown. This process 300 can, for example, be configured by... Figure 1 The computing device 104 in the environment 100 shown performs the operation. For example... Figure 3As shown, process 300 can acquire one or more standardized PDF documents as standardized templates 302-1, ..., 302-n. In some examples, users upload different types of standardized PDF documents to the client, and the computing device uses the received standardized PDF documents as standardized templates, each template corresponding to a fixed format. Process 300 can configure keywords and their corresponding screenshot area parameters for each standardized PDF document. The screenshot area parameters include an initial offset and a screenshot area size. For example, standardized template 1 is configured with box 304-1, configuring multiple sets of screenshot area parameters, each set corresponding to a keyword. Standardized templates 2 through n each have their own screenshot area parameter configurations. In some implementations, the user inputs the initial offset (Δx, Δy) and the screenshot area size, including width and height, through the client interface. The initial offset refers to the offset (unit: pt) required from the keyword's location to the screenshot start point. For example, (Δx, Δy) = (0, 0), then the keyword's location is the screenshot start point. For example, if (△x, △y) = (-20, 30), then the screenshot starting point is 20pt to the left and 30pt down from the keyword's location. After configuring the screenshot area parameters for each keyword, the screenshot area parameters for each keyword are saved, and then the standardized PDF document with all configurations is saved as a PDF document template. This process 300 can generate preview screenshots 306-1, ... 306-n based on the keywords and their corresponding screenshot area parameters. A screenshot preview is performed on each standardized PDF document with configured screenshot area parameters. In some implementations, if the user is not satisfied with the preview screenshot, they can adjust the input parameters or use the mouse to adjust the range of the screenshot area. The system automatically calculates the initial offset and the screenshot area size. The computing device receives the re-input or recalculated parameters, responds to user feedback, and adjusts the screenshot area parameters. If the preview is satisfactory, the user confirms the saving of the screenshot area parameters on the interface, and the computing device responds to the user's confirmation command and saves the screenshot area parameters. After configuring all keywords and their screenshot area parameters, save the configured standardized PDF document as PDF document template 308-1, ..., 308-n.
[0043] Through the aforementioned template-based configuration, the embodiments in this specification ensure the uniformity of the target screenshot area's position and size, avoiding human error. Furthermore, the templates can be flexibly configured to meet the needs of cross-domain and cross-document types, and once configured, can be reused long-term, adapting to the processing of the same type of document. In addition, the preview function during configuration provides feedback on parameter adjustments, allowing users to intuitively determine whether the screenshot area meets their expectations. This user-friendly interface enables accurate and satisfactory template configuration, facilitating subsequent efficient and standardized batch screenshotting.
[0044] Figure 4A schematic diagram of an example process 400 for batch screenshotting of PDF documents according to some embodiments of this specification is shown. This process 400 can, for example, be performed by... Figure 1 The process 400 is executed by computing device 104 in the environment 100 shown. This process 400 is illustrated using the example of taking a screenshot of a target PDF document. The process of taking screenshots of multiple different content areas of a target PDF document based on multiple target keywords, as well as the process of batch screenshotting multiple target PDF documents, can be referred to in the following ways. Figure 4 Example execution. (e.g.) Figure 4 As shown, in box 402, this process can obtain a user screenshot request. In box 404, the user screenshot request is parsed. In some implementations, the user screenshot request includes a target keyword, a PDF document template, and a target PDF document. In box 404, based on the target keyword, a screenshot area parameter corresponding to the target keyword is matched from the PDF document template. For example, if the target keyword matches keyword N in the PDF document template, then the screenshot area parameter N is determined to be the matched screenshot area parameter. In box 408, this process 400 can search for the target keyword in the target PDF document and determine the keyword K. 目标 The screenshot request includes all pages, which can be a single page or multiple pages, such as page 1, page 5, ..., page n. To ensure that the area the user wants to screenshot is located, the screenshot request also includes one or more auxiliary keywords K. 辅助 This is used to locate the target PDF document in conjunction with the target keyword. When the target keyword appears multiple times in the document, the auxiliary keyword is used to narrow down the scope, ensuring unique and accurate positioning. In some examples, the target keyword that is located on the same page as one or more auxiliary keywords is found in the target PDF document. In box 410, this process 400 can locate the target screenshot area based on the screenshot area parameters of the target keyword. In some implementations, the starting point coordinates are obtained by offsetting according to the initial offset in the screenshot area parameters, starting from the coordinates of the page where the queried target keyword is located, and then combined with the area size in the screenshot area parameters, the screenshot area is expanded to the lower right from the starting point located in the upper left corner to a preset area size. At this time, the screenshot area is the target screenshot area. In one or more embodiments of this specification, when multiple identical target keywords and auxiliary keywords appear on the same page, the screenshot starting point coordinates are calculated based on the reference of the first target keyword on the page, and then the target screenshot area is located.
[0045] Figure 5a This illustration shows a sample document page illustrating the location of a target screenshot area on a page of a PDF document according to some embodiments of this specification. Figure 5b It shows Figure 5a This is an example screenshot of a Chinese document page. Figure 5aThe document page displays a biological experiment testing report, with marker 502 pointing to the target keyword "K4125164". The user selects a PDF document template for biological experiment testing on the client, uploads the target PDF document, and enters the target keyword "K4125164". The computing device receives the user's screenshot request and processes it accordingly. Figure 2 The illustrated process executes an automated, standard screenshot procedure. The computing device searches for the target PDF document based on the target keyword, finding the target keyword 502 on page 6 and obtaining its coordinates. Based on the initial offset, the screenshot starting point 504 is calculated. Then, the target screenshot area 506 is located according to the screenshot area size. A screenshot is taken based on the located target screenshot area 506, ultimately yielding the desired result. Figure 5b The screenshot shown. When multiple target PDF documents are captured in batch, multiple screenshots can be obtained. Figure 5b The screenshots shown are in a uniform format. Furthermore, when configuring the template, the embodiments in this manual can be referred to. Figure 5a and Figure 5b The example shown is for understanding. Figure 5b This can be understood as a preview screenshot. Once the user is satisfied with the preview screenshot, the screenshot area parameters related to the target keyword "K4125164" are saved.
[0046] Figure 6a This illustration shows another example document page illustrating the location of a target screenshot area on a page of a PDF document according to some embodiments of this specification. Figure 6b It shows Figure 6a Another example screenshot of a Chinese document page is shown. Figure 6a This document page displays a biological experiment test report, which is related to... Figure 5b The difference is Figure 6a The text contains multiple instances of the same target keyword "K4125164". Users who want to obtain... Figure 5b For the same screenshot, the client also needs to input the auxiliary keyword "electrophoresis". The computing device obtains the user's screenshot request and follows... Figure 2 The process shown executes an automated, standard screenshot procedure. The computing device searches for the target PDF document based on the target keyword and auxiliary keyword 602-2. Multiple target keywords are found on page 6. Using auxiliary keyword 602-2, the first occurrence of the target keyword 602-1 on the current page is accurately located, and its coordinates are obtained. The screenshot starting point 604 is calculated based on the initial offset. Then, the target screenshot area 606 is located according to the screenshot area size. A screenshot is taken based on the located target screenshot area 606, ultimately yielding the desired result. Figure 6b The screenshot shown is provided. Furthermore, when configuring the template, the embodiments in this manual can be referred to. Figure 6a and Figure 6b The example shown is for understanding.Figure 6b This can be understood as a preview screenshot. Once the user is satisfied with the preview screenshot, the screenshot area parameters related to the target keyword "K4125164" are saved.
[0047] Figure 7 A schematic diagram of another example process for configuring a PDF document template according to some embodiments of this specification is shown. This process 700 can, for example, be performed by... Figure 1 The computing device 104 in the environment 100 shown performs the operation. For example... Figure 7As shown, process 700 can acquire one or more standardized PDF documents as standardized templates 702-1, ..., 702-n. In some examples, users upload different types of standardized PDF documents to the client, and the computing device uses the received standardized PDF documents as standardized templates, each template corresponding to a fixed format. Process 700 can configure keywords, auxiliary keywords (there can be multiple, only one is shown as an example in the figure), and their corresponding screenshot area parameters for each standardized PDF document. The screenshot area parameters include an initial offset and a screenshot area size. For example, standardized template 1 is configured with box 704-1, configuring multiple sets of screenshot area parameters. Each set of screenshot area parameters corresponds to a keyword group, and each keyword group contains one keyword (which can be considered a primary keyword) and one auxiliary keyword. For example, in the figure, keyword 1 and auxiliary keyword 1 form one keyword group, and keyword 1 and auxiliary keyword 2 form another keyword group. Standardized templates 2 to n each have their own screenshot area parameter configuration. In some implementations, the user inputs the initial offset (Δx, Δy) and the screenshot area size, including width and height, through the client interface. The initial offset refers to the offset (unit: pt) required from the keyword's location to the screenshot's starting point. For example, (△x, △y) = (0, 0), then the keyword's location is the screenshot's starting point. Another example is (△x, △y) = (-20, 30), where the screenshot's starting point is 20pt to the left and 30pt down from the keyword's location. After configuring the screenshot area parameters for each keyword, the parameters are saved, and a standardized PDF document containing all configurations is used as a PDF document template. This process 700 generates preview screenshots 706-1,…706-n based on the keywords and their corresponding screenshot area parameters. A screenshot preview is performed on each standardized PDF document with configured screenshot area parameters. In some implementations, if the user is not satisfied with the preview screenshot, they can adjust the input parameters or use the mouse to adjust the screenshot area's range. The system automatically calculates the initial offset and the screenshot area size. Upon receiving the re-input or recalculated parameters, the computing device responds to user feedback and adjusts the screenshot area parameters. If the preview is satisfactory, the user confirms the screenshot area parameters on the interface. The computing device responds to the user's confirmation command and saves the screenshot area parameters. After all keywords and their screenshot area parameters are configured, the configured standardized PDF document is saved as a PDF document template 708-1, ..., 708-n.
[0048] In some examples, a user uploads a PDF of a medical test report, enters the keyword "gene mutation," sets the auxiliary keyword "test result," and sets the initial offset (Δx=50, Δy=20) and screenshot area size (width=200, height=120). The system generates a preview screenshot, which the user adjusts to width=300 and height=150. After confirmation, the user saves the template configuration as follows: { "template_name": "Medical Test Report", "main_keywords": ["gene mutation"], "assist_keywords": ["Detection results"], "x_offset": 50, "y_offset": 20, "width": 300, "height": 150 }
[0049] Through the aforementioned templated configuration, the embodiments in this specification ensure the uniformity of the target screenshot area's position and size, avoiding human error. Furthermore, by using keywords and auxiliary key groups to configure different screenshot areas pointed to by multiple identical keywords on the same page, accurate capture of different positions and sizes of content from different areas with the same keywords can be achieved. Moreover, the templates can be flexibly configured to meet cross-domain and cross-document type requirements; once configured, they can be reused long-term and adapted to the processing of the same type of document. In addition, during the configuration process, previewing provides feedback for parameter adjustments, allowing users to intuitively determine whether the screenshot area meets expectations. This user-friendly interface enables accurate and satisfactory template configuration, facilitating subsequent efficient and standardized batch screenshotting.
[0050] Figure 8 A schematic diagram of another example process for batch taking screenshots of PDF documents according to some embodiments of this specification is shown. This process 800 can, for example, be performed by... Figure 1 The process 800 is executed by computing device 104 in the environment 100 shown. This process 800 is illustrated by taking a screenshot of a target PDF document based on a target keyword as an example. The process of taking screenshots of multiple different content areas of a target PDF document based on multiple target keywords, as well as the process of batch screenshotting multiple target PDF documents, can be referred to in the same way. Figure 8 Example execution. (e.g.) Figure 8As shown, in box 802, this process can obtain a user screenshot request. In box 804, the user screenshot request is parsed. In some implementations, the user screenshot request includes a target keyword, auxiliary keywords (which may be one or more), a PDF document template, and a target PDF document. In box 804, based on the keyword group consisting of the target keyword and its auxiliary keywords, a screenshot area parameter corresponding to the target keyword and its auxiliary keywords is matched from the PDF document template. For example, if the target keyword and its auxiliary keywords match the keyword N and its auxiliary keyword m of the PDF document template, then the screenshot area parameter N is determined to be the matched screenshot area parameter. In box 808, this process 800 can search for the keyword group consisting of the target keyword and its auxiliary keywords in the target PDF document, and can determine the target keyword K. 目标 and auxiliary keyword K 辅助 The shared page can be a single page or multiple pages, such as page 1, page 5, ..., page n. Furthermore, by utilizing the positional relationship between the target keyword and auxiliary keywords contained in the user's screenshot request, the approximate location of the target keyword within the page can be determined, excluding other areas not related to the positional relationship. In some examples, the target keyword is searched for within the target PDF document on the same page as one or more auxiliary keywords. In some examples, the target keyword is searched for within the target PDF document on the same page as one or more auxiliary keywords, and the target keyword appears within a certain positional range of the auxiliary keywords. For example, the target keyword appears 100pt below the auxiliary keywords. In box 810, this process 800 can locate the target screenshot area based on the screenshot area parameters of the target keyword. In some implementations, the area near the keyword group is located as the target screenshot area according to the screenshot area parameters. In some examples, starting from the coordinates of the page containing the queried target keyword, the initial offset in the screenshot area parameters is used to obtain the screenshot starting point coordinates. Then, combined with the area size in the screenshot area parameters, the screenshot starting point is expanded to the lower right of the preset area size. At this point, the area selected in the screenshot is the target screenshot area. In one or more embodiments of this specification, when multiple identical target keywords appear on the same page, the target keywords and their corresponding auxiliary keywords can be grouped for searching. The target screenshot area 1 is determined based on screenshot area parameter 1 for the positions located by target keyword 1 and auxiliary keyword 1, and the target screenshot area 2 is determined based on screenshot area parameter 2 for the positions located by target keyword 1 and auxiliary keyword 2. It should be noted that the starting coordinates of the screenshot of target screenshot area 1 are calculated based on the coordinates of target keyword 1 related to this area, and the starting coordinates of the screenshot of target screenshot area 2 are calculated based on the coordinates of target keyword 2 related to this area.
[0051] Figure 9aThis illustration shows another example document page illustrating the location of a target screenshot area on a page of a PDF document according to some embodiments of this specification. Figure 9b It shows Figure 9a Another example screenshot of a Chinese document page is shown. Figure 9a The document page displays a biological experiment test report. Markers 902-1, 921-1, and 922-1 in the image all point to the target keyword "K4125164". The user selects a PDF document template for biological experiment testing on the client, uploads the target PDF document, and enters the target keyword "K4125164" and its auxiliary keywords for differentiation. For example, the target keyword "K4125164" and the auxiliary keyword "electrophoresis" form one keyword group; the target keyword "K4125164" and the auxiliary keyword "total result" form another; and the target keyword "K4125164" and the auxiliary keyword "peak" form yet another. The computing device receives the user's screenshot request and processes it accordingly. Figure 2 The process shown executes an automated, standard screenshot procedure. The computing device queries the target PDF document based on keyword groups consisting of target keywords and auxiliary keywords. On page 6, it finds target keyword 902-1 and its auxiliary keywords 902-2, target keyword 912-1 and its auxiliary keywords 912-2, and target keyword 922-1 and its auxiliary keywords 922-2. The coordinates of target keywords 902-1, 921-1, and 922-1 are obtained. Based on the initial offsets corresponding to each keyword group, the screenshot starting points 904, 914, and 924 are calculated respectively. Then, the target screenshot areas 906, 916, and 926 are located according to the screenshot area size. A screenshot is taken based on the located target screenshot areas 906, 916, and 926, resulting in the final screenshot. Figure 9b The three screenshots shown illustrate how multiple screenshots can be obtained when multiple target PDF documents are batch-screened. Figure 9b The screenshots shown are in a uniform format. Furthermore, when configuring the template, the embodiments in this manual can be referred to. Figure 9a and Figure 9b The example shown is for understanding. Figure 9b This can be understood as a preview screenshot. Once the user is satisfied with the preview screenshot, the screenshot area parameters corresponding to the target keyword "K4125164" and its auxiliary keywords are saved.
[0052] Figure 10 This diagram illustrates a display interface for batch screenshots taken according to some embodiments of this specification. For example... Figure 10As shown, the interface displays thumbnails of all screenshots taken from a target PDF document. Each screenshot is named with the target keyword and saved as an image. If there are multiple screenshots with the same target keyword, they can be distinguished by adding numerical codes, such as "K4125161(1)" and "K4125161(2)" in the figure. In addition, timestamps can be added to avoid conflicts. Users can download all screenshots at once and save them in a ZIP file. Furthermore, the target keyword and the screenshot file path are stored in the screenshot record table to record the source and capture information of each screenshot file.
[0053] Figure 11 A schematic diagram of a report generation process 1100 based on screenshots according to some embodiments of this specification is shown. For example... Figure 11 As shown, process 1100 can take multiple screenshots of a target PDF document 1102 to obtain multiple screenshots 1104. In one example, different screenshots can be obtained based on multiple different keywords. In another example, multiple screenshots can be obtained based on one keyword. Process 1100 can extract text information 1108 from all screenshots in the same target PDF document by a content recognition module 1106 configured with a content recognition model. In some implementations, the content recognition model can be an OCR model to extract text information from the screenshots. Process 1100 can generate a report based on the text information 1108 and the screenshots 1104 by output module 1110. In some examples, output module 1110 can be implemented by a Python tool, generating a structured analysis report based on text information and screenshots through a predefined report format. The report can include information such as keywords, screenshots, recognized text, timestamps, and file source, and supports PDF, Word, or Excel formats. In this way, the content of screenshots can be automatically recognized and reports generated, eliminating the need for users to manually organize the content and obtaining structured reports, thus improving the level of automation.
[0054] Figure 12 Example block diagrams of a PDF document screenshot device 1200, representing some embodiments of this specification, are shown. Device 1200 can, for example, be configured in... Figure 1 The computing device 104 is located in the environment 100 shown. For example... Figure 12As shown, the device 1200 includes an acquisition module 1202 configured to acquire user screenshot requests. The user screenshot request includes target keywords, a PDF document template, and one or more target PDF documents. The PDF document template is configured with multiple sets of screenshot area parameters determined based on different keywords. The target PDF documents and the PDF document template have the same format. The device 1200 also includes a positioning module 1204 configured to locate multiple target screenshot areas from one or more target PDF documents based on the target keywords and the PDF document template. Furthermore, the device 1200 includes a generation module 1206 configured to batch generate multiple screenshots based on the multiple target screenshot areas.
[0055] This specification also provides an electronic device including a processor that can perform various appropriate actions and processes based on computer program instructions loaded into random access memory (RAM) according to computer program instructions stored in read-only memory (ROM). Various programs and data required for device operation may also be stored in the RAM. The processor, ROM, and RAM are interconnected via a bus. Input / output (I / O) interfaces are also connected to the bus.
[0056] The various processes and handling described above, such as method 200, can be executed by a processor. For example, in some embodiments, method 200 can be implemented as a software program tangibly contained in a machine-readable medium. In some embodiments, part or all of the software program can be loaded into and / or installed onto the device via ROM. When the software program is loaded into RAM and executed by a processor, one or more actions of method 200 described above can be performed.
[0057] This specification also provides a computer-readable storage medium storing instructions that, when executed on a computer or processor, cause the computer or processor to perform one or more steps in the above-described method embodiments. If the constituent modules of the above-described electronic device are implemented as software functional units and sold or used as independent products, they can be stored in the computer-readable storage medium.
[0058] In the above embodiments, implementation can be achieved, in whole or in part, through software, hardware, firmware, or any combination thereof. When implemented in software, it can be implemented, in whole or in part, as a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of this specification are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in or transmitted through a computer-readable storage medium. The computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, Digital Subscriber Line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium accessible to a computer or a data storage device such as a server or data center that integrates one or more available media. The available media may be magnetic media (e.g., floppy disks, hard disks, magnetic tapes), optical media (e.g., Digital Versatile Discs (DVDs)), or semiconductor media (e.g., Solid State Disks (SSDs)).
[0059] The embodiments described above are merely preferred embodiments of this specification and are not intended to limit the scope of this specification. Any modifications and improvements made by those skilled in the art to the technical solutions of this specification without departing from the spirit of this specification should fall within the protection scope defined by the claims of this specification.
Claims
1. A method of taking a screenshot of a PDF document, characterized in that, comprising: obtaining a user screenshot request, the user screenshot request comprising a target keyword, a PDF document template, and one or more target PDF documents, the PDF document template being configured with a plurality of sets of screenshot region parameters determined based on different keywords, the target PDF documents having the same format as the PDF document template; locating a plurality of target screenshot regions from the one or more target PDF documents based on the target keyword and the PDF document template; and generating a plurality of screenshots in batch based on the plurality of target screenshot regions. locating a plurality of target screenshot regions from the one or more target PDF documents based on the target keyword and the PDF document template comprises:
2. The method of claim 1, wherein, matching, from the PDF document template, a screenshot region parameter corresponding to the target keyword based on the target keyword; and locating a target screenshot region from the target PDF document based on the target keyword and the screenshot region parameter, in this way locating a plurality of the target screenshot regions from the one or more target PDF documents. The user screenshot request further comprises one or more auxiliary keywords, locating the target keyword from the target PDF document comprises:
3. The method of claim 2, wherein, locating the target keyword from the target PDF document based on the target keyword and one or more auxiliary keywords related thereto being located on the same page. The user screenshot request further comprises one or more auxiliary keywords and a plurality of positional relationships about the target keyword and the auxiliary keywords, each positional relationship corresponding to a keyword group comprising the target keyword and one or more auxiliary keywords related thereto, locating a plurality of target screenshot regions from the one or more target PDF documents based on the target keyword and the PDF document template comprises:
4. The method of claim 2, wherein, matching, from the PDF document template, a screenshot region parameter corresponding to the keyword group based on the keyword group; and locating a target screenshot region from the target PDF document based on the keyword group and the screenshot region parameter, in this way locating a plurality of the target screenshot regions from the one or more target PDF documents. The screenshot region parameter comprises an initial offset and a region size, locating a target screenshot region based on the target keyword and the screenshot region parameter comprises:
5. The method according to claim 2 or 3 or 4, characterized in that, obtaining a screenshot starting point by offsetting the initial offset from a position where the target keyword is located; and locating the target screenshot region based on the screenshot starting point and the region size. The user screenshot request further comprises a plurality of target keywords and a plurality of auxiliary keywords, each target keyword being associated with one or more auxiliary keywords and forming a keyword group; 6. The method of claim 3, wherein, all keyword groups locate a plurality of target screenshot regions from the one or more target PDF documents based on the target keyword and the PDF document template in the keyword group. further comprising:
7. The method of claim 1, wherein, obtaining a standardized PDF document; For a standardized PDF document, configure multiple sets of keywords and their corresponding screenshot area parameters, the screenshot area parameters including initial offset and screenshot area size; And Save the configured standardized PDF document as a PDF document template.
8. The method of claim 7, wherein, Also includes: Form a preview screenshot according to the keywords and their corresponding screenshot area parameters; Adjust the screenshot area parameters in response to user feedback; And Save the configured standardized PDF document in response to user confirmation instructions.
9. The method of claim 1, wherein, Also includes: Batch download multiple screenshots in response to a download request.
10. The method of claim 1, wherein, Also includes: Extract text information from a content recognition model based on all screenshots in the same target PDF document; And Form a report based on all screenshots and their text information.
Citation Information
Patent Citations
Multi-zone screenshot method and device
CN103593171A
Short message interface searching method and device
CN107861861A
Webpage screenshot method and device, storage medium and processor
CN110020240A
PDF keyword positioning method and device and storage medium
CN115270706A
Online PDF (Portable Document Format) document keyword positioning method and device, equipment and medium
CN120492642A