Content analysis-based PDF-to-DXF conversion method

By performing raster content detection and classification on PDF documents and selecting the optimal conversion path, the problem of low quality and accuracy in PDF to DXF conversion in existing technologies is solved, and high-quality DXF file generation is achieved.

CN121580972APending Publication Date: 2026-02-27PROVENCE TECH SHENZHEN
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511541728.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-10-27
Publication Date
2026-02-27

AI Technical Summary

Technical Problem

Existing PDF to DXF conversion methods lack intelligent analysis capabilities for document content types, and cannot effectively distinguish between pure vector content, raster image content, and mixed content, resulting in low conversion quality and accuracy.

Method used

By performing raster content detection on PDF documents, classifying and processing PDF page files, selecting the optimal conversion path, and using different tools and algorithms to process different types of page content, including SVG conversion, dynamic image enhancement, and normalization processing, the final output is a DXF file.

Benefits of technology

It achieves high-quality conversion of PDF documents, maintaining the mathematical precision and visual fidelity of the original content, and improving the consistency and accuracy of the conversion.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121580972A_ABST
    Figure CN121580972A_ABST
Patent Text Reader

Abstract

The invention discloses a PDF-to-DXF conversion method based on content analysis. The method comprises the following steps: preprocessing an original PDF document to obtain a single-page PDF file set, carrying out grating content detection on each PDF page file, and carrying out classification processing based on a detection result to obtain a page content type of each PDF page file; if the page content type is a pure vector page, carrying out SVG (Scalable Vector Graphics) conversion on the PDF page file by utilizing a pdftocairo tool to obtain an SVG vector file; if the page content type is a grating mixed page, processing by using a dynamic image enhancement algorithm to obtain an SVG vector file; if the page is a grating mixed page, converting the standardized SVG file into a DXF file; and if the page is a pure vector page, sequentially converting the standardized SVG file by using a pdftops tool and a pstoedit tool, and outputting a DXF file. According to the method, the grating content vectorization path and the pure vector content direct conversion path can be established, the optimal conversion path is selected for each content type, and the quality and precision of the original content are kept to the maximum extent.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of document conversion, and in particular to a PDF-to-DXF conversion method based on content analysis. BACKGROUND

[0002] PDF (Portable Document Format) is a widely used electronic document format, and is widely used in the fields of engineering design, technical drawings and document exchange. DXF (Drawing Exchange Format) is a standard format for data exchange between CAD software, and is widely used in the fields of mechanical design, construction engineering and manufacturing. The demand for converting PDF documents to DXF format is very common in engineering practice, especially when existing drawings need to be edited, modified or further designed.

[0003] The conversion methods in the prior art mainly include direct conversion method and rasterization and vectorization method. Among them, the direct conversion method directly extracts vector information through a PDF analysis engine and converts it into DXF format, mainly relying on the internal vector structure of the PDF document, and generating corresponding DXF entities by analyzing the graphic objects of the PDF; and the rasterization and vectorization method first converts the PDF page into a bitmap image, and then converts the bitmap into a vector graphic through an image vectorization algorithm, and finally outputs it as a DXF format, which is mainly suitable for PDF files containing complex graphics or scanned documents.

[0004] However, the existing conversion tools generally lack intelligent analysis capability for the content type of PDF documents, and cannot effectively distinguish between pure vector content, raster image content and mixed content in the document, so they also lack the ability to dynamically select the optimal conversion path according to the content characteristics of the document. For mixed documents containing CAD vector graphics and scanned images, existing tools often can only use a single processing method, resulting in a significant decline in conversion quality. For PDF content that is originally pure vector, unnecessary rasterization and re-vectorization processes will cause loss of mathematical precision; and for pages containing raster content, if forced to use direct vector extraction, the raster part cannot be processed correctly, resulting in information loss. This lack of targeted conversion strategy directly affects the consistency and accuracy of the final output quality. SUMMARY

[0005] The purpose of the present application is to provide a PDF-to-DXF conversion method based on content analysis to solve the technical problems of poor conversion quality and low precision of existing conversion methods in the prior art. The technical effects produced by the preferred technical solutions in the many technical solutions provided by the present application are described in detail below.

