A conversion processing method, device and equipment for format files

By dynamically cropping invisible areas and rendering areas during PDF to OFD conversion, the problems of resource waste and inefficiency in traditional technologies are solved, and more efficient file conversion and storage effects are achieved.

CN119398002BActive Publication Date: 2025-04-01BEIJING SUWELL TECHNOLOGY CO LTD +2
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411982282.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-12-31
Publication Date
2025-04-01
Estimated Expiration
2044-12-31

AI Technical Summary

Technical Problem

Traditional PDF-to-OFD conversion technology cannot effectively remove or crop images beyond the visible area when processing invisible content in PDF files, resulting in waste of resources and reduced conversion efficiency.

Method used

By obtaining the page display area and the visible area of ​​the page element of the PDF file, determine the invisible area of ​​the page element, and crop it to obtain the target page. Then, based on the visible elements in the target page, the target rendering page is further cropped, and finally converted to an OFD file.

Benefits of technology

It effectively reduces redundant content in files, improves file conversion efficiency, storage efficiency and presentation effect, and ensures that document content is best presented in different devices and environments.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119398002B_ABST
    Figure CN119398002B_ABST
Patent Text Reader

Abstract

The present invention provides a conversion processing method, device and equipment for layout files, and the conversion processing method for layout files includes: obtaining a page display area and a visible area of ​​page elements of a first layout file; determining an invisible area of ​​page elements according to the page display area and the visible area of ​​page elements; clipping the invisible area of ​​page elements to obtain a target page of the first layout file; obtaining a target rendering page according to the visible element display area and the rendering viewport in the target page of the first layout file; converting the target rendering page into a page of a second layout file, and displaying it in a display interface of a terminal device. The present invention can reduce redundant content in files, and improve file conversion efficiency, storage performance and presentation effect.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of file processing technology, and in particular to a conversion processing method, device and equipment for format files. Background Art

[0002] With the popularity and application of digital document formats, PDF (Portable Document Format) files have become one of the most commonly used electronic document formats due to their powerful cross-platform display and printing capabilities. However, as the content becomes more complex, PDF files may contain a large number of invisible areas or images, graphic elements, or redundant rendering areas that are beyond the visible range. These invisible parts may cause unnecessary computing burden, file redundancy, or display distortion when converting file formats, especially when converting to OFD (layout file) format, if they are not effectively processed.

[0003] In PDF files, there are often some graphic content or image elements outside the visible area of ​​the document, which may be caused by page content offset, scaling, cropping or multi-page document layout. When processing such invisible content, traditional PDF to OFD conversion technology often cannot effectively remove or crop images that exceed the visible area, resulting in a waste of resources and a decrease in conversion efficiency. Summary of the invention

[0004] The technical problem to be solved by the present invention is to provide a conversion processing method, device and equipment for a layout file, which can reduce redundant content in the file and improve the file conversion efficiency, storage performance and presentation effect.

[0005] In order to solve the above technical problems, the technical solution of the present invention is as follows:

[0006] A conversion processing method for a format file, comprising:

[0007] Get the page display area and page element visible area of ​​the first layout file;

[0008] Determine the invisible area of ​​the page elements according to the page display area and the visible area of ​​the page elements;

[0009] Cropping the invisible area of ​​the page element to obtain a target page of the first layout file;

[0010] Obtaining a target rendering page according to a visible element display area and a rendering viewport in a target page of the first layout file;

[0011] The target rendering page is converted into a page of a second layout file, and displayed in a display interface of a terminal device.

[0012] Optionally, obtaining the page display area and page element visible area of ​​the first layout file includes:

[0013] Obtaining page attributes of the first layout file;

[0014] From the page attributes, obtain the page display area, the position of the page element and the size of the page element;

[0015] The visible area of ​​the page element is determined according to the position of the page element and the size of the page element.

[0016] Optionally, determining the invisible area of ​​the page elements according to the page display area and the visible area of ​​the page elements includes:

[0017] Comparing the page display area with the page element visible area to obtain an overlapping area between the page display area and the page element visible area;

[0018] An area outside the overlapping area in the page display area is determined as a page element invisible area.

