简体   繁体   中英

Excessive number of pages when printing a webpage

So I am trying to print a webpage with javascript:window.print(); . Rest of the website works perfectly fine. There is this one page where the data is coming from 3rd party sources which might be the culprit but I am not sure at this moment. But when I try to print this page the print window shows 'Loading preview...' and total number of pages are astonishing 31000+. When it should hardly be a 3 page print.

在此处输入图像描述

When I turn OFF my VPN (which allow me to access those 3rd party sources and fetch and render the data on the page) the access is revoked from the 3rd party sources, making the print work fine with only 1 page.

在此处输入图像描述

I tried searching on the inte.net for this issue but no luck.

The application is built in Drupal 9 having twig as template engine. So I simply fixed html indentation and found out it was an extra </div> tag which was causing this issue. So guys always indent your code and be careful with writing lots of html in a single template. :)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM