PDF name too long

Hello people.
I need to save a PDF, but the name is very long and is more than 256 characters, does anyone know how I can solve this?