PDF conversion: added argument validation

just to be safe