[0019] Optionally, the invisible area of ​​the page element is cropped to obtain a target page of the first layout file, including:

[0020] The boundary of the page element in the invisible area of ​​the page element is adjusted so that the boundary of the page element is located in the visible area of ​​the page element, thereby obtaining the target page of the first layout file.

[0021] Optionally, obtaining a target rendering page according to a visible element display area and a rendering viewport in a target page of the first layout file includes:

[0022] Determine an invisible area of ​​page elements beyond the rendering viewport according to an intersection area of ​​a visible element display area and a rendering viewport in a target page of the first layout file;

[0023] The invisible area of ​​the page element beyond the rendering viewport is cropped to obtain a target rendering page.

[0024] Optionally, determining the invisible area of ​​the page elements beyond the rendering viewport according to the intersection area of ​​the visible element display area in the target page of the first layout file and the rendering viewport includes:

[0025] Obtaining initial coordinates of page elements in a visible element display area in a target page of the first layout file;

[0026] Convert the page element initial coordinates into page element rendering viewport coordinates;

[0027] Determine the intersection area of ​​the visible element display area and the rendering viewport in the target page according to the page element rendering viewport coordinates;

[0028] The area other than the intersection area in the rendering viewport is determined as the page element invisible area.

[0029] Optionally, converting the target rendering page into a page of a second layout file includes:

[0030] The page elements in the target rendering page are loaded according to the page format of the second layout file, and a page of the second layout file is generated.

[0031] The embodiment of the present invention further provides a conversion processing device for a format file, comprising:

[0032] An acquisition module, used for acquiring a page display area and a page element visible area of ​​a first layout file;

[0033] A processing module is used to determine the invisible area of ​​page elements according to the page display area and the visible area of ​​page elements; crop the invisible area of ​​page elements to obtain the target page of the first layout file; obtain the target rendering page according to the visible element display area and the rendering viewport in the target page of the first layout file; convert the target rendering page into a page of the second layout file, and display it in the display interface of the terminal device.

[0034] An embodiment of the present invention further provides a computing device, comprising:

[0035] one or more processors;

[0036] The storage device is used to store one or more programs. When the one or more programs are executed by the one or more processors, the one or more processors implement the format file conversion processing method described in the present invention.

[0037] An embodiment of the present invention further provides a computer-readable storage medium, wherein a program is stored in the computer-readable storage medium, and when the program is executed by a processor, the format file conversion processing method of the present invention is implemented.

[0038] The above technical solution of the present invention has at least the following technical effects:

[0039] The conversion processing method of the layout file of the present invention obtains the page display area and the visible area of ​​the page elements of the first layout file; determines the invisible area of ​​the page elements according to the page display area and the visible area of ​​the page elements; cuts the invisible area of ​​the page elements to obtain the target page of the first layout file; obtains the target rendering page according to the visible element display area and the rendering viewport in the target page of the first layout file; converts the target rendering page into the page of the second layout file and displays it in the display interface of the terminal device. It can reduce the redundant content in the file and improve the file conversion efficiency, storage efficiency and presentation effect. BRIEF DESCRIPTION OF THE DRAWINGS

[0040] Figure 1 It is a schematic diagram of the conversion processing method of the layout file of the present invention;

[0041] Figure 2 It is a schematic diagram of the conversion processing device of the layout file of the present invention. DETAILED DESCRIPTION

[0042] The exemplary embodiments of the present invention will be described in more detail below with reference to the accompanying drawings. Although the exemplary embodiments of the present invention are shown in the accompanying drawings, it should be understood that the present invention can be implemented in various forms and should not be limited by the embodiments set forth herein. On the contrary, these embodiments are provided in order to enable a more thorough understanding of the present invention and to enable the scope of the present invention to be fully communicated to those skilled in the art.

[0043] like Figure 1 As shown, an embodiment of the present invention provides a conversion processing method for a layout file, comprising:

[0044] Step S1, obtaining a page display area and a page element visible area of ​​a first layout file;

[0045] Step S2, determining the invisible area of ​​the page elements according to the page display area and the visible area of ​​the page elements;

