After converting a PDF file into an image, we can now position each image in a rectangle, that is, to locate all the news in each image.
A rectangle has four coordinate points. In the future, we need to use VML to sketch it out, and then use JavaScript to control it. This rectangle is only available when it is moved to a rectangle. Therefore, in this step, you need to save the point outlined by VML, the minimum and maximum values of the X axis, and the minimum and maximum values of the Y axis.
The HTML code is as follows:
<HTML xmlns = "http://www.w3.org/1999/xhtml">
C # The Code is as follows:
Public partial class savepaper: system. Web. UI. Page {protected void page_load (Object sender, eventargs e) {ajaxpro. Utility. registertypeforajax (typeof (savepaper); If (! Ispostback) {datatable dt = sqlhelper. excutedatatable ("select * From tb_techpapers"); rpttechpapers. datasource = DT; rpttechpapers. databind () ;}} protected void lbtntechpapername_click (Object sender, eventargs e) {linkbutton lbtn = (linkbutton) sender; txttechpapername. value = lbtn. text; datatable dt = sqlhelper. excutedatatable ("select * From tb_techpaperdetails where techpaperid =" + lbtn. toolt IP); rpttechpaperdetails. datasource = DT; rpttechpaperdetails. databind ();} [ajaxpro. ajaxmethod (ajaxpro. httpsessionstaterequirement. readwrite)] Public String savetechpaperrects (string strtechpaperdid, string strtechpaperrects) {string strsql = ""; // 1. delete the rectangular data strsql = "delete tb_techpaperrects where techpaperdid =" + strtechpaperdid; sqlhelper. executesql (strsql); // 2. save every new rectangle string [] S Trarraytechpaperrects = strtechpaperrects. split ('|'); foreach (string strtechpaperrect in strarraytechpaperrects) {string [] strarraytechpaperrect = strtechpaperrect. split ('&'); techpaperrects mtechpaperrects = new techpaperrects (); mtechpaperrects. techpaperrid = mtechpaperrects. getmaxid (); mtechpaperrects. techpaperdid = convert. toint32 (strtechpaperdid); mtechpaperrects. techpaperrpoint = strarrayt Echpaperrect [0]; mtechpaperrects. techpaperrminx = strarraytechpaperrect [1]; mtechpaperrects. techpaperrmaxx = strarraytechpaperrect [2]; mtechpaperrects. techpaperrminy = strarraytechpaperrect [3]; mtechpaperrects. techpaperrmaxy = strarraytechpaperrect [4]; mtechpaperrects. techpaperrname = strarraytechpaperrect [5]; mtechpaperrects. add ();} return "successful! ";}}
If you have any questions or errors, you are welcome to correct and discuss them.