CN104572594A - Real-time generation method of dynamic PDF (portable document format) documents - Google Patents

Real-time generation method of dynamic PDF (portable document format) documents Download PDF

Info

Publication number
CN104572594A
CN104572594A CN201510041392.0A CN201510041392A CN104572594A CN 104572594 A CN104572594 A CN 104572594A CN 201510041392 A CN201510041392 A CN 201510041392A CN 104572594 A CN104572594 A CN 104572594A
Authority
CN
China
Prior art keywords
pdf
pdf document
document
real
request
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
CN201510041392.0A
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.)
Middle Complex Protects Co Ltd
Original Assignee
Middle Complex Protects 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 Middle Complex Protects Co Ltd filed Critical Middle Complex Protects Co Ltd
Priority to CN201510041392.0A priority Critical patent/CN104572594A/en
Publication of CN104572594A publication Critical patent/CN104572594A/en
Pending legal-status Critical Current

Links

Landscapes

  • Document Processing Apparatus (AREA)

Abstract

The invention discloses a real-time generation method of dynamic PDF (portable document format) documents. The method includes the steps: S1, a client starts a request of generating a PDF document; S2, a server creates a PDF document frame according to the request of the step S1 and fills a document structure; S3, the server outputs a temporary PDF file in repose to the request, and the client stores the temporary PDF file as a PDF document. Data required by generation of the PDF document are acquired through an ashx interface, the PDF document frame is created through a third-party component, mixed content of tables and text can be generated into one PDF file which supports Chinese, the needs of clients are greatly met, and users can conveniently acquire the PDF file.

Description

