I found the problem, the image I used as the background of the PDF was too large. By reducing it the PDF is created correctly