I have code that loads a pdf file into the PDFView that Apple provides in Swift. It works great, but the problem comes when trying to view pdf files where the URL is not formatted correctly.
For example, if I provide a URL for the PDFView that looks like http://www.example.com/files/myfile.pdf
the PDFView works just fine. However, when I provide it with a URL that looks like http://www.example.com/files/articles/article-432/pdf
it no longer functions. Both URLs (in the code) point to perfectly valid pdf documents, but only the former actually loads into the PDFView.
EDIT So after setting the environment variable CG_PDF_VERBOSE
in Xcode, the console returned failed to find PDF header: '%PDF' not found.
Not really sure what this means, though I suspect it probably means that there is some sort of redirect to the actual file, so I can't get the file directly.
Sorry that I can't share the actual URLs, but its just because they are company specific and I'm not allowed to distribute them.
Thanks in advance for any help!