TPPDF
TPPDF copied to clipboard
There will be a blank page at the top when generating a PDF with an image
ℹ Please fill out this template when filing an issue. All lines beginning with an ℹ symbol instruct you with what info we expect. You can delete those lines once you've filled in the info.
What did you do?
Hello.
When I generate a PDF with an image, a blank page appears at the top of the PDF
What did you expect to happen?
remove top blank page
TPPDF Environment
**TPPDF version:2.4.0 **Xcode version:14.2 **Swift version:5.0
Demo Code / Project
func generateDocument() -> [PDFDocument] { let document = PDFDocument(format: .a4) let tallImage = PDFImage(image: Image(named: "PortraitImage.jpg")!) document.add(.none, image: tallImage) let tallImage2 = PDFImage(image: Image(named: "Image-2.jpg")!) document.add(.none, image: tallImage2) return [document] }
Hi, thanks for opening up this issue. I believe this is related to the image being to tall to fit the current page. Did you try to tweak the fitting settings of the PDFImage
?
Hi, thanks for opening up this issue. I believe this is related to the image being to tall to fit the current page. Did you try to tweak the fitting settings of the
PDFImage
?
Thank you for your reply. Yes. I tried to modify the property settings of PDFImage, but it didn't work。 Do you have any good suggestions?
I have some problem
I have some problem
You can try setting the size of the image in PDFImage