added debugging for pdfs, fixed render issues