4

As far as I know, Apple has new approach to create images for 3x called PDF vector image.I have a PSD file (with multiple layers for many icons) and now I want to export all layers to pdf vector image to use asset catalog. I also refer this tutorial but i don't understand how to do for step 1. http://martiancraft.com/blog/2014/09/vector-images-xcode6/

How can i do that? Please give some solution to do that. Thanks in advance.

NTNT
  • 541
  • 1
  • 7
  • 18

1 Answers1

1

You can use vectorized PDF files in Xcode in the 1x slot.

When you compile your project, Xcode automatically will generate the PNG files for each required resolution (1x, 2x and 3x). (You final project won't have the PDF file)

To use that feature you need to have a vectorized image (SVG, EPS or AI) and print them to vectorized PDF. (PSD is not a vectorized format)

I usually use SVG files and I print to Vectorized PDF with this page http://www.fileformat.info/convert/image/svg2pdf.htm

If you have a PSD file, you can save your layers to PNG in the 3x resolution and put each PNG in the 3x slot. When you do that, XCode automatically will generate the 1x and 2x images resizing the 3x image.

Hope this helps

CrApHeR
  • 2,595
  • 4
  • 25
  • 40
  • Thanks for quick response. But i have a psd file with multiple layers so how to export all layers to svg? After exporting to .svg, use the link you recommend to print all layers to vectorized PDF? – NTNT May 17 '15 at 16:30
  • Yes, I usually use that site to generate the vectorized PDFs. Another solution is to export to PNG in the 3x resolution as I added to my answer. The result will be the same the only difference is how the PNGs for each resolution is generated. – CrApHeR May 17 '15 at 16:31
  • Thanks your suggestion. but i want to know how to use PDF vector image as Apple introduce. Can you please show me how to do that? Because i want to make 1 time for feature iOS device (ex: 4x or 5x ...) – NTNT May 17 '15 at 16:31
  • Sure. Let suppose you already have a SVG file (I usually use SVG files) you can use the site in my answer to generate the Vectorized PDF. Once you have the PDF file, you have to put it in the 1x slot in Xcode and that's all. When you compile your project, XCode will generate the PNG files for each resolution. – CrApHeR May 17 '15 at 16:34
  • I already generate PDF vector image in Xcode, now i build app to run on ipad but the image seems to not correct. I have a question:When building app, the XCode will generate 1x,2x and 3x .PNG and where they are put? I go to Image Asset folder and only see 2 files: Content.JSON and vector_image.pdf. – NTNT May 21 '15 at 06:31
  • You have to put the pdf file in the slot 1x in a new resource created in you images.xcassets. See this post for reference http://stackoverflow.com/questions/26020979/xcode-6-xcassets-for-universal-image-support – CrApHeR May 21 '15 at 11:42