fixes for PDF creation