Dynamic PDP Real-time Generation
Technical field
The present invention relates to document processing technology, be specifically related to dynamic PDP Real-time Generation.
Background technology
Some enterprise software application platform with user interactions in, user sometimes needs software application platform that multiple types information (as form, word etc.) is combined into the document of a similar report, be supplied to user, download for user and consult, and be uploaded to software application platform after forming map file stamped signature.Because the information generating report relates to the mixing of form and word, and the display etc. of document format, and may in the process generating report, partial information may need repeatedly to revise, thus require that the generative process of above-mentioned document can compatible eurypalynous information, and each information can upgrade and adjustment at any time, thus facilitate user to obtain and use this report document.But current existing document processing technology cannot meet the demand.
Summary of the invention
In order to solve the technical matters existing for existing document processing technology, the invention provides dynamic PDP Real-time Generation, being very easy to user and obtaining and use relevant report file.
The present invention adopts following technical scheme: dynamic PDP Real-time Generation, comprises the following steps:
S1, client initiate the request generating PDF document;
S2, service end create PDF document framework according to the request of step S1, fill file structure;
S3, service end response request export interim pdf document, save as PDF document by client.
Preferably, described step S2 service end carries out legitimate verification to the request of step S1 before creating PDF document framework.Legitimate verification process is preferably: for every a different PDF document template, construct different ashx files in service end, is used for receiving the parameter of the generation PDF document request that client is initiated, to verify the legitimacy generating PDF document request.
Preferably, described step S2 creates PDF document framework, and the process of filling file structure is:
The data generated required for PDF document are obtained, then good according to predefined PDF document paragraph layout form, the content format of the raw data formatting one-tenth PDF display translation extracted from database by ashx interface;
By third party's building component PDF document framework, and set the basic page format of this PDF document framework, utilize system file treatment mechanism FileStream to open file stream, utilize the PDF constructor that third party's assembly provides, document flow and the PDF document framework that creates are bound together; By inheriting PDF top margin page footing handle object class in third party's assembly, construct paging object, this paging object of instantiation, then this paging object instance is passed in the paging event of PDF constructor, and open point page attribute switch of PDF constructor, thus realize the PDF document automatic paging that generates and the display paging page number and total page number.
The pdf document that the present invention generates can support Chinese font, generate in described step S2 and support that the PDF content process of Chinese font is: by obtaining the environmental variance of system, the font path of acquisition system, by calling PDF composition of content function in third party's assembly, font path is passed to PDF composition of content function with the form of parameter.
The mixing content of form and word can be generated a pdf document by the present invention, the process mixing of form and word being configured to PDF content in described step S2 is: by defining multiple PDF paragraph object, the form character string needing to export and word character string are packaged into different PDF paragraph objects respectively according to the size of PDF document framework and form, then press the order of document display, described PDF paragraph object is added in PDF document framework successively.
Dynamic PDP treatment mechanism designed by the present invention, its principle is as follows: when client initiates acquisition request report file, first by third party's assembly the mode of information by document flow needing dynamic combined, be organized into the response flow information of PDF, be delivered to client in the mode of file download, user preserves these response flow data and forms a real-time PDF document.
Compared with prior art, tool of the present invention has the following advantages and beneficial effect:
1, polytype information such as dynamic combination form, word etc., meets the demand of user.
2, client preserves the pdf document of generation in real time, and service end does not retain duplicate of the document, saves the storage space of service end and the time of process data.
3, user just has the right generate and download pdf document after legitimate verification, and security is high.
Accompanying drawing explanation
Fig. 1 is product process figure of the present invention.
Embodiment
Below in conjunction with embodiment and accompanying drawing, the present invention is described in further detail, but embodiments of the present invention are not limited to this.
Embodiment
As shown in Figure 1, in the present embodiment, dynamic PDP Real-time Generation comprises the following steps:
1) client initiates the request generating PDF document.
2) service end creates PDF document framework, fills file structure, generates interim pdf document.
Client is not needed to postback process owing to dynamically generating PDF document, for every a different PDF document template, we construct different ashx files in service end, are used for receiving the parameter of generation PDF document request that client is initiated, to verify the legitimacy generating PDF document request.If it is legal to generate PDF document request, after the user profile empirical tests of namely asking, completed the establishment of PDF document by service end.
Service end is when receiving generation PDF document request, first the data generated required for PDF document are obtained by ashx interface, then good according to predefined PDF document paragraph layout form, the content format of the raw data formatting one-tenth PDF display translation extracted from database, be generally character string type, as data form character string, text description character string etc.
Then, by third party's assembly (iTextSharp), remove establishment PDF document framework, and set the basic page format of this PDF document framework, after PDF document framework sets, utilize system file treatment mechanism FileStream, open a file stream, the PDF composition of content function utilizing third party's assembly to provide, is bound together document flow and the PDF document framework created.By inheriting PDF top margin page footing handle object class in third party's assembly, construct paging object, this paging object of instantiation, then this paging object instance is passed in the paging event of PDF composition of content function, and open point page attribute switch of PDF composition of content function, thus realize the PDF document automatic paging that generates and the display paging page number and total page number.
Chinese display can be supported to allow PDF content, we are by the environmental variance of acquisition system, the font path of acquisition system, by calling PDF composition of content function in third party's assembly, font path is passed to PDF composition of content function with the form of parameter, thus generates the PDF content can supporting Chinese font.
When constructing PDF content, if run into the mixing of form and word, by defining multiple PDF paragraph object, the form character string needing to export and word character string are packaged into different PDF paragraph objects respectively according to the size of PDF document framework and form, then press the order of document display, these PDF paragraph objects are added in PDF document framework successively.After finally all document contents have constructed, close PDF document framework.Now can generate a interim pdf document in service end.
3) service end response request exports interim pdf document, saves as PDF document by client.
Service end creates a file object interim pdf document, by obtaining the instance objects of current request session, described file object by response flow, export to client according to binary stream mode, save as PDF document by client, thus complete the process of a dynamic PDP generation.
When user initiates to generate PDF document request by client, according to different users, the response that system is real-time also constructs up-to-date pdf document stream, transmits and is kept at client.If interim amendment occurs information, only need again to initiate to generate PDF document request, construct the pdf document stream made new advances, transmit and be kept at client, for user.
Above-described embodiment is one embodiment of the present invention; but embodiments of the present invention do not limit therewith; be engaged in these those skilled in the art do not deviate from the present invention spirit and principle under make any amendment, replacement, improvement, be all included in protection scope of the present invention.

