<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic convert downloaded pdf file to human readable string in Dropbox API Support &amp; Feedback</title>
    <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/convert-downloaded-pdf-file-to-human-readable-string/m-p/202236#M9598</link>
    <description>&lt;P&gt;Im downloading a pdf file from dropbox that I've previously saved to dropbox, created progamatically using HTML Markup. (which is working fine). &amp;nbsp;But I then want to convert the pdf file to a human readable String so that I can gather specific info from that string. &amp;nbsp;heres what i've been trying but its not giving me a human readable string.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;/** Download pdf file from dropbox **/
        
        // Verify user is logged into Dropbox
        if let dropboxClient = DropboxClientsManager.authorizedClient {
            
            // Download File from Dropbox
            let filename = ((cell?.textLabel?.text)! + ".pdf").lowercased()
            print(filename)
            
            dropboxClient.files.download(path: "/\(filename)").response { response, error in
                
                if let response = response {
                    let responseMetadata = response.0
                    print("dropbox responseMetadata: \(responseMetadata)")
                    let fileContents = response.1 as NSData
                    print("dropbox fileContents: \(fileContents.description)")
                    
                    let encodedFile = String(data: fileContents as Data, encoding: String.Encoding.ascii)
                    
                    print("ACTUAL FILE: \(encodedFile?)")
                    
                } else if let error = error {
                    print("dropbox error: \(error)")
                }
            }
        }&lt;/PRE&gt;&lt;P&gt;I believe Im having trouble using the proper String.encoding, but i've tried most of them and nothing seems to work. &amp;nbsp;Any help is much appreciated. Thanks&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 29 May 2019 09:26:46 GMT</pubDate>
    <dc:creator>bbongrip</dc:creator>
    <dc:date>2019-05-29T09:26:46Z</dc:date>
    <item>
      <title>convert downloaded pdf file to human readable string</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/convert-downloaded-pdf-file-to-human-readable-string/m-p/202236#M9598</link>
      <description>&lt;P&gt;Im downloading a pdf file from dropbox that I've previously saved to dropbox, created progamatically using HTML Markup. (which is working fine). &amp;nbsp;But I then want to convert the pdf file to a human readable String so that I can gather specific info from that string. &amp;nbsp;heres what i've been trying but its not giving me a human readable string.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;/** Download pdf file from dropbox **/
        
        // Verify user is logged into Dropbox
        if let dropboxClient = DropboxClientsManager.authorizedClient {
            
            // Download File from Dropbox
            let filename = ((cell?.textLabel?.text)! + ".pdf").lowercased()
            print(filename)
            
            dropboxClient.files.download(path: "/\(filename)").response { response, error in
                
                if let response = response {
                    let responseMetadata = response.0
                    print("dropbox responseMetadata: \(responseMetadata)")
                    let fileContents = response.1 as NSData
                    print("dropbox fileContents: \(fileContents.description)")
                    
                    let encodedFile = String(data: fileContents as Data, encoding: String.Encoding.ascii)
                    
                    print("ACTUAL FILE: \(encodedFile?)")
                    
                } else if let error = error {
                    print("dropbox error: \(error)")
                }
            }
        }&lt;/PRE&gt;&lt;P&gt;I believe Im having trouble using the proper String.encoding, but i've tried most of them and nothing seems to work. &amp;nbsp;Any help is much appreciated. Thanks&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 29 May 2019 09:26:46 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/convert-downloaded-pdf-file-to-human-readable-string/m-p/202236#M9598</guid>
      <dc:creator>bbongrip</dc:creator>
      <dc:date>2019-05-29T09:26:46Z</dc:date>
    </item>
    <item>
      <title>Re: convert downloaded pdf file to human readable string</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/convert-downloaded-pdf-file-to-human-readable-string/m-p/202552#M9622</link>
      <description>It sounds like the Dropbox portion of this is working properly, so I'm afraid I can't offer much insight.&lt;BR /&gt;&lt;BR /&gt;That is, the PDF data is getting downloaded, and how your app handles that data is up to you. PDF data isn't necessarily human-readable though, so this may not just be a matter of encoding string properly. I recommend reading about the PDF format to see how you can extract the information you're looking for.</description>
      <pubDate>Tue, 17 Jan 2017 19:09:23 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/convert-downloaded-pdf-file-to-human-readable-string/m-p/202552#M9622</guid>
      <dc:creator>Greg-DB</dc:creator>
      <dc:date>2017-01-17T19:09:23Z</dc:date>
    </item>
    <item>
      <title>Re: convert downloaded pdf file to human readable string</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/convert-downloaded-pdf-file-to-human-readable-string/m-p/202799#M9658</link>
      <description>ok. Thanks again Greg</description>
      <pubDate>Thu, 19 Jan 2017 02:12:14 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/convert-downloaded-pdf-file-to-human-readable-string/m-p/202799#M9658</guid>
      <dc:creator>bbongrip</dc:creator>
      <dc:date>2017-01-19T02:12:14Z</dc:date>
    </item>
  </channel>
</rss>