[0046] Step S3, cropping the invisible area of ​​the page element to obtain a target page of the first layout file;

[0047] Step S4, obtaining a target rendering page according to the visible element display area and the rendering viewport in the target page of the first layout file;

[0048] Step S5: convert the target rendering page into a page of a second layout file, and display it on a display interface of a terminal device.

[0049] In this embodiment, the conversion processing method of the layout file of the present invention first obtains the page display area and the visible area of ​​the page elements of the first layout file, including the page size, the position and size of the page elements and other information; then, according to the page display area and the visible area of ​​the page elements, the position and size of each element in the page are found, and the part of the page element that exceeds the page size range is determined as the invisible area of ​​the page element; again, according to the page size, the invisible area of ​​the page element is cropped, and the elements that exceed the page size range are deleted to obtain the target page of the first layout file; next, according to the setting of the rendering viewport during file conversion, the visible element display area in the target page of the first layout file is cropped according to the position and size of the rendering viewport to obtain the target rendering page; finally, the target rendering page is adjusted to obtain the page of the second layout file, which is displayed in the display interface of the terminal device. The method of the present invention can be applied in the process of converting PDF (Portable Document Format) to OFD (Layout File). During file conversion, only the actually displayed part of the page content is rendered, and those contents outside the actual display area are effectively cropped, which not only improves the conversion efficiency but also ensures the accuracy of the rendering effect, and can ensure that the document content is presented in the best way in different devices and environments.

[0050] In an optional embodiment of the present invention, in step S1, obtaining the page display area and the page element visible area of ​​the first layout file includes:

[0051] Step S11, obtaining page attributes of the first layout file;

[0052] Step S12, obtaining the page display area, the position of the page element and the size of the page element from the page attributes;

[0053] Step S13, determining the visible area of ​​the page element according to the position of the page element and the size of the page element.

[0054] In this embodiment, the page display area and the visible area of ​​the page elements of the first layout file are processed; first, the page attributes of the first layout file are obtained, and the position and size information of each page element in the page is extracted from the page attributes. Each graphic element in the PDF (including text, pictures, vector graphics, etc.) has its position and size information on the page, and the specific coordinates and size of each element can be extracted through a PDF parsing library (such as PyMuPDF, pdfminer, etc.); for example, the position and size of an image are usually expressed in terms of the coordinates, width, and height of the lower left corner; then, the page size is extracted from the page attributes. The page size is usually specified by the MediaBox attribute in the PDF file. The MediaBox defines the overall size of the page in points (usually 1 / 72 inches). ) as the unit, giving the coordinates of the lower left and upper right corners of the page; MediaBox reflects the boundaries of the physical medium used to print the page. The paper size used to print the sample is larger than the actual size. The blank space around it can be used to place reference information such as auxiliary lines and sizes, as well as marks for overprinting and color correction. Larger samples are also convenient for printing multiple pages on a piece of paper, which is convenient for proofreading and typesetting; in addition, when the TrimBox (cropping box) attribute in the PDF file has a separate definition, the size of the TrimBox is used as the page size; The TrimBox attribute specifies the "trimming" area of ​​the page, which is usually used for the trimming area of ​​printing. The TrimBox attribute is the expected size after cutting; According to the coordinates and size of each element, the range of the page element in the page is determined to obtain the visible area of ​​the page element.

[0055] In an optional embodiment of the present invention, in step S2, determining the invisible area of ​​the page elements according to the page display area and the visible area of ​​the page elements includes:

[0056] Step S21, comparing the page display area and the page element visible area to obtain an overlapping area between the page display area and the page element visible area;

[0057] Step S22: determining the area outside the overlapping area in the page display area as a page element invisible area.

[0058] In this embodiment, after the page display area is determined, the page display area is compared with the visible area of ​​the page element, and the intersection of the page display area and the visible area of ​​the page element is calculated to determine whether the visible area of ​​the page element has an intersection with the page display area, and the overlapping area of ​​the two is obtained. The part of the visible area of ​​the page element that exceeds the page display area, that is, the element area outside the overlapping area is determined to be invisible, thereby obtaining the invisible area of ​​the page element.

