Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

When should a print template check the print job type?

Job print Template type
0
Posted

When should a print template check the print job type?

0

The timing of this call is important when a print template generates its LAYOUTRECT and DEVICERECT elements dynamically, as most should do. You might think CheckPrint could be the onload event handler, or could be called from the onload event handler. However, it’s not quite that simple. When a print template loads, there are two threads involved. One is the thread loading the print template and creating the DEVICERECT and LAYOUTRECT elements. The other is the thread loading the source document into the LAYOUTRECT elements. In general, the thread loading the template will finish after the thread loading the source document, but both threads must finish before the template can print properly. During print preview or when printing with a prompt, this is usually not a problem; enough delay is built into each of these processes that the template will preview or print correctly. The issue crops up when printing without a prompt, when each thread is racing to completion. In the example prese

Related Questions

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.

Experts123