Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using PDFs as vector-like images in iOS apps, keeping transparency?

I've 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 quality scalability and I guess save on file size.

However, compressing into a PDF as opposed to PNG seems to kill transparency, meaning you get a white background by default.

This seems like an interesting technique, but it would be far more useful if we the PDFs could somehow retain transparent parts like PNGs do. Does anyone have any ideas or techniques on how this effect could further be achieved? Thanks

like image 994
user339946 Avatar asked Feb 24 '12 02:02

user339946


People also ask

Why do we use transparency in PDF?

Transparency in PDF files. This effect can be used for a number of reasons: It makes underlying image objects shine through, so it is useful for emulating glass, fog, varnish but also shadow. Adding a drop shadow to text or images is one of the most popular uses of transparency.

How to detect transparency in InDesign files?

Other preflight engines like PitStop Professional can also be used to detect transparency. To designers, it is not always obvious when their files contain transparency. InDesign has a very nice mechanism for this. Pages that contain transparent objects have a checkerboard pattern in the pages list.

What was the first version of PDF that supported transparency?

PDF 1.4 (the file format supported by Acrobat 5) was the first version of PDF that supported transparency. This PDF release came to market around the same time that Adobe Illustrator 9 was launched. Transparency was ‘the’ big new feature in that release.

How do you use transparency in Photoshop?

Adding a drop shadow to text or images is one of the most popular uses of transparency. It can be used to show parts of objects that are normally hidden from view. Transparency can be used to lighten (parts of) images so that the text on top remains readable.


1 Answers

PDF's rendered by iOS maintain transparency. Including the code you refer to will retain transparency.

If you are seeing white, make sure:

  • Your PDF is saved with transparency.
  • In that library you haven't set the backgroundColor (the default is [UIColor clearColor])
like image 107
peterept Avatar answered Oct 04 '22 23:10

peterept