[0006] To achieve the above object, the present application provides the following technical scheme:

[0007] The PDF to DXF conversion method based on content analysis provided by the present application comprises the following steps: preprocessing an original PDF document to obtain a single-page PDF file set, wherein the single-page PDF file set comprises a plurality of PDF page files; performing raster content detection on each of the PDF page files; performing classification processing based on the detection results to obtain the page content type of each of the PDF page files; if the page content type is a pure vector page, performing SVG conversion on the PDF page file by using a pdftocairo tool to obtain an SVG vector file; if the page content type is a raster mixed page, performing processing by using a dynamic image enhancement algorithm to obtain an SVG vector file; performing standardization processing on the SVG vector file and the SVG vector file to obtain a standardized SVG file and a session memory file; judging the standardized SVG file based on the session memory file; if the raster mixed page, converting the standardized SVG file into a DXF file; if the pure vector page, sequentially converting the standardized SVG file by using a pdftops tool and a pstoedit tool, and outputting the DXF file.

[0008] In some embodiments, the raster content detection on each of the PDF page files and the classification processing based on the detection results comprise the following steps: scanning the embedded image of each of the PDF page files by using a pdfimages tool to extract the feature parameters of the embedded image; calculating the quality score of the raster content according to the feature parameters, and classifying each of the PDF page files according to a preset threshold.

[0009] In some embodiments, the processing by using the dynamic image enhancement algorithm comprises the following steps: converting the PDF page file into a PNG image by using a pdftocairo tool, adjusting the resolution of the PNG image according to the image size and pixel value, performing gray scale conversion, filter noise reduction and adaptive histogram equalization enhancement on the adjusted PNG image to obtain an enhanced image; performing contour tracing on the enhanced image by using an autotrace tool to obtain an initial vector file, performing path simplification on the initial vector file by using a Douglas-Peucker algorithm, and then eliminating redundant control points and short path segments by using an intelligent path connection and merging algorithm.

[0010] In some embodiments, the standardization of the SVG vector file and the SVG vector file obtains a standardized SVG file and a session memory file, including: adjusting the stroke width according to the page size of the SVG vector file and the SVG vector file, inserting a standardized ID tag, normalizing the coordinate system, and standardizing the color and line type to obtain the standardized SVG file; obtaining dot matrix information of the standardized SVG file, classifying the dot matrix information to obtain a content classification result, and outputting the session memory file.

[0011] In some embodiments, after the SVG conversion of the PDF page file by the pdftocairo tool, the PDF-to-DXF conversion method based on content analysis further includes: inserting a CAD-compatible ID tag into the SVG vector file, and optimizing the coordinate system and the transformation matrix.

[0012] In some embodiments, the preprocessing of the original PDF document includes: extracting metadata of the original PDF document by using the pdfinfo tool, automatically paginating the original PDF document based on the metadata to obtain a plurality of PDF page files, establishing a page index and a file identification system for each PDF page file, and recording the basic information of each PDF page file to obtain the page metadata corresponding to each PDF page file.

[0013] In some embodiments, the conversion of the standardized SVG file into a DXF file includes: calling a custom svg2dxf converter, performing SVG path analysis on the standardized SVG file based on the ezdxf library to obtain SVG path elements; converting the SVG path elements into DXF polyline entities, performing matrix operation processing on the transformation matrix of the standardized SVG file, and mapping the style attributes of the standardized SVG file to CAD layers.

[0014] In some embodiments, after the standardized SVG file is sequentially converted by the pdftops tool and the pstoedit tool to output the DXF file, the PDF-to-DXF conversion method based on content analysis further includes: adjusting the $LUNITS parameter of the DXF file to decimal mode; standardizing the coordinate system and the measurement unit of the DXF file, and resetting the identification parameters of the DXF file.

[0015] In some embodiments, the PDF-to-DXF conversion method based on content analysis further comprises: converting the PDF page file into a TIFF file using the pdftocairo tool, performing angle correction and text region detection on the TIFF file using the PaddleOCR tool, then performing confidence evaluation and result filtering on the text segments of the TIFF file to obtain a structured text file.

