Reading pdf file in ipad application - iphone

In my Ipad application i need to read .pdf files. these pdf files are stored in my server. the size of the pdf files are nearly 20Mb. Normaly in ipad we can view the pdf using UIwebview, but it's not useful in this case. the reason is normaly in iPad the pdf files are downloaded and showed in UIWebview.. but in my case the size maters..so i need another solution to read pdf files.

my suggestion is take the pdf in a spitted fashion.means suppose ur pdf contains 1000 pages download first page and load on the webView and start download for the remaining pages in the background something like nsoperationquee .so you need to modify in the server side also if you like my suggestion.

You have pdf url that in server right? get the pdf files from the server and store it locally like DB. After that you can display the PDF files from the DB. This is the one time process.Then it not take much time for download.
Or you get the pdf images and display in the uiimageview its simple and easy. But one drawback is you can read the text but not do any action on that i.e., copy the text like that
Thanking you

Related

Providing EXIF-free images in a gallery or other webpage

First, thanks for any and all help regarding this topic.
Sites like Facebook and Twitter strip EXIF information from images as they are uploading. My goal is to allow users to upload images to our platform (working with Nextcloud and others) with full EXIF information, however, we need to display images that do not contain EXIF information or any metadata. Without stripping and creating a second, Exif-Free image for each, is it possible to simply hide that EXIF info so that, if a user downloads that image, the EXIF is not embedded?
We were told that the only way to do this is to have a second, exif-free copy (the order of when that's created is irrelevant pre/during/post upload). I'm hoping there's a way that we can simply display such a copy without doubling our physical space requirements.
Thanks again for your help.
Exif is metadata, along with IPTC, XMP, AFCP, ICC, FPXR, MPF, JPS and a comment, just for the JFIF/JPEG file format alone. Other picture file formats support even more/other metadata.
You wrote it yourself: a download - so it's a file in any case. Pictures are files, just like executables, movies, texts, music and archives are files, too. And metadata is part of its content, so whoever accesses the raw bytes of the file can grab everything in it. Which is not "please don't look" proof. If you
create that on the fly by stripping metadata everytime a download is requested,
or if you do it once to preserve performance and instead occupy space remains your decision.
If there would be something as simple as a "don't show" feature then it would still be in the file and could be extracted easily by software written to ignore that instruction. Seriously, there's no shortcut to that - do it properly and don't spare yourself from getting work done at the wrong end.

Failed to display UIWebView to display docx/xlsx file with SFUZipEndOfCentralDirectoryError error with custom URL

We are writing some program to display documents on iOS. I think that there are a lot of confusion on the web about what type of documents which iOS UIWebView could display. Generally people refer to Technical Q&A QA1630 Using UIWebView to display select document types to see that all the MS office 07+ files (such as docx, xlsx, pptx) could not be displayed, however actually that is not what we see from testing. Actually we are able to display docx/xlsx/pptx document at UIWebView either loading from a remote URL, local file or in memory (loadData, here the baseURL can not be nil on simulator, see this link). Of course We are testing on latest version of iOS on iPhone simulator, it might be that the support was not at older iOS. At this point, We don't know that yet. If you know, please let me know.
However right now, We have one issue to display document at UIWebView by using custom URL for security reason. I did the custom URL by following the code here: protecting iOS resource. We could display xls, doc, ppt, pdf file, but not docx/xlsx/pptx, We got some error like this:
EXCEPTION SFUZipEndOfCentralDirectoryError: Could not find the end of central directory record
We tried to debug and could not figure what's to do here. Do you see similar error here? Could anyone shed some lights on this? Thanks very much.
It looks like the document you're trying to open might be corrupt. docx, xlsx, and pptx files are actually zip files containing a bunch of XML documents and other data. Check if you are able to uncompress the file on your computer by renaming it to .zip and then unzipping.

Caching UIWebview from local loaded files

I have a uiwebview which loads documents from local file system. Some of the images on these HTML files are 2 mb. I wanted to cache those images or the whole HTML.
What is the best way to accomplish or is this even something I should consider?
Thanks for all your help.
It sounds like your best option would be to cache the large images and put them in the bundle at compile time. You could then change the URL's to those large images in your HTML to file URL's pointing to the files in the bundle.

Download and View PDFs in iPhone

I'm planning to develop an iPhone app in which will do the following:
download PDF file from my
website.
open PDF file which is password
protected
access this PDF file offline from
the iPhone
I really want to know how to achieve the above, what classes to use and what tips should I consider?
Thanks
When downloading large files on mobile devices it's a good idea to save the data as it comes in. I suggest you use a good network library that performs all this work for you: ASIHTTPRequest and AFNetworking are both very good and actively maintained.
Since your pdf files are password protected you'll need to write a custom pdf viewer. For non-password protected pdf files you could have used the QuickLook framework to display pdf files.
You can unlock pdf files by using the CGPDFDocumentUnlockWithPassword function which takes 2 arguments: a CGPDFDocumentRef reference to the pdf document and a const char* password. Opening the pdf file first with the CGPDFDocumentCreateWithURL function will give you a CGPDFDocumentRef reference.
Now that you've opened the pdf file you'll need to draw each page individually to a UIView. This is the hardest part and takes a lot of work to get it done right. This question on SO has helped me a lot while working on my customizable framework for rendering PDF files.
I've written a pretty good Kiosk-Example that does the download, displaying the progress bar, saving the pdf in documents directory, displaying, opening - everything you want.
Password support is included, and looks like that:
const char *key = [passwordString UTF8String];
BOOL success = CGPDFDocumentUnlockWithPassword(pdf, key);

creating a full html file out of webloc in a batch mode

I've got over 400 bookmarks saved as .webloc files. I'd like to move them to the iPhone's goodReader app. goodReader cannot open webloc files. It can sork with pdf, html but not webloc.
Do you know of a way or a program that would take a folder as its input, and convert every single .webloc file in it into a PDF version or a html version - so I can grab the converted files and move them onto iPhone.
Thank you
Try this, it should be able to convert the files to pdf http://files.macscripter.net/joy/files/webloc2pdf.zip