CN109284453A - Data download method and device based on PDF document, storage medium, terminal - Google Patents
Data download method and device based on PDF document, storage medium, terminal Download PDFInfo
- Publication number
- CN109284453A CN109284453A CN201810796560.0A CN201810796560A CN109284453A CN 109284453 A CN109284453 A CN 109284453A CN 201810796560 A CN201810796560 A CN 201810796560A CN 109284453 A CN109284453 A CN 109284453A
- Authority
- CN
- China
- Prior art keywords
- class object
- pdf document
- data
- compressed file
- text
- 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.)
- Granted
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/166—Editing, e.g. inserting or deleting
- G06F40/186—Templates
-
- Y—GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02D—CLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
- Y02D10/00—Energy efficient computing, e.g. low power processors, power management or thermal management
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)
- Information Transfer Between Computers (AREA)
Abstract
The invention discloses a kind of data download method based on PDF document and device, storage medium, terminals, it is related to technical field of data processing, main purpose is the problem of website needs the format for the data downloaded and content to be all not fixed, increase website processing pressure when these data are added to fixed PDF document template.It include: that text data, image data are obtained according to the request content carried in the data download request when receiving data download request;The text data, image data are respectively converted into the first class object, the second class object, and read the PDF document template being pre-created;It is added to the class object X, the class object Y according to first class object, the matching of the second class object, and establishes the output word throttling of the PDF document after matching;In the empty compressed file that the throttling write-in of the output word of PDF document after foundation is pre-established, and store the compressed file after the PDF document is written into the interim store path of server.
Description
Technical field
The present invention relates to a kind of technical field of data processing, more particularly to a kind of data downloading side based on PDF document
Method and device, storage medium, terminal.
Background technique
As propagating with no paper at all for data information is universal, more and more users are believed using internet site downloading data
Breath is checked.For example, in order to obtain the related data in website, user downloads from website in some big data websites
Document with PDF format, so that user prints.
Currently, available data, during generating and downloading PDF document, usual internet site is in the case where receiving data
After carrying request, website pre-establishes a fixed PDF document template, and the data downloaded will be needed to be added to PDF document template
In, still, due to website need the format of data downloaded and content be all it is unfixed, these data are added to fixed
Website processing pressure is increased when PDF document template, expands data download time, and is replaced PDF document template and be will increase
The complexity of data downloading, reduces the efficiency of data downloading.
Summary of the invention
In view of this, the present invention provides a kind of data download method based on PDF document and device, storage medium, terminal,
Main purpose be it is existing due to website needs the format of data downloaded and content be all it is unfixed, these data are added
Website processing pressure is increased when to fixed PDF document template, data download time is expanded, and replaces PDF document template
The problem of will increase the complexity of data downloading again, reducing the efficiency of data downloading.
According to the present invention on one side, a kind of data download method based on PDF document is provided, comprising:
When receiving data download request, textual data is obtained according to the request content carried in the data download request
According to, image data;
The text data, image data are respectively converted into the first class object, the second class object, and reads and is pre-created
PDF document template, be each configured with class object X, class object Y in the textview field, picture domain in the PDF document template;
According to the class object attribute of first class object and second class object, by first class object, described
Second class object matches respectively is added to the class object X, the class object Y, and establishes the output word of the PDF document after matching
Throttling;
In the empty compressed file that the output word throttling write-in of PDF document after foundation is pre-established, and will be described in write-in
Compressed file after PDF document is stored into the interim store path of server, so that user passes through the interim storage road
The data of diameter downloading PDF document.
Further, described that text data, picture number are obtained according to the request content carried in the data download request
According to before, further includes:
The PDF document template is established, and divides textview field, picture domain, the textview field in the PDF document template
In include the text filed of different names, the different names it is text filed in separately include the numbers of different text datas
It measures, attribute, includes different picture regions in the picture domain, include the corresponding position of the picture region in each picture region
Coordinate.
Further, in the empty compressed file that the output word throttling write-in of the PDF document after foundation is pre-established
Before, further includes:
It extracts in server and suspends the interim store path used, establish the empty compressed file, and by the sky
Compressed file is stored into the temporary file under the interim store path.
It is further, described that the text data, image data are respectively converted into the first class object, the second class object,
And it reads the PDF document template being pre-created and includes:
According to the definition of the data attribute of the text data and matched first class object of class object X in the textview field;
The identification code of the image data is converted into binary code, the binary code is converted to and the class object
Matched second class object of Y;
The class object Y in the class object X and picture domain of textview field in the PDF document template being pre-created is read respectively,
The class object X is the class object that can add text data, attribute, and the class object Y is the coordinate bit of addable picture data
The class object set.
Further, the class object attribute according to first class object and second class object, by described
One class object, second class object match respectively is added to the class object X, the class object Y, and establish matching after
The output word of PDF document throttles
The attribute of the class object X is initialized using AcroFields class object, it will be in first class object
The attribute of attribute and the class object X configured;
The coordinate position of the identification code of second class object and the class object Y are subjected to matching configuration, the matching
It is configured to be configured according to the preset mapping relations between the identification code and the coordinate position;
Output byte is established according to according to the PDF document after PDF document template matching configuration class object X, class object Y
Stream.
Further, in the empty compressed file that the output word throttling write-in of the PDF document after foundation is pre-established,
And will be written after the compressed file after the PDF document stores into the interim store path of server, the method is also wrapped
It includes:
After the completion of compression, the compressed file is converted into binary word output throttling in the form of output stream, so that
User downloads the compressed file.
Further, the method also includes:
The compressed file under the interim store path of the server in temporary file is removed according to prefixed time interval.
According to the present invention on one side, a kind of data download apparatus based on PDF document is provided, comprising:
Acquiring unit, for when receiving data download request, according to the request carried in the data download request
Content obtains text data, image data;
Converting unit, for the text data, image data to be respectively converted into the first class object, the second class object,
And the PDF document template being pre-created is read, the textview field, picture in the PDF document template are each configured with class pair in domain
As X, class object Y;
Adding unit, for the class object attribute according to first class object and second class object, by described
One class object, second class object match respectively is added to the class object X, the class object Y, and establish matching after
The output word of PDF document throttles;
Storage unit, for the output word throttling of the PDF document after establishing to be written in the empty compressed file pre-established,
And store the compressed file after the PDF document is written into the interim store path of server, so that user passes through institute
State the data of interim store path downloading PDF document.
Further, described device further include:
Unit is established, for establishing the PDF document template, and divides textview field, picture in the PDF document template
Domain, includes the text filed of different names in the textview field, the different names it is text filed in separately include difference
The quantity of text data, attribute include different picture regions in the picture domain, include the picture region in each picture region
The corresponding position coordinates in domain.
Further, described device further include:
Extraction unit establishes the pneumatics contracting text for extracting the interim store path for suspending in server and using
Part, and the empty compressed file is stored into the temporary file under the interim store path.
Further, the converting unit includes:
Definition module is matched for being defined according to the data attribute of the text data with class object X in the textview field
The first class object;
Conversion module converts the binary code for the identification code of the image data to be converted to binary code
For with matched second class object of the class object Y;
Read module, for reading class object X and the picture domain of textview field in the PDF document template being pre-created respectively
In class object Y, the class object X be the class object that can add text data, attribute, the class object Y is addable picture
The class object of the coordinate position of data.
Further, the adding unit includes:
First configuration module will for being initialized the attribute of the class object X using AcroFields class object
The attribute of attribute and the class object X in first class object is configured;
Second configuration module, for carrying out the coordinate position of the identification code of second class object and the class object Y
Matching configuration, it is described to be configured to be matched according to the preset mapping relations between the identification code and the coordinate position
It sets;
Module is established, for according to according to the PDF text after PDF document template matching configuration class object X, class object Y
Shelves establish output word throttling.
Further, the converting unit, is also used to after the completion of compression, is turned the compressed file in the form of output stream
It is changed to binary word output throttling, so that user downloads the compressed file.
Further, described device further include:
Clearing cell, under the interim store path for removing the server according to prefixed time interval in temporary file
Compressed file.
According to another aspect of the invention, a kind of storage medium is provided, at least one is stored in the storage medium can
It executes instruction, the executable instruction makes processor execute such as the corresponding operation of the above-mentioned data download method based on PDF document.
In accordance with a further aspect of the present invention, a kind of terminal is provided, comprising: processor, memory, communication interface and communication
Bus, the processor, the memory and the communication interface complete mutual communication by the communication bus;
For the memory for storing an at least executable instruction, it is above-mentioned that the executable instruction executes the processor
The corresponding operation of data download method based on PDF document.
By above-mentioned technical proposal, technical solution provided in an embodiment of the present invention is at least had the advantage that
The present invention provides a kind of data download method based on PDF document and device, storage medium, terminals, first when
When receiving data download request, text data, picture number are obtained according to the request content carried in the data download request
According to;The text data, image data are respectively converted into the first class object, the second class object, and read the PDF being pre-created
Document template is each configured with class object X, class object Y in the textview field, picture domain in the PDF document template;According to described
The class object attribute of first class object and second class object, by first class object, second class object difference
Output word with the PDF document for being added to the class object X, the class object Y, and establishing after matching throttles;After foundation
In the empty compressed file that pre-establishes of output word throttling write-in of PDF document, and the compressed file after the PDF document will be written
It stores into the interim store path of server, so that user downloads the data of PDF document by the interim store path.
Compared with website needs the format of data downloaded and content to be all unfixed, the embodiment of the present invention, which will pass through, to request
Text data, image data are converted to the first class object that may be added to that in PDF document template, the second class object, then by
One class object, the matching of the second class object are added in corresponding class object X, class object Y, then with the output byte of PDF document
Manifold formula is written in empty compressed file, compressed file is stored into interim store path, to realize text data, image data
It is flexibly added in PDF document, reduces website processing pressure, reduce data download time, flexile textview field, figure
Piece domain can reduce the complexity of the addition downloading data of PDF document template, to improve data download efficiency.
The above description is only an overview of the technical scheme of the present invention, in order to better understand the technical means of the present invention,
And it can be implemented in accordance with the contents of the specification, and in order to allow above and other objects of the present invention, feature and advantage can
It is clearer and more comprehensible, the followings are specific embodiments of the present invention.
Detailed description of the invention
By reading the following detailed description of the preferred embodiment, various other advantages and benefits are common for this field
Technical staff will become clear.The drawings are only for the purpose of illustrating a preferred embodiment, and is not considered as to the present invention
Limitation.And throughout the drawings, the same reference numbers will be used to refer to the same parts.In the accompanying drawings:
Fig. 1 shows a kind of data download method flow chart based on PDF document provided in an embodiment of the present invention;
Fig. 2 shows another data download method flow charts based on PDF document provided in an embodiment of the present invention;
Fig. 3 shows a kind of data download apparatus block diagram based on PDF document provided in an embodiment of the present invention;
Fig. 4 shows another data download apparatus block diagram based on PDF document provided in an embodiment of the present invention;
Fig. 5 shows a kind of structural schematic diagram of terminal provided in an embodiment of the present invention.
Specific embodiment
Exemplary embodiments of the present disclosure are described in more detail below with reference to accompanying drawings.Although showing the disclosure in attached drawing
Exemplary embodiment, it being understood, however, that may be realized in various forms the disclosure without should be by embodiments set forth here
It is limited.On the contrary, these embodiments are provided to facilitate a more thoroughly understanding of the present invention, and can be by the scope of the present disclosure
It is fully disclosed to those skilled in the art.
The embodiment of the invention provides a kind of data download methods based on PDF document, as shown in Figure 1, the method packet
It includes:
101, when receiving data download request, text is obtained according to the request content carried in the data download request
Notebook data, image data.
Wherein, the request content is the specific data for needing to be downloaded, these data can store in the database,
Also it can store in the caching of server, the embodiment of the present invention is not specifically limited.In addition, the text data is specific
The data such as text, number, the image data is to be shown image data, when receiving data download request, Ke Yigen
It is the historical viewings record that user on October 3 logs in network address a according to request content, such as request content, then it can be by being stored in clothes
Historical viewings record in business device gets text data, the image data on October 3.
It should be noted that the text data got is the data such as specific text, number, and the picture number got
According to being then the identification code of picture, such as bar code, bar code sheet passes through open source generation as the character string of an English and number composition
Code is converted into the bar code of dimension, the specification in the present embodiment include the type of bar code, the thickness of bar code, size,
Display resolution etc., is not specifically limited.
102, the text data, image data are respectively converted into the first class object, the second class object, and read preparatory
The PDF document template of creation.
Wherein, the textview field in the PDF document template, in picture domain be each configured with class object X, class object Y.PDF
Be provided with different size, various forms of textview fields and picture domain in document template in advance, each textview field can according to need
The text data of generation number, size, attribute configured, and be named for different textview fields, when by text data
When being added in textview field, it can be added according to the title of textview field.In addition, picture domain is with co-ordinate position information
Picture can be added in specific position by region when being added image data according to co-ordinate position information, and in advance
What the PDF document template of creation was established is blank PDF document, and different textview fields or picture configuration of territory have corresponding text
The class object Y of class object X originally and picture, to carry out matching addition when adding text and picture.
It should be noted that specific text, data directly can be converted to class object for text data, for area
Divide the class object converted out with image data, text data is converted to the first class object, image data can be led to
The binary code that identification code is converted to image is crossed, then binary code is converted into the second class object.
103, according to the class object attribute of first class object and second class object, by first class object,
Second class object matches respectively is added to the class object X, the class object Y, and establishes the defeated of the PDF document after matching
Byte stream out.
In the embodiment of the present invention, in order to which accurately text data is added in textview field, and image data is added to
It in picture domain, is added in the class object X in textview field by the first kind object matching for converting text data, by picture number
It is added in the class object Y in picture domain according to the second class object matching of conversion.Wherein, have in advance in PDF document template solid
Fixed class object X determines the class object X of first kind object matching then according to the attribute of class object or type.In order to just
It being exported in by the PDF document for having added text data and image data, the output word established for PDF document throttles, with
Just the step of empty compressed file is written in step 104 is carried out.
104, in the empty compressed file for pre-establishing the output word throttling write-in of the PDF document after foundation, and will write-in
Compressed file after the PDF document is stored into the interim store path of server.
For the embodiment of the present invention, so that user downloads the data of PDF document by the interim store path.It is described
Empty compressed file is the blank compressed file without adding any content pre-established, and in the interim store path of server
In reserve a position, after being added to PDF document according to the data that get, by the output word throttling write-in of PDF document this
In a blank compressed file, and the compressed file write is stored in reserved position, so that user is at any time from interim storage
PDF document is downloaded in path.
The present invention provides a kind of data download method based on PDF document, the data that need to download with website
Format and content be all it is unfixed compare, the embodiment of the present invention can by being converted to the text data of request, image data
Then the first class object, the second class object being added in PDF document template add the first class object, the matching of the second class object
It adds in corresponding class object X, class object Y, is then written in empty compressed file with the output byte manifold formula of PDF document, it will
Compressed file is stored into interim store path, to realize that text data, image data are flexibly added in PDF document, drop
Low website processing pressure, reduces data download time, and flexile textview field, picture domain can reduce PDF document template
Addition downloading data complexity, to improve data download efficiency.
Data download method the embodiment of the invention provides another kind based on PDF document, as shown in Fig. 2, the method
Include:
201, the PDF document template is established, and divides textview field, picture domain in the PDF document template.
For the embodiment of the present invention, in order to avoid needing to re-establish PDF mould when adding text data, image data
Plate, so the embodiment of the present invention pre-establishes divided good textview field, the PDF document template in picture domain, in the textview field
Include the text filed of different names, the different names it is text filed in separately include different text datas quantity,
Attribute includes different picture regions in the picture domain, sits in each picture region comprising the corresponding position of the picture region
Mark.
It should be noted that due to may include multiple textview fields, multiple picture domains in PDF document template, it is drawing
When point textview field, picture domain, the division of textview field is the text of quantity according to text data, attribute names different size region
The quantity in domain, text data is the data such as text, number, that is, forms the size of data of text, data attribute includes character string number
According to, byte data etc., different size of region is gone out according to text data quantity, Attribute transposition, and be named to each region.
In addition, including that different location sits target area in picture domain, different position coordinates can add different pictures, i.e., one
Plurality of pictures can be added according to position coordinates in region, multiple picture domains can also be marked off in a PDF document template,
The embodiment of the present invention is not specifically limited.The position of the bar code of image data is to mark off to come in advance, it can utilizes seat
The form of parameter determines, for example, when request content is image data, according to mark off in advance come image data bar shaped
Bar code is added in this position by code position.
202, it extracts in server and suspends the interim store path used, establish the empty compressed file, and by institute
Sky compressed file is stated to store into the temporary file under the interim store path.
For the embodiment of the present invention, in order to not influence the storage of other data, and it is not take up the use of normal data, mentioned
The interim store path for suspending in server and using is taken, establishes the compressed file of blank under this interim store path, and deposit
Storage is into the temporary file under interim store path, when so that PDF document being added to current empty compressed file, directly from interim
Empty compressed file is extracted in file.
203, when receiving data download request, text is obtained according to the request content carried in the data download request
Notebook data, image data.
This step is identical as step 101 method shown in FIG. 1, and details are not described herein.
204, the text data, image data are respectively converted into the first class object, the second class object, and read preparatory
The PDF document template of creation.
This step is identical as step 102 method shown in FIG. 1, and details are not described herein.
For the embodiment of the present invention, step 204 is specifically as follows: according to the definition of the data attribute of the text data and institute
State matched first class object of class object X in textview field;The identification code of the image data is converted into binary code, it will be described
Binary code is converted to and matched second class object of the class object Y;The PDF document template Chinese being pre-created is read respectively
The class object X in this domain and class object Y, the class object X in picture domain is the class object that can add text data, attribute,
The class object Y is the class object of the coordinate position of addable picture data.
For the embodiment of the present invention, the first class object of definition is the specific text data inquired, the first class object
Each attribute be with the attribute setup of text data it is identical, can be directly by the first class object thus when being matched
It is matched with class object X.In the embodiment of the present invention, since image data is when obtaining, the mark of the as image data of acquisition
Know code, such as bar code, in order to by image data be converted into matched second class object of class object Y, need to convert identification code
For binary code, the second class object is then converted to by binary code.
In addition, being read to accurately add the first class object and the second class object in the PDF template being pre-created
After getting the first class object and the second class object, need to read class object X and class object Y in PDF document template, thus into
Row accurately matching addition.
205, according to the class object attribute of first class object and second class object, by first class object,
Second class object matches respectively is added to the class object X, the class object Y, and establishes the defeated of the PDF document after matching
Byte stream out.
This step is identical as step 103 method shown in FIG. 1, and details are not described herein.
For the embodiment of the present invention, step 205 is specifically as follows: utilizing AcroFields class object by the class object X
Attribute initialized, the attribute of attribute and the class object X in first class object is configured;By described
The coordinate position of the identification code of two class objects and the class object Y carry out matching configuration, described to be configured to according to the mark
The preset mapping relations known between code and the coordinate position are configured;It is configured according to according to the PDF document template matching
PDF document after class object X, class object Y establishes output word throttling.
For the embodiment of the present invention, the AcroFields class object is the java class of general pdf textview field, initialization
Process be that the attribute of class object X initialized into text domain variable corresponding to AcroFields class object.Wherein, PDF text
Each textview field field in shelves template, this part attribute field are finally initialized again to each of the AcroFields class object of standard
Attribute field, it can also include additional word that the attribute field of AcroFields is read from specified pdf template, which to be come,
Section is transmitted for parameter or records information, such as pathname, flag bit, pdf document name, the embodiment of the present invention do not do specific limit
It is fixed.
In addition, store the essential information of class: class is big since the class object in the embodiment of the present invention is a kind of data structure
Small, class name, the version of class, inheritance hierarchy and the mapping table of message and function etc. are stored with the page, coordinate in class object Y
The information such as information, these pages, coordinate information can be matched with identification code, specifically, passing through identification code and coordinate position
Between preset mapping relations configured, if there are preset mapping relations between identification code 1 and coordinate position (a, b, c), then
Identification code 1 and coordinate position (a, b, c) are configured, the identification code of the second class object after conversion, which can match, to be configured to
The class object Y page, coordinate information, to picture is added in PDF document, for example, according to class object Y in PDF document template
The page, coordinate information, the corresponding picture of the bar code that will acquire is written on the position of the page, coordinate information.
It should be noted that the output word throttling established is the PDF document of added complete text data, image data
Output word throttling, when this PDF document generate output word throttling after, this output word throttling byte information be complete
PDF document object.
206, in the empty compressed file for pre-establishing the output word throttling write-in of the PDF document after foundation, and will write-in
Compressed file after the PDF document is stored into the interim store path of server.
This step is identical as step 104 method shown in FIG. 1, and details are not described herein.
207, after the completion of compressing, the compressed file is converted into binary word output throttling in the form of output stream.
For the embodiment of the present invention, so that user downloads the compressed file.For example, after empty compressed file is written
PDF document obtains compressed file and is stored in the temporary path of server, reads in this compressed file inlet flow, this input
Stream refers to that compressed file is input in memory or caching, is then converted to binary word throttling, and be written to output stream, word here
The general byte stream that throttling is eight, i.e., be converted into byte data for compressed file, and output stream here refers to from memory or delays
It is exported in depositing, is downloaded to be transmitted to client.After the completion of compression, that is, the pressure being transferred in inlet flow can be read
Contracting file, the compressed file in inlet flow is converted with binary system byte manifold formula, so that client is downloaded.
208, the compression text under the interim store path of the server in temporary file is removed according to prefixed time interval
Part.
For the embodiment of the present invention, in order to avoid temporary file is excessive under interim store path, at excessive influence server
Efficiency is managed, the compressed file under the interim store path according to certain time interval removing server in temporary file is needed,
It can storage state to be always maintained at interim store path.Wherein, prefixed time interval can according to the downloads of data into
Row setting, for example, being set as 10 minutes, when download is too small when download is excessive, is set as 1 hour, the embodiment of the present invention is not
It is specifically limited.
Data download method the present invention provides another kind based on PDF document, the embodiment of the present invention, which will pass through, to request
Text data, image data are converted to the first class object that may be added to that in PDF document template, the second class object, then by
One class object, the matching of the second class object are added in corresponding class object X, class object Y, then with the output byte of PDF document
Manifold formula is written in empty compressed file, compressed file is stored into interim store path, to realize text data, image data
It is flexibly added in PDF document, reduces website processing pressure, reduce data download time, flexile textview field, figure
Piece domain can reduce the complexity of the addition downloading data of PDF document template, to improve data download efficiency.
Further, as the realization to method shown in above-mentioned Fig. 1, the embodiment of the invention provides one kind based on PDF text
The data download apparatus of shelves, as shown in figure 3, the device includes: acquiring unit 31, converting unit 32, adding unit 33, storage list
Member 34.
Acquiring unit 31, for being asked according to what is carried in the data download request when receiving data download request
Content is asked to obtain text data, image data;The acquiring unit 31 is executed to work as the data download apparatus based on PDF document and be connect
When receiving data download request, text data, image data are obtained according to the request content carried in the data download request
Program module.
Converting unit 32, for the text data, image data to be respectively converted into the first class object, the second class pair
As, and the PDF document template being pre-created is read, the textview field, picture in the PDF document template are each configured with class in domain
Object X, class object Y;The converting unit 32 is that the data download apparatus based on PDF document is executed the text data, figure
Sheet data is respectively converted into the first class object, the second class object, and reads the program module for the PDF document template being pre-created.
Adding unit 33 will be described for the class object attribute according to first class object and second class object
First class object, second class object match respectively is added to the class object X, the class object Y, and establish matching after
The output word of PDF document throttles;The adding unit 33 is that the data download apparatus based on PDF document is executed according to described first
First class object, second class object are matched add respectively by the class object attribute of class object and second class object
The class object X, the class object Y are added to, and establishes the program module of the output word throttling of the PDF document after matching.
Storage unit 34, the empty compressed file for pre-establishing the output word throttling write-in of the PDF document after establishing
In, and store the compressed file after the PDF document is written into the interim store path of server, so that user passes through
The data of the interim store path downloading PDF document.The storage unit 34 is that the data download apparatus based on PDF document is held
The output word throttling for being about to the PDF document after establishing is written in the empty compressed file pre-established, and the PDF document will be written
Compressed file afterwards stores the program module into the interim store path of server.
The present invention provides a kind of data download apparatus based on PDF document, the data for needing to download with website
Format and content be all it is unfixed compare, the embodiment of the present invention can by being converted to the text data of request, image data
Then the first class object, the second class object being added in PDF document template add the first class object, the matching of the second class object
It adds in corresponding class object X, class object Y, is then written in empty compressed file with the output byte manifold formula of PDF document, it will
Compressed file is stored into interim store path, to realize that text data, image data are flexibly added in PDF document, drop
Low website processing pressure, reduces data download time, and flexile textview field, picture domain can reduce PDF document template
Addition downloading data complexity, to improve data download efficiency.
Further, as the realization to method shown in above-mentioned Fig. 2, the embodiment of the invention provides another kinds to be based on PDF
The data download apparatus of document, as shown in figure 4, the device includes: acquiring unit 41, converting unit 42, adding unit 43, storage
Unit 44 establishes unit 45, extraction unit 46, clearing cell 47.
Acquiring unit 41, for being asked according to what is carried in the data download request when receiving data download request
Content is asked to obtain text data, image data;
Converting unit 42, for the text data, image data to be respectively converted into the first class object, the second class pair
As, and the PDF document template being pre-created is read, the textview field, picture in the PDF document template are each configured with class in domain
Object X, class object Y;
Adding unit 43 will be described for the class object attribute according to first class object and second class object
First class object, second class object match respectively is added to the class object X, the class object Y, and establish matching after
The output word of PDF document throttles;
Storage unit 44, the empty compressed file for pre-establishing the output word throttling write-in of the PDF document after establishing
In, and store the compressed file after the PDF document is written into the interim store path of server, so that user passes through
The data of the interim store path downloading PDF document.
Further, described device further include:
Unit 45 is established, for establishing the PDF document template, and divides textview field, figure in the PDF document template
Piece domain, includes the text filed of different names in the textview field, the different names it is text filed in separately include not
Quantity, attribute with text data include different picture regions in the picture domain, include the picture in each picture region
The corresponding position coordinates in region.
Further, described device further include:
Extraction unit 46 establishes the pneumatics contracting for extracting the interim store path for suspending in server and using
File, and the empty compressed file is stored into the temporary file under the interim store path.
Further, the converting unit 42 includes:
Definition module 4201, for according to the definition of the data attribute of the text data and class object X in the textview field
Matched first class object;
Conversion module 4202, for the identification code of the image data to be converted to binary code, by the binary code
It is converted to and matched second class object of the class object Y;
Read module 4203, for reading the class object X and figure of textview field in the PDF document template being pre-created respectively
Class object Y, the class object X in piece domain are the class object that can add text data, attribute, and the class object Y is that can add
The class object of the coordinate position of image data.
Further, the adding unit 43 includes:
First configuration module 4301, it is initial for being carried out the attribute of the class object X using AcroFields class object
Change, the attribute of attribute and the class object X in first class object is configured;
Second configuration module 4302, for by the coordinate position of the identification code of second class object and the class object Y
Matching configuration is carried out, it is described to be configured to carry out according to the preset mapping relations between the identification code and the coordinate position
Configuration;
Module 4303 is established, after according to class object X, class object Y is configured according to the PDF document template matching
PDF document establishes output word throttling.
Further, the converting unit 42, is also used to after the completion of compression, by the compressed file in the form of output stream
Binary word output throttling is converted to, so that user downloads the compressed file.
Further, described device further include:
Clearing cell 47, temporary file under the interim store path for removing the server according to prefixed time interval
In compressed file.
Data download apparatus the present invention provides another kind based on PDF document, the embodiment of the present invention, which will pass through, to request
Text data, image data are converted to the first class object that may be added to that in PDF document template, the second class object, then by
One class object, the matching of the second class object are added in corresponding class object X, class object Y, then with the output byte of PDF document
Manifold formula is written in empty compressed file, compressed file is stored into interim store path, to realize text data, image data
It is flexibly added in PDF document, reduces website processing pressure, reduce data download time, flexile textview field, figure
Piece domain can reduce the complexity of the addition downloading data of PDF document template, to improve data download efficiency.
A kind of storage medium is provided according to an embodiment of the present invention, and it is executable that the storage medium is stored at least one
The data download method based on PDF document in above-mentioned any means embodiment can be performed in instruction, the computer executable instructions.
Fig. 5 shows a kind of structural schematic diagram of the terminal provided according to an embodiment of the present invention, and the present invention is specifically real
Example is applied not limit the specific implementation of terminal.
As shown in figure 5, the terminal may include: processor (processor) 502, communication interface (Communications
Interface) 504, memory (memory) 506 and communication bus 508.
Wherein: processor 502, communication interface 504 and memory 506 complete mutual lead to by communication bus 508
Letter.
Communication interface 504, for being communicated with the network element of other equipment such as client or other servers etc..
It is real can specifically to execute the above-mentioned data download method based on PDF document for executing program 510 for processor 502
Apply the correlation step in example.
Specifically, program 510 may include program code, which includes computer operation instruction.
Processor 502 may be central processor CPU or specific integrated circuit ASIC (Application
Specific Integrated Circuit), or be arranged to implement the integrated electricity of one or more of the embodiment of the present invention
Road.The one or more processors that terminal includes can be same type of processor, such as one or more CPU;It is also possible to
Different types of processor, such as one or more CPU and one or more ASIC.
Memory 506, for storing program 510.Memory 506 may include high speed RAM memory, it is also possible to further include
Nonvolatile memory (non-volatile memory), for example, at least a magnetic disk storage.
Program 510 specifically can be used for so that processor 502 executes following operation:
When receiving data download request, textual data is obtained according to the request content carried in the data download request
According to, image data;
The text data, image data are respectively converted into the first class object, the second class object, and reads and is pre-created
PDF document template, be each configured with class object X, class object Y in the textview field, picture domain in the PDF document template;
According to the class object attribute of first class object and second class object, by first class object, described
Second class object matches respectively is added to the class object X, the class object Y, and establishes the output word of the PDF document after matching
Throttling;
In the empty compressed file that the output word throttling write-in of PDF document after foundation is pre-established, and will be described in write-in
Compressed file after PDF document is stored into the interim store path of server, so that user passes through the interim storage road
The data of diameter downloading PDF document.
Obviously, those skilled in the art should be understood that each module of the above invention or each step can be with general
Computing device realize that they can be concentrated on a single computing device, or be distributed in multiple computing devices and formed
Network on, optionally, they can be realized with the program code that computing device can perform, it is thus possible to which they are stored
It is performed by computing device in the storage device, and in some cases, it can be to be different from shown in sequence execution herein
Out or description the step of, perhaps they are fabricated to each integrated circuit modules or by them multiple modules or
Step is fabricated to single integrated circuit module to realize.In this way, the present invention is not limited to any specific hardware and softwares to combine.
The foregoing is only a preferred embodiment of the present invention, is not intended to restrict the invention, for the skill of this field
For art personnel, the invention may be variously modified and varied.All within the spirits and principles of the present invention, made any to repair
Change, equivalent replacement, improvement etc., should all include within protection scope of the present invention.
Claims (10)
1. a kind of data download method based on PDF document characterized by comprising
When receiving data download request, according to the request content that is carried in the data download request obtain text data,
Image data;
The text data, image data be respectively converted into the first class object, the second class object, and reads and is pre-created
PDF document template is each configured with class object X, class object Y in the textview field, picture domain in the PDF document template;
According to the class object attribute of first class object and second class object, by first class object, described second
Class object matches respectively is added to the class object X, the class object Y, and establishes the output byte of the PDF document after matching
Stream;
In the empty compressed file that the output word throttling write-in of PDF document after foundation is pre-established, and the PDF text will be written
Compressed file after shelves is stored into the interim store path of server, so that user passes through the interim store path downloading
The data of PDF document.
2. the method according to claim 1, wherein described according to the request carried in the data download request
Content obtains before text data, image data, further includes:
The PDF document template is established, and divides textview field, picture domain in the PDF document template, is wrapped in the textview field
Containing the text filed of different names, the different names it is text filed in separately include different text datas quantity, belong to
Property, include different picture regions in the picture domain, includes the corresponding position coordinates of the picture region in each picture region.
3. the method according to claim 1, wherein described write the output word throttling of the PDF document after foundation
Before entering in the empty compressed file pre-established, further includes:
It extracts in server and suspends the interim store path used, establish the empty compressed file, and the pneumatics is contracted
File is stored into the temporary file under the interim store path.
4. the method according to claim 1, wherein described convert the text data, image data respectively
For the first class object, the second class object, and reads the PDF document template being pre-created and include:
According to the definition of the data attribute of the text data and matched first class object of class object X in the textview field;
The identification code of the image data is converted into binary code, the binary code is converted to and the class object Y
The second class object matched;
The class object Y in the class object X and picture domain of textview field in the PDF document template being pre-created is read respectively, it is described
Class object X is the class object that can add text data, attribute, and the class object Y is the coordinate position of addable picture data
Class object.
5. according to the method described in claim 4, it is characterized in that, described according to first class object and second class pair
First class object, second class object are matched respectively and are added to the class object X, described by the class object attribute of elephant
Class object Y, and the output word throttling for the PDF document established after matching includes:
The attribute of the class object X is initialized using AcroFields class object, by the category in first class object
Property and the attribute of the class object X are configured;
The coordinate position of the identification code of second class object and the class object Y is subjected to matching configuration, the matching configuration
To be configured according to the preset mapping relations between the identification code and the coordinate position;
Output word throttling is established according to according to the PDF document after PDF document template matching configuration class object X, class object Y.
6. the method according to claim 1, wherein described write the output word throttling of the PDF document after foundation
Enter in the empty compressed file pre-established, and store temporarily depositing to server for the compressed file after the PDF document is written
After storing up in path, the method also includes:
After the completion of compression, the compressed file is converted into binary word output throttling in the form of output stream, so that user
Download the compressed file.
7. the method according to claim 1, wherein the method also includes:
The compressed file under the interim store path of the server in temporary file is removed according to prefixed time interval.
8. a kind of data download apparatus based on PDF document characterized by comprising
Acquiring unit, for when receiving data download request, according to the request content carried in the data download request
Obtain text data, image data;
Converting unit for the text data, image data to be respectively converted into the first class object, the second class object, and is read
Take the PDF document template being pre-created, be each configured in the textview field, picture domain in the PDF document template class object X,
Class object Y;
Adding unit, for the class object attribute according to first class object and second class object, by the first kind
Object, second class object match respectively is added to the class object X, the class object Y, and establishes the PDF text after matching
The output word throttling of shelves;
Storage unit, for the output word throttling of the PDF document after establishing to be written in the empty compressed file pre-established, and will
Compressed file after the PDF document is written is stored into the interim store path of server, so that user is faced by described
When store path downloading PDF document data.
9. a kind of storage medium, it is stored with an at least executable instruction in the storage medium, the executable instruction makes to handle
Device executes such as the corresponding operation of the data download method of any of claims 1-7 based on PDF document.
10. a kind of terminal, comprising: processor, memory, communication interface and communication bus, the processor, the memory and
The communication interface completes mutual communication by the communication bus;
The memory executes the processor as right is wanted for storing an at least executable instruction, the executable instruction
Ask the corresponding operation of data download method described in any one of 1-7 based on PDF document.
Priority Applications (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810796560.0A CN109284453B (en) | 2018-07-19 | 2018-07-19 | Data downloading method and device based on PDF document, storage medium and terminal |
PCT/CN2018/111697 WO2020015220A1 (en) | 2018-07-19 | 2018-10-24 | Method and apparatus for downloading data based on pdf document, and storage medium and terminal |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810796560.0A CN109284453B (en) | 2018-07-19 | 2018-07-19 | Data downloading method and device based on PDF document, storage medium and terminal |
Publications (2)
Publication Number | Publication Date |
---|---|
CN109284453A true CN109284453A (en) | 2019-01-29 |
CN109284453B CN109284453B (en) | 2023-04-07 |
Family
ID=65182376
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201810796560.0A Active CN109284453B (en) | 2018-07-19 | 2018-07-19 | Data downloading method and device based on PDF document, storage medium and terminal |
Country Status (2)
Country | Link |
---|---|
CN (1) | CN109284453B (en) |
WO (1) | WO2020015220A1 (en) |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111666745A (en) * | 2020-06-03 | 2020-09-15 | 中国建设银行股份有限公司 | File downloading method, device, server and medium |
CN112380828A (en) * | 2020-11-03 | 2021-02-19 | 前海飞算云创数据科技(深圳)有限公司 | PDF document generation method and device, storage medium and electronic equipment |
CN117807291A (en) * | 2024-02-29 | 2024-04-02 | 南京三百云信息科技有限公司 | Intelligent identification interaction processing method and platform for business materials |
Families Citing this family (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112651215B (en) * | 2020-12-31 | 2023-11-03 | 中国农业银行股份有限公司 | Method and device for determining document map, electronic equipment and storage medium |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20040153462A1 (en) * | 2003-02-05 | 2004-08-05 | Bardwell Steven J. | Systems, methods, and computer program product for use in association with electronic documents |
US20170337216A1 (en) * | 2016-05-20 | 2017-11-23 | Adobe Systems Incorporated | Manipulation of pdf file content through http requests |
CN108090213A (en) * | 2017-12-29 | 2018-05-29 | 福建南威软件有限公司 | The method that mobile terminal rapid translating generates pdf document |
Family Cites Families (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP4756870B2 (en) * | 2005-02-03 | 2011-08-24 | キヤノン株式会社 | Document processing apparatus, document processing method, and program |
CN101777056B (en) * | 2009-12-31 | 2012-01-04 | 成都市华为赛门铁克科技有限公司 | Data storage method and device |
CN106776498A (en) * | 2016-12-09 | 2017-05-31 | 山东浪潮商用***有限公司 | A kind of method that data export as PDF |
CN108052491B (en) * | 2017-11-22 | 2021-02-26 | 中贸促商事服务有限公司 | Automatic processing method and device for certificate document |
-
2018
- 2018-07-19 CN CN201810796560.0A patent/CN109284453B/en active Active
- 2018-10-24 WO PCT/CN2018/111697 patent/WO2020015220A1/en active Application Filing
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20040153462A1 (en) * | 2003-02-05 | 2004-08-05 | Bardwell Steven J. | Systems, methods, and computer program product for use in association with electronic documents |
US20170337216A1 (en) * | 2016-05-20 | 2017-11-23 | Adobe Systems Incorporated | Manipulation of pdf file content through http requests |
CN108090213A (en) * | 2017-12-29 | 2018-05-29 | 福建南威软件有限公司 | The method that mobile terminal rapid translating generates pdf document |
Cited By (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111666745A (en) * | 2020-06-03 | 2020-09-15 | 中国建设银行股份有限公司 | File downloading method, device, server and medium |
CN112380828A (en) * | 2020-11-03 | 2021-02-19 | 前海飞算云创数据科技(深圳)有限公司 | PDF document generation method and device, storage medium and electronic equipment |
CN117807291A (en) * | 2024-02-29 | 2024-04-02 | 南京三百云信息科技有限公司 | Intelligent identification interaction processing method and platform for business materials |
CN117807291B (en) * | 2024-02-29 | 2024-04-26 | 南京三百云信息科技有限公司 | Intelligent identification interaction processing method and platform for business materials |
Also Published As
Publication number | Publication date |
---|---|
CN109284453B (en) | 2023-04-07 |
WO2020015220A1 (en) | 2020-01-23 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN109284453A (en) | Data download method and device based on PDF document, storage medium, terminal | |
CN109684607B (en) | JSON data analysis method and device, computer equipment and storage medium | |
JP5939123B2 (en) | Execution control program, execution control method, and information processing apparatus | |
CN106970820A (en) | Code storage method and code storage | |
CN113204598B (en) | Data synchronization method, system and storage medium | |
CN112131837B (en) | Service report configuration method, device, computer equipment and storage medium | |
CN112887451B (en) | Domain name resolution method and device and computer equipment | |
CN109815112B (en) | Data debugging method and device based on functional test and terminal equipment | |
CN107728892A (en) | picture display method, device, terminal and storage medium | |
CN108614808A (en) | The composition method and composing device of XML document | |
CN111046640A (en) | Dynamic generation method and device of certification document | |
CN114491462A (en) | Method, system, equipment and storage medium for signing multiple electronic documents once | |
CN107979595B (en) | Private data protection method and gateway system | |
CN109669678A (en) | Template engine integration method, device, electronic equipment and storage medium | |
CN110209780A (en) | A kind of question template generation method, device, server and storage medium | |
CN104050207B (en) | Information processing unit and file management system | |
JP2019053664A (en) | Pathology diagnosis management system, method and program | |
CN116974999A (en) | Electronic document signing method and device, electronic device and storage medium | |
CN107037997A (en) | Method for generating the user interface in mind map form | |
US20160162639A1 (en) | Digital image analysis and classification | |
CN116050370A (en) | Template data processing method, system and related equipment | |
CN112149391B (en) | Information processing method, information processing apparatus, terminal device, and storage medium | |
CN108595335A (en) | Test environment dispositions method, deployment device and storage medium | |
CN110851446B (en) | Data table generation method and device, computer equipment and storage medium | |
CN109657184B (en) | Rich text processing method, rich text processing device, server 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 | ||
GR01 | Patent grant | ||
GR01 | Patent grant |