[0059] In an optional embodiment of the present invention, in step S3, the invisible area of ​​the page element is cropped to obtain the target page of the first layout file, including:

[0060] The boundary of the page element in the invisible area of ​​the page element is adjusted so that the boundary of the page element is located in the visible area of ​​the page element, thereby obtaining the target page of the first layout file.

[0061] In this embodiment, the invisible area of ​​the page element is cropped; each page element in the file is traversed, and all graphic elements in the PDF page, including text, vector graphics and images, are checked one by one. If the element is outside the page display area, the element is considered invisible. For page elements that are within the page display area but not beyond the page display area, no cropping is required; for page elements that exceed the page display area, the boundary of the page element in the invisible area of ​​the page element is adjusted according to the boundary of the page display area, and the page element that exceeds the boundary of the page display area is adjusted to the page display area so that the adjusted boundary of the page element is within the visible area of ​​the page element, and the area of ​​the page element outside the boundary of the page display area is deleted to obtain the target page of the first layout file; for each page element, only the part within the visible area is retained through the clip operation (cropping operation), and the clip operation determines whether it exceeds the display area according to the coordinate system of the element, and if it exceeds, the excess part is clipped.

[0062] In an optional embodiment of the present invention, in step S4, obtaining a target rendering page according to a visible element display area and a rendering viewport in a target page of the first layout file includes:

[0063] Step S41, determining an invisible area of ​​page elements beyond the rendering viewport according to an intersection area between a visible element display area in a target page of the first layout file and a rendering viewport;

[0064] Step S42, cropping the invisible area of ​​the page element beyond the rendering viewport to obtain a target rendering page.

[0065] In this embodiment, the target rendering page is obtained; first, according to the setting of the rendering viewport, the size and position of the rendering viewport are extracted. The rendering viewport refers to the currently visible area, that is, the part that the user can see on the screen. If the user sets a zoom or view cropping, the size and position of the rendering viewport will change. The rendering viewport is usually determined by the user's settings (such as scrolling, zooming, etc.) and the actual display area of ​​the page. The rendering viewport uses [viewport_left, viewport_bottom, viewport_right, viewport_top]; then, according to the size and position of the rendering viewport, the visible element display area is compared with the rendering viewport, and the part located in the rendering viewport is used as the target rendering page; specifically, if the left boundary x1 of the page element is greater than the right boundary of the viewport, the page element is completely on the right side of the viewport, then the page element is not displayed; if the right boundary of the page element is less than the left boundary of the viewport, the element is completely on the left side of the viewport, then the page element is not displayed; if the lower boundary y1 of the page element is greater than the upper boundary of the viewport, the page element is completely above the viewport, then the page element is not displayed; if the upper boundary of the page element is less than the lower boundary of the viewport, the element is completely below the viewport, then the page element is not displayed; if the page element partially intersects with the rendering viewport, the elements of the intersection need to be rendered, but only the part intersecting with the viewport is rendered, and the intersection is the target rendering page; then, according to the rendering element range, the invisible area of ​​the page element beyond the rendering viewport is cropped, and the elements outside the rendering viewport are deleted;

[0066] Specifically, the following relationship is used for cutting:

[0067] left = max(x1, viewport_left),

[0068] right = min(x1 + width, viewport_right),

[0069] top = min(y1 + height, viewport_top),

[0070] bottom = max(y1, viewport_bottom),

[0071] Among them, left represents the left horizontal coordinate after cropping, right represents the right horizontal coordinate after cropping, top represents the upper vertical coordinate after cropping, bottom represents the lower vertical coordinate after cropping, x1 represents the horizontal coordinate of the page element rendering viewport, y1 represents the vertical coordinate of the page element rendering viewport, width represents the width of the page element, height represents the height of the page element, viewport_left represents the left horizontal coordinate of the rendering viewport, viewport_right represents the right horizontal coordinate of the rendering viewport, viewport_top represents the upper vertical coordinate of the rendering viewport, and viewport_right represents the lower vertical coordinate of the rendering viewport. For example: suppose the page size of the PDF file is A4 (210mm x 297mm), and the display area is a 1024x768 monitor viewport. When the image or graphic elements in the page are outside the viewport area (for example, the position coordinates exceed the range of the visible window), the excess parts of these elements will be cropped. Suppose an image is located at (300, 500), has a width of 500px and a height of 400px. If the lower right corner of the image is outside the display area, the clip operation will crop the portion that exceeds the visible area so that the converted image only retains the content of the visible area.

