CN113688619A - PDF document generation method and device, electronic equipment and storage medium - Google Patents

PDF document generation method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN113688619A
CN113688619A CN202110905609.3A CN202110905609A CN113688619A CN 113688619 A CN113688619 A CN 113688619A CN 202110905609 A CN202110905609 A CN 202110905609A CN 113688619 A CN113688619 A CN 113688619A
Authority
CN
China
Prior art keywords
document
content
xml
pdf
fixed
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202110905609.3A
Other languages
Chinese (zh)
Inventor
倪俊生
张贤
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen Xumi Yuntu Space Technology Co Ltd
Original Assignee
Shenzhen Jizhi Digital Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shenzhen Jizhi Digital Technology Co Ltd filed Critical Shenzhen Jizhi Digital Technology Co Ltd
Priority to CN202110905609.3A priority Critical patent/CN113688619A/en
Publication of CN113688619A publication Critical patent/CN113688619A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/10Text processing
    • G06F40/166Editing, e.g. inserting or deleting
    • G06F40/186Templates
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/10Text processing
    • G06F40/12Use of codes for handling textual entities
    • G06F40/149Adaptation of the text data for streaming purposes, e.g. Efficient XML Interchange [EXI] format
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/10Text processing
    • G06F40/12Use of codes for handling textual entities
    • G06F40/151Transformation

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Health & Medical Sciences (AREA)
  • Artificial Intelligence (AREA)
  • Audiology, Speech & Language Pathology (AREA)
  • Computational Linguistics (AREA)
  • General Health & Medical Sciences (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Multimedia (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

The disclosure relates to the technical field of data processing, and provides a PDF document generation method and device, electronic equipment and a storage medium. The PDF document generation method comprises the following steps: acquiring a general XML template and document contents of a PDF document to be generated, wherein the general XML template comprises fixed contents and at least one parameter content; based on the fixed content and the document content, filling the corresponding content into the corresponding position of the universal XML template to obtain a target XML document; the target XML document is converted into a WORD document and the WORD document is converted into a PDF document. According to the method and the device, the universal XML template is generated based on the fixed content and the parameter content, the target XML document is converted into the PDF document based on the universal XML template, repeated calling of the fixed content can be avoided, accordingly, the pressure of a server is relieved, the document conversion efficiency is improved, and user experience is further improved.

Description

PDF document generation method and device, electronic equipment and storage medium
Technical Field
The present disclosure relates to the field of data processing technologies, and in particular, to a method and an apparatus for generating a PDF document, an electronic device, and a computer-readable storage medium.
Background
With the development of computer and network technologies, the use of electronic documents has become an essential part of people's daily life and work. Portable Document Format (PDF) documents have the reading effect of paper books and can realize what you see is what you get, so that more and more electronic books, network materials, product descriptions, contracts and the like are reserved and managed by PDF documents.
In the prior art, a PDF document is generally generated by a developer filling relevant data called from a database of a server into a hypertext Markup Language (HTML) template, debugging the HTML template filled with the data, and generating the PDF document based on the debugged HTML template. Due to the limitation of the HTML template, a large amount of fixed content data needs to be repeatedly called from the database to fill the HTML template every time the PDF document is generated, which causes a high pressure on the server, a low efficiency of document conversion, and further causes a poor user experience.
Disclosure of Invention
In view of this, embodiments of the present disclosure provide a method and an apparatus for generating a PDF document, an electronic device, and a computer-readable storage medium, so as to solve the problems in the prior art that a large amount of fixed content data needs to be repeatedly called from a database to fill in an HTML template each time a PDF document is generated, which causes increased pressure on a server, reduced efficiency of document conversion, and further causes poor user experience.
In a first aspect of the embodiments of the present disclosure, a PDF document generating method is provided, including: acquiring a general XML template and document contents of a PDF document to be generated, wherein the general XML template comprises fixed contents and at least one parameter content; based on the fixed content and the document content, filling the corresponding content into the corresponding position of the universal XML template to obtain a target XML document; the target XML document is converted into a WORD document and the WORD document is converted into a PDF document.
In a second aspect of the embodiments of the present disclosure, a PDF document generating apparatus is provided, including: the device comprises an acquisition module, a processing module and a processing module, wherein the acquisition module is configured to acquire a general XML template and document contents of a PDF document to be generated, and the general XML template comprises fixed contents and at least one parameter content; the filling module is configured to fill corresponding contents into corresponding positions of the universal XML template based on the fixed contents and the document contents to obtain a target XML document; a conversion module configured to convert the target XML document into a WORD document and to convert the WORD document into a PDF document.
In a third aspect of the embodiments of the present disclosure, an electronic device is provided, which includes a memory, a processor, and a computer program stored in the memory and executable on the processor, and the processor implements the steps of the above method when executing the computer program.
In a fourth aspect of the embodiments of the present disclosure, a computer-readable storage medium is provided, which stores a computer program, which when executed by a processor, implements the steps of the above-mentioned method.
Compared with the prior art, the embodiment of the disclosure has the following beneficial effects: acquiring a general XML template and document contents of a PDF document to be generated, wherein the general XML template comprises fixed contents and at least one parameter content; based on the fixed content and the document content, filling the corresponding content into the corresponding position of the universal XML template to obtain a target XML document; the target XML document is converted into the WORD document, the WORD document is converted into the PDF document, and repeated calling of fixed content can be avoided, so that the pressure of a server is relieved, the document conversion efficiency is improved, and the user experience is further improved.
Drawings
To more clearly illustrate the technical solutions in the embodiments of the present disclosure, the drawings needed for the embodiments or the prior art descriptions will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present disclosure, and other drawings can be obtained by those skilled in the art without inventive efforts.
Fig. 1 is a schematic flow chart of a PDF document generating method according to an embodiment of the present disclosure;
fig. 2 is a schematic flow chart of another PDF document generating method provided by the embodiment of the present disclosure;
fig. 3 is a flowchart illustrating a PDF document generating method according to another embodiment of the present disclosure;
fig. 4 is a schematic structural diagram of a PDF document generating device according to an embodiment of the present disclosure;
fig. 5 is a schematic structural diagram of an electronic device provided in an embodiment of the present disclosure.
Detailed Description
In the following description, for purposes of explanation and not limitation, specific details are set forth, such as particular system structures, techniques, etc. in order to provide a thorough understanding of the disclosed embodiments. However, it will be apparent to one skilled in the art that the present disclosure may be practiced in other embodiments that depart from these specific details. In other instances, detailed descriptions of well-known systems, devices, circuits, and methods are omitted so as not to obscure the description of the present disclosure with unnecessary detail.
Fig. 1 is a schematic flowchart of a PDF document generating method according to an embodiment of the present disclosure. The PDF document generating method of fig. 1 may be performed by a server. As shown in fig. 1, the PDF document generating method includes:
s101, acquiring a general XML template and document contents of a PDF document to be generated, wherein the general XML template comprises fixed contents and at least one parameter content;
s102, based on the fixed content and the document content, filling the corresponding content into the corresponding position of the universal XML template to obtain a target XML document;
s103, converting the target XML document into a WORD document, and converting the WORD document into a PDF document.
Specifically, the server acquires a general XML template comprising fixed content and at least one parameter content and document content of a PDF document to be generated, and fills corresponding content to a corresponding position of the general XML template based on the fixed content and the document content to obtain a target XML document; further, the server converts the target XML document into a WORD document and converts the WORD document into a PDF document.
Here, the server may be a server that provides various services, for example, a backend server that receives a request transmitted from a terminal device with which a communication connection is established, and the backend server may perform processing such as receiving and processing of the request transmitted from the terminal device and generate a processing result. The server may be one server, or a server cluster composed of a plurality of servers, or may also be one cloud computing service center, which is not limited in this disclosure. Further, the server may be hardware or software. When the server is hardware, it may be various electronic devices that provide various services to the terminal device. When the server is software, it may be implemented as multiple software or software modules for providing various services for the terminal device, or may be implemented as a single software or software module for providing various services for the terminal device, which is not limited in this disclosure. It should be noted that the specific type, number, and combination of the servers may be adjusted according to the actual requirements of the application scenario, and the embodiment of the present disclosure does not limit this. Application scenarios of the disclosed embodiments may include, but are not limited to, population heating, traffic congestion, network security, and the like.
Xml (extensible Markup language) extensible Markup language is a Markup language used for marking electronic documents to have a structure. XML is a technology which is cross-platform in the Internet environment and depends on content, is a powerful tool for processing structured document information at present, meets the requirements of Web content publishing and exchange, and is suitable for being used as a universal platform for various storage and sharing. Sharing of data or data structures in any programming language environment can be done using XML markup language. Advantages of XML include, but are not limited to, complete separation of the content and structure of XML documents, XML being easily applied across platforms, XML facilitating retrieval of information, XML extensibility, and XML fitting into object-oriented program development.
The fixed content refers to unchanged content in a target XML document generated by applying a universal XML template, and the fixed content can comprise character content and format content; the at least one parameter content is a content that changes in the target XML document generated by applying the generic XML template, and is also referred to as a variable content. Here, taking the house rental contract as an example, the fixed content may include, but is not limited to, a lessor (party a), a lessee (party b), rental house information, rental term and usage, rental money, guarantee money fee and payment method, house security management, and the like; the at least one parameter content may include a lessor name (e.g., open), corresponding to a lessor (first party), a lessee name (e.g., wangxiang), corresponding to a lessee (second party), specific information (e.g., 3 years, i.e., 11/month 1/2020 to 11/month 1/2023), corresponding to a lease term, and the like.
Conversion of the WORD document to the PDF document may be accomplished by a Jacob open source component.
According to the technical scheme provided by the embodiment of the disclosure, a general XML template and the document content of a PDF document to be generated are obtained, wherein the general XML template comprises fixed content and at least one parameter content; based on the fixed content and the document content, filling the corresponding content into the corresponding position of the universal XML template to obtain a target XML document; the target XML document is converted into the WORD document, the WORD document is converted into the PDF document, and repeated calling of fixed content can be avoided, so that the pressure of a server is relieved, the document conversion efficiency is improved, and the user experience is further improved.
In some embodiments, before obtaining the general XML template and the document content of the PDF document to be generated, the PDF document generating method further includes: initializing an original XML document to determine fixed content and at least one parameter content; a generic XML template is generated based on the fixed content and the at least one parameter content.
Specifically, a developer may initialize a plurality of original XML documents based on document contents or an application field of the original XML documents, and the like, to determine fixed contents and at least one parameter content in the plurality of original XML documents; further, the server generates a generic XML template based on the fixed content and the at least one parametric content. Here, the generic XML template refers to a template to which different XML documents can be applied.
In some embodiments, based on the fixed content and the document content, filling the corresponding content into the corresponding position of the generic XML template to obtain the target XML document, including: comparing the fixed content to the document content to determine difference content between the fixed content and the document content; replacing at least one parameter content by using the difference content as a corresponding content, and filling the corresponding content into a corresponding position of the universal XML template; and generating a target XML document based on the filled XML template.
Specifically, after acquiring the document content of the PDF document, the server compares the fixed content with the document content by using a text comparison algorithm to determine a difference content between the fixed content and the document content; further, the server uses the difference content as corresponding content to replace at least one parameter content, and fills the corresponding content into a corresponding position of the universal XML template, so as to generate a target XML document based on the XML template after the filling of the content is completed.
Here, the text comparison algorithm may include an edit distance-based text comparison algorithm, for example, an ld (levenshtein distance) algorithm; text comparison algorithms based on the longest common substrings, such as Needleman/Wunsch algorithms, may also be included, as the disclosed embodiments are not limited in this respect.
It should be noted that the text comparison algorithm is not limited to the LD algorithm and Needleman/Wunsch algorithm as described above, and may also include, for example, Nakatsu algorithm, Rocchio algorithm, naive bayes algorithm, decision tree, genetic algorithm, and the like.
In some embodiments, the converted PDF document includes a single PDF document or a plurality of PDF documents, and the PDF document generating method further includes: and when the converted PDF documents are a plurality of PDF documents, combining the plurality of PDF documents into one PDF document.
Specifically, the converted PDF document may include a single PDF document or may include multiple PDF documents, which is not limited in this disclosure. Further, when the converted PDF document includes a plurality of PDF documents, the server may merge the plurality of PDF documents to generate one PDF document.
In some embodiments, the PDF document generating method further comprises: adding a watermark to a PDF document and setting related watermark attributes, wherein the watermark comprises at least one of a character watermark and an image watermark, and the watermark attributes comprise at least one of a font, a character size, a watermark size and an angle.
Specifically, after generating the PDF document, the server may add a watermark to the generated PDF document and set a related watermark attribute, where the watermark may include at least one of a text watermark and a picture watermark, and the watermark attribute may include at least one of a font, a text size, a watermark size, and an angle.
All the above optional technical solutions may be combined arbitrarily to form optional embodiments of the present application, and are not described herein again.
Fig. 2 is a schematic flow chart of another PDF document generating method according to the embodiment of the present disclosure. As shown in fig. 2, the PDF document generating method includes:
s201, initializing an original XML document to determine fixed content and at least one parameter content;
s202, generating a universal XML template based on the fixed content and the at least one parameter content;
s203, acquiring a general XML template and document contents of a PDF document to be generated;
s204, comparing the fixed content with the document content to determine the difference content between the fixed content and the document content;
s205, replacing at least one parameter content with the difference content as a corresponding content, and filling the corresponding content into a corresponding position of the universal XML template;
s206, generating a target XML document based on the XML template after the completion of the content filling;
s207, converting the target XML document into a WORD document, and converting the WORD document into a PDF document.
Specifically, a developer may initialize an original XML document to determine fixed content and at least one parameter content; the server generates a general XML template based on the fixed content and at least one parameter content, acquires the general XML template and the document content of the PDF document to be generated, and compares the document content of the PDF document to be generated with the fixed content in the general XML template to determine the difference content between the document content and the fixed content; the server replaces at least one parameter content by using the difference content as a corresponding content, and fills the corresponding content into a corresponding position of the universal XML template; further, the server generates a target XML document based on the XML template after the content is filled, converts the target XML document into a WORD document, and converts the WORD document into a PDF document.
According to the technical scheme provided by the embodiment of the disclosure, the universal XML template is generated based on the fixed content and the parameter content, the difference content is determined based on the fixed content and the document content, and the difference content is filled into the universal XML template, so that the target XML document is converted into the PDF document, and the repeated calling of the fixed content can be avoided, thereby reducing the pressure of the server, improving the document conversion efficiency and further improving the user experience.
Fig. 3 is a flowchart illustrating a PDF document generating method according to another embodiment of the present disclosure. As shown in fig. 3, the PDF document generating method includes:
s301, initializing an original XML document to determine fixed content and at least one parameter content;
s302, generating a general XML template based on the fixed content and the at least one parameter content;
s303, acquiring a general XML template and document contents of a PDF document to be generated;
s304, based on the fixed content and the document content, filling the corresponding content into the corresponding position of the universal XML template to obtain a target XML document;
s305, converting the target XML document into a WORD document, and converting the WORD document into a PDF document;
s306, when the converted PDF document is a plurality of PDF documents, combining the plurality of PDF documents into one PDF document, and/or adding watermarks to the converted PDF document and setting related watermark attributes.
Specifically, a developer may initialize an original XML document to determine fixed content and at least one parameter content; the server generates a general XML template based on the fixed content and at least one parameter content, acquires the general XML template and the document content of the PDF document to be generated, and fills the corresponding content to the corresponding position of the general XML template based on the fixed content and the document content to obtain a target XML document; further, the server converts the target XML document into a WORD document, converts the WORD document into a PDF document, and when the converted PDF document is a plurality of PDF documents, combines the plurality of PDF documents into one PDF document, and/or adds a watermark to the converted PDF document and sets a related watermark attribute.
According to the technical scheme provided by the embodiment of the disclosure, the universal XML template is generated based on the fixed content and the parameter content, the target XML document is converted into the PDF document based on the universal XML template, and the converted PDF is merged or added with the watermark, so that repeated calling of the fixed content can be avoided, the pressure of the server is reduced, the document conversion efficiency is improved, the document display effect is enriched, the document safety is improved, and the user experience is further improved.
The following are embodiments of the disclosed apparatus that may be used to perform embodiments of the disclosed methods. For details not disclosed in the embodiments of the apparatus of the present disclosure, refer to the embodiments of the method of the present disclosure.
Fig. 4 is a schematic structural diagram of a PDF document generating device according to an embodiment of the present disclosure. As shown in fig. 4, the PDF document generating apparatus includes:
an obtaining module 401 configured to obtain a generic XML template and document content of a PDF document to be generated, where the generic XML template includes fixed content and at least one parameter content;
a filling module 402, configured to fill corresponding content into a corresponding position of the generic XML template based on the fixed content and the document content, to obtain a target XML document;
a conversion module 403 configured to convert the target XML document into a WORD document and convert the WORD document into a PDF document.
According to the technical scheme provided by the embodiment of the disclosure, a general XML template and the document content of a PDF document to be generated are obtained, wherein the general XML template comprises fixed content and at least one parameter content; based on the fixed content and the document content, filling the corresponding content into the corresponding position of the universal XML template to obtain a target XML document; the target XML document is converted into the WORD document, the WORD document is converted into the PDF document, and repeated calling of fixed content can be avoided, so that the pressure of a server is relieved, the document conversion efficiency is improved, and the user experience is further improved.
In some embodiments, the PDF document generating device further comprises: a determining module 404 configured to initialize an original XML document to determine fixed content and at least one parameter content; a generating module 405 configured to generate a generic XML template based on the fixed content and the at least one parameter content.
In some embodiments, the fill-in module 402 of FIG. 4 compares the fixed content to the document content to determine the difference content between the fixed content and the document content; replacing at least one parameter content by using the difference content as a corresponding content, and filling the corresponding content into a corresponding position of the universal XML template; and generating a target XML document based on the filled XML template.
In some embodiments, the population module 402 of fig. 4 compares the fixed content to the document content using a text comparison algorithm to determine the difference content between the fixed content and the document content, wherein the text comparison algorithm comprises an edit distance-based text comparison algorithm or a longest common substring-based text comparison algorithm.
In some embodiments, the fixed content is unchanged content in the target XML document generated by applying the generic XML template, and the at least one parameter content is changed content in the target XML document generated by applying the generic XML template.
In some embodiments, the converted PDF document includes a single PDF document or a plurality of PDF documents, and the PDF document generating device further includes: a merging module 406 configured to merge multiple PDF documents into one PDF document when the converted PDF document is multiple PDF documents.
In some embodiments, the PDF document generating device further comprises: an adding module 407 configured to add a watermark to the PDF document and set a related watermark attribute, where the watermark includes at least one of a text watermark and a picture watermark, and the watermark attribute includes at least one of a font, a text size, a watermark size, and an angle.
It should be understood that, the sequence numbers of the steps in the foregoing embodiments do not imply an execution sequence, and the execution sequence of each process should be determined by its function and inherent logic, and should not constitute any limitation on the implementation process of the embodiments of the present disclosure.
Fig. 5 is a schematic structural diagram of an electronic device 5 provided in the embodiment of the present disclosure. As shown in fig. 5, the electronic apparatus 5 of this embodiment includes: a processor 501, a memory 502 and a computer program 503 stored in the memory 502 and operable on the processor 501. The steps in the various method embodiments described above are implemented when the processor 501 executes the computer program 503. Alternatively, the processor 501 implements the functions of the respective modules/units in the above-described respective apparatus embodiments when executing the computer program 503.
Illustratively, the computer program 503 may be partitioned into one or more modules/units, which are stored in the memory 502 and executed by the processor 501 to accomplish the present disclosure. One or more modules/units may be a series of computer program instruction segments capable of performing specific functions, which are used to describe the execution of the computer program 503 in the electronic device 5.
The electronic device 5 may be a desktop computer, a notebook, a palm computer, a cloud server, or other electronic devices. The electronic device 5 may include, but is not limited to, a processor 501 and a memory 502. Those skilled in the art will appreciate that fig. 5 is merely an example of the electronic device 5, and does not constitute a limitation of the electronic device 5, and may include more or less components than those shown, or combine certain components, or be different components, e.g., the electronic device may also include input-output devices, network access devices, buses, etc.
The Processor 501 may be a Central Processing Unit (CPU), other general purpose Processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field Programmable Gate Array (FPGA) or other Programmable logic device, discrete Gate or transistor logic device, discrete hardware component, or the like. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
The storage 502 may be an internal storage unit of the electronic device 5, for example, a hard disk or a memory of the electronic device 5. The memory 502 may also be an external storage device of the electronic device 5, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), and the like provided on the electronic device 5. Further, the memory 502 may also include both internal storage units and external storage devices of the electronic device 5. The memory 502 is used for storing computer programs and other programs and data required by the electronic device. The memory 502 may also be used to temporarily store data that has been output or is to be output.
It will be apparent to those skilled in the art that, for convenience and brevity of description, only the above-mentioned division of the functional units and modules is illustrated, and in practical applications, the above-mentioned function distribution may be performed by different functional units and modules according to needs, that is, the internal structure of the apparatus is divided into different functional units or modules, so as to perform all or part of the functions described above. Each functional unit and module in the embodiments may be integrated in one processing unit, or each unit may exist alone physically, or two or more units are integrated in one unit, and the integrated unit may be implemented in a form of hardware, or in a form of software functional unit. In addition, specific names of the functional units and modules are only for convenience of distinguishing from each other, and are not used for limiting the protection scope of the present application. The specific working processes of the units and modules in the system may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
In the above embodiments, the descriptions of the respective embodiments have respective emphasis, and reference may be made to the related descriptions of other embodiments for parts that are not described or illustrated in a certain embodiment.
Those of ordinary skill in the art will appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware or combinations of computer software and electronic hardware. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present disclosure.
In the embodiments provided in the present disclosure, it should be understood that the disclosed apparatus/electronic device and method may be implemented in other ways. For example, the above-described apparatus/electronic device embodiments are merely illustrative, and for example, a module or a unit may be divided into only one logical function, and may be implemented in other ways, and multiple units or components may be combined or integrated into another system, or some features may be omitted or not implemented. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
Units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present disclosure may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The integrated modules/units, if implemented in the form of software functional units and sold or used as separate products, may be stored in a computer readable storage medium. Based on such understanding, the present disclosure may implement all or part of the flow of the method in the above embodiments, and may also be implemented by a computer program to instruct related hardware, where the computer program may be stored in a computer readable storage medium, and when the computer program is executed by a processor, the computer program may implement the steps of the above methods and embodiments. The computer program may comprise computer program code, which may be in the form of source code, object code, an executable file or some intermediate form, etc. The computer readable medium may include: any entity or device capable of carrying computer program code, recording medium, usb disk, removable hard disk, magnetic disk, optical disk, computer Memory, Read-Only Memory (ROM), Random Access Memory (RAM), electrical carrier wave signals, telecommunications signals, software distribution medium, and the like. It should be noted that the computer readable medium may contain suitable additions or additions that may be required in accordance with legislative and patent practices within the jurisdiction, for example, in some jurisdictions, computer readable media may not include electrical carrier signals or telecommunications signals in accordance with legislative and patent practices.
The above examples are only intended to illustrate the technical solutions of the present disclosure, not to limit them; although the present disclosure has been described in detail with reference to the foregoing embodiments, it should be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; such modifications and substitutions do not substantially depart from the spirit and scope of the embodiments of the present disclosure, and are intended to be included within the scope of the present disclosure.

Claims (10)

1. A PDF document generation method is characterized by comprising the following steps:
acquiring a general XML template and document contents of a PDF document to be generated, wherein the general XML template comprises fixed contents and at least one parameter content;
based on the fixed content and the document content, filling corresponding content into a corresponding position of the universal XML template to obtain a target XML document;
converting the target XML document into a WORD document, and converting the WORD document into a PDF document.
2. The method according to claim 1, wherein before the obtaining the generic XML template and the document content of the PDF document to be generated, the method further comprises:
initializing an original XML document to determine the fixed content and the at least one parameter content;
generating the generic XML template based on the fixed content and the at least one parameter content.
3. The method according to claim 1, wherein the filling corresponding content into corresponding positions of the generic XML template based on the fixed content and the document content to obtain a target XML document comprises:
comparing the fixed content to the document content to determine difference content between the fixed content and the document content;
replacing the at least one parameter content with the difference content as the corresponding content and filling the corresponding content into a corresponding position of the generic XML template;
and generating the target XML document based on the filled XML template.
4. The method of claim 3, wherein comparing the fixed content to the document content to determine a difference content between the fixed content and the document content comprises:
comparing the fixed content with the document content using a text comparison algorithm to determine difference content between the fixed content and the document content, wherein the text comparison algorithm comprises an edit distance-based text comparison algorithm or a longest common substring-based text comparison algorithm.
5. The method of claim 1, wherein the fixed content is unchanged in the target XML document generated using the generic XML template, and wherein the at least one parameter content is changed in the target XML document generated using the generic XML template.
6. The method of claim 1, wherein the converted PDF document comprises a single PDF document or multiple PDF documents, the method further comprising:
and when the converted PDF documents are a plurality of PDF documents, combining the plurality of PDF documents into one PDF document.
7. The method according to any one of claims 1 to 6, further comprising:
adding a watermark to the PDF document and setting a related watermark attribute, wherein the watermark comprises at least one of a character watermark and an image watermark, and the watermark attribute comprises at least one of a font, a character size, a watermark size and an angle.
8. A PDF document generating apparatus comprising:
the device comprises an acquisition module, a processing module and a processing module, wherein the acquisition module is configured to acquire a general XML template and document contents of a PDF document to be generated, and the general XML template comprises fixed contents and at least one parameter content;
the filling module is configured to fill corresponding contents to corresponding positions of the universal XML template based on the fixed contents and the document contents to obtain a target XML document;
a conversion module configured to convert the target XML document to a WORD document and to convert the WORD document to a PDF document.
9. An electronic device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, characterized in that the processor implements the steps of the method according to any of claims 1 to 7 when executing the computer program.
10. A computer-readable storage medium, in which a computer program is stored which, when being executed by a processor, carries out the steps of the method according to any one of claims 1 to 7.
CN202110905609.3A 2021-08-05 2021-08-05 PDF document generation method and device, electronic equipment and storage medium Pending CN113688619A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110905609.3A CN113688619A (en) 2021-08-05 2021-08-05 PDF document generation method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110905609.3A CN113688619A (en) 2021-08-05 2021-08-05 PDF document generation method and device, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN113688619A true CN113688619A (en) 2021-11-23

Family

ID=78579145

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110905609.3A Pending CN113688619A (en) 2021-08-05 2021-08-05 PDF document generation method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN113688619A (en)

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101201833A (en) * 2006-12-13 2008-06-18 鸿富锦精密工业(深圳)有限公司 System and method for filling PDF document data
CN109710902A (en) * 2018-08-17 2019-05-03 深圳壹账通智能科技有限公司 Generation method, device, equipment and the computer readable storage medium of PDF document
CN109815464A (en) * 2018-12-15 2019-05-28 中国平安人寿保险股份有限公司 PDF document generation method, device, electronic equipment and storage medium
CN110838071A (en) * 2019-11-05 2020-02-25 泰康保险集团股份有限公司 Policy data processing method and device and server
CN111797595A (en) * 2020-05-18 2020-10-20 冠群信息技术(南京)有限公司 Method and device for generating OFD format page based on XML template
CN112380828A (en) * 2020-11-03 2021-02-19 前海飞算云创数据科技(深圳)有限公司 PDF document generation method and device, storage medium and electronic equipment
CN112906351A (en) * 2021-02-05 2021-06-04 中国人民解放军六一四二八部队 PDF document generation method and device

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101201833A (en) * 2006-12-13 2008-06-18 鸿富锦精密工业(深圳)有限公司 System and method for filling PDF document data
CN109710902A (en) * 2018-08-17 2019-05-03 深圳壹账通智能科技有限公司 Generation method, device, equipment and the computer readable storage medium of PDF document
CN109815464A (en) * 2018-12-15 2019-05-28 中国平安人寿保险股份有限公司 PDF document generation method, device, electronic equipment and storage medium
CN110838071A (en) * 2019-11-05 2020-02-25 泰康保险集团股份有限公司 Policy data processing method and device and server
CN111797595A (en) * 2020-05-18 2020-10-20 冠群信息技术(南京)有限公司 Method and device for generating OFD format page based on XML template
CN112380828A (en) * 2020-11-03 2021-02-19 前海飞算云创数据科技(深圳)有限公司 PDF document generation method and device, storage medium and electronic equipment
CN112906351A (en) * 2021-02-05 2021-06-04 中国人民解放军六一四二八部队 PDF document generation method and device

Similar Documents

Publication Publication Date Title
US20100235727A1 (en) Systems and Methods for Dynamic Electronic Signature Placement
CN112650533B (en) Interface document generation method and device and terminal equipment
CN110414149A (en) A kind of analytic method and system based on AutoCAD pel drawing
CN109815464A (en) PDF document generation method, device, electronic equipment and storage medium
CN111880752B (en) Seal printing method and device, electronic equipment and storage medium
CN111143446A (en) Data structure conversion processing method and device of data object and electronic equipment
CN109447820A (en) Data processing method, device, computer equipment and storage medium
US20210279400A1 (en) Memory-efficient document processing
CN110046868A (en) A kind of method and apparatus handling msu message
CN111190750B (en) Data processing method and system
CN114780701A (en) Automatic question-answer matching method, device, computer equipment and storage medium
CN113468862A (en) Method and device for creating layout file by block chain, electronic equipment and storage medium
CN110009476A (en) A kind of method and apparatus handling application of making loans
CN107491460B (en) Data mapping method and device of adaptation system
CN117522094A (en) Seal management method, platform, electronic equipment and storage medium
CN112235409A (en) File uploading method and device, electronic equipment and computer readable storage medium
CN111324645B (en) Block chain data processing method and device
CN112069808A (en) Financing wind control method and device, computer equipment and storage medium
CN111985491A (en) Similar information merging method, device, equipment and medium based on deep learning
CN113688619A (en) PDF document generation method and device, electronic equipment and storage medium
CN116360769A (en) Code generation method, device, equipment and storage medium
CN111142863A (en) Page generation method and device
CN115712411A (en) Method and device for generating user-defined serial number
CN113688418B (en) Engineering order settlement method and system based on blockchain data storage
CN115563942A (en) Contract generation method and device, electronic equipment and computer readable medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
TA01 Transfer of patent application right
TA01 Transfer of patent application right

Effective date of registration: 20230119

Address after: 518054 cable information transmission building 25f2504, no.3369 Binhai Avenue, Haizhu community, Yuehai street, Nanshan District, Shenzhen City, Guangdong Province

Applicant after: Shenzhen Xumi yuntu Space Technology Co.,Ltd.

Address before: No.103, no.1003, Nanxin Road, Nanshan community, Nanshan street, Nanshan District, Shenzhen City, Guangdong Province

Applicant before: Shenzhen Jizhi Digital Technology Co.,Ltd.