Method record of Html to pdf

Html to pdf method

reference: https://cloud.tencent.com/developer/article/1534712

Before receiving a request, the front end sends an html long string, which requires processing and conversion to pdf for storage. Since it has not been done before, what should I do? Baidu once found that although there are many problems on the Internet, they often have many problems. Either there is no code dependency, or there is dependency, but after copying it to the local area, it still reports an error, unable to operate normally. After a long time of searching, it has been found The procedure of Sven The article is very comprehensive. In order not to encounter the same function in the future and forget it, so after the successful implementation, it is decided to record it.

Here is my rendering

The first step is to prepare the jar package

			<dependency>  
                <groupId>com.itextpdf</groupId>  
                <artifactId>itextpdf</artifactId>  
                <version>5.5.13</version>
            </dependency>  
              
             <dependency>  
                <groupId>com.itextpdf.tool</groupId>  
                <artifactId>xmlworker</artifactId>  
                <version>5.5.13.1</version>
            </dependency>  
                       
            <dependency>  
                <groupId>com.itextpdf</groupId>  
                <artifactId>itext-asian</artifactId>  
                <version>5.2.0</version>
            </dependency>  
			
		<dependency>
		    <groupId>org.xhtmlrenderer</groupId>
		    <artifactId>flying-saucer-pdf-itext5</artifactId>
		    <version>9.0.3</version>
		</dependency>

Here is the java class. My side is to get the configuration of the configuration file. For local test, the code noted above can be used


	/* 
	private static String TEMP_ROOT_PATH = "D:/upload/temp";
    private static String SIMSUN_PATH ="c:/Windows/Fonts/simsun.ttc";
    */
    private static String HTML_PATH = "d:/html/031709421845.html";
                                                //031709420948.html
                                                //031709421845.html drug purchase contract
                                                //031709423132.html
                                                //031709440798.html

    private static String TEMP_ROOT_PATH;

    @Value("${LOCAL_ABSOLUTE_TEMP_PATH}")
    public void setTEMP_ROOT_PATH(String TEMP_ROOT_PATH) {
        this.TEMP_ROOT_PATH = TEMP_ROOT_PATH;
    }

    private static String SIMSUN_PATH;
    @Value("${SIMSUN_PATH}")
    public void setSIMSUN_PATH(String SIMSUN_PATH) {
        this.SIMSUN_PATH = SIMSUN_PATH;
    }
	/**
     * Convert HTML to PD format. HTML file format is strict, all tags need to be < / > end
     * @param filePath pdf File storage path
     * @param htmlString html Character string
     * @param fileName file name
     * @return
     * @throws Exception
     */
    public static String htmlToPDF(String filePath, String htmlString,String fileName) throws Exception {
        String sfileName = fileName + "." + "pdf";
        String destRealFile = filePath + sfileName;
        String destFile = TEMP_ROOT_PATH + destRealFile.toLowerCase();
        
        if (StringUtils.isBlank(htmlString))
            htmlString = htmlToString();
        File mkdirs = new File(TEMP_ROOT_PATH + "d");
        mkdirs.mkdirs();
        
        OutputStream os = new FileOutputStream(destFile);
        ITextRenderer renderer = new ITextRenderer();
        /*Because my function is to convert the long html string from the front end to pdf file, I call the setDocumentFromString method of ITextRenderer class. If I want to convert html file, I will directly transfer the path of html file, and the setDocument method is the same*/
//        renderer.setDocument(url);
        renderer.setDocumentFromString(htmlString);
        // Solve Chinese support
        ITextFontResolver fontResolver = renderer.getFontResolver();
        if("linux".equals(getCurrentOperatingSystem())){
            fontResolver.addFont(SIMSUN_PATH, BaseFont.IDENTITY_H, BaseFont.EMBEDDED);
        }else{
            fontResolver.addFont(SIMSUN_PATH, BaseFont.IDENTITY_H, BaseFont.NOT_EMBEDDED);
        }

        renderer.layout();
        renderer.createPDF(os);
        os.close();
        System.out.println("success!!");
		//Return to file path
        return "/temp"+destRealFile;
    }

