The invention discloses a method for quickly generating a PDF (
Portable Document Format) file. The method comprises the following steps of: importing or shooting an image, carrying out optimization
processing on the size of an original image
data resolution file, carrying out optimization by adopting a resolution compression
algorithm, and storing the processed image into an image file path set; uniformly putting the image file path set into a
machine learning model for detection, detecting document matrix point locations in the image file through
thread pool operation, calculating a matrix
point location set according to the matrix point locations, enabling the matrix
point location set to correspond to the image file, and performing regional image interception to obtain a regional image; storing the regional image to the local to generate a new image document; the obtained image document is loaded to a PDF document preview page, image optimization
processing is carried out in the loading process, and image document correction and tuning are carried out; and optimizing the
open source library, customizing a display rule of the calculation image on a document page, and generating a PDF file. According to the method, the image is detected and recognized in a
machine learning model mode, the image document is quickly corrected and optimized, the PDF generation mode is optimized, the recognition accuracy and definition of the image are improved, simultaneous operation of multiple images is supported, and the PDF file generation speed is high.