[0072] In an optional embodiment of the present invention, in step S41, determining the invisible area of ​​the page elements beyond the rendering viewport according to the intersection area of ​​the visible element display area in the target page of the first layout file and the rendering viewport includes:

[0073] Step S411, obtaining the initial coordinates of the page elements in the visible element display area in the target page of the first layout file;

[0074] Step S412, converting the page element initial coordinates into page element rendering viewport coordinates;

[0075] Step S413, determining the intersection area of ​​the visible element display area in the target page and the rendering viewport according to the page element rendering viewport coordinates;

[0076] Step S414: determine the area in the rendering viewport other than the intersection area as the page element invisible area.

[0077] In this embodiment, first, the initial coordinates of the page elements in the visible element display area in the target page of the first layout file are obtained; then, according to the size and position of the rendering viewport, the initial coordinates in the target page are converted into the page element rendering viewport coordinates; from the rendering viewport settings, the rendering viewport origin coordinates are extracted, specifically, the coordinates of the upper left corner of the rendering viewport are used as the origin coordinates, that is, [viewport_left, viewport_top] is used as the rendering viewport origin coordinates; for the page element with the page coordinates (x, y), the converted rendering viewport coordinates are obtained using the following formula:

[0078] The horizontal coordinate of the rendering viewport coordinates is:

[0079] x1=(x- viewport_left)*Z*cosθ-(y- viewport_top)*Z *sinθ,

[0080] The ordinate of the rendering viewport coordinates is:

[0081] y1=(x- viewport_left)*Z *sinθ+(y- viewport_top)*Z * cosθ,

[0082] Wherein, Z is the scaling ratio of the page element, and θ is the rotation angle of the page element.

[0083] Finally, according to the page element rendering viewport coordinates, the intersection area of ​​the visible element display area in the target page and the rendering viewport is determined; and the invisible area of ​​the page element beyond the intersection area is determined.

[0084] In an optional embodiment of the present invention, in step S5, converting the target rendering page into a page of a second layout file includes:

[0085] The page elements in the target rendering page are loaded according to the page format of the second layout file, and a page of the second layout file is generated.

[0086] In this embodiment, page element extraction is performed in the target rendering page, and only page elements containing valid information are extracted, and blank areas irrelevant to rendering are deleted to obtain a page of the second layout file. For example, if there is a large amount of blank space on the left and top of the page, and the actual content is concentrated in the lower right corner, the rendering area will be automatically adjusted to only contain the actual content; then, the target rendering page is range-adjusted, and the cropped elements need to adjust their rendering positions to ensure that they are correctly displayed in the rendering viewport, and the cropped elements are aligned with the rendering viewport to obtain a page of the second layout file. For example: suppose that the page content originally covers the entire A4 page, but during the conversion process, the actual content is only concentrated in the lower right corner of the page. At this time, the conversion program will dynamically calculate the content boundary and adjust the rendering area to only cover the actual content (for example, from the horizontal range of 200mm to 210mm of the page, and the vertical range of 200mm to 250mm), avoiding the rendering of unnecessary blank areas.

[0087] The specific implementation process of the above method of the present invention is described below:

[0088] Step 111, obtaining the page display area and the page element visible area of ​​the first layout file;

[0089] Step 112, obtaining the page attributes of the first layout file;

[0090] Step 113, obtaining the page display area, the position of the page element and the size of the page element from the page attributes;

[0091] Step 114, determining a visible area of ​​the page element according to the position of the page element and the size of the page element;

[0092] Step 115, comparing the page display area and the page element visible area to obtain an overlapping area between the page display area and the page element visible area;

[0093] Step 116, determining the area outside the overlapping area in the page display area as a page element invisible area;