[0016] In some embodiments, the PDF-to-DXF conversion method based on content analysis further comprises: parsing two reference elements of the standardized SVG file, extracting the geometric transformation matrix of the reference elements, and calculating the actual coordinate positions of the two reference elements; calculating the direction vector of the reference line according to the actual coordinate positions to obtain a parallelism verification result; measuring the distance between the two reference elements in the standardized SVG file, converting the unit of application and calculating a scaling factor; constructing a unified scaling transformation matrix, updating the geometric data of the DXF file based on the scaling factor to obtain a DXF file after accurate scaling.

[0017] Implementing one of the technical solutions in the above technical solutions of the present application has the following advantages or beneficial effects: In the present application, the PDF document is subjected to raster content detection, the PDF page file is classified according to the page content type, and different conversion paths are selected according to different page contents. In this case, the present application can automatically identify and classify the vector content and raster content in the PDF document, establish a raster content vectorization path and a pure vector content direct conversion path, select the optimal conversion path for each content type, and maximize the quality and accuracy of the original content. At the same time, the present application establishes a phased processing architecture, and through the session memory mechanism, i.e., the session memory file transmits optimization information between stages, effective state tracking and batch processing consistency management are achieved. BRIEF DESCRIPTION OF DRAWINGS

[0018] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings needed in the embodiment description will be briefly introduced. Obviously, the drawings in the following description are only some embodiments of the present application, and other drawings can be obtained by those skilled in the art without creative labor, and the drawings are as follows:

[0019] Figure 1 is a flowchart of the PDF-to-DXF conversion method based on content analysis of the embodiments of the present application. DETAILED DESCRIPTION

[0020] In order to make the purposes, technical solutions and advantages of the present application clearer, the various exemplary embodiments to be described below will be described with reference to the corresponding drawings, which form part of the exemplary embodiments, and in which various exemplary embodiments that can be used to implement the present application are described. Unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The implementations described in the following exemplary embodiments do not represent all implementations consistent with the present disclosure. It should be understood that they are only examples of processes, methods and apparatuses, etc. consistent with some aspects of the present disclosure as detailed in the appended claims, and other embodiments can be used or structural and functional modifications can be made to the embodiments listed herein without departing from the scope and spirit of the present application.

[0021] In the description of the present application, it should be understood that the terms "center", "longitudinal", "transverse" and the like indicate the orientation or positional relationship based on the drawings shown, and are only for the convenience of describing the present application and simplifying the description, and do not indicate or imply that the elements referred to must have a particular orientation, be constructed and operated in a particular orientation. The terms "first", "second" and the like are only for descriptive purposes and should not be understood as indicating or implying relative importance or implicitly indicating the number of technical features indicated. The term "a plurality of" means two or more. The terms "connected", "connected" should be broadly understood, for example, it can be fixed connection, detachable connection, integral connection, mechanical connection, electrical connection, communication connection, direct connection, indirect connection through intermediate medium, internal communication of two elements or interaction relationship between two elements. The term "and / or" includes any and all combinations of one or more related listed items. For those skilled in the art, the specific meaning of the above terms in the present application can be understood according to the specific circumstances.

[0022] In order to illustrate the technical solutions described in the present application, the following will be described by specific embodiments, only showing the parts related to the embodiments of the present application.

[0023] As Figure 1 shown, the present application provides a PDF to DXF conversion method based on content analysis, comprising the following steps (steps S1 to S3):

[0024] S1, preprocessing the original PDF document to obtain a single-page PDF file set, wherein the single-page PDF file set includes a plurality of PDF page files, performing raster content detection on each PDF page file, and performing classification processing based on the detection result to obtain the page content type of each PDF page file.

[0025] In some embodiments, the preprocessing of the original PDF document can include: extracting metadata of the original PDF document by using a pdfinfo tool, automatically paginating the original PDF document based on the metadata to obtain a plurality of PDF page files, establishing a page index and a file identification system for each PDF page file, and recording basic information of each PDF page file to obtain page metadata corresponding to each PDF page file.

