Fixed pdf-generation error (Empty when opened with Adobe)