CN107153636A - It is a kind of to realize the method and system that business datum is quickly exported with PDF format - Google Patents
It is a kind of to realize the method and system that business datum is quickly exported with PDF format Download PDFInfo
- Publication number
- CN107153636A CN107153636A CN201710255970.XA CN201710255970A CN107153636A CN 107153636 A CN107153636 A CN 107153636A CN 201710255970 A CN201710255970 A CN 201710255970A CN 107153636 A CN107153636 A CN 107153636A
- Authority
- CN
- China
- Prior art keywords
- business datum
- masterplates
- masterplate
- component
- 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
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F40/00—Handling natural language data
- G06F40/10—Text processing
- G06F40/12—Use of codes for handling textual entities
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F40/00—Handling natural language data
- G06F40/10—Text processing
- G06F40/166—Editing, e.g. inserting or deleting
- G06F40/186—Templates
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)
- Stored Programmes (AREA)
Abstract
The method and system of business datum are quickly exported with PDF format the present invention relates to a kind of realize, belong to business datum export field, solve export business datum in the past logic is more complicated and the problem of higher learning cost.The present invention sends the request for obtaining business datum by the querying condition according to user to server end;Received server-side is asked, business datum needed for the querying condition in request is obtained, and calls default PDF masterplates class to select required PDF masterplates from default PDF template libraries, and PDF masterplates include the masterplate component corresponding with the business datum got;Then initialize the PDF masterplates, load masterplate component, parsing business datum obtain with the corresponding information data of template assembly difference, be filled into after corresponding masterplate component and be shown PDF template generation pdf documents.For making developer, easily finishing service data, with the quick derived development task of PDF format, improve development efficiency.
Description
Technical field
Field is exported the present invention relates to business datum, more particularly to a kind of realize quickly exports business datum with PDF format
Method and system.
Background technology
, it is necessary to which the electronic document for exchanging, filing retention typically more uses PDF format, mainly in present working environment
Because PDF is not easy to be tampered, therefore many formal occasion call formats require PDF.Such as many commercial AC materials, pin
Sell agreement that personnel and user settle and signed and stamped file printout etc., it is general it is mostly is PDF format.The CRM systems of general enterprises
It is PDF format that system, particularly contract system, which can also specially require document export,.Realize that pdf document is led usually using java modes
The function of going out and download, but general logic is more complicated, and the cost learnt is also higher.
The content of the invention
The technical problems to be solved by the invention are that there is provided one kind realization is fast with PDF format in view of the shortcomings of the prior art
The method and system of speed export business datum, it is therefore intended that by providing the PDF template class defined, as long as closing developer
Business datum is noted, care PDF generating process is completely dispensed with, easily finishing service data are with the quick derived exploitation of PDF format
Task, improves development efficiency, accelerates project process.
The technical scheme that the present invention solves above-mentioned technical problem is as follows:
It is a kind of to realize the method that business datum is quickly exported with PDF format, comprise the following steps:
S1, the request for obtaining business datum is sent according to the querying condition of user to server end;
S2, the request of acquisition business datum described in received server-side, and the querying condition acquisition in request is required
Business datum, call default PDF masterplates class to select required PDF masterplates, the PDF moulds from default PDF template libraries
Version includes the masterplate component corresponding with the business datum got;
S3, initializes the PDF masterplates, loads the masterplate component in the PDF masterplates, and parses the business datum and obtains
To with the corresponding information data of template assembly difference, the information data corresponding respectively is filled into corresponding masterplate group
PDF template generation pdf documents are shown after part.
The beneficial effects of the invention are as follows:By providing the PDF template class defined, as long as making developer pay close attention to business number
According to completely dispensing with care PDF generating process, easily finishing service data are improved with the quick derived development task of PDF format
Development efficiency, accelerates project process.
On the basis of above-mentioned technical proposal, the present invention can also do following improvement:
Further, the process that required PDF masterplates are selected described in the S2 is:According to the business datum got
In all data stream types, selected from default PDF template libraries comprising the masterplate group corresponding with each data stream type
The PDF masterplates of part.
Beneficial effect using above-mentioned further scheme is:The PDF masterplates being selected can meet the various of business datum
Data flow is shown, business datum is shown according to practical situations, and practicality is high, and the applicable scope of business is wide.
Further, masterplate component includes described in the S2:
Basic format definitions component, the basic format for defining PDF masterplates according to the business datum, the fundamental mesh
Formula includes header, footer, table format, font format and total page number;
Initialization setting components, for the basic format according to the business datum Initialize installation PDF masterplates;
Document layout component, for the document content root that will be parsed in the S3 in the information data obtained after business datum
Implemented and now shown with PDF format using functional block or functional section according to the data volume of document content.
Beneficial effect using above-mentioned further scheme is:Accurately matched by the masterplate component of subdivision in business datum
Various data stream types, bandwagon effect is good, meets the demand that the specification of miscellaneous service data is quickly shown.
Further, masterplate component described in the S2 also includes watermark component, for adding in the pdf document of the generation
Plus default watermark information.
Beneficial effect using above-mentioned further scheme is:It can be helped to watermark information is added in derived PDF document
In satisfaction publicity and the effect of protection copyright.
Further, PDF masterplates required described in the S2 are multiple, and each PDF masterplates include more than one masterplate group
Part;
Also include in the S3:The information data corresponding respectively is filled into after corresponding masterplate component, called pre-
If merging PDF classes by after filling information data multiple PDF masterplates merge generation pdf document be shown.
Beneficial effect using above-mentioned further scheme is:All PDF document parts can be multiplexed single mould
Board component partial function, during exploitation, only it is to be understood that the function and the template of realization of each components, complete template function
Assembling, can be realized with the business function of rapid build oneself.
In order to solve the above-mentioned technical problem, realized the invention also provides one kind and business datum is quickly exported with PDF format
System, including with lower module:
User interactive module, sends to masterplate acquisition module for the querying condition according to user and obtains asking for business datum
Ask;
Masterplate acquisition module, the request for receiving the acquisition business datum, and querying condition in request are obtained
Required business datum is taken, calls default PDF masterplates class to select required PDF masterplates from default PDF template libraries, it is described
PDF masterplates include the masterplate component corresponding with the business datum got;
PDF generation modules, for initializing the PDF masterplates, load the masterplate component in the PDF masterplates, and parse
The business datum obtain with the corresponding information data of template assembly difference, the corresponding information data of the difference is filled
PDF masterplates are generated pdf document and are sent to user interactive module after to corresponding masterplate component and are shown.
The beneficial effects of the invention are as follows:By providing the PDF template class defined, as long as making developer pay close attention to business number
According to completely dispensing with care PDF generating process, easily finishing service data are improved with the quick derived development task of PDF format
Development efficiency, accelerates project process.
On the basis of above-mentioned technical proposal, the present invention can also do following improvement:
Further, the masterplate acquisition module is additionally operable to all Tstreams in the business datum that gets according to
Type, selects the PDF masterplates for including the masterplate component corresponding with each data stream type from default PDF template libraries.
Beneficial effect using above-mentioned further scheme is:The PDF masterplates being selected can meet the various of business datum
Data flow is shown, business datum is shown according to practical situations, and practicality is high, and the applicable scope of business is wide.
Further, masterplate component includes described in the masterplate acquisition module:
Basic format definitions component, the basic format for defining PDF masterplates according to the business datum, the fundamental mesh
Formula includes header, footer, table format, font format and total page number;
Initialization setting components, for the basic format according to the business datum Initialize installation PDF masterplates;
Document layout component, for that will be parsed in the PDF generation modules in the information data obtained after business datum
Document content is implemented using functional block or functional section according to the data volume of document content and now shown with PDF format.
Beneficial effect using above-mentioned further scheme is:Accurately matched by the masterplate component of subdivision in business datum
Various data stream types, bandwagon effect is good, meets the demand that the specification of miscellaneous service data is quickly shown.
Further, masterplate component described in the masterplate acquisition module also includes watermark component, in the generation
Default watermark information is added in pdf document.
Beneficial effect using above-mentioned further scheme is:It can be helped to watermark information is added in derived PDF document
In satisfaction publicity and the effect of protection copyright.
Further, PDF masterplates required described in the masterplate acquisition module are multiple, and each PDF masterplates include one
Above masterplate component;
The PDF generation modules are additionally operable to the information data corresponding respectively being filled into after corresponding masterplate component,
Call default merging PDF classes to merge generation pdf document and be sent to user multiple PDF masterplates after filling information data to hand over
Mutual module is shown.
Beneficial effect using above-mentioned further scheme is:All PDF document parts can be multiplexed single mould
Board component partial function, during exploitation, only it is to be understood that the function and the template of realization of each components, complete template function
Assembling, can be realized with the business function of rapid build oneself.
Brief description of the drawings
Fig. 1 is a kind of flow chart for realizing the method that business datum is quickly exported with PDF format in the embodiment of the present invention 1;
Fig. 2 is a kind of structural frames for realizing the system that business datum is quickly exported with PDF format in the embodiment of the present invention 2
Figure.
Embodiment
The principle and feature of the present invention are described below in conjunction with accompanying drawing, the given examples are served only to explain the present invention, and
It is non-to be used to limit the scope of the present invention.
Embodiment 1
As shown in figure 1, a kind of realize the method that business datum is quickly exported with PDF format, comprise the following steps:
S1, the request for obtaining business datum is sent according to the querying condition of user to server end;
S2, the request of acquisition business datum described in received server-side, and the querying condition acquisition in request is required
Business datum, call default PDF masterplates class to select required PDF masterplates, the PDF moulds from default PDF template libraries
Version includes the masterplate component corresponding with the business datum got;
S3, initializes the PDF masterplates, loads the masterplate component in the PDF masterplates, and parses the business datum and obtains
To with the corresponding information data of template assembly difference, the information data corresponding respectively is filled into corresponding masterplate group
PDF masterplates generation pdf document is shown after part.
Specifically, the present invention can (iText be for creating and operating increasing income for pdf document in Java using iText bags
Storehouse) generation and export of pdf document are completed, framework uses:Spring4 (Spring is an Open Framework, Spring be in
The Java Development Frameworks of the lightweight risen for 2003)+SpringMVC (the structure Web application journeys that Spring frameworks are provided
The global function MVC modules of sequence) a kind of+MyBatis3 (Open Framework)+Tomcat7 (Web application services popular at present
Device).Front end can use CSS (CSS, English full name with interacting for user:Cascading Style Sheets, be
One kind is used for showing the computer language of the file pattern such as HTML or XML (a subset of standard generalized markup language))+JS
(i.e. JavaScript, a kind of literal translation formula script)+HTML (application of standard generalized markup language) realizes interface exhibition
Show, and support to realize foreground export and download the usage scenarios such as printing, if need not be shown on foreground, can also only preserve file
To main frame.
Under above-mentioned framework, user is sent to server using querying condition and asked, and is asked by Spring front-end controls
DispatcherServlet (a kind of preposition controller) captures in Servelt (being the server with written in Java);
DispatcherServlet is parsed to the URL (URL) in request, obtains asking resource identifier
(URI), then according to the URI, HandlerMapping (processor mapping) is called to obtain Handler (a kind of Message Processings
Device) configuration object;The model data in Request (a kind of object of acquisition solicited message) is extracted, filling Handler enters
Ginseng, starts to perform Handler;Controller (is that one kind is responsible for processing by DispatcherServlet in SpringMVC
The controller of the request of distribution) ModelAndView (one kind bags will be returned after the processing of Handler finishing service logics
Object containing view name or view object and some model attributes) give DispatcherServlet, the response returned
PDF document, can open or preserve.
Brief flow is:Inquiry request is obtained, front-end control DispatcherServlet captures are carried out to URL in request
Parsing, obtains Handler, selects a suitable HandlerAdapter, extracts the model data in Request, filling
Handler enters ginseng, starts to perform Handler, by service layers (service layers), calling DAO layers, (DAO layers are data accesses
Layer, for accessing the persistence of database realizing data) interface, database is inquired about, business datum is returned, by template class or certainly
Definition template class (representing PDF masterplates class described in S2 in the present invention) processing business data, generate PDF document, to
DispatcherServlet returns to a ModelAndView object;Rendering result is returned to use by DispatcherServlet
Family.
The JAR that said process is used is surrounded by:Itextpdf.jar (being used for core classes processing) and itext-asian.jar
(being used for Chinese language processing), wherein application framework uses JAR (being a kind of software package file form), according to project integrated selection correspondence
Version.
PDF masterplates class can independently be defined according to traffic data type, and then obtain PDF ATLs.
IText bags realize the work of pdf document initialization, while page-size, page footing footer can be in initialization
When give tacit consent to, reduce developer work;As long as developer pays close attention to the displaying form of specific business datum and needs, commonly use
Scene be that form is fixed, business datum is different;Most work can be multiplexed template, as long as the incoming business of developer
Data, are shown by template.
By taking the document of agreement scene that sales force and user settle as an example:This kind of Documents Comparison is adapted to use template form,
If the company information of both sides is, it is necessary to which the articles of law followed and the agreement reached, respective right and obligation, occur
Solution during disagreement etc..Foreground is preserved according to template typing information.PDF template class receives foreground and looked into by querying condition
To derived document of agreement data flow is needed, the work that renders of data, generation PDF texts are completed after business datum is handled
Part, shows user, meanwhile, it can also preserve a on main frame.PDF template class is the core of function treatment.
The present invention, as long as making developer pay close attention to business datum, completely dispenses with pass by providing the PDF template class defined
Heart PDF generating process, easily finishing service data are with the quick derived development task of PDF format, and raising development efficiency is accelerated
Project process.
Further, the process that required PDF masterplates are selected described in the S2 is:According to the business datum got
In all data stream types, selected from default PDF template libraries comprising the masterplate group corresponding with each data stream type
The PDF masterplates of part.
Specifically, the data stream type selection PDF masterplates in business datum, make to include in selected PDF masterplates
There are the various elements required for business datum.
In the improvement, the PDF masterplates being selected can meet the various data flows displaying of business datum, according to practical application
Situation shows business datum, and practicality is high, and the applicable scope of business is wide.
Further, masterplate component includes described in the S2:
Basic format definitions component, the basic format for defining PDF masterplates according to the business datum, the fundamental mesh
Formula includes header, footer, table format, font format and total page number;
Initialization setting components, for the basic format according to the business datum Initialize installation PDF masterplates;
Document layout component, for the document content after business datum in the information data that obtains will to be parsed according in document
The data volume of appearance is implemented using functional block or functional section and now shown with PDF format.
Specifically, basic format component can complete to define tables of data columns, set form, definition tables width, definition
Table width percentage, background color and alignment thereof that form is set, gauge outfit element is set, set font and font format, definition
The various functions such as page-size, increase headerfooter and setting total page number.
Initialization setting components can instantiate template information, can complete when opening document, establishment one is default
The masterplate of total page number, set under footer in the page number, triggering write-in header and footer after the completion of one page loading, set header to take
Picture and the title of upper right, the position of designated pictures, total page number is set, writes header in document and the example such as specified location
Change function.
In document layout component, generally a small amount of information is shown by functional block (Chunk), such as Party A's title, first
The functions such as square address, postcode and setting underscore.When one page has multiple functional blocks, it is possible to achieve become more meticulous control
System, each little module can be handled individually, complete layout.The content of big length is controlled by functional section (Paragraph)
Make, the larger content of the length that such as both sides arrange.
In the improvement, by the masterplate component of subdivision come the accurate various data stream types matched in business datum, displaying
Effect is good, meets the demand that the specification of miscellaneous service data is quickly shown.
Further, masterplate component described in the S2 also includes watermark component, for adding in the pdf document of the generation
Plus default watermark information.
Specifically, such as addWatermark classes realize watermark function, word, picture, the anglec of rotation could be arranged to
Deng setting display location by coordinate.Watermark can be enterprise logo, literal with special effect, personalized photo miscellaneous function beautification text
Part.AddWatermark classes mainly complete the realization to watermark function by Public method PdfReader and PdfStamper.
It can solidify more than element in above-mentioned all masterplate components, all elements information is also all reusable.
In the improvement, it can help to meet publicity and protect copyright to watermark information is added in derived PDF document
Effect.
Further, PDF masterplates required described in the S2 are multiple, and each PDF masterplates include more than one masterplate group
Part;
Also include in the S3:The information data corresponding respectively is filled into after corresponding masterplate component, called pre-
If merging PDF classes by after filling information data multiple PDF masterplates merge generation pdf document be shown.
Specifically, in order to increase versatility, the function that all masterplate components are included all can be individually real in a PDF template
It is existing, it can be realized and be multiplexed by the merging to template;Merging is realized by Copypdf classes, such as Copypdf (PDFfile1,
PDFfile3, PDFfile4, PDFfile2) (merging in sequence), that is, each document order is connected as a text when showing
Part.Copypdf classes are realized by public method PdfCopy and PdfReader.PdfCopy can only realize the merging of file,
The merging of content can not be realized, i.e., every page of content is also to maintain constant.
In the improvement, all PDF document parts can be multiplexed single template assembly partial function, during exploitation,
, can be with rapid build oneself only it is to be understood that the function and the template of realization of each components, complete the assembling of template function
Business function realize.
The pdf document of generation can respond foreground request, be downloaded, and print, application, while pdf document is by file service
Device is managed collectively.PDF document on main frame can also be (a kind of to receive from network by externally providing Webservice
The request passed in other systems, the independent mechanics of communication of lightweight) etc. protocol massages, generation PDF document remotely pass
It is defeated.PDF document on main frame can by Crontab, (Crontab orders be common in Unix and class Unix operation according to rule
Among system, for setting the instruction being periodically performed) clear up and backup PDF document.
Embodiment 2
As shown in Fig. 2 a kind of realize the system that business datum is quickly exported with PDF format, including with lower module:
User interactive module, sends to masterplate acquisition module for the querying condition according to user and obtains asking for business datum
Ask, and pdf document is showed into user in the form of showing interface;
Masterplate acquisition module, the request for receiving the acquisition business datum, and querying condition in request are obtained
Required business datum is taken, calls default PDF masterplates class to select required PDF masterplates from default PDF template libraries, it is described
PDF masterplates include the masterplate component corresponding with the business datum got;
PDF generation modules, for initializing the PDF masterplates, load the masterplate component in the PDF masterplates, and parse
The business datum obtain with the corresponding information data of template assembly difference, the corresponding information data of the difference is filled
PDF masterplates are generated pdf document and are sent to user interactive module after to corresponding masterplate component and are shown.
The present invention can be using iText bags (iText be used in Java creating and operating pdf document storehouse of increasing income) come complete
Into the generation and export of pdf document, framework is used:(Spring is an Open Framework to spring4, and Spring is in 2003
Rise a lightweight Java Development Frameworks)+SpringMVC (and Spring frameworks provide structure web application it is complete
Function MVC modules)+MyBatis3 (a kind of Open Framework)+Tomcat7 (Web Application Server popular at present).Front end
CSS (CSS, English full name can be used with interacting for user:Cascading Style Sheets, are that one kind is used for
Showing the computer language of the file pattern such as HTML or XML (a subset of standard generalized markup language))+JS is (i.e.
JavaScript, a kind of literal translation formula script)+HTML (application of standard generalized markup language) realizes showing interface,
And support to realize foreground export and download the usage scenarios such as printing, if need not be shown on foreground, it can also only preserve file and arrive
Main frame.
Under above-mentioned framework, user is sent to server using querying condition and asked, and is asked by Spring front-end controls
DispatcherServlet (a kind of preposition controller) captures in Servelt (being the server with written in Java);
DispatcherServlet is parsed to the URL (URL) in request, obtains asking resource identifier
(URI), then according to the URI, HandlerMapping (processor mapping) is called to obtain Handler (a kind of Message Processings
Device) configuration object;The model data in Request (a kind of object of acquisition solicited message) is extracted, filling Handler enters
Ginseng, starts to perform Handler;Controller (is that one kind is responsible for processing by DispatcherServlet in SpringMVC
The controller of the request of distribution) ModelAndView (one kind bags will be returned after the processing of Handler finishing service logics
Object containing view name or view object and some model attributes) give DispatcherServlet, the response returned
PDF document, can open or preserve.
The brief operational process of system is:User interactive module obtains inquiry request, the control of masterplate acquisition module
DispatcherServlet is captured, and URL in request is parsed, and obtains Handler, selects one suitably
HandlerAdapter, PDF generation module extract the model data in Request, and filling Handler enters ginseng, starts to perform
Handler, by service layers (service layers), calling DAO layers, (DAO layers are data access layers, for accessing database realizing
The persistence of data) interface, database is inquired about, business datum is returned, (masterplate obtains mould by template class or self-defined template class
The classes of PDF masterplates described in block) processing business data, PDF document is generated, one is returned to DispatcherServlet
ModelAndView objects;Rendering result is returned to user interactive module by DispatcherServlet.
The JAR that said process is used is surrounded by:Itextpdf.jar (being used for core classes processing) and itext-asian.jar
(being used for Chinese language processing), wherein application framework uses JAR (being a kind of software package file form), according to project integrated selection correspondence
Version.
PDF masterplates class can independently be defined according to traffic data type, and then obtain PDF ATLs.
IText bags realize the work of pdf document initialization, while page-size, page footing footer can be in initialization
When give tacit consent to, reduce developer work;As long as developer pays close attention to the displaying form of specific business datum and needs, commonly use
Scene be that form is fixed, business datum is different;Most work can be multiplexed template, as long as the incoming business of developer
Data, are shown by template.
By taking the document of agreement scene that sales force and user settle as an example:This kind of Documents Comparison is adapted to use template form,
If the company information of both sides is, it is necessary to which the articles of law followed and the agreement reached, respective right and obligation, occur
Solution during disagreement etc..Foreground is preserved according to template typing information.PDF template class receives foreground and looked into by querying condition
To derived document of agreement data flow is needed, the work that renders of data, generation PDF texts are completed after business datum is handled
Part, shows user, meanwhile, it can also preserve a on main frame.PDF template class is the core of function treatment.
The present invention, as long as making developer pay close attention to business datum, completely dispenses with pass by providing the PDF template class defined
Heart PDF generating process, easily finishing service data are with the quick derived development task of PDF format, and raising development efficiency is accelerated
Project process.
Further, the masterplate acquisition module is additionally operable to all Tstreams in the business datum that gets according to
Type, selects the PDF masterplates for including the masterplate component corresponding with each data stream type from default PDF template libraries.
Specifically, the data stream type selection PDF masterplates in business datum, make to include in selected PDF masterplates
There are the various elements required for business datum.
In the improvement, the PDF masterplates being selected can meet the various data flows displaying of business datum, according to practical application
Situation shows business datum, and practicality is high, and the applicable scope of business is wide.
Further, masterplate component includes described in the S2:
Basic format definitions component, the basic format for defining PDF masterplates according to the business datum, the fundamental mesh
Formula includes header, footer, table format, font format and total page number;
Initialization setting components, for the basic format according to the business datum Initialize installation PDF masterplates;
Document layout component, for the document content after business datum in the information data that obtains will to be parsed according in document
The data volume of appearance is implemented using functional block or functional section and now shown with PDF format.
Specifically, basic format component can complete to define tables of data columns, set form, definition tables width, definition
Table width percentage, background color and alignment thereof that form is set, gauge outfit element is set, set font and font format, definition
The various functions such as page-size, increase headerfooter and setting total page number.
Initialization setting components can instantiate template information, can complete when opening document, establishment one is default
The masterplate of total page number, set under footer in the page number, triggering write-in header and footer after the completion of one page loading, set header to take
Picture and the title of upper right, the position of designated pictures, total page number is set, writes header in document and the example such as specified location
Change function.
In document layout component, generally a small amount of information is shown by functional block (Chunk), such as Party A's title, first
The functions such as square address, postcode and setting underscore.When one page has multiple functional blocks, it is possible to achieve become more meticulous control
System, each little module can be handled individually, complete layout.The content of big length is controlled by functional section (Paragraph)
Make, the larger content of the length that such as both sides arrange.
In the improvement, by the masterplate component of subdivision come the accurate various data stream types matched in business datum, displaying
Effect is good, meets the demand that the specification of miscellaneous service data is quickly shown.
Further, masterplate component described in the S2 also includes watermark component, for adding in the pdf document of the generation
Plus default watermark information.
Specifically, such as addWatermark classes realize watermark function, word, picture, the anglec of rotation could be arranged to
Deng setting display location by coordinate.Watermark can be enterprise logo, literal with special effect, personalized photo miscellaneous function beautification text
Part.AddWatermark classes mainly complete the realization to watermark function by Public method PdfReader and PdfStamper.
It can solidify more than element in above-mentioned all masterplate components, all elements information is also all reusable.
In the improvement, it can help to meet publicity and protect copyright to watermark information is added in derived PDF document
Effect.
Further, PDF masterplates required described in the masterplate acquisition module are multiple, and each PDF masterplates include one
Above masterplate component;
The PDF generation modules are additionally operable to the information data corresponding respectively being filled into after corresponding masterplate component,
Call default merging PDF classes to merge generation pdf document and be sent to user multiple PDF masterplates after filling information data to hand over
Mutual module is shown.
Specifically, in order to increase versatility, the function that all masterplate components are included all can be individually real in a PDF template
It is existing, it can be realized and be multiplexed by the merging to template;Merging is realized by Copypdf classes, such as Copypdf (PDFfile1,
PDFfile3, PDFfile4, PDFfile2) (merging in sequence), that is, each document order is connected as a text when showing
Part.Copypdf classes are realized by public method PdfCopy and PdfReader.PdfCopy can only realize the merging of file,
The merging of content can not be realized, i.e., every page of content is also to maintain constant.
In the improvement, all PDF document parts can be multiplexed single template assembly partial function, during exploitation,
, can be with rapid build oneself only it is to be understood that the function and the template of realization of each components, complete the assembling of template function
Business function realize.
The pdf document of generation can respond foreground request, be downloaded, and print, application, while pdf document is by file service
Device is managed collectively.PDF document on main frame can also be (a kind of to receive from network by externally providing Webservice
The request passed in other systems, the independent mechanics of communication of lightweight) etc. protocol massages, generation PDF document remotely pass
It is defeated.PDF document on main frame can by Crontab, (Crontab orders be common in Unix and class Unix operation according to rule
Among system, for setting the instruction being periodically performed) clear up and backup PDF document.
The foregoing is only presently preferred embodiments of the present invention, be not intended to limit the invention, it is all the present invention spirit and
Within principle, any modification, equivalent substitution and improvements made etc. should be included in the scope of the protection.
Claims (10)
1. a kind of realize the method that business datum is quickly exported with PDF format, it is characterised in that comprises the following steps:
S1, the request for obtaining business datum is sent according to the querying condition of user to server end;
S2, obtains the request of business datum described in received server-side, and the querying condition in request obtain needed for industry
Business data, call default PDF masterplates class to select required PDF masterplates, the PDF masterplates bag from default PDF template libraries
Containing the masterplate component corresponding with the business datum got;
S3, initializes the PDF masterplates, loads the masterplate component in the PDF masterplates, and parse the business datum obtain with
The template assembly distinguishes corresponding information data, and the information data corresponding respectively is filled into after corresponding masterplate component
PDF template generation pdf documents are shown.
2. the method that business datum is quickly exported with PDF format is realized as claimed in claim 1, it is characterised in that the S2
Described in select the processes of required PDF masterplates to be:According to all data stream types in the business datum got, from
The PDF masterplates for including the masterplate component corresponding with each data stream type are selected in default PDF template libraries.
3. the method that business datum is quickly exported with PDF format is realized as claimed in claim 2, it is characterised in that the S2
Described in masterplate component include:
Basic format definitions component, the basic format for defining PDF masterplates according to the business datum, the basic format bag
Include header, footer, table format, font format and total page number;
Initialization setting components, for the basic format according to the business datum Initialize installation PDF masterplates;
Document layout component, for the document content after business datum in the information data that obtain will to be parsed in the S3 according to text
The data volume of shelves content is implemented using functional block or functional section and now shown with PDF format.
4. the method that business datum is quickly exported with PDF format is realized as claimed in claim 3, it is characterised in that the S2
Described in masterplate component also include watermark component, for adding default watermark information in the pdf document of the generation.
5. the method that the realization as described in any one of Claims 1-4 quickly exports business datum with PDF format, its feature exists
In the PDF masterplates needed for described in the S2 are multiple, and each PDF masterplates include more than one masterplate component;
Also include in the S3:The information data corresponding respectively is filled into after corresponding masterplate component, called default
Merge PDF classes to be shown multiple PDF masterplates merging generation pdf document after filling information data.
6. a kind of realize the system that business datum is quickly exported with PDF format, it is characterised in that including with lower module:
User interactive module, the request for obtaining business datum is sent for the querying condition according to user to masterplate acquisition module;
Masterplate acquisition module, the request for receiving the acquisition business datum, and the querying condition acquisition institute in request
The business datum needed, calls default PDF masterplates class to select required PDF masterplates, the PDF from default PDF template libraries
Masterplate includes the masterplate component corresponding with the business datum got;
PDF generation modules, for initializing the PDF masterplates, load the masterplate component in the PDF masterplates, and parse described
Business datum obtain with the corresponding information data of template assembly difference, the information data corresponding respectively is filled into pair
PDF masterplates are generated pdf document and are sent to user interactive module after the masterplate component answered and are shown.
7. the system that business datum is quickly exported with PDF format is realized as claimed in claim 6, it is characterised in that the mould
Version acquisition module is additionally operable to all data stream types in the business datum that gets according to, from default PDF template libraries
In select the PDF masterplates for including the masterplate component corresponding with each data stream type.
8. the system that business datum is quickly exported with PDF format is realized as claimed in claim 7, it is characterised in that the mould
Masterplate component includes described in version acquisition module:
Basic format definitions component, the basic format for defining PDF masterplates according to the business datum, the basic format bag
Include header, footer, table format, font format and total page number;
Initialization setting components, for the basic format according to the business datum Initialize installation PDF masterplates;
Document layout component, for the document that will be parsed in the PDF generation modules in the information data obtained after business datum
Content is implemented using functional block or functional section according to the data volume of document content and now shown with PDF format.
9. the system that business datum is quickly exported with PDF format is realized as claimed in claim 8, it is characterised in that the mould
Masterplate component also includes watermark component described in version acquisition module, for adding default water in the pdf document of the generation
Official seal ceases.
10. the system that the realization as described in any one of claim 6 to 9 quickly exports business datum with PDF format, its feature exists
In the PDF masterplates needed for described in the masterplate acquisition module are multiple, and each PDF masterplates include more than one masterplate component;
The PDF generation modules are additionally operable to the information data corresponding respectively being filled into after corresponding masterplate component, call
Multiple PDF masterplates after filling information data are merged generation pdf document and are sent to user mutual mould by default merging PDF classes
Block is shown.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710255970.XA CN107153636A (en) | 2017-04-18 | 2017-04-18 | It is a kind of to realize the method and system that business datum is quickly exported with PDF format |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710255970.XA CN107153636A (en) | 2017-04-18 | 2017-04-18 | It is a kind of to realize the method and system that business datum is quickly exported with PDF format |
Publications (1)
Publication Number | Publication Date |
---|---|
CN107153636A true CN107153636A (en) | 2017-09-12 |
Family
ID=59793063
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201710255970.XA Pending CN107153636A (en) | 2017-04-18 | 2017-04-18 | It is a kind of to realize the method and system that business datum is quickly exported with PDF format |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN107153636A (en) |
Cited By (18)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108345684A (en) * | 2018-03-06 | 2018-07-31 | 弘成科技发展有限公司 | Intelligent analysis system and analysis method based on various dimensions multi objective system |
CN108491365A (en) * | 2018-02-02 | 2018-09-04 | 方欣科技有限公司 | A kind of PDF splits the method and device of combination according to different business automatically |
CN108984505A (en) * | 2018-07-17 | 2018-12-11 | 浪潮软件股份有限公司 | A kind of data resource automation sharing method and system based on operation template |
CN109635255A (en) * | 2018-12-14 | 2019-04-16 | 泰康保险集团股份有限公司 | A kind of pdf document output method, device, storage medium and electronic equipment |
CN109669718A (en) * | 2018-09-26 | 2019-04-23 | 深圳壹账通智能科技有限公司 | System permission configuration method, device, equipment and storage medium |
CN109725933A (en) * | 2018-05-24 | 2019-05-07 | 中国平安人寿保险股份有限公司 | Big data document structure tree method, apparatus, equipment and computer readable storage medium |
CN109815645A (en) * | 2019-01-25 | 2019-05-28 | 浪潮天元通信信息系统有限公司 | A method of realizing that background server exports foreground interface |
CN109815464A (en) * | 2018-12-15 | 2019-05-28 | 中国平安人寿保险股份有限公司 | PDF document generation method, device, electronic equipment and storage medium |
CN110287468A (en) * | 2019-06-27 | 2019-09-27 | 苏宁消费金融有限公司 | PDF document generation method and system suitable for online protocol |
CN110309497A (en) * | 2019-07-04 | 2019-10-08 | 苏宁消费金融有限公司 | A kind of pdf document quick-speed generation system of on-line signing agreement |
CN110335652A (en) * | 2019-06-28 | 2019-10-15 | 四川旅鸽科技有限公司 | Medical record information synthetic method, device and server |
CN111127124A (en) * | 2019-12-20 | 2020-05-08 | 深圳前海环融联易信息科技服务有限公司 | pdf electronic invoice display method and device and computer equipment |
CN111176628A (en) * | 2019-12-19 | 2020-05-19 | 福建天泉教育科技有限公司 | Front-end access method under modular architecture and storage medium |
CN109739981B (en) * | 2018-12-17 | 2020-12-29 | 四川译讯信息科技有限公司 | PDF file type judgment method and character extraction method |
CN112836468A (en) * | 2021-01-21 | 2021-05-25 | 山东健康医疗大数据有限公司 | Method and system for generating pdf document by virtue of front end and back end of server |
CN113177021A (en) * | 2021-04-28 | 2021-07-27 | 中国工商银行股份有限公司 | Data export method and device for different data sources |
CN113554546A (en) * | 2021-07-30 | 2021-10-26 | 北京东方国信科技股份有限公司 | Watermark drawing method and device |
CN114936540A (en) * | 2022-07-22 | 2022-08-23 | 深圳联友科技有限公司 | Data processing method and processing assembly of PDF document model |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101201833A (en) * | 2006-12-13 | 2008-06-18 | 鸿富锦精密工业(深圳)有限公司 | System and method for filling PDF document data |
CN104933020A (en) * | 2015-07-17 | 2015-09-23 | 北京奇虎科技有限公司 | Method and device for generating target documents based on template |
CN105740217A (en) * | 2014-12-08 | 2016-07-06 | 珠海金山办公软件有限公司 | Document generation method and device based on document template |
-
2017
- 2017-04-18 CN CN201710255970.XA patent/CN107153636A/en active Pending
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101201833A (en) * | 2006-12-13 | 2008-06-18 | 鸿富锦精密工业(深圳)有限公司 | System and method for filling PDF document data |
CN105740217A (en) * | 2014-12-08 | 2016-07-06 | 珠海金山办公软件有限公司 | Document generation method and device based on document template |
CN104933020A (en) * | 2015-07-17 | 2015-09-23 | 北京奇虎科技有限公司 | Method and device for generating target documents based on template |
Non-Patent Citations (1)
Title |
---|
BRUNO LOWAGIE: "《iText in Action(second edition)》", 31 October 2010, MANNING PUBLICATIONS * |
Cited By (24)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108491365A (en) * | 2018-02-02 | 2018-09-04 | 方欣科技有限公司 | A kind of PDF splits the method and device of combination according to different business automatically |
CN108345684A (en) * | 2018-03-06 | 2018-07-31 | 弘成科技发展有限公司 | Intelligent analysis system and analysis method based on various dimensions multi objective system |
CN109725933A (en) * | 2018-05-24 | 2019-05-07 | 中国平安人寿保险股份有限公司 | Big data document structure tree method, apparatus, equipment and computer readable storage medium |
CN108984505A (en) * | 2018-07-17 | 2018-12-11 | 浪潮软件股份有限公司 | A kind of data resource automation sharing method and system based on operation template |
CN109669718A (en) * | 2018-09-26 | 2019-04-23 | 深圳壹账通智能科技有限公司 | System permission configuration method, device, equipment and storage medium |
CN109635255A (en) * | 2018-12-14 | 2019-04-16 | 泰康保险集团股份有限公司 | A kind of pdf document output method, device, storage medium and electronic equipment |
CN109635255B (en) * | 2018-12-14 | 2023-12-19 | 泰康保险集团股份有限公司 | PDF file output method and device, storage medium and electronic equipment |
CN109815464A (en) * | 2018-12-15 | 2019-05-28 | 中国平安人寿保险股份有限公司 | PDF document generation method, device, electronic equipment and storage medium |
CN109815464B (en) * | 2018-12-15 | 2024-06-07 | 中国平安人寿保险股份有限公司 | PDF document generation method, device, electronic equipment and storage medium |
CN109739981B (en) * | 2018-12-17 | 2020-12-29 | 四川译讯信息科技有限公司 | PDF file type judgment method and character extraction method |
CN109815645A (en) * | 2019-01-25 | 2019-05-28 | 浪潮天元通信信息系统有限公司 | A method of realizing that background server exports foreground interface |
CN110287468B (en) * | 2019-06-27 | 2023-06-06 | 南银法巴消费金融有限公司 | PDF document generation method and system suitable for online protocol |
CN110287468A (en) * | 2019-06-27 | 2019-09-27 | 苏宁消费金融有限公司 | PDF document generation method and system suitable for online protocol |
CN110335652A (en) * | 2019-06-28 | 2019-10-15 | 四川旅鸽科技有限公司 | Medical record information synthetic method, device and server |
CN110309497A (en) * | 2019-07-04 | 2019-10-08 | 苏宁消费金融有限公司 | A kind of pdf document quick-speed generation system of on-line signing agreement |
CN110309497B (en) * | 2019-07-04 | 2023-06-06 | 南银法巴消费金融有限公司 | PDF file quick generation system of online signing protocol |
CN111176628A (en) * | 2019-12-19 | 2020-05-19 | 福建天泉教育科技有限公司 | Front-end access method under modular architecture and storage medium |
CN111176628B (en) * | 2019-12-19 | 2023-04-18 | 福建天泉教育科技有限公司 | Front-end access method under modular architecture and storage medium |
CN111127124A (en) * | 2019-12-20 | 2020-05-08 | 深圳前海环融联易信息科技服务有限公司 | pdf electronic invoice display method and device and computer equipment |
CN112836468A (en) * | 2021-01-21 | 2021-05-25 | 山东健康医疗大数据有限公司 | Method and system for generating pdf document by virtue of front end and back end of server |
CN113177021A (en) * | 2021-04-28 | 2021-07-27 | 中国工商银行股份有限公司 | Data export method and device for different data sources |
CN113177021B (en) * | 2021-04-28 | 2024-05-10 | 中国工商银行股份有限公司 | Data export method and device for different data sources |
CN113554546A (en) * | 2021-07-30 | 2021-10-26 | 北京东方国信科技股份有限公司 | Watermark drawing method and device |
CN114936540A (en) * | 2022-07-22 | 2022-08-23 | 深圳联友科技有限公司 | Data processing method and processing assembly of PDF document model |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN107153636A (en) | It is a kind of to realize the method and system that business datum is quickly exported with PDF format | |
CN110908712A (en) | Data processing method and equipment for cross-platform mobile terminal | |
JP4913777B2 (en) | Web page distribution system | |
US20160070677A1 (en) | Assistive technology for the visually impaired | |
EP2711846A1 (en) | Method and device for processing template file | |
CN108268262A (en) | Realize the method, apparatus and system that HTML is converted to wechat small routine | |
CN102710793B (en) | Network printing system based on cloud computing and data storage method thereof | |
CN103077185A (en) | Object-based user-defined information-expanding method | |
CN109815451B (en) | PDF (Portable document Format) generation method, device and equipment | |
CN107423004B (en) | Method for printing bill by POS terminal and POS terminal | |
CN102945287A (en) | Java server page (JSP) data automatic paging java standard tag library (JSTL) label technology and application | |
CN102999337A (en) | Browser packaging system and method | |
CN107832469A (en) | A kind of generation method and device of enterprise logo images | |
CN110780868A (en) | Website development method, device, equipment and storage medium based on componentized template | |
CN112507273A (en) | Webpage generating method and device and electronic equipment | |
CN108268260A (en) | It is a kind of quick micro- using assemble method based on integrated support technology | |
CN114416056A (en) | Page generation method, system, computer equipment and readable storage medium | |
CN106776994B (en) | Application method and system of engineering symbols in engineering report forms and web pages | |
CN111367514B (en) | Page card development method and device, computing device and storage medium | |
US20080281871A1 (en) | Method for Handling Electronic Documents | |
CN110674437A (en) | Method and device for converting webpage data into PDF (Portable document Format) attachment | |
Neumann et al. | Time for SVG—towards high quality interactive web-maps | |
CN107506597A (en) | Medical files acquisition methods, terminal and server | |
CN109739504B (en) | Method for automatically generating H5 service handling page according to background configuration | |
CN116579296A (en) | B/S architecture electronic document preview processing method, device, medium and equipment |
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 | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20170912 |
|
RJ01 | Rejection of invention patent application after publication |