CN110633059A - Printing method of PDF format electronic bill - Google Patents
Printing method of PDF format electronic bill Download PDFInfo
- Publication number
- CN110633059A CN110633059A CN201810572791.3A CN201810572791A CN110633059A CN 110633059 A CN110633059 A CN 110633059A CN 201810572791 A CN201810572791 A CN 201810572791A CN 110633059 A CN110633059 A CN 110633059A
- Authority
- CN
- China
- Prior art keywords
- data
- format
- electronic bill
- order
- 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.)
- Withdrawn
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F3/00—Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
- G06F3/12—Digital output to print unit, e.g. line printer, chain printer
- G06F3/1201—Dedicated interfaces to print systems
- G06F3/1223—Dedicated interfaces to print systems specifically adapted to use a particular technique
- G06F3/1237—Print job management
- G06F3/1253—Configuration of print job parameters, e.g. using UI at the client
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F3/00—Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
- G06F3/12—Digital output to print unit, e.g. line printer, chain printer
- G06F3/1297—Printer code translation, conversion, emulation, compression; Configuration of printer parameters
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Human Computer Interaction (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Accessory Devices And Overall Control Thereof (AREA)
Abstract
The invention relates to the technical field of Web application and development, in particular to a printing method of a PDF format electronic bill. The method comprises the following steps: 1. acquiring order data according to the order number; 2. packaging order data into electronic bill PDF data; 3. merging a plurality of PDF electronic bill data; 4. setting a file stream output format as a PDF format; 5. and outputting and opening the file, and automatically connecting a printer for printing. The invention solves the problem of printing the electronic receipt data in the PDF format, and can be widely applied to WEB development and application.
Description
Technical Field
The invention relates to the technical field of Web application and development, in particular to a printing method of a PDF format electronic bill.
Background
The PDF format data document has the characteristics of difficult modification and strong safety. In the process of printing data transmission, a common data format similar to JSON can be directly read and operated, but a PDF format electronic bill is transmitted by a whole document, and in order to solve the problem of printing the PDF format electronic bill data, a data document is analyzed and then operated. The invention solves the problem of printing the PDF format data electronic list, and can be widely applied to WEB development and application.
Disclosure of Invention
The invention solves the technical problem of providing a printing method of a PDF format electronic bill; the problem of printing the PDF format electronic bill data is solved.
The technical scheme for solving the technical problems is as follows:
the method comprises the following steps:
step one, obtaining order data according to an order number;
step two, packaging order data into electronic surface form PDF data;
step three, combining a plurality of PDF electronic bill data;
setting the file stream output format to PDF format;
and fifthly, outputting and opening the file, and automatically connecting a printer for printing.
The printing method of the PDF format electronic bill comprises the step one of obtaining order data according to an order number, wherein the order data comprises order information, purchased commodity data, shipper information, consignee information and the like.
In the second step, the order data parameters are packaged, an electronic bill PDF template is requested from the server, JOSN data in the electronic bill is returned, and the PDF data in the bill is analyzed and converted into a base64 format.
In the third step, each order data corresponds to one piece of PDF data, and after a plurality of order data are packaged into electronic document PDF data, the plurality of PDF electronic document data are merged, PDF document data documents are opened one by one in a memory, PDF data are read in a circulating manner, and PDF documents are merged and appended through the operation of a file stream.
In the fourth step and the fifth step, the file stream merged in the third step is set to be in a PDF format, the file is stored and output, and the file is automatically opened to be connected with a printer for printing.
The invention solves the problem of printing the electronic receipt data in the PDF format, and can be widely applied to WEB development and application.
Drawings
The invention is further described below with reference to the accompanying drawings:
FIG. 1 is a block flow diagram of the method of the present invention.
Detailed Description
As shown in fig. 1, the present invention specifically comprises the following steps:
step one, obtaining order data according to an order number;
step two, packaging order data into electronic surface form PDF data;
step three, combining a plurality of PDF electronic bill data;
setting the file stream output format to PDF format;
and fifthly, outputting and opening the file, and automatically connecting a printer for printing.
In the first step, order data is obtained according to the order number, wherein the order data comprises order information, purchased commodity data, shipper information, consignee information and the like.
In the second step, the order data parameters are packaged, an electronic bill PDF template is requested from the server, JOSN data in the electronic bill is returned, and the PDF data in the bill is analyzed and converted into a base64 format. Code:
var result = orderBll.GetModelByRegNo(regNo);
var order = (B2C_SalesOrder)result.data;
var client = new RestClient(url);
var request = new RestRequest("/websale/trade/orderWaybillIiPrint.action", Method.POST);
request.AddParameter("sourceName", ThirdPlant.jd.ToString());
request.AddParameter("api_key", "websale");
request.AddParameter("jsonParams", "{\"customerCode\":\"020K73221\",\"deliveryId\":\""+ order.EmsNo +"\"}");
var response = client.Execute<TaoBaoResult>(request);
if(response.StatusCode != System.Net.HttpStatusCode.OK)
{
return new Result { state = 400, msg = response.ErrorMessage };
}
var jdResult = response.Data;
var json = LitJson.JsonMapper.ToObject(jdResult.data.ToString());
var pdfArr = json["jingdong_etms_order_print_responce"]["response"]["pdfArr"].ToString();
in the third step, each order data corresponds to one piece of PDF data, and after a plurality of order data are packaged into electronic document PDF data, the plurality of PDF electronic document data are merged, PDF document data documents are opened one by one in a memory, PDF data are read in a circulating manner, and PDF documents are merged and appended through the operation of a file stream. Code:
public System.IO.Stream CombinePDF(System.IO.Stream pdf1, System.IO.Stream pdf2)
{
// Open the input files
PdfDocument inputDocument1 = PdfReader.Open(pdf1, PdfDocumentOpenMode.Import);
PdfDocument inputDocument2 = PdfReader.Open(pdf2, PdfDocumentOpenMode.Import);
// Create the output document
PdfDocument outputDocument = new PdfDocument();
foreach (PdfPage item in inputDocument1.Pages)
{
outputDocument.AddPage(item);
}
foreach (PdfPage item in inputDocument2.Pages)
{
outputDocument.AddPage(item);
}
System.IO.Stream iStream = new System.IO.MemoryStream();
outputDocument.Save(iStream,false);
return iStream;
}
in the fourth step and the fifth step, the file stream merged in the third step is set to be in a PDF format, the file is stored and output, and the file is automatically opened to be connected with a printer for printing. Code:
File(resultStream, "application/pdf")。
Claims (5)
1. a printing method of a PDF format electronic receipt is characterized in that: the method comprises the following steps:
step one, obtaining order data according to an order number;
step two, packaging order data into electronic surface form PDF data;
step three, combining a plurality of PDF electronic bill data;
setting the file stream output format to PDF format;
and fifthly, outputting and opening the file, and automatically connecting a printer for printing.
2. A printing method of a PDF format electronic bill according to claim 1, wherein: in the first step, order data is obtained according to the order number, wherein the order data comprises order information, purchased commodity data, shipper information, consignee information and the like.
3. A printing method of a PDF format electronic bill according to claim 1, wherein: in the second step, the order data parameters are packaged, an electronic bill PDF template is requested from the server, JOSN data in the electronic bill is returned, and the PDF data in the bill is analyzed and converted into a base64 format.
4. A printing method of a PDF format electronic bill according to claim 1, wherein: in the third step, each order data corresponds to one piece of PDF data, and after a plurality of order data are packaged into electronic document PDF data, the plurality of PDF electronic document data are merged, PDF document data documents are opened one by one in a memory, PDF data are read in a circulating manner, and PDF documents are merged and appended through the operation of a file stream.
5. A printing method of a PDF format electronic bill according to claim 1, wherein: in the fourth step and the fifth step, the file stream merged in the third step is set to be in a PDF format, the file is stored and output, and the file is automatically opened to be connected with a printer for printing.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810572791.3A CN110633059A (en) | 2018-06-06 | 2018-06-06 | Printing method of PDF format electronic bill |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810572791.3A CN110633059A (en) | 2018-06-06 | 2018-06-06 | Printing method of PDF format electronic bill |
Publications (1)
Publication Number | Publication Date |
---|---|
CN110633059A true CN110633059A (en) | 2019-12-31 |
Family
ID=68966160
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201810572791.3A Withdrawn CN110633059A (en) | 2018-06-06 | 2018-06-06 | Printing method of PDF format electronic bill |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN110633059A (en) |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111949229A (en) * | 2020-07-29 | 2020-11-17 | 唯品会(珠海)电子商务有限公司 | Method and device for printing bill, computer equipment and storage medium |
CN112036803A (en) * | 2020-11-06 | 2020-12-04 | 上海洋漪信息技术有限公司 | Method for generating general cross-border logistics distribution list |
-
2018
- 2018-06-06 CN CN201810572791.3A patent/CN110633059A/en not_active Withdrawn
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111949229A (en) * | 2020-07-29 | 2020-11-17 | 唯品会(珠海)电子商务有限公司 | Method and device for printing bill, computer equipment and storage medium |
CN112036803A (en) * | 2020-11-06 | 2020-12-04 | 上海洋漪信息技术有限公司 | Method for generating general cross-border logistics distribution list |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US11296961B2 (en) | Simplified entity lifecycle management | |
US11288142B2 (en) | Recovery strategy for a stream processing system | |
US10437635B2 (en) | Throttling events in entity lifecycle management | |
US20180113847A1 (en) | Automating interrogative population of electronic forms using a real-time communication system | |
US20180253335A1 (en) | Maintaining throughput of a stream processing framework while increasing processing load | |
WO2020134991A1 (en) | Automatic input method for paper form, apparatus , and computer device and storage medium | |
Gill et al. | Agile enterprise architecture: a case of a cloud technology-enabled government enterprise transformation | |
US8805094B2 (en) | Using machine learning to improve detection of visual pairwise differences between browsers | |
CN102968282A (en) | Method for achieving electronization of any bill and receipt by intercepting print data | |
CN109543985A (en) | Business risk appraisal procedure, system and medium | |
CN102810057A (en) | Log recording method | |
CN110633059A (en) | Printing method of PDF format electronic bill | |
US20160196564A1 (en) | Systems and methods for analyzing consumer sentiment with social perspective insight | |
CN109240625A (en) | A kind of document structure tree method, apparatus and computer storage medium suitable for printing | |
WO2019019768A1 (en) | Method and apparatus for printing policy, storage medium and computer device | |
CN111145054A (en) | Signing method, device and storage medium for electronic contracts of same type | |
CN103092625B (en) | A kind of method and apparatus of the process civil aviation passenger transport passenger ticket ticket data based on .NET Framework platform | |
CN104965783A (en) | Method and apparatus for monitoring web content presentation | |
CN114997418A (en) | Data processing method and device, electronic equipment and storage medium | |
CN108228549A (en) | A kind of collecting method and system, server | |
CN105138322B (en) | Generate the method and system of application program | |
Xiong et al. | Defaultable bond markets with jumps | |
JP5944945B2 (en) | In-memory management system and in-memory management program | |
EP3588298B1 (en) | Enabling synchronous editable signals in process modeling | |
US8976378B2 (en) | Pre-flight system for PDF/VT |
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 | ||
WW01 | Invention patent application withdrawn after publication |
Application publication date: 20191231 |
|
WW01 | Invention patent application withdrawn after publication |