Using PDFs as vector images in iOS apps while maintaining transparency?

I recently came across a blog post about how you can use Photoshop PDF files as vector images: http://mattgemmell.com/2012/02/10/using-pdf-images-in-ios-apps/

Basically, you can achieve scalability in quality and, I think, keep the file size.

However, PDF compression, unlike PNG, seems to kill transparency, meaning you get a white background by default.

This sounds like an interesting technique, but it would be much more useful if the PDF files could somehow preserve the transparent parts, like PNG. Does anyone have any ideas or methods of how this effect can be achieved? Thanks

+4
source share
1 answer

The PDF provided by iOS supports transparency. Including the code you refer to will preserve transparency.

If you see white, make sure that:

  • Your PDF is saved with transparency.
  • You did not set backgroundColor in this library (the default is [UIColor clearColor])
+6
source

Source: https://habr.com/ru/post/1398158/


All Articles