views:

75

answers:

1

i want to open the pdf file in my app from the pdf file, this my info.plist file.

     <key>UIFileSharingEnabled</key>
      <true/>
   <key>CFBundleDocumentTypes</key>
   <array>
   <dict>
      <key>CFBundleTypeName</key>
      <string>pdf</string>
      <key>CFBundleTypeExtensions</key>
        <array>
            <string>pdf</string>

        </array>        
    <key>CFBundleTypeOSTypes</key>
    <array>
    <string>TEXT</string>
     </array>               
     <key>CFBundleTypeRole</key>
    <string>Editor</string>     
    <key>CFBundleTypeIconFiles</key>
    <string>Icon.png</string>
    <key>LSIsAppleDefaultForType</key>
    <true/>     
    <key>LSItemContentTypes</key>
    <string>com.adobe.pdf</string>

    <key>LSHandlerRank</key>
    <string>Alternate</string>
</dict>
</array>

i dont know where i am wrong or what is the addition steps for doing it. i need some help.

A: 

Hi Uttam,

I put the following text in info.plist. file and it works.

<key>CFBundleDocumentTypes</key>
<array>
    <dict>
        <key>CFBundleTypeIconFile</key>
        <string>Icon.png</string>
        <key>CFBundleTypeIconFiles</key>
        <string>Icon.png</string>
        <key>CFBundleTypeName</key>
        <string>pdf</string>
        <key>CFBundleTypeRole</key>
        <string>Editor</string>
        <key>LSHandlerRank</key>
        <string>Alternate</string>
        <key>LSIsAppleDefaultForType</key>
        <true/>
        <key>LSItemContentTypes</key>
        <array>
            <string>com.adobe.pdf</string>
        </array>
        <key>NSDocumentClass</key>
        <string>Document</string>
    </dict>
</array>

Btw, you can go to the "properties" tab in your target settings to add document types directly. So, there is no need to modify the info.plist manually.

hope it helps.

sunil137