|
@@ -337,34 +337,11 @@ function _setupPgBrks(pageData) {
|
|
|
pageData.pageBreaks = [];
|
|
|
let pgBrkIdx = 0;
|
|
|
const pgBrk = [];
|
|
|
- function _insertMaxBottom(pCells, targetBottomArr, chkTop) {
|
|
|
- if (pCells) {
|
|
|
- for (const cell of pCells) {
|
|
|
- let cb = parseFloat(cell[JV.PROP_AREA][JV.PROP_BOTTOM]);
|
|
|
- if (targetBottomArr.indexOf(cb) < 0) {
|
|
|
- targetBottomArr.push(cb);
|
|
|
- }
|
|
|
- if (chkTop || pCells.isStamp) {
|
|
|
- cb = parseFloat(cell[JV.PROP_AREA][JV.PROP_TOP]);
|
|
|
- if (targetBottomArr.indexOf(cb) < 0) {
|
|
|
- targetBottomArr.push(cb);
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- // for (const page of pageData.items) {
|
|
|
- // for (let i = 0; i < pageData.items.length - 1; i++) {
|
|
|
for (let i = 0; i < pageData.items.length; i++) {
|
|
|
const page = pageData.items[i];
|
|
|
const maxBottomArr = [];
|
|
|
- _insertMaxBottom(page[JV.PROP_CELLS], maxBottomArr);
|
|
|
- _insertMaxBottom(page[JV.PROP_INTERACT_CELLS], maxBottomArr);
|
|
|
- _insertMaxBottom(page[JV.PROP_SIGNATURE_CELLS], maxBottomArr, true);
|
|
|
- _insertMaxBottom(page[JV.PROP_SIGNATURE_DATE_CELLS], maxBottomArr);
|
|
|
- _insertMaxBottom(page[JV.PROP_SIGNATURE_AUDIT_CELLS], maxBottomArr);
|
|
|
- _insertMaxBottom(page[JV.PROP_WATERMARK_CELLS], maxBottomArr, true);
|
|
|
- pgBrkIdx += maxBottomArr.length;
|
|
|
+ preAnalyzePos(pageData, page, [], maxBottomArr, []); // 这里统一分析坐标方法,要错的话,大家都错
|
|
|
+ pgBrkIdx += maxBottomArr.length - 2; // preAnalyzePos方法会多一个0
|
|
|
pgBrk.push(pgBrkIdx);
|
|
|
}
|
|
|
pageData.pageBreaks.push(pgBrk);
|