PDF printing method and device, computer equipment, readable storage medium and program product
By reading the content information of PDF files and obtaining printing device parameters, the system generates print pages and rendered images adapted to different devices, solving the problem of poor output quality of PDF files on different printing devices and improving printing efficiency and quality.
Patent Information
- Application Number
- CN202411538512.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-31
- Publication Date
- 2025-02-14
AI Technical Summary
Differences between different printing devices result in poor output quality when PDF files are printed directly.
By reading the content information of the PDF file, the page information is determined and the printing parameters of the target printing device are obtained. Based on the page information and printing parameters, the layout information is determined, the print page is generated, the target image is rendered, and finally the image is sent to the printing device for printing.
It enables PDF files to be displayed correctly on various printing devices, improving printing efficiency and quality.
Smart Images

Figure CN119440437A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a PDF printing method, apparatus, computer equipment, computer-readable storage medium, and computer program product. Background Art
[0002] With the popularity of digital office, PDF (Portable Document Format) files have become one of the standard formats of electronic documents due to their cross-platform compatibility and format stability. However, due to the differences between different printing devices, directly printing PDF files may result in poor output effects. Summary of the invention
[0003] Based on this, it is necessary to provide a PDF printing method, device, computer equipment, computer-readable storage medium and computer program product to address the above technical problems, which can intelligently adapt to various printing devices to improve printing efficiency and printing quality.
[0004] In a first aspect, the present application provides a PDF printing method, comprising:
[0005] Read the content information of the PDF file to be printed, and determine the page information of the PDF file;
[0006] Get the printing parameters of the target printing device;
[0007] Determine layout information according to page information and printing parameters;
[0008] Arrange the content information according to the arrangement information and generate a print page;
[0009] Generate a target image for printing according to the printing page rendering;
[0010] Send the target image to the target printing device for printing.
[0011] In one embodiment, the page information includes page size, the printing parameters include paper size, printing direction and printing alignment, and the sorting information includes element size and coordinate position; and the arrangement information is determined according to the page information and the printing parameters, including:
[0012] Determine the scaling ratio based on page size, paper size, and printing orientation;
[0013] Determine element size based on zoom ratio and page size;
[0014] Determine the coordinate position based on the element size, paper size, and print alignment.
[0015] In one embodiment, the content information includes at least one content type and corresponding document content, and the printing parameters include the printing content type; after obtaining the printing parameters of the target printing device, the method further includes:
[0016] If the print content type includes all content types of the PDF file, then performing a step of determining arrangement information according to the page information and the print parameters;
[0017] If there is any content type in the PDF file that does not match the print content type, the content information and page information are adjusted, and based on the adjusted content information, the step of determining the arrangement information is performed according to the page information and printing parameters, and based on the adjusted content information, the step of arranging the content information according to the arrangement information to generate a print page is performed.
[0018] In one embodiment, the printing parameters include a layout type; arranging the content information according to the layout information to generate a print page includes:
[0019] Determine the content filling area according to the layout information;
[0020] According to the typesetting type, the content information is arranged in the content filling area to generate a print page.
[0021] In one embodiment, the page information includes the image resolution, and the printing parameters include the resolution; the content information is arranged according to the arrangement information, and before the print page is generated, the method further includes:
[0022] Adjusting the image content in the content information according to the resolution and the picture resolution;
[0023] Based on the adjusted content information, the step of arranging the content information according to the arrangement information to generate a print page is performed.
[0024] In one embodiment, obtaining the printing parameters of the target printing device includes:
[0025] Display the user interface;
[0026] The target printing device is determined based on the user interface, and printing parameters are obtained.
[0027] In a second aspect, the present application also provides a PDF printing device, comprising:
[0028] The file reading module is used to read the content information of the PDF file to be printed and determine the page information of the PDF file;
[0029] A parameter acquisition module, used to acquire the printing parameters of the target printing device;
[0030] The page generation module is used to determine the arrangement information according to the page information and the printing parameters; arrange the content information according to the arrangement information and generate the printing page;
[0031] A rendering module, used for generating a target image for printing according to the printing page rendering;
[0032] The printing module is used to send the target image to the target printing device for printing.
[0033] In a third aspect, the present application further provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the following steps are implemented:
[0034] Read the content information of the PDF file to be printed, and determine the page information of the PDF file;
[0035] Get the printing parameters of the target printing device;
[0036] Determine layout information according to page information and printing parameters;
[0037] Arrange the content information according to the arrangement information and generate a print page;
[0038] Generate a target image for printing according to the printing page rendering;
[0039] Send the target image to the target printing device for printing.
[0040] In a fourth aspect, the present application further provides a computer-readable storage medium having a computer program stored thereon, wherein when the computer program is executed by a processor, the following steps are implemented:
[0041] Read the content information of the PDF file to be printed, and determine the page information of the PDF file;
[0042] Get the printing parameters of the target printing device;
[0043] Determine layout information according to page information and printing parameters;
[0044] Arrange the content information according to the arrangement information and generate a print page;
[0045] Generate a target image for printing according to the printing page rendering;
[0046] Send the target image to the target printing device for printing.
[0047] In a fifth aspect, the present application further provides a computer program product, including a computer program, which implements the following steps when executed by a processor:
[0048] Read the content information of the PDF file to be printed, and determine the page information of the PDF file;
[0049] Get the printing parameters of the target printing device;
[0050] Determine layout information according to page information and printing parameters;
[0051] Arrange the content information according to the arrangement information and generate a print page;
[0052] Generate a target image for printing according to the printing page rendering;
[0053] Send the target image to the target printing device for printing.
[0054] The above-mentioned PDF printing method, device, computer equipment, computer-readable storage medium and computer program product read the content information of the PDF file to be printed and determine the page information of the PDF file; obtain the printing parameters of the target printing device; determine the arrangement information according to the page information and the printing parameters; arrange the content information according to the arrangement information to generate a printing page; generate a target image for printing according to the printing page rendering; send the target image to the target printing device for printing. In the above-mentioned manner, by generating the printing page and rendering the target image, it is ensured that the PDF file is correctly displayed on the target printing device; it can intelligently adapt to various printing devices and printing parameters to improve printing efficiency and printing quality. BRIEF DESCRIPTION OF THE DRAWINGS
[0055] In order to more clearly illustrate the technical solutions in the embodiments of the present application or related technologies, the drawings required for use in the embodiments of the present application or related technical descriptions will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.
[0056] FIG1 is an application environment diagram of a PDF printing method in one embodiment;
[0057] FIG2 is a schematic diagram of a flow chart of a PDF printing method in one embodiment;
[0058] FIG3 is a schematic flow chart of a PDF printing method in another embodiment;
[0059] FIG4 is a block diagram of a PDF printing device in one embodiment;
[0060] FIG. 5 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION
[0061] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0062] The PDF printing method provided in the embodiment of the present application can be applied in the application environment shown in Figure 1. Among them, the computer device 102 communicates with the printing device 104 through the network. The data storage system can store the data that the computer device 102 needs to process. The data storage system can be integrated on the computer device 102, or it can be placed on the cloud or other network servers. The computer device 102 obtains the PDF file, processes it through the PDF printing method provided in the embodiment of the present application, and sends it to the printing device 104 for printing. The computer device 102 can receive the PDF file uploaded by the user through the data input interface, can also read the PDF file from the data storage system, and can also receive the PDF file from other network devices. Among them, the computer device 102 can be, but is not limited to, various personal computers, laptops, smart phones, tablet computers, and Internet of Things devices. The Internet of Things devices can be smart speakers, smart TVs, smart air conditioners, projection devices, etc.
[0063] In an exemplary embodiment, as shown in FIG. 2 , a PDF printing method is provided, which is described by taking the method applied to the computer device 102 in FIG. 1 as an example, and includes:
[0064] Step 202: read the content information of the PDF file to be printed, and determine the page information of the PDF file.
[0065] Among them, the PDF parsing library is used to read the PDF file and extract the content information of each page in the PDF file, including but not limited to the text, pictures, vector images, annotations, marks, etc. in the PDF file. Each page of the PDF file is analyzed and the page information is recorded, which may include page size, image resolution, text direction, page margins, etc.
[0066] Step 204: Obtain printing parameters of the target printing device.
[0067] The printing parameters may be default parameters of the target printing device or printing parameters set by the user, such as paper size, printing direction, resolution, etc. The target printing device may be a printing device automatically matched by the computer device or a printing device selected by the user.
[0068] Step 206, determining arrangement information according to the page information and printing parameters.
[0069] Step 208, arranging the content information according to the arrangement information, and generating a print page.
[0070] Among them, based on the page information and printing parameters, the scaling ratio of the PDF file can be adjusted to adapt to the paper size, and the layout of the content in the PDF file can also be adjusted to generate layout information. Initialize the print page, and on the print page, arrange the content information of the PDF file according to the layout information to obtain a print page containing the print content.
[0071] Step 210: Generate a target image for printing according to the print page rendering.
[0072] Here, a graphics device interface or other graphics rendering technology is used to draw the page content according to the adjusted element size, element position information, etc. in the print page to generate a target image for printing.
[0073] Step 212: Send the target image to a target printing device for printing.
[0074] The generated target image is sent to the target printing device through the I / O port for physical printing.
[0075] In the above-mentioned PDF printing method, the content information of the PDF file to be printed is read, and the page information of the PDF file is determined; the printing parameters of the target printing device are obtained; the arrangement information is determined according to the page information and the printing parameters; the content information is arranged according to the arrangement information to generate a printing page; the target image for printing is generated according to the printing page rendering; and the target image is sent to the target printing device for printing. In the above-mentioned manner, by generating the printing page and rendering the target image, it is ensured that the PDF file is correctly displayed on the target printing device; it can intelligently adapt to various printing devices and printing parameters to improve printing efficiency and printing quality.
[0076] In an exemplary embodiment, the page information includes the page size, the printing parameters include the paper size, the printing direction and the printing alignment, and the sorting information includes the element size and the coordinate position; step 206 includes: determining the scaling ratio according to the page size, the paper size and the printing direction; determining the element size according to the scaling ratio and the page size; determining the coordinate position according to the element size, the paper size and the printing alignment.
[0077] The page size includes page height, page width, and page margins, etc. The side corresponding to the paper width and the side corresponding to the paper height in the page of the PDF file can be determined according to the printing direction. For example, if the printing direction is portrait printing, the page width corresponds to the paper width and the page height corresponds to the paper height; if the printing direction is landscape printing, the page width corresponds to the paper height and the page height corresponds to the paper width.
[0078] For example, the page width is x1, the page height is y1, the paper width is x2, and the paper height is y2. If the printing direction is portrait printing, the scaling ratio is the smaller value of x2 / x1 and y2 / y1. If the printing direction is landscape printing, the scaling ratio is the smaller value of x2 / y1 and y2 / x1.
[0079] In an optional implementation, an element refers to an area in a PDF page where content is displayed; the page height, page width, and page margins can determine the initial size of the area; based on the scaling ratio and the initial size of the area where content is displayed, the size of the element after adapting to the paper size can be determined. Print alignment includes center, left, right, top, bottom, etc. Based on the element size, paper size, and print alignment, the coordinate position of the area where content is displayed can be determined, such as the coordinates of the center of the area on the paper, the coordinates of the upper left vertex of the area on the paper, the coordinates of the four vertices of the area on the paper, etc.
[0080] For example, elements refer to various components constituting the content of a PDF page, such as text elements, image elements, markup elements, etc. Based on the scaling ratio and the page size, various elements are scaled to determine the element size after adapting to the paper size. Based on the element size, paper size, and print alignment, the coordinate position of each element on the paper can be determined, such as the coordinate of the center of the element on the paper.
[0081] In this embodiment, by determining the element size and coordinate position, it is possible to ensure that the page content of the PDF file adapts to the paper size and printing alignment, thereby improving the printing quality.
[0082] In an exemplary embodiment, as shown in FIG. 3 , the content information includes at least one content type and corresponding document content, and the printing parameters include the printing content type; after step 204, the method further includes:
[0083] Step 302: If the print content type includes all content types of the PDF file, a step of determining arrangement information according to page information and print parameters is performed.
[0084] The content types include text, pictures, vector images, annotations, marks, etc. By setting the print content type, the content type to be printed can be selected. If the print content type includes all content types of the PDF file, it indicates that all content in the PDF file needs to be printed, and the computer device continues to execute the subsequent steps.
[0085] Step 304, if there is any content type in the PDF file that does not match the print content type, the content information and the page information are adjusted, and based on the adjusted content information, the step of determining the arrangement information according to the page information and the printing parameters is executed, and based on the adjusted content information, the step of arranging the content information according to the arrangement information and generating a print page is executed.
[0086] If there is any content type in the PDF file that does not match the print content type, it indicates that some content in the PDF file does not need to be printed. At this time, it is necessary to adjust the content information and page information to be printed, and perform subsequent steps based on the adjusted content information and page information. Exemplarily, the annotation type is set to an unselected state, that is, the print content type does not include the annotation type. If the PDF file includes annotation content, it is necessary to adjust the content information and page information to be printed.
[0087] Optionally, based on the content type and print content type included in the content information, determine the target type not to be printed; delete the document content corresponding to the target type from the content information to obtain adjusted content information; if the target type is an annotation type, reduce at least one of the page width and the page height to obtain adjusted page information.
[0088] In this embodiment, when the content type of the PDF file matches the printing requirements, it can be automatically arranged according to the page information and printing parameters without manual intervention, thereby improving printing efficiency. When there is content in the PDF file that does not match the print content type, the content information and page information can be adjusted, and PDF files with complex layouts can be intelligently identified, and the page layout can be automatically adjusted to adapt to different printing requirements, cope with various complex printing situations, and improve printing quality.
[0089] In an exemplary embodiment, the printing parameters include a layout type; step 208 includes: determining a content filling area according to the layout information; arranging the content information in the content filling area according to the layout type to generate a print page.
[0090] Among them, the typesetting type is related to the user's printing needs, including consistent typesetting or custom typesetting. Consistent typesetting emphasizes that when printing a PDF file, the typesetting format, font, font size, word spacing, paragraph alignment, image position, etc. of the original PDF file should be maintained as much as possible. Custom typesetting includes the typesetting information configured for the printing device, such as text typesetting information (font, font size, word spacing, paragraph alignment, etc.) and image typesetting information (image size, position, border, etc.).
[0091] According to the layout information, a content filling area can be divided in the printed page. According to the layout type, layout information for arranging content information can be obtained, and according to the layout information, the content information is arranged in the content filling area to generate a printed page containing printed content.
[0092] In this embodiment, the content of the PDF document is reasonably arranged according to printing requirements, thereby improving the flexibility and diversity of PDF printing.
[0093] In an exemplary embodiment, the page information includes image resolution, and the printing parameters include resolution; before step 208, the method further includes: adjusting the image content in the content information according to the resolution and the image resolution; and executing step 208 based on the adjusted content information.
[0094] Among them, according to the printing resolution and the picture resolution, the resolution of the image content is adjusted so that the resolution of the image content is consistent with the printing resolution. This can ensure that the image content has sufficient clarity when printed, thereby improving the printing quality. On the other hand, if the picture resolution is too large, by reducing the image resolution, the size of the target image generated subsequently can be significantly reduced, thereby improving printing efficiency.
[0095] In an exemplary embodiment, step 204 includes: displaying a user interface; determining a target printing device based on the user interface, and acquiring printing parameters.
[0096] A user interface is provided to allow the user to select or automatically match a target printing device, and to allow the user to manually specify printing parameters.
[0097] It should be understood that, although the various steps in the flowcharts involved in the above-mentioned embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-mentioned embodiments can include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.
[0098] Based on the same inventive concept, the embodiment of the present application also provides a PDF printing device for implementing the PDF printing method involved above. The implementation solution provided by the device to solve the problem is similar to the implementation solution recorded in the above method, so the specific limitations in one or more PDF printing device embodiments provided below can refer to the limitations on the PDF printing method above, and will not be repeated here.
[0099] In an exemplary embodiment, as shown in FIG4 , a PDF printing device is provided, comprising:
[0100] The file reading module 402 is used to read the content information of the PDF file to be printed and determine the page information of the PDF file.
[0101] The parameter acquisition module 404 is used to acquire the printing parameters of the target printing device.
[0102] The page generation module 406 is used to determine the arrangement information according to the page information and the printing parameters; arrange the content information according to the arrangement information, and generate a printing page.
[0103] The rendering module 408 is used to generate a target image for printing according to the printing page rendering.
[0104] The printing module 410 is used to send the target image to a target printing device for printing.
[0105] In the above-mentioned PDF printing device, the content information of the PDF file to be printed is read, and the page information of the PDF file is determined; the printing parameters of the target printing device are obtained; the layout information is determined according to the page information and the printing parameters; the content information is arranged according to the layout information to generate a printing page; the target image for printing is generated according to the printing page rendering; and the target image is sent to the target printing device for printing. In the above-mentioned manner, by generating the printing page and rendering the target image, it is ensured that the PDF file is correctly displayed on the target printing device; it can intelligently adapt to various printing devices and printing parameters to improve printing efficiency and printing quality.
[0106] In an exemplary embodiment, the page information includes the page size, the printing parameters include the paper size, the printing direction and the printing alignment, and the sorting information includes the element size and the coordinate position; the page generation module 406 is also used to determine the scaling ratio according to the page size, the paper size and the printing direction; determine the element size according to the scaling ratio and the page size; determine the coordinate position according to the element size, the paper size and the printing alignment.
[0107] In an exemplary embodiment, the content information includes at least one content type and corresponding document content, and the printing parameters include the printing content type; the PDF printing device further includes an adjustment module;
[0108] The adjustment module is used to, if the print content type includes all content types of the PDF file, execute the step of determining arrangement information according to the page information and printing parameters; if there is any content type in the PDF file that does not match the print content type, adjust the content information and page information, execute the step of determining arrangement information according to the page information and printing parameters based on the adjusted content information, and execute the step of arranging the content information according to the arrangement information to generate a print page based on the adjusted content information.
[0109] In an exemplary embodiment, the printing parameters include a layout type; the page generation module 406 is further used to determine a content filling area according to the layout information; and to arrange the content information in the content filling area according to the layout type to generate a print page.
[0110] In an exemplary embodiment, the page information includes image resolution, and the printing parameters include resolution; the page generation module 406 is also used to adjust the image content in the content information according to the resolution and the image resolution; based on the adjusted content information, the content information is arranged according to the arrangement information to generate a print page.
[0111] In an exemplary embodiment, the parameter acquisition module 404 is also used to display a user interface; determine a target printing device based on the user interface, and acquire printing parameters.
[0112] Each module in the above-mentioned PDF printing device can be implemented in whole or in part by software, hardware and a combination thereof. Each of the above-mentioned modules can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in a computer device in the form of software, so that the processor can call and execute the operations corresponding to each of the above modules.
[0113] In an exemplary embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be shown in FIG5. The computer device includes a processor, a memory, an input / output interface (Input / Output, referred to as I / O) and a communication interface. The processor, the memory and the input / output interface are connected via a system bus, and the communication interface is connected to the system bus via the input / output interface. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal via a network connection. When the computer program is executed by the processor, a PDF printing method is implemented.
[0114] Those skilled in the art will understand that the structure shown in FIG. 5 is merely a block diagram of a partial structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than shown in the figure, or combine certain components, or have a different arrangement of components.
[0115] In an exemplary embodiment, a computer device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the following steps when executing the computer program: reading content information of a PDF file to be printed and determining page information of the PDF file; obtaining printing parameters of a target printing device; determining arrangement information based on the page information and the printing parameters; arranging the content information based on the arrangement information to generate a printing page; generating a target image for printing based on the printing page rendering; and sending the target image to the target printing device for printing.
[0116] In one embodiment, when the processor executes the computer program, the following steps are also implemented: determining the scaling ratio according to the page size, paper size and printing direction; determining the element size according to the scaling ratio and page size; determining the coordinate position according to the element size, paper size and printing alignment.
[0117] In one embodiment, when the processor executes the computer program, the following steps are also implemented: if the print content type includes all content types of the PDF file, the step of determining the arrangement information according to the page information and the printing parameters is executed; if there is any content type in the PDF file that does not match the print content type, the content information and the page information are adjusted, and based on the adjusted content information, the step of determining the arrangement information according to the page information and the printing parameters is executed, and based on the adjusted content information, the step of arranging the content information according to the arrangement information to generate a print page is executed.
[0118] In one embodiment, when the processor executes the computer program, the following steps are also implemented: determining the content filling area according to the arrangement information; arranging the content information in the content filling area according to the typesetting type to generate a print page.
[0119] In one embodiment, when the processor executes the computer program, it also implements the following steps: adjusting the image content in the content information according to the resolution and the picture resolution; and arranging the content information according to the arrangement information based on the adjusted content information to generate a print page.
[0120] In one embodiment, when the processor executes the computer program, the following steps are further implemented: displaying a user interface; determining a target printing device based on the user interface, and acquiring printing parameters.
[0121] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the following steps are implemented: reading content information of a PDF file to be printed and determining page information of the PDF file; obtaining printing parameters of a target printing device; determining arrangement information based on the page information and the printing parameters; arranging the content information based on the arrangement information to generate a printing page; generating a target image for printing based on the printing page rendering; and sending the target image to the target printing device for printing.
[0122] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented: determining the scaling ratio according to the page size, paper size and printing direction; determining the element size according to the scaling ratio and page size; determining the coordinate position according to the element size, paper size and printing alignment.
[0123] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: if the print content type includes all content types of the PDF file, the step of determining the arrangement information based on the page information and the printing parameters is executed; if there is any content type in the PDF file that does not match the print content type, the content information and the page information are adjusted, and based on the adjusted content information, the step of determining the arrangement information based on the page information and the printing parameters is executed, and based on the adjusted content information, the step of arranging the content information based on the arrangement information to generate a print page is executed.
[0124] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: determining the content filling area according to the arrangement information; arranging the content information in the content filling area according to the typesetting type to generate a print page.
[0125] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: adjusting the image content in the content information according to the resolution and the picture resolution; and arranging the content information according to the arrangement information based on the adjusted content information to generate a print page.
[0126] In one embodiment, when the computer program is executed by the processor, the following steps are further implemented: displaying a user interface; determining a target printing device based on the user interface, and acquiring printing parameters.
[0127] In one embodiment, a computer program product is provided, including a computer program, which, when executed by a processor, implements the following steps: reading content information of a PDF file to be printed and determining page information of the PDF file; obtaining printing parameters of a target printing device; determining arrangement information based on the page information and the printing parameters; arranging the content information based on the arrangement information to generate a printing page; generating a target image for printing based on the printing page rendering; and sending the target image to the target printing device for printing.
[0128] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented: determining the scaling ratio according to the page size, paper size and printing direction; determining the element size according to the scaling ratio and page size; determining the coordinate position according to the element size, paper size and printing alignment.
[0129] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: if the print content type includes all content types of the PDF file, the step of determining the arrangement information based on the page information and the printing parameters is executed; if there is any content type in the PDF file that does not match the print content type, the content information and the page information are adjusted, and based on the adjusted content information, the step of determining the arrangement information based on the page information and the printing parameters is executed, and based on the adjusted content information, the step of arranging the content information based on the arrangement information to generate a print page is executed.
[0130] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: determining the content filling area according to the arrangement information; arranging the content information in the content filling area according to the typesetting type to generate a print page.
[0131] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: adjusting the image content in the content information according to the resolution and the picture resolution; and arranging the content information according to the arrangement information based on the adjusted content information to generate a print page.
[0132] In one embodiment, when the computer program is executed by the processor, the following steps are further implemented: displaying a user interface; determining a target printing device based on the user interface, and acquiring printing parameters.
[0133] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant regulations.
[0134] A person of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment method can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile memory and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, an artificial intelligence (AI) processor, etc., but are not limited to this.
[0135] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this application.
[0136] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.
Claims
1. A PDF printing method, characterized in that: The method comprises: Read the content information of the PDF file to be printed, and determine the page information of the PDF file; Get the printing parameters of the target printing device; Determining arrangement information according to the page information and the printing parameters; Arranging the content information according to the arrangement information to generate a print page; Generating a target image for printing according to the printing page rendering; The target image is sent to the target printing device for printing.
2. The method according to claim 1, characterized in that The page information includes page size, the printing parameters include paper size, printing direction and printing alignment, and the sorting information includes element size and coordinate position; The determining arrangement information according to the page information and the printing parameters includes: Determining a scaling ratio according to the page size, the paper size, and the printing direction; Determining the element size according to the zoom ratio and the page size; The coordinate position is determined according to the element size, the paper size and the printing alignment.
3. The method according to claim 1, characterized in that The content information includes at least one content type and corresponding document content, and the printing parameters include the printing content type; After obtaining the printing parameters of the target printing device, the method further includes: If the print content type includes all content types of the PDF file, then performing the step of determining arrangement information according to the page information and the print parameters; If there is any content type in the PDF file that does not match the print content type, the content information and the page information are adjusted, and the step of determining the arrangement information according to the page information and the printing parameters is performed based on the adjusted content information, and the step of arranging the content information according to the arrangement information to generate a print page is performed based on the adjusted content information.
4. The method according to claim 1, characterized in that: The printing parameters include a layout type; and the content information is arranged according to the arrangement information to generate a print page, including: Determining a content filling area according to the arrangement information; The content information is arranged in the content filling area according to the type of typesetting to generate a print page.
5. The method according to claim 1, characterized in that The page information includes picture resolution, and the printing parameters include resolution; before arranging the content information according to the arrangement information and generating a print page, the method further includes: Adjusting the image content in the content information according to the resolution and the picture resolution; The step of arranging the content information according to the arrangement information to generate a print page is performed based on the adjusted content information.
6. The method according to any one of claims 1 to 5, characterized in that The step of obtaining the printing parameters of the target printing device includes: Display the user interface; A target printing device is determined based on the user interface, and printing parameters are obtained.
7. A PDF printing device, characterized in that: The device comprises: A file reading module, used to read the content information of the PDF file to be printed and determine the page information of the PDF file; A parameter acquisition module, used to acquire the printing parameters of the target printing device; A page generation module, used to determine arrangement information according to the page information and the printing parameters; arrange the content information according to the arrangement information to generate a print page; A rendering module, used for generating a target image for printing according to the printing page rendering; The printing module is used to send the target image to the target printing device for printing.
8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 6 are implemented.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.
10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.
Citation Information
Cited By
Self-adaptive adjustment method and device for printing parameters of laser printer
CN120832107A
Image printing method, image forming device and computer program product
CN121541841A