[0026] Specifically, the pdfinfo tool is a command line tool from the Poppler toolset or the Xpdf tool package, which can be used to extract metadata of a PDF file, where the metadata can include data attributes, creation date, author, file size, and storage location of the original PDF document. Further, the pdfinfo tool can be used to detect the page size of the original PDF document.

[0027] By establishing the page index and the file identification system, the plurality of PDF page files can be conveniently managed, referenced, and automatically processed, that is, the page order can be directly reflected by the file name, the file identification system can include a document identifier, a page number identifier, and an extension, for example, document pg01.pdf, and the page index can be 01, 02, etc. The basic information can at least include the physical size and resolution of each PDF page file.

[0028] In some embodiments, the raster content detection of each PDF page file and the classification processing based on the detection result can include: scanning embedded images of each PDF page file by using a pdfimages tool, extracting feature parameters of the embedded images, calculating a quality score of the raster content according to the feature parameters, and classifying each PDF page file according to a preset threshold.

[0029] Specifically, the pdfimages tool is a command line tool in the Poppler toolset, which can be used to extract embedded images from a PDF file, and the feature parameters can at least include the total number of pixels, resolution, and color depth. Further, the sharpness, noise, edge strength, edge continuity, etc. can be calculated by using image pixels and feature parameters, and the quality score can be calculated by comprehensively adjusting the proportion of each parameter. The page classification result can include a pure vector page and a raster mixed page, that is, it can be represented as a pure vector page: has_rasters = false, and a raster mixed page: has_rasters = true, thereby distinguishing the vector content and the raster content of the PDF page file, and finally obtaining the page content type classification result and the raster score data of each PDF page file.

[0030] S2. If the page content type is a pure vector page, use the pdftocairo tool to convert the PDF page file into SVG to obtain an SVG vector file; if the page content type is a raster hybrid page, use a dynamic image enhancement algorithm to process it to obtain an SVG vector file.

[0031] SVG is an XML-based vector image format that preserves the mathematical descriptions of geometric objects in an image, such as paths and text. The pdftocairo tool is a versatile command-line tool within the Poppler toolset that uses the Cairo graphics library to convert PDF files to various formats, including SVG. Using pdftocairo, the mathematical precision and geometric relationships of the original vectors can be maintained.

[0032] This application provides an intelligent preprocessing mechanism for different resolutions and image qualities, implementing enhancement algorithms for low-resolution images and using optimized processing parameters for high-resolution images to ensure the best balance between vectorization effect and processing efficiency.

[0033] In some embodiments, after converting PDF page files to SVG using the pdftocairo tool to obtain SVG vector files, the content analysis-based PDF to DXF conversion method may further include: inserting CAD-compatible ID tags into the SVG vector files and optimizing the coordinate system and transformation matrix. In this case, it can be ensured that the conversion from PDF to SVG not only maintains visual fidelity but also preserves mathematical accuracy and compatibility requirements with CAD systems.

[0034] In some embodiments, processing using a dynamic image enhancement algorithm may include: converting a PDF page file into a PNG image using the pdftocairo tool; adjusting the resolution of the PNG image according to its size and pixel values; performing grayscale conversion, filtering and noise reduction, and adaptive histogram equalization on the adjusted PNG image to obtain an enhanced image; performing contour tracing on the enhanced image using the autotrace tool to obtain an initial vector file; simplifying the path of the initial vector file using the Douglas-Peucker algorithm; and then using an intelligent path connection and merging algorithm to eliminate redundant control points and short path segments. This application embodiment implements intelligent path simplification, connection, and merging algorithms, provides high-precision scaling and calibration functions based on reference elements, and ensures that the generated DXF file is fully compatible with mainstream CAD software and conforms to engineering drawing standards.

[0035] Specifically, the autotrace tool can be used to convert a bitmap image into a vector image, and the enhanced image in PNG format can be converted into an initial vector file in SVG format; the Douglas-Peucker algorithm is a curve simplification algorithm used to reduce the number of points constituting a curve while maintaining the original shape characteristics.

