|
@@ -1,4 +1,7 @@
|
|
|
// $(document).ready(function() {
|
|
|
+function trim(str){
|
|
|
+ return str.replace(/^\s+|\s+$/g, '')
|
|
|
+}
|
|
|
|
|
|
export default function getPdfPoints() {
|
|
|
// pdf容器contenterPdf
|
|
@@ -28,7 +31,8 @@ export default function getPdfPoints() {
|
|
|
}
|
|
|
var pdfPagePointsList = [];
|
|
|
Array.from(page_cells).forEach((page_cell, index) => {
|
|
|
- baseY = baseY + $(page_cell).height()*index;
|
|
|
+ var baseY = contenterPdf.offset().top;
|
|
|
+ baseY = baseY + ($(page_cell).height()+25)*index;
|
|
|
let pdfPointsList = [];
|
|
|
let elementsDom = [];
|
|
|
// 标准点
|
|
@@ -143,7 +147,7 @@ export default function getPdfPoints() {
|
|
|
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(" ", ""),
|
|
|
+ text: $($(page_cell).find("#zkzh")).text().trim(),
|
|
|
type: "text"
|
|
|
})
|
|
|
elementsDom = $(page_cell).find(".zkzh_rect");
|
|
@@ -174,7 +178,7 @@ export default function getPdfPoints() {
|
|
|
w: $($(page_cell).find("#noteInfo_title")).width(),
|
|
|
h: $($(page_cell).find("#noteInfo_title")).height(),
|
|
|
type: "text",
|
|
|
- text: $($(page_cell).find("#noteInfo_title")).text()
|
|
|
+ text: $($(page_cell).find("#noteInfo_title")).text().trim()
|
|
|
})
|
|
|
|
|
|
elementsDom = $(page_cell).find(".noteInfo_desc");
|
|
@@ -185,7 +189,7 @@ export default function getPdfPoints() {
|
|
|
w: $(elementsDom[i]).width(),
|
|
|
h: $(elementsDom[i]).height(),
|
|
|
type: "text",
|
|
|
- text: $(elementsDom[i]).text()
|
|
|
+ text: $(elementsDom[i]).text().trim()
|
|
|
})
|
|
|
}
|
|
|
pdfData.noteInfo = pointList
|
|
@@ -206,7 +210,8 @@ export default function getPdfPoints() {
|
|
|
w: $($(page_cell).find("#barCodeTitle")).width(),
|
|
|
h: $($(page_cell).find("#barCodeTitle")).height(),
|
|
|
type: "text",
|
|
|
- text: $($(page_cell).find("#barCodeTitle")).text()
|
|
|
+ text: $($(page_cell).find("#barCodeTitle")).text(),
|
|
|
+ size:16
|
|
|
})
|
|
|
pointList.push({
|
|
|
x: $($(page_cell).find("#barCodeNote")).offset().left - baseX,
|
|
@@ -214,7 +219,8 @@ export default function getPdfPoints() {
|
|
|
w: $($(page_cell).find("#barCodeNote")).width(),
|
|
|
h: $($(page_cell).find("#barCodeNote")).height(),
|
|
|
type: "text",
|
|
|
- text: $($(page_cell).find("#barCodeNote")).text()
|
|
|
+ text: $($(page_cell).find("#barCodeNote")).text(),
|
|
|
+ size:6
|
|
|
})
|
|
|
pdfData.barCodeInfo = pointList
|
|
|
pdfPointsList = pdfPointsList.concat(pointList)
|
|
@@ -274,7 +280,7 @@ export default function getPdfPoints() {
|
|
|
w: $($(page_cell).find(".page_objective_title")[0]).width(),
|
|
|
h: $($(page_cell).find(".page_objective_title")[0]).height(),
|
|
|
type: "text",
|
|
|
- text: $($(page_cell).find(".page_objective_title")[0]).text()
|
|
|
+ text: $($(page_cell).find(".page_objective_title")[0]).text().trim()
|
|
|
})
|
|
|
// 客观题矩形区域
|
|
|
pointList.push({
|
|
@@ -336,7 +342,7 @@ export default function getPdfPoints() {
|
|
|
w: $(elementsDom[i]).width(),
|
|
|
h: $(elementsDom[i]).height(),
|
|
|
type: "text",
|
|
|
- text: $(elementsDom[i]).text()
|
|
|
+ text: $(elementsDom[i]).text().trim()
|
|
|
})
|
|
|
}
|
|
|
|
|
@@ -359,7 +365,7 @@ export default function getPdfPoints() {
|
|
|
w: $(elementsDom[i]).width(),
|
|
|
h: $(elementsDom[i]).height(),
|
|
|
type: "text",
|
|
|
- text: $(elementsDom[i]).text(),
|
|
|
+ text: $(elementsDom[i]).text().trim(),
|
|
|
})
|
|
|
}
|
|
|
|
|
@@ -416,3 +422,9 @@ export default function getPdfPoints() {
|
|
|
return data;
|
|
|
}
|
|
|
|
|
|
+// export function getAnsCardHtml(){
|
|
|
+// var contenterPdf = $("#contenterPdf")
|
|
|
+// console.log(contenterPdf.html())
|
|
|
+// return contenterPdf.html();
|
|
|
+// }
|
|
|
+
|