just before pdf download