before valid pdf-generation