One problem in the project is to export the contents of the web page to pdf. However, if the page has a scroll bar and slides up and down, the exported pdf is only a part, which affects the use. I found many methods, and finally solved the method perfectly, so that when the user calls the export button, the page height returns to the top of the page: write printing method.
window . pageyoffset = 0;
document . document element . scroll top = 0;
document . body . scroll top = 0;