[0036] S3, standardizing the SVG vector file and the SVG vector file to obtain a standardized SVG file and a session memory file, judging the standardized SVG file based on the session memory file, if it is a raster mixed page, converting the standardized SVG file into a DXF file; if it is a pure vector page, sequentially converting the standardized SVG file using the pdftops tool and the pstoedit tool to output a DXF file.

[0037] In this case, the optimal DXF conversion path can be selected according to different page content types, if the page originally contains raster content, the quality and details of the vectorization processing can be directly converted, if the page is a pure vector page, the mathematical precision of the original vector can be maintained.

[0038] The pdftops tool is part of the Poppler toolset and can be used to convert a PDF file into a PostScript format, and the pstoedit tool can convert a PostScript format into other vector formats, such as a DXF format.

[0039] In some embodiments, the standardized processing of the SVG vector file and the SVG vector file to obtain a standardized SVG file and a session memory file can include: adjusting the stroke width according to the page size of the SVG vector file and the SVG vector file, inserting a standardized ID tag, normalizing the coordinate system, and standardizing the color and line type to obtain a standardized SVG file; obtaining dot matrix information of the standardized SVG file, classifying the dot matrix information to obtain a content classification result, and outputting a session memory file.

[0040] Generally, the SVG file has a certain standard format, but there is still a flexible space to allow different writing methods. The SVG files generated by different converters will have small differences in format, and the standardization of the format is beneficial to the automatic process and the string between nodes, and the ID tag is used for scaling calibration. The processing path and page number of the standardized SVG file can also be obtained, which can be used to establish the basis for subsequent DXF conversion decisions.

[0041] The following is an example of a standardized SVG file:

[0042] <path

[0043] d="M 1694.0 1990.0 L 1698.0 1990.0"

[0044] fill="none"

[0045] stroke="#000000"

[0046] stroke-width="3.5"

[0047] id="path780" / >

[0048] In some embodiments, converting the standardized SVG file into the DXF file can include: calling a custom svg2dxf converter, performing SVG path parsing on the standardized SVG file based on an ezdxf library to obtain SVG path elements; converting the SVG path elements into DXF polyline entities, performing matrix operation processing on a transformation matrix of the standardized SVG file, and mapping style attributes of the standardized SVG file to CAD layers.

[0049] Specifically, the custom svg2dxf converter can refer to a converter for converting SVG format into DXF format, the ezdxf library can be used to parse path data in the standardized SVG file, such as straight line segments, Bezier curves, and other vector elements, and at the same time, it can be used to construct a structural framework of the DXF file, which can deconstruct the XML structure of the standardized SVG file to obtain all vector graphic elements and their attributes. Further, the transformation matrix includes translation, rotation, scaling, and tilting, and through matrix operation, the DXF polyline entities and the standardized SVG file can be kept the same in spatial position and dimensional proportion, and at the same time, the coordinate system of the standardized SVG file can be unified. Further, the style attributes can include color, line width, and fill, and after mapping them to the CAD layers, the corresponding color, line type, and line width can be configured for each CAD layer, so that the DXF file can be more in line with the standard engineering specifications of CAD.

[0050] In some embodiments, after the standardized SVG file is sequentially converted by using the pdftops tool and the pstoedit tool and the DXF file is output, the conversion method of converting PDF into DXF based on content analysis can further include: adjusting the $LUNITS parameter of the DXF file to decimal mode; performing standardized processing on the coordinate system and the measurement unit of the DXF file, and resetting the identification parameters of the DXF file.

[0051] Specifically, the $LUNITS parameter is used to represent the display format, which can make all sizes and coordinates displayed in decimal numbers. In the standardization of the coordinate system, the range box and the drawing limit can be defined, and in the standardization of the unit of measurement, the unit of insertion parameter can be defined, set to millimeters or inches, or choose the metric or imperial drawing standard to better match. By resetting the identification parameters of the DXF file, it can be compatible with the versions of various target CAD platforms.

[0052] In some embodiments, the PDF-to-DXF conversion method based on content analysis can further include: converting the PDF page file into a TIFF file using the pdftocairo tool, performing angle correction and text region detection on the TIFF file using the PaddleOCR tool, then performing confidence evaluation and result filtering on the text segments of the TIFF file to obtain a structured text file.