Claims (8)

1. dynamic PDP Real-time Generation, is characterized in that, comprises the following steps:
S1, client initiate the request generating PDF document;
S2, service end create PDF document framework according to the request of step S1, fill file structure;
S3, service end response request export interim pdf document, save as PDF document by client.
2. dynamic PDP Real-time Generation according to claim 1, is characterized in that, described step S2 service end carries out legitimate verification to the request of step S1 before creating PDF document framework.
3. dynamic PDP Real-time Generation according to claim 2, it is characterized in that, described legitimate verification process is: for every a different PDF document template, different ashx files is constructed in service end, be used for receiving the parameter of generation PDF document request that client is initiated, to verify the legitimacy generating PDF document request.
4. dynamic PDP Real-time Generation according to claim 1, is characterized in that, described step S2 creates PDF document framework, and the process of filling file structure is:
The data generated required for PDF document are obtained, then good according to predefined PDF document paragraph layout form, the content format of the raw data formatting one-tenth PDF display translation extracted from database by ashx interface;
By third party's building component PDF document framework, and set the basic page format of this PDF document framework, utilize system file treatment mechanism FileStream to open file stream, utilize the PDF constructor that third party's assembly provides, document flow and the PDF document framework that creates are bound together; By inheriting PDF top margin page footing handle object class in third party's assembly, construct paging object, this paging object of instantiation, then this paging object instance is passed in the paging event of PDF constructor, and open point page attribute switch of PDF constructor, thus realize the PDF document automatic paging that generates and the display paging page number and total page number.
5. dynamic PDP Real-time Generation according to claim 4, it is characterized in that, described step S2 generates and supports that the PDF content process of Chinese font is: by obtaining the environmental variance of system, the font path of acquisition system, by calling PDF composition of content function in third party's assembly, font path is passed to PDF composition of content function with the form of parameter.
6. dynamic PDP Real-time Generation according to claim 4, it is characterized in that, the process that the mixing of form and word is configured to PDF content is by described step S2: by defining multiple PDF paragraph object, the form character string needing to export and word character string are packaged into different PDF paragraph objects respectively according to the size of PDF document framework and form, then press the order of document display, described PDF paragraph object is added in PDF document framework successively.
7. dynamic PDP Real-time Generation according to claim 4, is characterized in that, in described step S2, third party's assembly is iTextSharp.
8. dynamic PDP Real-time Generation according to claim 1, it is characterized in that, described step S3 service end creates file object interim pdf document, by obtaining the instance objects of current request session, described file object is exported to client by response flow, saves as PDF document by client.
CN201510041392.0A 2015-01-27 2015-01-27 Real-time generation method of dynamic PDF (portable document format) documents Pending CN104572594A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201510041392.0A CN104572594A (en) 2015-01-27 2015-01-27 Real-time generation method of dynamic PDF (portable document format) documents

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201510041392.0A CN104572594A (en) 2015-01-27 2015-01-27 Real-time generation method of dynamic PDF (portable document format) documents

Publications (1)

Publication Number Publication Date
CN104572594A true CN104572594A (en) 2015-04-29

Family

ID=53088699

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201510041392.0A Pending CN104572594A (en) 2015-01-27 2015-01-27 Real-time generation method of dynamic PDF (portable document format) documents

Country Status (1)