[0094] Step 117, adjusting the border of the page element in the invisible area of ​​the page element so that the border of the page element is located in the visible area of ​​the page element, and obtaining the target page of the first layout file;

[0095] Step 118, obtaining the initial coordinates of the page elements in the visible element display area in the target page of the first layout file;

[0096] Step 119, converting the page element initial coordinates into page element rendering viewport coordinates;

[0097] Step 120, determining the intersection area of ​​the visible element display area in the target page and the rendering viewport according to the page element rendering viewport coordinates;

[0098] Step 121, determining the area in the rendering viewport other than the intersection area as the page element invisible area;

[0099] Step 122, cropping the invisible area of ​​the page elements beyond the rendering viewport to obtain a target rendering page;

[0100] Step 123: load the page elements in the target rendering page according to the page format of the second layout file, and generate a page of the second layout file.

[0101] The above-mentioned scheme of the present invention can effectively reduce the redundant content in the OFD file, improve the conversion efficiency and reduce the file size through dynamic cropping and optimization of the rendering area, and enable the document content to be presented in the best way under different devices and environments. Redundant content is reduced. Since the images and graphics beyond the visible area are cropped, the converted OFD file contains only the content of the visible part of the page, reducing unnecessary redundant data; improving conversion efficiency; when performing the conversion, only the actually visible part needs to be rendered, avoiding the invalid rendering of useless content, reducing the computational burden, and increasing the speed of the conversion process; reducing the file size, removing the graphics and image content beyond the visible area, and greatly reducing the storage requirements of the OFD file, especially when processing large documents, the effect is particularly obvious.

[0102] The solution of the present invention can be widely applied to multiple scenarios, especially when a large number of PDF files or documents need to be processed, and can significantly improve processing efficiency and storage performance.

[0103] Typical applications include: Electronic document management system: When processing a large number of documents, it can effectively reduce the file size and improve the speed of document loading and conversion.

[0104] Online PDF to OFD tool: provides a more efficient and accurate file conversion experience, reduces unnecessary storage space usage, and improves user experience.

[0105] Mobile device readers: On mobile devices, especially those with limited screen size, reducing redundant data can significantly improve display performance and save storage space.

[0106] like Figure 2 As shown, the embodiment of the present invention further provides a format file conversion processing device 20, comprising:

[0107] An acquisition module 21, used for acquiring a page display area and a page element visible area of ​​a first layout file;

[0108] The processing module 22 is used to determine the invisible area of ​​the page elements according to the page display area and the visible area of ​​the page elements; crop the invisible area of ​​the page elements to obtain the target page of the first layout file; obtain the target rendering page according to the visible element display area and the rendering viewport in the target page of the first layout file; convert the target rendering page into a page of the second layout file, and display it in the display interface of the terminal device.

[0109] Optionally, obtaining the page display area and page element visible area of ​​the first layout file includes:

[0110] Obtaining page attributes of the first layout file;

[0111] From the page attributes, obtain the page display area, the position of the page element and the size of the page element;

[0112] The visible area of ​​the page element is determined according to the position of the page element and the size of the page element.

[0113] Optionally, determining the invisible area of ​​the page elements according to the page display area and the visible area of ​​the page elements includes:

[0114] Comparing the page display area with the page element visible area to obtain an overlapping area between the page display area and the page element visible area;

[0115] An area outside the overlapping area in the page display area is determined as a page element invisible area.

[0116] Optionally, the invisible area of ​​the page element is cropped to obtain a target page of the first layout file, including:

[0117] The boundary of the page element in the invisible area of ​​the page element is adjusted so that the boundary of the page element is located in the visible area of ​​the page element, thereby obtaining the target page of the first layout file.

[0118] Optionally, obtaining a target rendering page according to a visible element display area and a rendering viewport in a target page of the first layout file includes:

[0119] Determine an invisible area of ​​page elements beyond the rendering viewport according to an intersection area of ​​a visible element display area and a rendering viewport in a target page of the first layout file;

[0120] The invisible area of ​​the page element beyond the rendering viewport is cropped to obtain a target rendering page.