//Test html
private static String getHtml() {
        StringBuffer html = new StringBuffer();
        html.append("<div style='color:green;font-size:20px;'>Hello world! hello world !</div>");
        html.append("<span style='color:red'>what are you What to do!</span>");
        html.append("<h1>Title</h1>");
        html.append("<table>");
        html.append("<tr>");
        html.append("<th>Serial number</th>");
        html.append("<th>User name</th>");
        html.append("<th>Gender</th>");
        html.append("</tr>");
        html.append("<tr>");
        html.append("<td>1</td>");
        html.append("<td>fengxing</td>");
        html.append("<td>male</td>");
        html.append("</tr>");
        html.append("<tr>");
        html.append("<td>2</td>");
        html.append("<td>admin</td>");
        html.append("<td>female</td>");
        html.append("</tr>");


        html.append("</table>");
        return html.toString();
    }

	//html file to html long string
    private static String htmlToString() {
        String htmlTemplete = "";
        try {
            //Read the template file and write it to String
            InputStream in = new FileInputStream(HTML_PATH);
            InputStreamReader isr = new InputStreamReader(in, "utf-8");
            BufferedReader brd = new BufferedReader(isr);
            StringBuffer sbf = new StringBuffer();
            String line = "";
            while((line=brd.readLine())!=null) {
                sbf.append(line);
            }
            htmlTemplete = sbf.toString();
            //The template does not support svg format pictures
            System.out.println(htmlTemplete);
        } catch (FileNotFoundException e) {
            e.printStackTrace();
        }catch (IOException e) {
            e.printStackTrace();
        }
        return htmlTemplete;
    }
    //Get current operating system
    public static String getCurrentOperatingSystem(){
        String os = System.getProperty("os.name").toLowerCase();
        System.out.println("---------The current system is-----------" + os);
        return os;
    }


    public static void main(String[] args) {
        String pdfFile = "test";
        try {
            HtmlToPdfUtil.html2pdf("D/html", null,"");
        } catch (FileNotFoundException e) {
            e.printStackTrace();
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

Now let me tell you something about this easy to step on pit,

First of all, it may not be able to find the simsun.ttc file. Generally, windows system will not have such a problem. The main problem is that in linux system, you need to go there by yourself. Of course, it is not common with Simsun under windows.

Secondly, the problem of Chinese display , you need to add the < body tag in html Style = "font family: Simsun;" style, burt is the same as below, no Chinese. Secondly, there will be problems with special escape symbols. When such special characters appear in the text, errors will be reported: This is because html to pdf is very strict with html code specification, so we need to declare it in the front, otherwise we won't do special processing

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html lang="en" xmlns="http://www.w3.org/1999/xhtml">

There may also be a situation where you have added style = "font family: Simsun; style to the body tag, but the text is still not displayed. Then you can see if there is a default font in your html, just remove it. We can see that part of the text in the back of the above pdf image is not completely displayed. Here is because I have another style that is not set, which makes it impossible for him to wrap normally. Add this in style to make the line break normal. This is to set the normal line break of the text in the p tag.

	p {
		word-break:break-all;
		word-wrap : break-word;
	}

Finally, you can set the paper size through @ page

	@page {
		size: 7in 15.25in;
	}

Paste the local html test code

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html lang="en" xmlns="http://www.w3.org/1999/xhtml">
 <head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  <meta http-equiv="Content-Style-Type" content="text/css" />
  <meta name="generator" content="Aspose.Words for .NET 15.1.0.0" /> 
  <style>		
  @page {
		size: 7in 15.25in;
	}
	p {
		word-break:break-all;
		word-wrap : break-word;
	}
  </style>
  <title>Contract No.:</title>
 </head>
 <body style="font-family: SimSun;">
 
  <div>
   <p style="margin:0pt; orphans:0; text-align:justify; widows:0"><span style=" font-size:14pt">Contract No.:</span><span style=" font-size:14pt; text-decoration:underline">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></p>
   <p style="margin:0pt; orphans:0; text-align:justify; widows:0"><span style="font-family:'Times New Roman'; font-size:10.5pt">&nbsp;</span></p>
   <p style="margin:0pt; orphans:0; text-align:justify; widows:0"><span style="font-family:'Times New Roman'; font-size:10.5pt">&nbsp;</span></p>
   <p style="margin:0pt; orphans:0; text-align:justify; widows:0"><span style="font-family:'Times New Roman'; font-size:10.5pt">&nbsp;</span></p>
   <p style="margin:0pt; orphans:0; text-align:justify; widows:0"><span style="font-family:'Times New Roman'; font-size:10.5pt">&nbsp;</span></p>
   <p style="margin:0pt; orphans:0; text-align:center; widows:0"><span style=" font-size:26pt; font-weight:bold">Drug purchase contract</span></p>
   <p style="margin:0pt; orphans:0; text-align:center; widows:0"><span style="font-family:'Times New Roman'; font-size:24pt; font-weight:bold">&nbsp;</span></p>
   <p style="margin:0pt; orphans:0; text-align:center; widows:0"><span style="font-family:'Times New Roman'; font-size:24pt; font-weight:bold">&nbsp;</span></p>
   <p style="margin:0pt; orphans:0; text-align:center; widows:0"><span style=" font-size:14pt">nail&nbsp;&nbsp;&nbsp; Fang:_____________________</span></p>
   <p style="margin:0pt; orphans:0; text-align:center; widows:0"><span style=" font-size:14pt">B&nbsp;&nbsp;&nbsp; Fang:_____________________</span></p>
   <p style="margin:0pt; orphans:0; text-align:center; widows:0"><span style=" font-size:14pt">Place of signing:_____________________</span></p>
   <p style="margin:0pt; orphans:0; text-align:center; widows:0"><span style=" font-size:14pt">Date of signing:_____________________</span></p>
   <p style="margin:0pt; orphans:0; text-align:justify; widows:0"><span style=" font-size:10.5pt">&nbsp;</span></p>
   <p style="margin:0pt; orphans:0; text-align:justify; widows:0"><span style=" font-size:10.5pt">&nbsp;</span></p>
   <p style="margin:0pt; orphans:0; text-align:justify; widows:0"><span style=" font-size:10.5pt">&nbsp;</span></p>
   <p style="margin:0pt; orphans:0; text-align:justify; widows:0"><span style=" font-size:10.5pt">&nbsp;</span></p>
   <p style="margin:0pt; orphans:0; text-align:justify; widows:0"><span style=" font-size:10.5pt">&nbsp;</span></p>
   <p style="margin:0pt; orphans:0; text-align:justify; widows:0"><span style=" font-size:10.5pt">&nbsp;</span></p>
   <p style="margin:0pt; orphans:0; text-align:justify; widows:0"><span style=" font-size:10.5pt">&nbsp;</span></p>
   <p style="margin:0pt; orphans:0; text-align:justify; widows:0"><span style=" font-size:10.5pt">&nbsp;</span></p>
   <p style="margin:0pt; orphans:0; text-align:justify; widows:0"><span style=" font-size:10.5pt">&nbsp;</span></p>
   <p style="margin:0pt; orphans:0; text-align:justify; widows:0"><span style=" font-size:10.5pt">&nbsp;</span></p>
   <p style="margin:0pt; orphans:0; text-align:justify; widows:0"><span style=" font-size:10.5pt">&nbsp;</span></p>
   <p style="margin:0pt; orphans:0; text-align:justify; widows:0"><span style=" font-size:10.5pt">&nbsp;</span></p>
   <p style="margin:0pt; orphans:0; text-align:justify; widows:0"><span style=" font-size:10.5pt">&nbsp;</span></p>
   <p style="margin:0pt; orphans:0; text-align:justify; widows:0"><span style=" font-size:10.5pt">&nbsp;</span></p>
   <p style="margin:0pt; orphans:0; text-align:justify; widows:0"><span style=" font-size:10.5pt">&nbsp;</span></p>
   <p style="margin:0pt; orphans:0; text-align:justify; widows:0"><span style=" font-size:10.5pt">&nbsp;</span></p>
   <p style="margin:0pt; orphans:0; text-align:justify; widows:0"><span style=" font-size:10.5pt">&nbsp;</span></p>
   <p style="margin:0pt; orphans:0; text-align:justify; widows:0"><span style=" font-size:10.5pt">&nbsp;</span></p>
   <p style="margin:0pt; orphans:0; text-align:justify; widows:0"><span style=" font-size:10.5pt">&nbsp;</span></p>
   <p style="margin:0pt; orphans:0; text-align:justify; widows:0"><span style=" font-size:10.5pt">&nbsp;</span></p>
   <p style="margin:0pt; orphans:0; text-align:justify; widows:0"><span style=" font-size:10.5pt">&nbsp;</span></p>
   <p style="margin:0pt; orphans:0; text-align:justify; widows:0"><span style=" font-size:10.5pt">&nbsp;</span></p>
   <p style="margin:0pt; orphans:0; text-align:justify; widows:0"><span style=" font-size:10.5pt">&nbsp;</span></p>
   <p style="margin:0pt; orphans:0; text-align:justify; widows:0"><span style=" font-size:10.5pt">  First party(Demander): xx company</span></p>
   <p style="margin:0pt; orphans:0; text-align:justify; widows:0"><span style=" font-size:10.5pt">  Party B(supplier): xx Branch Office</span></p>
   <p style="margin:0pt; orphans:0; text-align:justify; widows:0"><span style=" font-size:10.5pt">  Party A shall purchase the commonly used drugs annually according to the needs of daily use, and Party B shall provide the drugs for Party A. In accordance with relevant laws and regulations, both parties have reached an agreement to sign this contract.</span></p>
   <p style="margin:0pt; orphans:0; text-align:justify; widows:0"><span style=" font-size:10.5pt">  Article 1 purchase and sale mode</span></p>
   <p style="margin:0pt; orphans:0; text-align:justify; widows:0"><span style=" font-size:10.5pt">  Party A issues an order according to the needs of daily use, Party B confirms the order and delivers it, and Party A confirms and pays according to the specified time after receiving the medicine delivered by Party B.</span></p>
   <p style="margin:0pt; orphans:0; text-align:justify; widows:0"><span style=" font-size:10.5pt">  Article 2 quality assurance</span></p>
   <p style="margin:0pt; orphans:0; text-align:justify; widows:0"><span style=" font-size:10.5pt">  1,Party B shall provide Party A with legal and valid certificates such as the license for drug handling enterprises and the copy of the business license for enterprise legal person.</span></p>
   <p style="margin:0pt; orphans:0; text-align:justify; widows:0"><span style=" font-size:10.5pt">  2,Party B shall be responsible for the quality of the drugs sold, and the drugs provided must meet the national quality standards and relevant requirements.</span></p>
   <p style="margin:0pt; orphans:0; text-align:justify; widows:0"><span style=" font-size:10.5pt">  3,Party B shall provide the production approval and product certificate of the drugs sold, and the first batch of drugs shall be provided by the provincial or provincial government(city)Inspection report of the drug inspection institute.</span></p>
   <p style="margin:0pt; orphans:0; text-align:justify; widows:0"><span style=" font-size:10.5pt">  4,The imported drugs shall be attached with copies of the port inspection report, import registration certificate or registration certificate of pharmaceutical products of the batch of drugs, and shall be sealed by the quality management department.</span></p>
   <p style="margin:0pt; orphans:0; text-align:justify; widows:0"><span style=" font-size:10.5pt">  5,If the validity period of the drugs is within 1 year or 1.5 years, the drugs supplied by Party B shall not be less than 12 months; if the validity period is 2 years or more, the drugs supplied by Party B shall not be less than 18 months of the whole validity period.</span></p>
   <p style="margin:0pt; orphans:0; text-align:justify; widows:0"><span style=" font-size:10.5pt">  Article 3 drug packaging standards</span></p>
   <p style="margin:0pt; orphans:0; text-align:justify; widows:0"><span style=" font-size:10.5pt">  1,Unless otherwise specified in the packaging, all drugs provided by Party B shall be packed in accordance with national standard protection measures to prevent damage or deterioration of drugs in transit and ensure the safe and undamaged delivery of drugs to the designated place.</span></p>
   <p style="margin:0pt; orphans:0; text-align:justify; widows:0"><span style=" font-size:10.5pt">  2,Each packing box shall be attached with a detailed packing list and a quality inspection report or certificate of conformity. If the packing box is not complete, a sealed copy of the quality inspection report or certificate of conformity shall be attached. Packing, marking and documents inside and outside the packing box shall meet the requirements of the contract.</span></p>
   <p style="margin:0pt; orphans:0; text-align:justify; widows:0"><span style=" font-size:10.5pt">  3,Party B shall be responsible for replacement or compensation for the loss of product damage and deterioration caused by improper packaging.</span></p>
   <p style="margin:0pt; orphans:0; text-align:justify; widows:0"><span style=" font-size:10.5pt">  Article 4 drug inspection</span></p>
   <p style="margin:0pt; orphans:0; text-align:justify; widows:0"><span style=" font-size:10.5pt">  1,Party A shall check and confirm the drugs when receiving them, and Party A has the right to refuse to accept the drugs that do not meet the requirements of the contract. Party B shall timely replace the damaged, short-term products or other unqualified packaging products found during unpacking, without affecting Party A's medication. Party B shall be responsible for compensation for any loss caused to Party A due to Party B's non-conforming delivery.</span></p>
   <p style="margin:0pt; orphans:0; text-align:justify; widows:0"><span style=" font-size:10.5pt">  2,In case of any dispute between Party A and Party B over the quality of drugs, it shall be submitted to the local drug inspection department of Party A for inspection. If there is any quality problem with the drug submitted for inspection, the inspection fee shall be borne by Party B, and Party A has the right to unilaterally suspend the performance of the purchase and sale contract of the drug;If there is no quality problem with the drugs submitted for inspection, the contract shall continue to be performed, and the inspection fee shall be borne by both parties 50%.During the period of drug inspection, Party A's medication is temporarily replaced by other similar drugs.</span></p>
   <p style="margin:0pt; orphans:0; text-align:justify; widows:0"><span style=" font-size:10.5pt">  3,If the drugs distributed by Party B are used for many times(Three or more times)In case of any adverse reactions, Party A shall promptly notify Party B. At the same time, Party A has the right to unilaterally suspend the product specification</span></p>
   <p style="margin:0pt; orphans:0; text-align:justify; widows:0"><span style=" font-size:10.5pt">  Party B shall bear all losses caused by the continued performance of the drug purchase contract and the return of the remaining drugs.</span></p>
   <p style="margin:0pt; orphans:0; text-align:justify; widows:0"><span style=" font-size:10.5pt">  4,In order to ensure the quality of drugs and avoid the waste of drugs, Party A shall properly store and manage the purchased drugs. In case of any loss caused by Party B's drug quality, Party B shall bear all responsibilities;Party A shall be fully responsible for the quality problems caused by Party A's storage conditions that do not conform to the normal storage of drugs.</span></p>
   <p style="margin:0pt; orphans:0; text-align:justify; widows:0"><span style=" font-size:10.5pt">  5,Party A can ask Party B for a replacement within 3 months after purchasing the medicine;If Party A still needs to exchange goods with Party B for more than 3 months, both parties shall negotiate for settlement;Unless otherwise agreed in writing by both parties, invalid drugs cannot be returned or replaced.</span></p>
   <p style="margin:0pt; orphans:0; text-align:justify; widows:0"><span style=" font-size:10.5pt">  Article 5 term of contract</span></p>
   <p style="margin:0pt; orphans:0; text-align:justify; widows:0"><span style=" font-size:10.5pt">  The validity of this contract is one year, from November 30, 2011 to November 30, 2012, the method of one-time signing, supplying in batches and paying in installments is adopted. Upon the expiration of the contract, both parties may extend it for one year without any objection.</span></p>
   <p style="margin:0pt; orphans:0; text-align:justify; widows:0"><span style=" font-size:10.5pt">  Article 6 delivery time and place</span></p>
   <p style="margin:0pt; orphans:0; text-align:justify; widows:0"><span style=" font-size:10.5pt">  1,Party B or the drug distributor entrusted by Party B shall be responsible for drug distribution. Party A shall send the batch purchase plan to Party B according to the drug use plan, and Party B shall deliver accordingly. The time and quantity of each delivery by Party B must be in strict accordance with the batch purchase plan sent by Party A. The delivery time of general drugs should not exceed seven jobs</span><span style=" font-size:10.5pt">Day.</span></p>
   <p style="margin:0pt; orphans:0; text-align:justify; widows:0"><span style=" font-size:10.5pt">  2,When Party B delivers the goods, Party A has the right to require Party B to provide relevant incidental services:(1)On site handling or warehousing of drugs; (2)Provide medicine unpacking or repacking tools;(3)Timely replace the damaged, near expiration drugs or other unqualified packaged drugs found during unpacking;(4)Other relevant services to be provided by Party B.</span></p>
   <p style="margin:0pt; orphans:0; text-align:justify; widows:0"><span style=" font-size:10.5pt">  3,Delivery place: the place designated by Party A.</span></p>
   <p style="margin:0pt; orphans:0; text-align:justify; widows:0"><span style=" font-size:10.5pt">  Article 7 contract price and settlement</span></p>
   <p style="margin:0pt; orphans:0; text-align:justify; widows:0"><span style=" font-size:10.5pt">  1,The contract drug price is 300000 yuan</span></p>
   <p style="margin:0pt; orphans:0; text-align:justify; widows:0"><span style=" font-size:10.5pt">  2,If the relevant departments of the state adjust the drug price, the drug price will be lower or higher in principle, thus causing a drug backlog, Party A has the right to return the overstocked drugs or modify the contract, and the losses caused to Party B shall be solved by both parties through negotiation.</span></p>
   <p style="margin:0pt; orphans:0; text-align:justify; widows:0"><span style=" font-size:10.5pt">  3,Settlement method: mass purchase(More than 50000 yuan for a drug)Settlement shall be carried out in batches according to the facts. Settlement shall be carried out at the end of each quarter for ordinary sporadic purchase. Party B shall submit to Party A**And related documents.</span></p>
   <p style="margin:0pt; orphans:0; text-align:justify; widows:0"><span style=" font-size:10.5pt">  Article 8 termination of contract</span></p>
   <p style="margin:0pt; orphans:0; text-align:justify; widows:0"><span style=" font-size:10.5pt">  In case of any of the following circumstances, Party A may issue a written notice to Party B, terminate the contract in part or in whole, and Party B shall compensate Party A for its losses:</span></p>
   <p style="margin:0pt; orphans:0; text-align:justify; widows:0"><span style=" font-size:10.5pt">  (1)The medicine provided by Party B has quality problems.</span></p>
   <p style="margin:0pt; orphans:0; text-align:justify; widows:0"><span style=" font-size:10.5pt">  (2)Party B fails to provide part or all of the drugs within the time limit specified in the contract or extended by Party A.</span></p>
   <p style="margin:0pt; orphans:0; text-align:justify; widows:0"><span style=" font-size:10.5pt">  (3)Party B's failure to perform its obligations under the contract will affect Party A's normal use.</span></p>
   <p style="margin:0pt; orphans:0; text-align:justify; widows:0"><span style=" font-size:10.5pt">  (4)Party B has any illegal behavior during the implementation of this contract.</span></p>
   <p style="margin:0pt; orphans:0; text-align:justify; widows:0"><span style=" font-size:10.5pt">  2,If Party A fails to settle the price on time according to the provisions of the contract, Party B has the right to require Party A to pay the legal overdue fine and bear the corresponding liability for breach of contract until the termination of the contract.</span></p>
   <p style="margin:0pt; orphans:0; text-align:justify; widows:0"><span style=" font-size:10.5pt">  Article 9 liability for breach of contract</span></p>
   <p style="margin:0pt; orphans:0; text-align:justify; widows:0"><span style=" font-size:10.5pt">  1,If Party B delays the delivery without proper reason, it will be charged 1000 yuan/Pay liquidated damages to Party A according to the daily standard, and the maximum amount of liquidated damages is 20% of the total contract price%,Party A according to Party B's breach of contract</span></p>
   <p style="margin:0pt; orphans:0; text-align:justify; widows:0"><span style=" font-size:10.5pt">  Party B has the right to terminate the contract in part or in whole.</span></p>
   <p style="margin:0pt; orphans:0; text-align:justify; widows:0"><span style=" font-size:10.5pt">  2,Party B shall be responsible for the compensation for any loss or accident caused to Party A or any third party due to the quality problem of the medicine provided by Party B, and Party A shall have the right to terminate the contract in part or in whole according to Party B's breach of contract.</span></p>
   <p style="margin:0pt; orphans:0; text-align:justify; widows:0"><span style=" font-size:10.5pt">  3,Party B shall have the right to require Party A to pay liquidated damages for the expected payment of the goods. The standard is 0.05% of the amount payable for each day overdue. Party B shall have the right to terminate part or all of the contract five days after sending the written notice of collection if the payment is overdue for 15 days.</span></p>
   <p style="margin:0pt; orphans:0; text-align:justify; widows:0"><span style=" font-size:10.5pt">  4,During the term of validity of the contract, if either party suspends performance without reason and fails to make corrections in time after being urged, the observant party shall have the right to require the breaching party to bear the total contract price 20%Liquidated damages.</span></p>
   <p style="margin:0pt; orphans:0; text-align:justify; widows:0"><span style=" font-size:10.5pt">  Article 10 force majeure</span></p>
   <p style="margin:0pt; orphans:0; text-align:justify; widows:0"><span style=" font-size:10.5pt">  1,Force majeure refers to uncontrollable, unforeseeable and unavoidable events or conditions, such as war, serious fire, flood, typhoon, earthquake, epidemic situation, etc.</span></p>
   <p style="margin:0pt; orphans:0; text-align:justify; widows:0"><span style=" font-size:10.5pt">  2,In the process of performing the contract, if Party B is unable to deliver drugs and provide accompanying services on time due to force majeure, Party B shall timely notify Party A in written form of the fact, possible time and reason of the delay. Party A shall verify the situation as soon as possible after receiving the notice from Party B. Party A shall determine whether to extend the delivery time and whether to collect liquidated damages or terminate the contract. The extension shall be approved and re signed by both parties by amending the contract.</span></p>
   <p style="margin:0pt; orphans:0; text-align:justify; widows:0"><span style=" font-size:10.5pt">  Article 11 dispute settlement</span></p>
   <p style="margin:0pt; orphans:0; text-align:justify; widows:0"><span style=" font-size:10.5pt">  Any dispute arising from the performance of this contract shall be settled by both parties through consultation;If the negotiation fails, the dispute may be submitted to arbitration or brought to a people's court in accordance with the relevant laws and regulations.</span></p>
   <p style="margin:0pt; orphans:0; text-align:justify; widows:0"><span style=" font-size:10.5pt">  Article 12 others</span></p>
   <p style="margin:0pt; orphans:0; text-align:justify; widows:0"><span style=" font-size:10.5pt">  1,This contract is made in duplicate, one for each party.</span></p>
   <p style="margin:0pt; orphans:0; text-align:justify; widows:0"><span style=" font-size:10.5pt">  2,This contract shall come into force as of the date of sealing by both parties.</span></p>
   <p style="margin:0pt; orphans:0; text-align:justify; widows:0"><span style=" font-size:10.5pt">  3,Matters not covered in this contract shall be determined by both parties through negotiation.</span></p>
   <p style="margin:0pt; orphans:0; text-align:justify; widows:0"><span style=" font-size:10.5pt">  Party A: legal representative:</span></p>
   <p style="margin:0pt; orphans:0; text-align:justify; widows:0"><span style=" font-size:10.5pt">  agent:</span></p>
   <p style="margin:0pt; orphans:0; text-align:justify; widows:0"><span style=" font-size:10.5pt">  Date of signing: legal representative of Party B: entrusted agent: date of signing:</span></p>
  </div>
  <div class="cnzz" style="display: none;"> 
   <script src="https://s23.cnzz.com/z_stat.php?id=1277655852;web_id=1277655852" language="JavaScript"></script> 
  </div>  
 </body>
</html>

Tags: Programming Windows Linux less Java

Posted on Wed, 18 Mar 2020 05:57:03 -0400 by miksel