|
@@ -5,8 +5,14 @@ export default function getPdfPoints() {
|
|
|
var contenterPdf = $("#contenterPdf")
|
|
|
var baseX = contenterPdf.offset().left
|
|
|
var baseY = contenterPdf.offset().top
|
|
|
+ var pageSize = {};
|
|
|
+
|
|
|
+
|
|
|
+ contenterPdf.scrollTop(0)
|
|
|
// 每一页pdf
|
|
|
- var page_cell = contenterPdf.find(".page_cell")
|
|
|
+ var page_cells = contenterPdf.find(".page_cell")
|
|
|
+ pageSize.width = $(contenterPdf.find(".page_cell")[0]).width();
|
|
|
+ pageSize.height = $(contenterPdf.find(".page_cell")[0]).height();
|
|
|
// pdf数据
|
|
|
var pdfData = {
|
|
|
"stdPoints": [],
|
|
@@ -17,360 +23,396 @@ export default function getPdfPoints() {
|
|
|
"barCodeInfo": [],
|
|
|
"missExamInfo": [],
|
|
|
"objectiveQues": [],
|
|
|
- "tkQues":[],
|
|
|
- ywzwQues:[]
|
|
|
+ "tkQues": [],
|
|
|
+ ywzwQues: []
|
|
|
}
|
|
|
- var pdfPointsList = [];
|
|
|
- Array.from(page_cell).forEach((item) => {
|
|
|
- console.log(item)
|
|
|
+ var pdfPagePointsList = [];
|
|
|
+ Array.from(page_cells).forEach((page_cell, index) => {
|
|
|
+ baseY = baseY + $(page_cell).height()*index;
|
|
|
+ let pdfPointsList = [];
|
|
|
+ let elementsDom = [];
|
|
|
// 标准点
|
|
|
+ elementsDom = $(page_cell).find(".stdPoints");
|
|
|
let pointList = [];
|
|
|
- for (var i = 0; i < $(".stdPoints").length; i++) {
|
|
|
+ for (var i = 0; i < elementsDom.length; i++) {
|
|
|
pointList.push({
|
|
|
- x: $(".stdPoints").eq(i).offset().left - baseX,
|
|
|
- y: $(".stdPoints").eq(i).offset().top - baseY,
|
|
|
- w: $(".stdPoints").eq(i).width(),
|
|
|
- h: $(".stdPoints").eq(i).height(),
|
|
|
+ x: $(elementsDom[i]).offset().left - baseX,
|
|
|
+ y: $(elementsDom[i]).offset().top - baseY,
|
|
|
+ w: $(elementsDom[i]).width(),
|
|
|
+ h: $(elementsDom[i]).height(),
|
|
|
type: "rect",
|
|
|
- fill:1
|
|
|
+ fill: 1
|
|
|
})
|
|
|
}
|
|
|
pdfData.stdPoints = pointList
|
|
|
pdfPointsList = pdfPointsList.concat(pointList)
|
|
|
|
|
|
- pointList = [];
|
|
|
// 标题
|
|
|
- pointList.push({
|
|
|
- x: $("#paperNameTextAreaTem").offset().left - baseX,
|
|
|
- y: $("#paperNameTextAreaTem").offset().top - baseY,
|
|
|
- w: $("#paperNameTextAreaTem").width(),
|
|
|
- h: $("#paperNameTextAreaTem").height(),
|
|
|
- text: $("#paperNameTextAreaTem").text(),
|
|
|
- type: "rect"
|
|
|
- })
|
|
|
+ elementsDom = $(page_cell).find(".paperNameTextAreaTem");
|
|
|
+ pointList = [];
|
|
|
+ for (var i = 0; i < elementsDom.length; i++) {
|
|
|
+ pointList.push({
|
|
|
+ x: $(elementsDom[i]).offset().left - baseX,
|
|
|
+ y: $(elementsDom[i]).offset().top - baseY,
|
|
|
+ w: $(elementsDom[i]).width(),
|
|
|
+ h: $(elementsDom[i]).height(),
|
|
|
+ type: "rect"
|
|
|
+ })
|
|
|
+ }
|
|
|
pdfData.titleInfo = pointList
|
|
|
pdfPointsList = pdfPointsList.concat(pointList)
|
|
|
|
|
|
// 考生信息
|
|
|
pointList = []
|
|
|
- // 姓名,下划线
|
|
|
- pointList.push({
|
|
|
- x: $("#name").offset().left - baseX,
|
|
|
- y: $("#name").offset().top - baseY,
|
|
|
- w: $("#name").width(),
|
|
|
- h: $("#name").height(),
|
|
|
- text: $("#name").text(),
|
|
|
- type: "text"
|
|
|
- })
|
|
|
- pointList.push({
|
|
|
- x: $("#nameLine").offset().left - baseX,
|
|
|
- y: $("#nameLine").offset().top - baseY,
|
|
|
- w: $("#nameLine").width(),
|
|
|
- h: $("#nameLine").height(),
|
|
|
- text: $("#nameLine").text(),
|
|
|
- type: "line"
|
|
|
- })
|
|
|
- // 班级,下划线
|
|
|
- pointList.push({
|
|
|
- x: $("#className").offset().left - baseX,
|
|
|
- y: $("#className").offset().top - baseY,
|
|
|
- w: $("#className").width(),
|
|
|
- h: $("#className").height(),
|
|
|
- type: "text",
|
|
|
- text: $("#className").text()
|
|
|
- })
|
|
|
- pointList.push({
|
|
|
- x: $("#classNameLine").offset().left - baseX,
|
|
|
- y: $("#classNameLine").offset().top - baseY,
|
|
|
- w: $("#classNameLine").width(),
|
|
|
- h: $("#classNameLine").height(),
|
|
|
- text: $("#classNameLine").text(),
|
|
|
- type: "line"
|
|
|
- })
|
|
|
- // 考场号,下划线
|
|
|
- pointList.push({
|
|
|
- x: $("#kcNo").offset().left - baseX,
|
|
|
- y: $("#kcNo").offset().top - baseY,
|
|
|
- w: $("#kcNo").width(),
|
|
|
- h: $("#kcNo").height(),
|
|
|
- type: "text",
|
|
|
- text: $("#kcNo").text()
|
|
|
- })
|
|
|
- pointList.push({
|
|
|
- x: $("#kcNoLine").offset().left - baseX,
|
|
|
- y: $("#kcNoLine").offset().top - baseY,
|
|
|
- w: $("#kcNoLine").width(),
|
|
|
- h: $("#kcNoLine").height(),
|
|
|
- text: $("#kcNoLine").text(),
|
|
|
- type: "line"
|
|
|
- })
|
|
|
- // 座位号,下划线
|
|
|
- pointList.push({
|
|
|
- x: $("#sitNo").offset().left - baseX,
|
|
|
- y: $("#sitNo").offset().top - baseY,
|
|
|
- w: $("#sitNo").width(),
|
|
|
- h: $("#sitNo").height(),
|
|
|
- type: "text",
|
|
|
- text: $("#sitNo").text(),
|
|
|
- })
|
|
|
- pointList.push({
|
|
|
- x: $("#sitNoLine").offset().left - baseX,
|
|
|
- y: $("#sitNoLine").offset().top - baseY,
|
|
|
- w: $("#sitNoLine").width(),
|
|
|
- h: $("#sitNoLine").height(),
|
|
|
- text: $("#sitNoLine").text(),
|
|
|
- type: "line"
|
|
|
- })
|
|
|
- pdfData.studentInfo = pointList
|
|
|
- pdfPointsList = pdfPointsList.concat(pointList)
|
|
|
+ if (index == 0) {
|
|
|
+ // 姓名,下划线
|
|
|
+ pointList.push({
|
|
|
+ x: $($(page_cell).find("#name")).offset().left - baseX,
|
|
|
+ y: $($(page_cell).find("#name")).offset().top - baseY,
|
|
|
+ w: $($(page_cell).find("#name")).width(),
|
|
|
+ h: $($(page_cell).find("#name")).height(),
|
|
|
+ text: $($(page_cell).find("#name")).text(),
|
|
|
+ type: "text"
|
|
|
+ })
|
|
|
+ pointList.push({
|
|
|
+ x: $($(page_cell).find("#nameLine")).offset().left - baseX,
|
|
|
+ y: $($(page_cell).find("#nameLine")).offset().top - baseY,
|
|
|
+ w: $($(page_cell).find("#nameLine")).width(),
|
|
|
+ h: $($(page_cell).find("#nameLine")).height(),
|
|
|
+ text: $($(page_cell).find("#nameLine")).text(),
|
|
|
+ type: "line"
|
|
|
+ })
|
|
|
+ // 班级,下划线
|
|
|
+ pointList.push({
|
|
|
+ x: $($(page_cell).find("#className")).offset().left - baseX,
|
|
|
+ y: $($(page_cell).find("#className")).offset().top - baseY,
|
|
|
+ w: $($(page_cell).find("#className")).width(),
|
|
|
+ h: $($(page_cell).find("#className")).height(),
|
|
|
+ type: "text",
|
|
|
+ text: $($(page_cell).find("#className")).text()
|
|
|
+ })
|
|
|
+ pointList.push({
|
|
|
+ x: $($(page_cell).find("#classNameLine")).offset().left - baseX,
|
|
|
+ y: $($(page_cell).find("#classNameLine")).offset().top - baseY,
|
|
|
+ w: $($(page_cell).find("#classNameLine")).width(),
|
|
|
+ h: $($(page_cell).find("#classNameLine")).height(),
|
|
|
+ text: $($(page_cell).find("#classNameLine")).text(),
|
|
|
+ type: "line"
|
|
|
+ })
|
|
|
+ // 考场号,下划线
|
|
|
+ pointList.push({
|
|
|
+ x: $($(page_cell).find("#kcNo")).offset().left - baseX,
|
|
|
+ y: $($(page_cell).find("#kcNo")).offset().top - baseY,
|
|
|
+ w: $($(page_cell).find("#kcNo")).width(),
|
|
|
+ h: $($(page_cell).find("#kcNo")).height(),
|
|
|
+ type: "text",
|
|
|
+ text: $($(page_cell).find("#kcNo")).text()
|
|
|
+ })
|
|
|
+ pointList.push({
|
|
|
+ x: $($(page_cell).find("#kcNoLine")).offset().left - baseX,
|
|
|
+ y: $($(page_cell).find("#kcNoLine")).offset().top - baseY,
|
|
|
+ w: $($(page_cell).find("#kcNoLine")).width(),
|
|
|
+ h: $($(page_cell).find("#kcNoLine")).height(),
|
|
|
+ text: $($(page_cell).find("#kcNoLine")).text(),
|
|
|
+ type: "line"
|
|
|
+ })
|
|
|
+ // 座位号,下划线
|
|
|
+ pointList.push({
|
|
|
+ x: $($(page_cell).find("#sitNo")).offset().left - baseX,
|
|
|
+ y: $($(page_cell).find("#sitNo")).offset().top - baseY,
|
|
|
+ w: $($(page_cell).find("#sitNo")).width(),
|
|
|
+ h: $($(page_cell).find("#sitNo")).height(),
|
|
|
+ type: "text",
|
|
|
+ text: $($(page_cell).find("#sitNo")).text(),
|
|
|
+ })
|
|
|
+ pointList.push({
|
|
|
+ x: $($(page_cell).find("#sitNoLine")).offset().left - baseX,
|
|
|
+ y: $($(page_cell).find("#sitNoLine")).offset().top - baseY,
|
|
|
+ w: $($(page_cell).find("#sitNoLine")).width(),
|
|
|
+ h: $($(page_cell).find("#sitNoLine")).height(),
|
|
|
+ text: $($(page_cell).find("#sitNoLine")).text(),
|
|
|
+ type: "line"
|
|
|
+ })
|
|
|
+ pdfData.studentInfo = pointList
|
|
|
+ pdfPointsList = pdfPointsList.concat(pointList)
|
|
|
|
|
|
- // 准考证号和填涂框
|
|
|
- pointList = []
|
|
|
- pointList.push({
|
|
|
- x: $("#zkzh").offset().left - baseX,
|
|
|
- y: $("#zkzh").offset().top - baseY,
|
|
|
- w: $("#zkzh").width(),
|
|
|
- h: $("#zkzh").height(),
|
|
|
- text: $("#zkzh").text().replace(" ",""),
|
|
|
- type: "text"
|
|
|
- })
|
|
|
- for (var i = 0; i < $(".zkzh_rect").length; i++) {
|
|
|
+ // 准考证号和填涂框
|
|
|
+ pointList = []
|
|
|
pointList.push({
|
|
|
- x: $(".zkzh_rect").eq(i).offset().left - baseX,
|
|
|
- y: $(".zkzh_rect").eq(i).offset().top - baseY,
|
|
|
- w: $(".zkzh_rect").eq(i).width(),
|
|
|
- h: $(".zkzh_rect").eq(i).height(),
|
|
|
+ x: $($(page_cell).find("#zkzh")).offset().left - baseX,
|
|
|
+ y: $($(page_cell).find("#zkzh")).offset().top - baseY,
|
|
|
+ w: $($(page_cell).find("#zkzh")).width(),
|
|
|
+ h: $($(page_cell).find("#zkzh")).height(),
|
|
|
+ text: $($(page_cell).find("#zkzh")).text().replace(" ", ""),
|
|
|
+ type: "text"
|
|
|
+ })
|
|
|
+ elementsDom = $(page_cell).find(".zkzh_rect");
|
|
|
+ for (var i = 0; i < elementsDom.length; i++) {
|
|
|
+ pointList.push({
|
|
|
+ x: $(elementsDom[i]).offset().left - baseX,
|
|
|
+ y: $(elementsDom[i]).offset().top - baseY,
|
|
|
+ w: $(elementsDom[i]).width(),
|
|
|
+ h: $(elementsDom[i]).height(),
|
|
|
+ type: "rect"
|
|
|
+ })
|
|
|
+ }
|
|
|
+ pdfData.studentNo = pointList
|
|
|
+ pdfPointsList = pdfPointsList.concat(pointList)
|
|
|
+
|
|
|
+ // 注意事项
|
|
|
+ pointList = []
|
|
|
+ pointList.push({
|
|
|
+ x: $($(page_cell).find("#noteInfo")).offset().left - baseX,
|
|
|
+ y: $($(page_cell).find("#noteInfo")).offset().top - baseY,
|
|
|
+ w: $($(page_cell).find("#noteInfo")).width(),
|
|
|
+ h: $($(page_cell).find("#noteInfo")).height(),
|
|
|
type: "rect"
|
|
|
})
|
|
|
- }
|
|
|
- pdfData.studentNo = pointList
|
|
|
- pdfPointsList = pdfPointsList.concat(pointList)
|
|
|
+ pointList.push({
|
|
|
+ x: $($(page_cell).find("#noteInfo_title")).offset().left - baseX,
|
|
|
+ y: $($(page_cell).find("#noteInfo_title")).offset().top - baseY,
|
|
|
+ w: $($(page_cell).find("#noteInfo_title")).width(),
|
|
|
+ h: $($(page_cell).find("#noteInfo_title")).height(),
|
|
|
+ type: "text",
|
|
|
+ text: $($(page_cell).find("#noteInfo_title")).text()
|
|
|
+ })
|
|
|
|
|
|
- // 注意事项
|
|
|
- pointList = []
|
|
|
- pointList.push({
|
|
|
- x: $("#noteInfo").offset().left - baseX,
|
|
|
- y: $("#noteInfo").offset().top - baseY,
|
|
|
- w: $("#noteInfo").width(),
|
|
|
- h: $("#noteInfo").height(),
|
|
|
- type: "rect"
|
|
|
- })
|
|
|
- pointList.push({
|
|
|
- x: $("#noteInfo_title").offset().left - baseX,
|
|
|
- y: $("#noteInfo_title").offset().top - baseY,
|
|
|
- w: $("#noteInfo_title").width(),
|
|
|
- h: $("#noteInfo_title").height(),
|
|
|
- type: "text",
|
|
|
- text: $("#noteInfo_title").text()
|
|
|
- })
|
|
|
- for (var i = 0; i < $(".noteInfo_desc").length; i++) {
|
|
|
+ elementsDom = $(page_cell).find(".noteInfo_desc");
|
|
|
+ for (var i = 0; i < elementsDom.length; i++) {
|
|
|
+ pointList.push({
|
|
|
+ x: $(elementsDom[i]).offset().left - baseX,
|
|
|
+ y: $(elementsDom[i]).offset().top - baseY,
|
|
|
+ w: $(elementsDom[i]).width(),
|
|
|
+ h: $(elementsDom[i]).height(),
|
|
|
+ type: "text",
|
|
|
+ text: $(elementsDom[i]).text()
|
|
|
+ })
|
|
|
+ }
|
|
|
+ pdfData.noteInfo = pointList
|
|
|
+ pdfPointsList = pdfPointsList.concat(pointList)
|
|
|
+
|
|
|
+ // 条形码区域
|
|
|
+ pointList = []
|
|
|
+ pointList.push({
|
|
|
+ x: $($(page_cell).find("#barCodeRect")).offset().left - baseX,
|
|
|
+ y: $($(page_cell).find("#barCodeRect")).offset().top - baseY,
|
|
|
+ w: $($(page_cell).find("#barCodeRect")).width(),
|
|
|
+ h: $($(page_cell).find("#barCodeRect")).height(),
|
|
|
+ type: "rect"
|
|
|
+ })
|
|
|
+ pointList.push({
|
|
|
+ x: $($(page_cell).find("#barCodeTitle")).offset().left - baseX,
|
|
|
+ y: $($(page_cell).find("#barCodeTitle")).offset().top - baseY,
|
|
|
+ w: $($(page_cell).find("#barCodeTitle")).width(),
|
|
|
+ h: $($(page_cell).find("#barCodeTitle")).height(),
|
|
|
+ type: "text",
|
|
|
+ text: $($(page_cell).find("#barCodeTitle")).text()
|
|
|
+ })
|
|
|
+ pointList.push({
|
|
|
+ x: $($(page_cell).find("#barCodeNote")).offset().left - baseX,
|
|
|
+ y: $($(page_cell).find("#barCodeNote")).offset().top - baseY,
|
|
|
+ w: $($(page_cell).find("#barCodeNote")).width(),
|
|
|
+ h: $($(page_cell).find("#barCodeNote")).height(),
|
|
|
+ type: "text",
|
|
|
+ text: $($(page_cell).find("#barCodeNote")).text()
|
|
|
+ })
|
|
|
+ pdfData.barCodeInfo = pointList
|
|
|
+ pdfPointsList = pdfPointsList.concat(pointList)
|
|
|
+
|
|
|
+ // 缺考标记
|
|
|
+ pointList = []
|
|
|
+ pointList.push({
|
|
|
+ x: $($(page_cell).find("#missExamRect")).offset().left - baseX,
|
|
|
+ y: $($(page_cell).find("#missExamRect")).offset().top - baseY,
|
|
|
+ w: $($(page_cell).find("#missExamRect")).width(),
|
|
|
+ h: $($(page_cell).find("#missExamRect")).height(),
|
|
|
+ type: "rect"
|
|
|
+ })
|
|
|
+ pointList.push({
|
|
|
+ x: $($(page_cell).find("#exactFill")).offset().left - baseX,
|
|
|
+ y: $($(page_cell).find("#exactFill")).offset().top - baseY,
|
|
|
+ w: $($(page_cell).find("#exactFill")).width(),
|
|
|
+ h: $($(page_cell).find("#exactFill")).height(),
|
|
|
+ type: "text",
|
|
|
+ text: $($(page_cell).find("#exactFill")).text()
|
|
|
+ })
|
|
|
pointList.push({
|
|
|
- x: $(".noteInfo_desc").eq(i).offset().left - baseX,
|
|
|
- y: $(".noteInfo_desc").eq(i).offset().top - baseY,
|
|
|
- w: $(".noteInfo_desc").eq(i).width(),
|
|
|
- h: $(".noteInfo_desc").eq(i).height(),
|
|
|
+ x: $($(page_cell).find("#exactFillRect")).offset().left - baseX,
|
|
|
+ y: $($(page_cell).find("#exactFillRect")).offset().top - baseY,
|
|
|
+ w: $($(page_cell).find("#exactFillRect")).width(),
|
|
|
+ h: $($(page_cell).find("#exactFillRect")).height(),
|
|
|
+ type: "rect",
|
|
|
+ fill: 1
|
|
|
+ })
|
|
|
+ pointList.push({
|
|
|
+ x: $($(page_cell).find("#missExamFill")).offset().left - baseX,
|
|
|
+ y: $($(page_cell).find("#missExamFill")).offset().top - baseY,
|
|
|
+ w: $($(page_cell).find("#missExamFill")).width(),
|
|
|
+ h: $($(page_cell).find("#missExamFill")).height(),
|
|
|
type: "text",
|
|
|
- text: $(".noteInfo_desc").eq(i).text()
|
|
|
+ text: $($(page_cell).find("#missExamFill")).text()
|
|
|
})
|
|
|
+ pointList.push({
|
|
|
+ x: $($(page_cell).find("#missExamFillRect")).offset().left - baseX,
|
|
|
+ y: $($(page_cell).find("#missExamFillRect")).offset().top - baseY,
|
|
|
+ w: $($(page_cell).find("#missExamFillRect")).width(),
|
|
|
+ h: $($(page_cell).find("#missExamFillRect")).height(),
|
|
|
+ type: "rect"
|
|
|
+ })
|
|
|
+ pdfData.missExamInfo = pointList
|
|
|
+ pdfPointsList = pdfPointsList.concat(pointList)
|
|
|
}
|
|
|
- pdfData.noteInfo = pointList
|
|
|
- pdfPointsList = pdfPointsList.concat(pointList)
|
|
|
|
|
|
- // 条形码区域
|
|
|
- pointList = []
|
|
|
- pointList.push({
|
|
|
- x: $("#barCodeRect").offset().left - baseX,
|
|
|
- y: $("#barCodeRect").offset().top - baseY,
|
|
|
- w: $("#barCodeRect").width(),
|
|
|
- h: $("#barCodeRect").height(),
|
|
|
- type: "rect"
|
|
|
- })
|
|
|
- pointList.push({
|
|
|
- x: $("#barCodeTitle").offset().left - baseX,
|
|
|
- y: $("#barCodeTitle").offset().top - baseY,
|
|
|
- w: $("#barCodeTitle").width(),
|
|
|
- h: $("#barCodeTitle").height(),
|
|
|
- type: "text",
|
|
|
- text: $("#barCodeTitle").text()
|
|
|
- })
|
|
|
- pointList.push({
|
|
|
- x: $("#barCodeNote").offset().left - baseX,
|
|
|
- y: $("#barCodeNote").offset().top - baseY,
|
|
|
- w: $("#barCodeNote").width(),
|
|
|
- h: $("#barCodeNote").height(),
|
|
|
- type: "text",
|
|
|
- text: $("#barCodeNote").text()
|
|
|
- })
|
|
|
- pdfData.barCodeInfo = pointList
|
|
|
- pdfPointsList = pdfPointsList.concat(pointList)
|
|
|
-
|
|
|
- // 缺考标记
|
|
|
- pointList = []
|
|
|
- pointList.push({
|
|
|
- x: $("#missExamRect").offset().left - baseX,
|
|
|
- y: $("#missExamRect").offset().top - baseY,
|
|
|
- w: $("#missExamRect").width(),
|
|
|
- h: $("#missExamRect").height(),
|
|
|
- type: "rect"
|
|
|
- })
|
|
|
- pointList.push({
|
|
|
- x: $("#exactFill").offset().left - baseX,
|
|
|
- y: $("#exactFill").offset().top - baseY,
|
|
|
- w: $("#exactFill").width(),
|
|
|
- h: $("#exactFill").height(),
|
|
|
- type: "text",
|
|
|
- text: $("#exactFill").text()
|
|
|
- })
|
|
|
- pointList.push({
|
|
|
- x: $("#exactFillRect").offset().left - baseX,
|
|
|
- y: $("#exactFillRect").offset().top - baseY,
|
|
|
- w: $("#exactFillRect").width(),
|
|
|
- h: $("#exactFillRect").height(),
|
|
|
- type: "rect",
|
|
|
- fill:1
|
|
|
- })
|
|
|
- pointList.push({
|
|
|
- x: $("#missExamFill").offset().left - baseX,
|
|
|
- y: $("#missExamFill").offset().top - baseY,
|
|
|
- w: $("#missExamFill").width(),
|
|
|
- h: $("#missExamFill").height(),
|
|
|
- type: "text",
|
|
|
- text: $("#missExamFill").text()
|
|
|
- })
|
|
|
- pointList.push({
|
|
|
- x: $("#missExamFillRect").offset().left - baseX,
|
|
|
- y: $("#missExamFillRect").offset().top - baseY,
|
|
|
- w: $("#missExamFillRect").width(),
|
|
|
- h: $("#missExamFillRect").height(),
|
|
|
- type: "rect"
|
|
|
- })
|
|
|
- pdfData.missExamInfo = pointList
|
|
|
- pdfPointsList = pdfPointsList.concat(pointList)
|
|
|
|
|
|
// 客观题
|
|
|
pointList = []
|
|
|
- if ($(".page_objective_title").length > 0) {
|
|
|
+ if ($($(page_cell).find(".page_objective_title")).length > 0) {
|
|
|
// 客观题标题
|
|
|
pointList.push({
|
|
|
- x: $(".page_objective_title").eq(0).offset().left - baseX,
|
|
|
- y: $(".page_objective_title").eq(0).offset().top - baseY,
|
|
|
- w: $(".page_objective_title").eq(0).width(),
|
|
|
- h: $(".page_objective_title").eq(0).height(),
|
|
|
+ x: $($(page_cell).find(".page_objective_title")[0]).offset().left - baseX,
|
|
|
+ y: $($(page_cell).find(".page_objective_title")[0]).offset().top - baseY,
|
|
|
+ w: $($(page_cell).find(".page_objective_title")[0]).width(),
|
|
|
+ h: $($(page_cell).find(".page_objective_title")[0]).height(),
|
|
|
type: "text",
|
|
|
- text: $(".page_objective_title").eq(0).text()
|
|
|
+ text: $($(page_cell).find(".page_objective_title")[0]).text()
|
|
|
})
|
|
|
// 客观题矩形区域
|
|
|
pointList.push({
|
|
|
- x: $(".page_objective_rect").eq(0).offset().left - baseX,
|
|
|
- y: $(".page_objective_rect").eq(0).offset().top - baseY,
|
|
|
- w: $(".page_objective_rect").eq(0).width(),
|
|
|
- h: $(".page_objective_rect").eq(0).height(),
|
|
|
+ x: $($(page_cell).find(".page_objective_rect")[0]).offset().left - baseX,
|
|
|
+ y: $($(page_cell).find(".page_objective_rect")[0]).offset().top - baseY,
|
|
|
+ w: $($(page_cell).find(".page_objective_rect")[0]).width(),
|
|
|
+ h: $($(page_cell).find(".page_objective_rect")[0]).height(),
|
|
|
type: "rect"
|
|
|
})
|
|
|
// 客观题选项
|
|
|
- // Array.from($(".page_objective_ques")).forEach(item=>{
|
|
|
- let tmid = $(".page_cell_tm_id").eq(0);
|
|
|
- for (var i = 0; i < $(".page_cell_tm_id").length; i++) {
|
|
|
+ elementsDom = $(page_cell).find(".page_cell_tm_id");
|
|
|
+ for (var i = 0; i < elementsDom.length; i++) {
|
|
|
pointList.push({
|
|
|
- x: $(".page_cell_tm_id").eq(i).offset().left - baseX,
|
|
|
- y: $(".page_cell_tm_id").eq(i).offset().top - baseY,
|
|
|
- w: $(".page_cell_tm_id").eq(i).width(),
|
|
|
- h: $(".page_cell_tm_id").eq(i).height(),
|
|
|
+ x: $(elementsDom[i]).offset().left - baseX,
|
|
|
+ y: $(elementsDom[i]).offset().top - baseY,
|
|
|
+ w: $(elementsDom[i]).width(),
|
|
|
+ h: $(elementsDom[i]).height(),
|
|
|
type: "text",
|
|
|
- text: $(".page_cell_tm_id").eq(i).text(),
|
|
|
+ text: $(elementsDom[i]).text(),
|
|
|
})
|
|
|
}
|
|
|
- for (var i = 0; i < $(".page_cell_options").length; i++) {
|
|
|
+
|
|
|
+ elementsDom = $(page_cell).find(".page_cell_options");
|
|
|
+ for (var i = 0; i < elementsDom.length; i++) {
|
|
|
pointList.push({
|
|
|
- x: $(".page_cell_options").eq(i).offset().left - baseX,
|
|
|
- y: $(".page_cell_options").eq(i).offset().top - baseY,
|
|
|
- w: $(".page_cell_options").eq(i).width(),
|
|
|
- h: $(".page_cell_options").eq(i).height(),
|
|
|
+ x: $(elementsDom[i]).offset().left - baseX,
|
|
|
+ y: $(elementsDom[i]).offset().top - baseY,
|
|
|
+ w: $(elementsDom[i]).width(),
|
|
|
+ h: $(elementsDom[i]).height(),
|
|
|
type: "rect"
|
|
|
})
|
|
|
}
|
|
|
- for (var i = 0; i < $(".page_cell_options_char").length; i++) {
|
|
|
+
|
|
|
+ elementsDom = $(page_cell).find(".page_cell_options_char");
|
|
|
+ for (var i = 0; i < elementsDom.length; i++) {
|
|
|
pointList.push({
|
|
|
- x: $(".page_cell_options_char").eq(i).offset().left - baseX,
|
|
|
- y: $(".page_cell_options_char").eq(i).offset().top - baseY,
|
|
|
- w: $(".page_cell_options_char").eq(i).width(),
|
|
|
- h: $(".page_cell_options_char").eq(i).height(),
|
|
|
+ x: $(elementsDom[i]).offset().left - baseX,
|
|
|
+ y: $(elementsDom[i]).offset().top - baseY,
|
|
|
+ w: $(elementsDom[i]).width(),
|
|
|
+ h: $(elementsDom[i]).height(),
|
|
|
type: "text",
|
|
|
- text: $(".page_cell_options_char").eq(i).text()
|
|
|
+ text: $(elementsDom[i]).text()
|
|
|
})
|
|
|
}
|
|
|
|
|
|
}
|
|
|
pdfData.objectiveQues = pointList
|
|
|
pdfPointsList = pdfPointsList.concat(pointList)
|
|
|
- console.log(pdfData, 33333333333333)
|
|
|
- console.log(pdfPointsList,44444444444444444)
|
|
|
|
|
|
// 填空题
|
|
|
pointList = []
|
|
|
- if ($(".page_tk_title").length > 0) {
|
|
|
- pointList.push({
|
|
|
- x: $(".page_tk_title").eq(0).offset().left - baseX,
|
|
|
- y: $(".page_tk_title").eq(0).offset().top - baseY,
|
|
|
- w: $(".page_tk_title").eq(0).width(),
|
|
|
- h: $(".page_tk_title").eq(0).height(),
|
|
|
- type: "text",
|
|
|
- text: $(".page_tk_title").eq(0).text()
|
|
|
- })
|
|
|
- pointList.push({
|
|
|
- x: $(".page_tk_rect").eq(0).offset().left - baseX,
|
|
|
- y: $(".page_tk_rect").eq(0).offset().top - baseY,
|
|
|
- w: $(".page_tk_rect").eq(0).width(),
|
|
|
- h: $(".page_tk_rect").eq(0).height(),
|
|
|
- type: "rect",
|
|
|
- })
|
|
|
- for (var i = 0; i < $(".page_tk_tm_id").length; i++) {
|
|
|
+ console.log($($(page_cell).find(".page_tk_title")).length,8888888888888888888)
|
|
|
+ if ($($(page_cell).find(".page_tk_title")).length > 0) {
|
|
|
+ elementsDom = $(page_cell).find(".page_tk_title");
|
|
|
+ for(var i=0;i<elementsDom.length;i++){
|
|
|
pointList.push({
|
|
|
- x: $(".page_tk_tm_id").eq(i).offset().left - baseX,
|
|
|
- y: $(".page_tk_tm_id").eq(i).offset().top - baseY,
|
|
|
- w: $(".page_tk_tm_id").eq(i).width(),
|
|
|
- h: $(".page_tk_tm_id").eq(i).height(),
|
|
|
+ x: $(elementsDom[i]).offset().left - baseX,
|
|
|
+ y: $(elementsDom[i]).offset().top - baseY,
|
|
|
+ w: $(elementsDom[i]).width(),
|
|
|
+ h: $(elementsDom[i]).height(),
|
|
|
type: "text",
|
|
|
- text: $(".page_tk_tm_id").eq(i).text(),
|
|
|
+ text: $(elementsDom[i]).text()
|
|
|
})
|
|
|
}
|
|
|
- for (var i = 0; i < $(".page_tk_tm_line").length; i++) {
|
|
|
+
|
|
|
+ elementsDom = $(page_cell).find(".page_tk_rect");
|
|
|
+ for(var i=0;i<elementsDom.length;i++){
|
|
|
pointList.push({
|
|
|
- x: $(".page_tk_tm_line").eq(i).offset().left - baseX,
|
|
|
- y: $(".page_tk_tm_line").eq(i).offset().top - baseY,
|
|
|
- w: $(".page_tk_tm_line").eq(i).width(),
|
|
|
- h: $(".page_tk_tm_line").eq(i).height(),
|
|
|
+ x: $(elementsDom[i]).offset().left - baseX,
|
|
|
+ y: $(elementsDom[i]).offset().top - baseY,
|
|
|
+ w: $(elementsDom[i]).width(),
|
|
|
+ h: $(elementsDom[i]).height(),
|
|
|
+ type: "rect"
|
|
|
+ })
|
|
|
+ }
|
|
|
+
|
|
|
+ elementsDom = $(page_cell).find(".page_tk_tm_id");
|
|
|
+ for (var i = 0; i < elementsDom.length; i++) {
|
|
|
+ pointList.push({
|
|
|
+ x: $(elementsDom[i]).offset().left - baseX,
|
|
|
+ y: $(elementsDom[i]).offset().top - baseY,
|
|
|
+ w: $(elementsDom[i]).width(),
|
|
|
+ h: $(elementsDom[i]).height(),
|
|
|
+ type: "text",
|
|
|
+ text: $(elementsDom[i]).text(),
|
|
|
+ })
|
|
|
+ }
|
|
|
+
|
|
|
+ elementsDom = $(page_cell).find(".page_tk_tm_line");
|
|
|
+ for (var i = 0; i < elementsDom.length; i++) {
|
|
|
+ pointList.push({
|
|
|
+ x: $(elementsDom[i]).offset().left - baseX,
|
|
|
+ y: $(elementsDom[i]).offset().top - baseY,
|
|
|
+ w: $(elementsDom[i]).width(),
|
|
|
+ h: $(elementsDom[i]).height(),
|
|
|
type: "line"
|
|
|
})
|
|
|
}
|
|
|
pdfData.tkQues = pointList
|
|
|
pdfPointsList = pdfPointsList.concat(pointList)
|
|
|
+
|
|
|
+ console.log(pointList,7777777777777777777)
|
|
|
}
|
|
|
|
|
|
// 语文作文题
|
|
|
pointList = []
|
|
|
- if ($(".page_tk_title").length > 0) {
|
|
|
- for (var i = 0; i < $(".left_div_words").length; i++) {
|
|
|
+ if ($(page_cell).find(".left_div_words").length > 0) {
|
|
|
+ elementsDom = $(page_cell).find(".left_div_words");
|
|
|
+ for (var i = 0; i < elementsDom.length; i++) {
|
|
|
pointList.push({
|
|
|
- x: $(".left_div_words").eq(i).offset().left - baseX,
|
|
|
- y: $(".left_div_words").eq(i).offset().top - baseY,
|
|
|
- w: $(".left_div_words").eq(i).width(),
|
|
|
- h: $(".left_div_words").eq(i).height(),
|
|
|
+ x: $(elementsDom[i]).offset().left - baseX,
|
|
|
+ y: $(elementsDom[i]).offset().top - baseY,
|
|
|
+ w: $(elementsDom[i]).width(),
|
|
|
+ h: $(elementsDom[i]).height(),
|
|
|
type: "rect"
|
|
|
})
|
|
|
}
|
|
|
- for (var i = 0; i < $(".left_div_words_li").length; i++) {
|
|
|
+
|
|
|
+ elementsDom = $(page_cell).find(".left_div_words_li");
|
|
|
+ for (var i = 0; i < elementsDom.length; i++) {
|
|
|
pointList.push({
|
|
|
- x: $(".left_div_words_li").eq(i).offset().left - baseX,
|
|
|
- y: $(".left_div_words_li").eq(i).offset().top - baseY,
|
|
|
- w: $(".left_div_words_li").eq(i).width(),
|
|
|
- h: $(".left_div_words_li").eq(i).height(),
|
|
|
+ x: $(elementsDom[i]).offset().left - baseX,
|
|
|
+ y: $(elementsDom[i]).offset().top - baseY,
|
|
|
+ w: $(elementsDom[i]).width(),
|
|
|
+ h: $(elementsDom[i]).height(),
|
|
|
type: "rect"
|
|
|
})
|
|
|
}
|
|
|
pdfData.ywzwQues = pointList
|
|
|
pdfPointsList = pdfPointsList.concat(pointList)
|
|
|
}
|
|
|
+ pdfPagePointsList.push(pdfPointsList);
|
|
|
});
|
|
|
- return pdfPointsList;
|
|
|
-}
|
|
|
+ console.log(pdfPagePointsList,6666666666666666666)
|
|
|
+ let data = {
|
|
|
+ pageSize:pageSize,
|
|
|
+ pdfPagePointsList:pdfPagePointsList
|
|
|
+ }
|
|
|
+ return data;
|
|
|
+}
|
|
|
+
|