为什么“显示:行内块;位置:相对”;从IE11打印时,跨度会创建额外的分页符吗?

时间:2018-10-29 18:33:50

标签: html printing internet-explorer-11

我正在开发一个大型Web应用程序,该应用程序创建html页面供用户打印。这些“打印形式”通常由字段标签和字段数据对组成。一位用户在fielddata字段中包含一个很长的字符串,该字符串持续了超过1页并包含html代码(出于某种原因,我允许html注入,这不是关于安全性的问题,请纵容我)。出于某种原因,当我尝试使用IE11打印打印表单时,使用此超长字段会导致意外的分页符。从Chrome进行打印时,所有内容均不会分页打印。

我重现了以下代码段中发现的错误。

<!DOCTYPE html>

<html>
	<head runat="server">
	  <title>Minimum styles</title>
	  <style>
		.fieldlabel {
			font-family: Segoe UI, Arial;
			font-size: 8pt;
			font-style: normal;
			font-weight: bold;
			text-align: left;
			vertical-align: top;
			color: #7f99cd;
			background-color: none;
		}
		
		.fielddata {
			font-family: Segoe UI, Arial;
			font-size: 10pt;
			font-style: normal;
			font-weight: normal;
			text-align: left;
			vertical-align: top;
			color: #000000;
			background-color: none;
		}
		
		span {
			word-break: break-word;
			display: inline-block;
			position: relative;
		}
	  </style>
	</head>
	<body>
		<form>
			<div class="report-panel">
				<span class="fieldlabel">Currency</span>
				<span class="fielddata">CAN</span>
				<span class="fieldlabel">Total</span>
				<span class="fielddata">1337.42</span>
				<div class="line">line</div>
				<span class="fieldlabel">ChargeBack</span>
				<span class="fielddata">M.G. -999 / CAN-B 12345 / USMC / WOW / ELVISH</span>
				<span class="fieldlabel">Terms</span>
				<span class="fielddata">
					<p style="position: relative; page-break-before:always">PageBreak</p>
					<p style="font-family:Times New Roman">
						<B><Center><h3>PURCHASE ORDER AGREEMENT TERMS AND CONDITIONS</h3></center></B>
						<ol type="1">
							<li>Items, materials, goods, and/or services provided on this Purchase Order (“Goods”) are to be in full compliance with these Terms and Conditions, with any attached specifications, exhibits and addenda, and with standards prescribed by law.  Supplier agrees to the Terms and Conditions contained in this Purchase Order by accepting this Purchase Order, by acknowledging its receipt, or by shipping or providing Goods.  This Purchase Order supercedes any prior negotiations, representations or agreements, either written or oral, except for an existing master or blanket contract which shall always control in the event of conflict or inconsistency with this Purchase Order.  Purchaser’s signature on an invoice or other form of documentation accompanying delivery of Goods shall constitute acknowledgement of receipt only, and will not constitute Purchaser’s agreement to any terms therein.</li>
							<li>Payment terms are net due in 45 days after the date Purchaser receives a complete and accurate invoice.  Payment terms are extended to 90 days for invoices received more than 60 days after final delivery of the Goods, and invoices received more than 120 days after such delivery will not be accepted or paid.</li>
							<li>For Purchase Orders of $250,000 or less, Supplier may issue invoices as follows:
							•	90% upon notifying Purchaser of readiness to ship.
							•	10% upon Purchaser’s receipt of final Supplier documentation.</li>
							<li>For Purchase Orders greater than $250,000, Supplier may issue invoices as follows:
							•	15% upon Purchaser’s receipt of drawings for approval.
							•	25% upon Supplier’s receipt of major materials.
							•	50% upon notifying Purchaser of readiness to ship.
							•	10% upon Purchaser’s receipt of final Supplier documentation.</li>
							<li>Purchaser shall have the right at any time to reject, or revoke acceptance of Goods that do not conform to the requirements of this Purchase Order.  In the event Purchaser has already paid for any Goods rejected, Supplier agrees to promptly refund the purchase price of such rejected Goods.  Payment of an invoice does not constitute inspection or acceptance of Goods purchased.</li>
							<li>Supplier shall pay promptly any and all amounts owing by Supplier so that no lien shall ever attach, or be permitted to attach, to Purchaser's property, whether real or personal, and Supplier shall defend and indemnify Purchaser from any such liens.  Supplier shall not file any lien against Purchaser's property under any circumstances.  In the event any liens are filed against Purchaser or any of its property, Purchaser shall have the right of set-off against any amounts then due to Supplier or which may subsequently become due to Supplier.</li>
							<li>All taxes, except for applicable state and/or local sales and/or use taxes, shall be Supplier’s responsibility and shall be included in the price of the Goods.  Any applicable state and/or local sales and/or use taxes due on the Goods are the duty of Supplier to collect and shall be separately stated on all invoices as such.  However, Supplier shall not collect any sales and/or use taxes on Goods for which Purchaser provides Supplier with a properly completed Exemption Certificate.</li>
							<li>Supplier specifically warrants Goods to be free of defects.  When Purchaser provides specifications for a particular purpose, Supplier warrants fitness for that particular purpose.</li>
							<li>Supplier shall hold in strict confidence all technical and business information made available to Supplier by Purchaser or developed or acquired by Supplier in performance of this Purchase Order.</li>
							<li>Supplier agrees to defend and indemnify Purchaser from any claims or suits instituted against Purchaser by any person or entity asserting that Goods infringe any patent, trademark, or copyright.</li>
							<li><B>IF ANY CLAIMS OR SUITS ARE ASSERTED AGAINST PURCHASER, ITS CO-LESSEES, PARTNERS, JOINT VENTURERS, JOINT INTEREST OWNERS, OTHER CONTRACTORS AND SUBCONTRACTORS, OR ITS OR THEIR RESPECTIVE PARENTS, AFFILIATES, SUBSIDIARIES, OFFICERS, DIRECTORS, MANAGERS, MEMBERS, AND EMPLOYEES (ALL OF WHICH ARE HEREIN COLLECTIVELY REFERRED TO AS THE “INDEMNIFIED PURCHASER PARTIES”) FOR ILLNESS OF, INJURY TO AND/OR DEATH OF ANY EMPLOYEES OF SUPPLIER, OR FOR DAMAGE TO OR LOSS OF PROPERTY OF SUPPLIER, SUPPLIER WILL RELEASE, DEFEND AND INDEMNIFY THE INDEMNIFIED PURCHASER PARTIES, EVEN IF SAID CLAIMS OR SUITS ARISE, IN WHOLE OR IN PART, FROM NEGLIGENCE OR STRICT LIABILITY ATTRIBUTABLE TO THE INDEMNIFIED PURCHASER PARTIES.  SUPPLIER’S ABOVE ASSUMED RELEASE, DEFENSE AND INDEMNITY OBLIGATIONS SHALL NOT INCLUDE PURCHASER’S DEFENSE AND INDEMNITY OBLIGATIONS TO OTHERS.  HOWEVER, IN THE EVENT THAT BOTH PURCHASER AND SUPPLIER OWE DEFENSE AND INDEMNITY OBLIGATIONS TO THE SAME ENTITY OR PERSON, SUPPLIER WILL SATISFY SUPPLIER’S OBLIGATIONS TO SAID ENTITY OR PERSON WITHOUT SEEKING RECOUPMENT, SHARING, OR OTHER RECOVERY AGAINST PURCHASER OR PURCHASER’S INSURERS.</li></B>
							<li>Supplier shall maintain insurance in amounts and scope necessary to respond to Supplier’s obligations assumed in this Purchase Order.</li>
							<li>If Supplier fails to meet the Delivery Date specified on the Purchase Order (or any subsequent modification of the Delivery Date), Supplier shall pay to Purchaser per day of delay the following amounts as liquidated damages for delay:
							•	no charge for a seven day grace period, but thereafter 2% of the Purchase Order amount for each seven day period.
							•	Subject to a maximum of 10% of the Purchase Order amount.

							The liquidated damages are not a penalty but instead represent a reasonable pre-estimate of Purchaser’s actual damages, which are difficult or impossible to calculate.  Purchaser, without prejudice to other means of recovery of the liquidated damages, shall be entitled to deduct the amount thereof from any sums due or which may become due to Supplier.  The payment of such liquidated damages shall be Supplier’s sole obligation and Purchaser’s sole remedy in respect of delays in meeting the Delivery Date.</li>
						</p></ol>
				</span>
			</div>
		</form>
	</body>
</html>

具体地说,在“条款”和“分页符”之间有一个空白页,不应在该页上。 “分页符” 应该开始一个新页面。如果我添加更多样式(所有跨度上的宽度,边距,最小高度以及.line),我都会在.line之后,拒付数据之后,条款之后添加分页符,但没有空白页。

我发现,如果我从条款列表中删除“ display:in-line block”样式,大多数问题都会消失,但是由于printform是根据用户输入的数据以程序方式生成的,因此这不是实际的解决方案。我还发现,仅当术语列表达到强制切入另一页面的大小时才开始出现问题,并且问题随着大小的增加而增加。

0 个答案:

没有答案