[0053] Specifically, text lines with a confidence lower than the filtering threshold can be filtered, thereby facilitating user editing of the text information of the PDF page file.

[0054] In some embodiments, the PDF-to-DXF conversion method based on content analysis can further include: parsing two reference elements of the standardized SVG file, extracting the geometric transformation matrix of the reference elements, and calculating the actual coordinate positions of the two reference elements; calculating the direction vector of the reference line according to the actual coordinate positions to obtain a parallelism verification result; measuring the distance between the two reference elements in the standardized SVG file, converting the application unit and calculating the scaling factor; applying a uniform scaling transformation matrix, updating the geometric data of the DXF file based on the scaling factor, and obtaining a precisely scaled DXF file.

[0055] Specifically, when the user needs to directly calibrate through the converter instead of subsequent manual adjustment through CAD software, the above method can be used for precise scaling calibration. In this way, all geometric elements of the standardized SVG file can be scaled according to the proportion, maintaining the complete geometric relationship and topological structure.

[0056] In this application, the PDF document is subjected to raster content detection, the PDF page file is classified according to the page content type, and different conversion paths are selected according to different page contents. In this case, the application can automatically identify and classify the vector content and raster content in the PDF document, establish a raster content vectorization path and a pure vector content direct conversion path, select the optimal conversion path for each content type, and maximize the quality and accuracy of the original content. At the same time, by establishing a phased processing architecture and through a session memory mechanism, i.e., the session memory file transmits optimization information between stages, effective state tracking and batch processing consistency management are realized.

[0057] Those skilled in the art can understand that all or part of the features / steps of the above-mentioned method embodiments can be implemented by a method, a data processing system or a computer program, and these features can be implemented in a manner of not using hardware, all using software or using a combination of hardware and software. The aforementioned computer program can be stored in one or more computer-readable storage media, and the storage media stores the computer program. When the computer program is executed by a processor, the steps of the aforementioned PDF-to-DXF conversion method based on content analysis are executed.

[0058] The aforementioned storage media that can store program codes include a static hard disk, a solid-state hard disk, a random access memory (SRAM), an electrically erasable programmable read-only memory (EEPROM), an erasable programmable read-only memory (EPROM), a programmable read-only memory (PROM), a read-only memory (ROM), an optical storage device, a magnetic storage device, a flash memory, a magnetic disk or an optical disk, and / or a combination of the above devices, i.e., can be implemented by any type of volatile or non-volatile storage device or a combination thereof.

[0059] The present application also provides a processing device embodiment, which includes one or more processors and a memory; wherein the memory is used to store one or more computer programs, and the one or more processors are used to execute the one or more computer programs stored in the memory, so that the processor executes the features / steps of the aforementioned PDF-to-DXF conversion method based on content analysis.

[0060] The above-mentioned are only the preferred embodiments of the present application, and those skilled in the art know that various changes or equivalent replacements can be made to the features and embodiments without departing from the spirit and scope of the present application. In addition, the features and embodiments can be modified to adapt to specific conditions and materials under the guidance of the present application without departing from the spirit and scope of the present application. Therefore, the present application is not limited by the specific embodiments disclosed herein, and all embodiments falling within the scope of the claims of the present application are within the protection scope of the present application.

Claims

1. A PDF to DXF conversion method based on content analysis, characterized in that, include: The original PDF document is preprocessed to obtain a set of single-page PDF files, wherein the set of single-page PDF files includes multiple PDF page files. Raster content detection is performed on each of the PDF page files, and classification processing is performed based on the detection results to obtain the page content type of each of the PDF page files. If the page content type is a pure vector page, the PDF page file is converted to SVG using the pdftocairo tool to obtain an SVG vector file; if the page content type is a raster hybrid page, it is processed using a dynamic image enhancement algorithm to obtain an SVG vector file. The SVG vector file and the SVG vector file are standardized to obtain a standardized SVG file and a session memory file. Based on the session memory file, the standardized SVG file is judged. If it is the raster hybrid page, the standardized SVG file is converted into a DXF file; if it is the pure vector page, the standardized SVG file is converted sequentially using the pdftops and pstoedit tools to output the DXF file.