Country Link
CN (1) CN104572594A (en)

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105701073A (en) * 2015-12-31 2016-06-22 北京中科江南信息技术股份有限公司 Layout file generation method and device
CN108090213A (en) * 2017-12-29 2018-05-29 福建南威软件有限公司 The method that mobile terminal rapid translating generates pdf document
CN108170656A (en) * 2017-12-28 2018-06-15 阿里巴巴集团控股有限公司 Template establishment method, document creating method, rendering intent and device
CN109711458A (en) * 2018-12-24 2019-05-03 深圳市毕美科技有限公司 A kind of drawing classification management method and device
CN109710902A (en) * 2018-08-17 2019-05-03 深圳壹账通智能科技有限公司 Generation method, device, equipment and the computer readable storage medium of PDF document
CN110335652A (en) * 2019-06-28 2019-10-15 四川旅鸽科技有限公司 Medical record information synthetic method, device and server
CN113704187A (en) * 2020-05-21 2021-11-26 北京字节跳动网络技术有限公司 Method and device for generating file

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
李宽等: ""基于C# iTextSharp类库PDF文档生成技术的研究与应用"", 《昆明学院学报》 *

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105701073A (en) * 2015-12-31 2016-06-22 北京中科江南信息技术股份有限公司 Layout file generation method and device
CN108170656A (en) * 2017-12-28 2018-06-15 阿里巴巴集团控股有限公司 Template establishment method, document creating method, rendering intent and device
CN108090213A (en) * 2017-12-29 2018-05-29 福建南威软件有限公司 The method that mobile terminal rapid translating generates pdf document
CN109710902A (en) * 2018-08-17 2019-05-03 深圳壹账通智能科技有限公司 Generation method, device, equipment and the computer readable storage medium of PDF document
CN109711458A (en) * 2018-12-24 2019-05-03 深圳市毕美科技有限公司 A kind of drawing classification management method and device
CN110335652A (en) * 2019-06-28 2019-10-15 四川旅鸽科技有限公司 Medical record information synthetic method, device and server
CN113704187A (en) * 2020-05-21 2021-11-26 北京字节跳动网络技术有限公司 Method and device for generating file
CN113704187B (en) * 2020-05-21 2024-05-28 北京字节跳动网络技术有限公司 Method, apparatus, server and computer readable medium for generating file

Similar Documents

Publication Publication Date Title
CN104572594A (en) Real-time generation method of dynamic PDF (portable document format) documents
CN111176976B (en) Test data generation method and device, storage medium and electronic device
Oskinova et al. Neglecting the porosity of hot-star winds can lead to underestimating mass-loss rates
CN104252444B (en) A kind of composition method, module and the system of magazine application
JP2017523535A (en) Web content generation method and system
CN104573131B (en) Generate the method and terminal installation of item detail page data
CN104750796A (en) Method for leading out Word under BS system
CN103959281A (en) Method for associating third party content with online document signing
CN107273122A (en) Based on decoupling mechanism can iteration set up operation system method and its terminal
CN107506383B (en) Audit data processing method and computer equipment
CN103902662A (en) Test question generating method based on browser
CN101770449A (en) Dynamic report generation method and device employing XML
CN104572089B (en) The method and apparatus for generating Android installation kit
CN104766029A (en) Method and device for performing national cryptologic electronic signature processing on PDF (Portable Document Format) document
CN110705237A (en) Automatic document generation method, data processing device, and storage medium
CN112016290A (en) Automatic document typesetting method, device, equipment and storage medium
CN103631604A (en) Standardized digital learning resource management method and system based on CELTS (Chinese E-learning technology standard)-41 specification
CN109508211A (en) A kind of multilingual configuration method, device, system and electronic equipment
US11544346B2 (en) System and method for generation of starter websites
CN103914293B (en) Generate the method and server of the page
CN106502977B (en) A kind of sheet disposal method and form system based on B/S framework
CN103294463A (en) Editing system and method
KR101541659B1 (en) Microblog-based document file sharing method and device
CN115587075A (en) Layout file processing method and device, terminal equipment and storage medium
CN105488146B (en) Courseware material management method and system of computer aided training system

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
WD01 Invention patent application deemed withdrawn after publication

Application publication date: 20150429

WD01 Invention patent application deemed withdrawn after publication