[0121] Optionally, determining the invisible area of ​​the page elements beyond the rendering viewport according to the intersection area of ​​the visible element display area in the target page of the first layout file and the rendering viewport includes:

[0122] Obtaining initial coordinates of page elements in a visible element display area in a target page of the first layout file;

[0123] Convert the page element initial coordinates into page element rendering viewport coordinates;

[0124] Determine the intersection area of ​​the visible element display area and the rendering viewport in the target page according to the page element rendering viewport coordinates;

[0125] The area other than the intersection area in the rendering viewport is determined as the page element invisible area.

[0126] Optionally, converting the target rendering page into a page of a second layout file includes:

[0127] The page elements in the target rendering page are loaded according to the page format of the second layout file, and a page of the second layout file is generated.

[0128] It should be noted that all implementation methods in the above method embodiments are applicable to the embodiments of the device and can achieve the same technical effects.

[0129] An embodiment of the present invention further provides a computing device, comprising:

[0130] one or more processors;

[0131] The storage device is used to store one or more programs. When the one or more programs are executed by the one or more processors, the one or more processors implement the conversion processing method of the layout file described in the present invention. All implementation methods in the above method embodiments are applicable to the embodiments of the device and can achieve the same technical effect.

[0132] The embodiment of the present invention further provides a computer-readable storage medium, wherein the computing device-readable storage medium stores a program, and when the program is executed by a processor, the format file conversion processing method of the present invention is implemented. All implementation methods in the above method embodiment are applicable to the embodiment of the computing device-readable storage medium, and can also achieve the same technical effect.

[0133] Those skilled in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.

[0134] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.

[0135] In the embodiments provided by the present invention, 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 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 system, 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.

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

[0137] In addition, each functional unit in each embodiment of the present invention 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.

[0138] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, server, or network device, etc.) to perform all or part of the steps of the methods of various embodiments of the present invention. The aforementioned storage medium includes: various media that can store program codes, such as USB flash drives, mobile hard disks, ROM, RAM, magnetic disks, or optical disks.

[0139] In addition, it should be pointed out that in the apparatus and method of the present invention, it is obvious that each component or each step can be decomposed and / or recombined. These decompositions and / or recombinations should be regarded as equivalent schemes of the present invention. Moreover, the steps of performing the above series of processing can naturally be performed in chronological order according to the order of description, but it is not necessary to perform them in chronological order, and some steps can be performed in parallel or independently of each other. For those of ordinary skill in the art, it is understandable that all or any steps or components of the method and apparatus of the present invention can be implemented in hardware, firmware, software or a combination thereof in any computing device (including processors, storage media, etc.) or a network of computing devices, which can be achieved by those of ordinary skill in the art using their basic programming skills after reading the description of the present invention.

[0140] Therefore, the purpose of the present invention can also be achieved by running a program or a group of programs on any computing device. The computing device can be a well-known general-purpose device. Therefore, the purpose of the present invention can also be achieved by simply providing a program product containing a program code for implementing a method or device. That is to say, such a program product also constitutes the present invention, and a storage medium storing such a program product also constitutes the present invention. Obviously, the storage medium can be any well-known storage medium or any storage medium developed in the future. It should also be pointed out that in the device and method of the present invention, it is obvious that each component or each step can be decomposed and / or recombined. These decompositions and / or recombinations should be regarded as equivalent schemes of the present invention. In addition, the steps of performing the above-mentioned series of processing can naturally be performed in chronological order according to the order of description, but it is not necessary to perform them in chronological order. Some steps can be performed in parallel or independently of each other.

[0141] The above is a preferred embodiment of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present invention. These improvements and modifications should also be regarded as the scope of protection of the present invention.

Claims