2. The PDF to DXF conversion method based on content analysis according to claim 1, characterized in that, The step of performing raster content detection on each of the PDF page files and classifying them based on the detection results includes: using the pdfimages tool to scan the embedded image of each of the PDF page files and extracting the feature parameters of the embedded image; calculating the quality score of the raster content based on the feature parameters and classifying each of the PDF page files according to a preset threshold.

3. The PDF to DXF conversion method based on content analysis according to claim 1, characterized in that, The processing using the dynamic image enhancement algorithm includes: converting the PDF page file into a PNG image using the pdftocairo tool; adjusting the resolution of the PNG image according to the image size and pixel values; performing grayscale conversion, filtering and noise reduction, and adaptive histogram equalization enhancement on the adjusted PNG image to obtain an enhanced image; performing contour tracing on the enhanced image using the autotrace tool to obtain an initial vector file; simplifying the path of the initial vector file using the Douglas-Peucker algorithm; and then using an intelligent path connection and merging algorithm to eliminate redundant control points and short path segments.

4. The PDF to DXF conversion method based on content analysis according to claim 1, characterized in that, The standardization process for the SVG vector file and the SVG vector file to obtain a standardized SVG file and a session memory file includes: adjusting the stroke width according to the page size of the SVG vector file and the SVG vector file; inserting standardized ID tags; normalizing the coordinate system; and standardizing the color and line type to obtain the standardized SVG file; acquiring the bitmap information of the standardized SVG file; classifying the content according to the bitmap information to obtain the content classification result; and outputting the session memory file.

5. The PDF to DXF conversion method based on content analysis according to claim 1, characterized in that, After converting the PDF page file to SVG using the pdftocairo tool, the content analysis-based PDF to DXF conversion method further includes: inserting CAD-compatible ID tags into the SVG vector file and optimizing the coordinate system and transformation matrix.

6. The PDF to DXF conversion method based on content analysis according to claim 1, characterized in that, The original PDF document is preprocessed, including: extracting the metadata of the original PDF document using the pdfinfo tool; automatically paginating the original PDF document based on the metadata to obtain multiple PDF page files; establishing a page index and file identification system for each PDF page file; recording the basic information of each PDF page file; and obtaining the page metadata corresponding to each PDF page file.

7. The PDF to DXF conversion method based on content analysis according to claim 1, characterized in that, The step of converting the standardized SVG file into a DXF file includes: calling a custom svg2dxf converter, performing SVG path parsing on the standardized SVG file based on the ezdxf library to obtain SVG path elements; converting the SVG path elements into DXF polyline entities, performing matrix operations on the transformation matrix of the standardized SVG file, and mapping the style attributes of the standardized SVG file to a CAD layer.

8. The PDF to DXF conversion method based on content analysis according to claim 1, characterized in that, After using the pdftops and pstoedit tools to sequentially convert the standardized SVG file and output the DXF file, the content analysis-based PDF to DXF conversion method further includes: adjusting the $LUNITS parameter of the DXF file to decimal mode; standardizing the coordinate system and measurement units of the DXF file; and resetting the identifier parameters of the DXF file.

9. The PDF to DXF conversion method based on content analysis according to claim 1, characterized in that, The content analysis-based PDF to DXF conversion method further includes: using the pdftocairo tool to convert the PDF page file into a TIFF file, using the PaddleOCR tool to perform angle correction and text region detection on the TIFF file, and then performing confidence evaluation and result filtering on the text segments of the TIFF file to obtain a structured text file.

10. The PDF to DXF conversion method based on content analysis according to claim 1, characterized in that, The content analysis-based PDF to DXF conversion method further includes: parsing two reference elements of the standardized SVG file, extracting the geometric transformation matrix of the reference elements, and calculating the actual coordinate positions of the two reference elements; calculating the direction vector of the reference line based on the actual coordinate positions to obtain the parallelism verification result; measuring the distance between the two reference elements in the standardized SVG file, converting the application units and calculating the scaling factor; constructing a unified scaling transformation matrix, updating the geometric data of the DXF file based on the scaling factor, and obtaining a precisely scaled DXF file.