WebGL-based PDF drawing aggregation reading method
The WebGL-based PDF drawing aggregation method addresses the limitation of traditional PDF readers by allowing multiple drawings to be viewed simultaneously on a single screen, improving review efficiency through aggregation and interactive operations.
Patent Information
- Application Number
- CN202411134421.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-19
- Publication Date
- 2024-12-03
AI Technical Summary
Traditional PDF reading software cannot view multiple drawings on the same screen, leading to low review efficiency in the online review of construction drawings.
A PDF drawing aggregation reading method based on WebGL that parses PDF drawings to obtain graphic vector data, calculates offset coordinates, and uses WebGL technology to aggregate and load multiple pages on a single web page, enabling translation, zooming, and rotation operations.
Enables simultaneous viewing of multiple PDF drawing pages on a single screen, enhancing drawing review efficiency.
Smart Images

Figure CN119066284A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of document processing, and in particular to a PDF drawing aggregation reading method based on WebGL. Background Art
[0002] With the continuous development of technology, the review of construction drawings has gradually moved away from the offline paper-based review method. The online review of electronic documents of construction drawings has been used to improve the review efficiency. PDF is a common document format for construction drawings.
[0003] However, when reviewing drawings in PDF format with existing technology, there is a problem that traditional PDF reading software can only read single-page drawings, and it is impossible to view multiple drawings on the same screen, resulting in low review efficiency. Summary of the invention
[0004] The purpose of the present invention is to provide a PDF drawing aggregation reading method based on WebGL, aiming to solve the problem that traditional PDF reading software in the prior art can only read single-page drawings, cannot realize viewing multiple drawings on the same screen, and has low drawing review efficiency.
[0005] To achieve the above object, the present invention adopts a PDF drawing aggregation reading method based on WebGL, comprising the following steps:
[0006] Parse PDF drawings based on PDF specifications to obtain graphic vector data;
[0007] Get the width and height information of the drawing pages to be aggregated through js extension, and calculate the offset coordinates of each page;
[0008] Use WebGL technology to aggregate and load various drawing pages on the web page.
[0009] Among them, in the step of parsing the PDF drawing based on the PDF specification and obtaining the graphic vector data:
[0010] The graphic vector data includes coordinates, shape, color, and line type attribute data of graphic elements; the graphic elements include lines, curves, polygons, and texts.
[0011] Among them, in the step of obtaining the width and height information of the drawing pages to be aggregated through js extension and calculating the offset coordinates of each page:
[0012] The width and height information of each page of the drawing is obtained through the js extension. According to the rule of wrapping two pages of drawings in each row, the coordinate offset value of each page of the drawing is calculated in sequence according to the width and height of each page of the drawing.
[0013] Among them, in the step of aggregating and loading each drawing page on a web page using WebGL technology:
[0014] In a single web page, multiple selected PDF drawing pages are displayed simultaneously with two pages per line, and operations such as translation, zooming, and rotation are performed to realize drawing reading.
[0015] Among them, in the steps of performing translation, zooming, and rotation operations to realize drawing reading:
[0016] By capturing the user's dragging and scrolling operations on the interface, the coordinate properties of the PDF drawing page are adjusted accordingly.
[0017] The invention discloses a PDF drawing aggregation reading method based on WebGL, which parses PDF drawings based on PDF specifications to obtain graphic vector data; obtains width and height information of drawing pages that need to be aggregated through js extension, and calculates the offset coordinates of each page; aggregates and loads each drawing page on a web page by using WebGL technology; realizes the aggregation and online reading of single files and multiple pages of PDF format architectural construction design drawings, achieves the effect of multiple drawings reading on the same screen, and improves the efficiency of drawing review. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0019] Figure 1 It is a flowchart of the steps of the WebGL-based PDF drawing aggregation reading method of the present invention. DETAILED DESCRIPTION
[0020] See also Figure 1 ,in Figure 1 It is a flowchart of the steps of the PDF drawing aggregation reading method based on WebGL.
[0021] The present invention provides a PDF drawing aggregate reading method based on WebGL, comprising the following steps:
[0022] S100: Parse the PDF drawing based on the PDF specification to obtain graphic vector data.
[0023] In this embodiment, the PDF drawing is parsed based on the PDF specification to obtain graphic vector data, wherein the graphic vector data includes coordinates, shape, color, and line type attribute data of graphic elements; the graphic elements include lines, curves, polygons, and texts.
[0024] S200: Obtain the width and height information of the drawing pages to be aggregated through js extension, and calculate the offset coordinates of each page.
[0025] In this embodiment, the width and height information of each page of the drawing is obtained through js extension, and the coordinate offset value of each page of the drawing is calculated in sequence according to the width and height of each page of the drawing according to the rule of wrapping two pages of drawings in each row.
[0026] S300: Utilize WebGL technology to aggregate and load various drawing pages on a web page.
[0027] In this embodiment, WebGL technology is used to display multiple selected PDF drawing pages simultaneously in a single web page with two pages per line, and perform translation, zooming, and rotation operations to realize drawing reading. In the process of translation, zooming, and rotation operations, the coordinate attributes of the PDF drawing pages are adjusted accordingly by capturing the user's dragging and scrolling operations on the interface.
[0028] In the present invention, firstly, the PDF drawing is parsed based on the PDF specification to obtain graphic vector data, wherein the graphic vector data includes coordinates, shapes, colors, and line type attribute data of graphic elements; the graphic elements include lines, curves, polygons, and texts. Then, the width and height information of each page of the drawing is obtained through the js extension, and the coordinate offset value of each page of the drawing should be calculated in sequence according to the width and height of each page of the drawing according to the rule of displaying two pages of drawings in each line. Finally, using WebGL technology, in a single web page, the selected multiple PDF drawing pages are displayed at the same time according to the line break of two pages of drawings in each line, and translation, scaling, and rotation operations are performed to realize drawing reading. In the process of translation, scaling, and rotation operations, the coordinate attributes of the PDF drawing page are adjusted accordingly by capturing the dragging and scrolling operations of the user on the interface. Through the above method, the single file and cross-file multi-page aggregation of PDF format architectural construction design drawings are realized for online reading, achieving the effect of multi-image reading on the same screen and improving the efficiency of drawing review.
[0029] What is disclosed above is only a preferred embodiment of the present invention, and it certainly cannot be used to limit the scope of rights of the present invention. Ordinary technicians in this field can understand that all or part of the processes of the above embodiment and equivalent changes made according to the claims of the present invention still fall within the scope of the invention.
Claims
1. A PDF drawing aggregate reading method based on WebGL, characterized in that: The steps include: Parse PDF drawings based on PDF specifications to obtain graphic vector data; Get the width and height information of the drawing pages to be aggregated through js extension, and calculate the offset coordinates of each page; Use WebGL technology to aggregate and load various drawing pages on the web page.
2. The WebGL-based PDF drawing aggregate reading method according to claim 1, characterized in that: In the steps of parsing PDF drawings based on PDF specifications and obtaining graphic vector data: The graphic vector data includes coordinates, shape, color, and line type attribute data of graphic elements; the graphic elements include lines, curves, polygons, and texts.
3. The WebGL-based PDF drawing aggregate reading method according to claim 1, characterized in that: In the step of obtaining the width and height information of the drawing pages to be aggregated through js extension and calculating the offset coordinates of each page: The width and height information of each page of the drawing is obtained through the js extension. According to the rule of wrapping two pages of drawings in each row, the coordinate offset value of each page of the drawing is calculated in sequence according to the width and height of each page of the drawing.
4. The WebGL-based PDF drawing aggregate reading method according to claim 1, characterized in that: In the steps of loading various drawing pages on a web page using WebGL technology: In a single web page, multiple selected PDF drawing pages are displayed simultaneously with two pages per line, and operations such as translation, zooming, and rotation are performed to realize drawing reading.
5. The WebGL-based PDF drawing aggregate reading method according to claim 4, characterized in that: In the steps of panning, zooming, rotating and viewing drawings: By capturing the user's dragging and scrolling operations on the interface, the coordinate properties of the PDF drawing page are adjusted accordingly.
