Uzair
Uzair

Reputation: 766

Calculate number of pages which will print using Javascript window.print

My Client requirement is to show to make a customized page print using window.print method of js. major Issues are

How I can check how many pages are creating of letter size page when content is populated dynamically?

If content is choping at the end of page it may automatically transfer content to next page. Now is it possible to check whether content will chop or not at the end of page when data in populated dynamically depending upon number of entries filled?

Upvotes: 8

Views: 3544

Answers (2)

c-smile
c-smile

Reputation: 27460

Browsers do not provide such data even they have that information available internally.

Just in case: in Sciter I've invented special type of frame - <frame type=pager src=...> in order to show print preview. That type of frame generates pagination events including number of pages.

frame type=pager

Upvotes: 0

Rodrigo5244
Rodrigo5244

Reputation: 5525

Unfortunately you can't calculate the number of pages that are going to be printed, but you can force content to a new page using page breaks.

Upvotes: 1

Related Questions