1. A conversion processing method for a layout file, characterized in that: include: Get the page display area and page element visible area of ​​the first layout file; Determine the invisible area of ​​the page elements according to the page display area and the visible area of ​​the page elements; Cropping the invisible area of ​​the page element to obtain a target page of the first layout file; Obtaining a target rendering page according to a visible element display area and a rendering viewport in a target page of the first layout file; Converting the target rendering page into a page of a second layout file, and displaying the page in a display interface of a terminal device; Wherein, determining the invisible area of ​​the page elements according to the page display area and the visible area of ​​the page elements includes: Comparing the page display area with the page element visible area to obtain an overlapping area between the page display area and the page element visible area; Determine, in the page display area, an area outside the overlapping area as a page element invisible area; Obtaining a target rendering page according to the visible element display area and the rendering viewport in the target page of the first layout file includes: Determine an invisible area of ​​page elements beyond the rendering viewport according to an intersection area of ​​a visible element display area and a rendering viewport in a target page of the first layout file; The invisible area of ​​the page elements beyond the rendering viewport is cropped to obtain a target rendering page; Determining an invisible area of ​​page elements beyond the rendering viewport according to an intersection area of ​​a visible element display area in the target page of the first layout file and a rendering viewport includes: Obtaining initial coordinates of page elements in a visible element display area in a target page of the first layout file; Convert the page element initial coordinates into page element rendering viewport coordinates; Determine the intersection area of ​​the visible element display area and the rendering viewport in the target page according to the page element rendering viewport coordinates; The area other than the intersection area in the rendering viewport is determined as the page element invisible area.

2. The conversion processing method of the layout file according to claim 1, characterized in that: Get the page display area and page element visible area of ​​the first layout file, including: Obtaining page attributes of the first layout file; From the page attributes, obtain the page display area, the position of the page element and the size of the page element; The visible area of ​​the page element is determined according to the position of the page element and the size of the page element.

3. The conversion processing method of the layout file according to claim 1, characterized in that: Cropping the invisible area of ​​the page element to obtain the target page of the first layout file includes: The boundary of the page element in the invisible area of ​​the page element is adjusted so that the boundary of the page element is located in the visible area of ​​the page element, thereby obtaining the target page of the first layout file.

4. The conversion processing method of the layout file according to claim 1, characterized in that: Converting the target rendering page into a page of a second layout file includes: The page elements in the target rendering page are loaded according to the page format of the second layout file, and a page of the second layout file is generated.

5. A conversion processing device for a layout file, characterized in that: include: An acquisition module, used for acquiring a page display area and a page element visible area of ​​a first layout file; A processing module, used for determining a page element invisible area according to the page display area and the page element visible area; The invisible area of ​​the page element is cropped to obtain a target page of the first layout file; a target rendering page is obtained according to the visible element display area and the rendering viewport in the target page of the first layout file; the target rendering page is converted into a page of the second layout file and displayed in the display interface of the terminal device; Wherein, determining the invisible area of ​​the page elements according to the page display area and the visible area of ​​the page elements includes: Comparing the page display area with the page element visible area to obtain an overlapping area between the page display area and the page element visible area; Determine, in the page display area, an area outside the overlapping area as a page element invisible area; Obtaining a target rendering page according to the visible element display area and the rendering viewport in the target page of the first layout file includes: Determine an invisible area of ​​page elements beyond the rendering viewport according to an intersection area of ​​a visible element display area and a rendering viewport in a target page of the first layout file; The invisible area of ​​the page elements beyond the rendering viewport is cropped to obtain a target rendering page; Determining an invisible area of ​​page elements beyond the rendering viewport according to an intersection area of ​​a visible element display area in the target page of the first layout file and a rendering viewport includes: Obtaining initial coordinates of page elements in a visible element display area in a target page of the first layout file; Convert the page element initial coordinates into page element rendering viewport coordinates; Determine the intersection area of ​​the visible element display area and the rendering viewport in the target page according to the page element rendering viewport coordinates; The area other than the intersection area in the rendering viewport is determined as the page element invisible area.

6. A computing device, characterized in that include: one or more processors; A storage device for storing one or more programs, when the one or more programs are executed by the one or more processors, the one or more processors implement the method according to any one of claims 1 to 4.

7. A computing device readable storage medium, characterized in that: The computing device readable storage medium stores a program, which implements the method according to any one of claims 1 to 4 when executed by a processor.

Citation Information

Patent Citations

  • Method and system for processing displayed content in overlapping windows

    CN106681583A

  • OFD document rapid rendering method and device, electronic equipment and storage medium

    CN115168758A