简体   繁体   中英

iOS iPhone how to convert a UIImage into a PDF while preserving scale?

I got a 640x960 UIImage of the screen, which is nice and crisp when re-displayed on the retina display. I'm thinking of a way to convert this image into a nice crisp PDF document page.

How would I go about converting a UIImage into a PDF page?

Do I need to make the resulting PDF to be 640x960, or does PDF automatically scale content (ex: 320x480 with the scale factor of 2)?

Thank you!

You will have to scale it by yourself. This link would help you in converting view to PDF.

UIGraphicsBeginImageContext(CGSize size); - not retina UIGraphicsBeginImageContextWithOptions(CGSize size, BOOL opaque, CGFloat scale) - retina

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM