TPPDF
TPPDF copied to clipboard
How to add UIView?
Hello, I have a question that I would like to ask, please help to answer if it is convenient, thank you.
I want to add a UIView inside a PDF, this UIView has some UILabel on it. I saw that there is no method for adding UIView in the interface, so I converted UIView into UIImage and added it. But then the text of the UILabel on the UIView is very blurry. Please help to see how to solve it, thank you.
Hi there,
TPPDF does not support rendering an UIView into an PDF, as it does not rely on UIKit or AppKit anymore, but mostly on CoreGraphics instead, and also because it uses building blocks instead of UI elements.
Rendering the UIView into an image, and then adding the UIImage is the best way to do it. If your UILabel is blurry, you might need to set a larger scale on the UIView before rendering.
Please provide a small reproducible example, so we can see how you approach it.
Thanks, I've solved the problem.
Thanks, I've solved the problem.
can you tell me how you solved it?