Basic PDF handling in iOS - ios

How would I implement basic PDF handling like page addition, removal, rotation, and moving (move page 1 to page 3...) in an iOS application? I've found some third party libraries online but their focus seems to either raw creation or just viewing features (searching, annotations).

Related

Xcode PDFKit form automatic calculation

This may not be possible, but after searching for quite a while I thought I would ask the question to either point me in the right direction or confirm it's not possible!
I have iOS app (Xcode swift) that displays pdf documents using PDFKit
I have several PDF forms created in acrobat that have simply calculations which update automatically as numbers are entered or checkboxes ticked i.e. adding numbers together, totalling the number of checkboxes ticked.
Whilst each form has only simply calculations, each has a different number of input fields.
Is it possible in PDFKit (or another method) to display these PDF forms in an iOS app and have them perform the calculations without having to re-write in Xcode the calculation per form, i.e. basically make use of the embedded javascript that is part of the PDF form?
At present, when I display the form, while I can edit the the editable textfields, the calculation doesn't occur.
Appreciate any help
I've discussed this at WWDC 2017 when Apple introduced PDFKit for iOS.
Their answer is that JavaScript is not a feature that they are planning to support. This is consistent with the level of support in Apple Preview on macOS and also Safari on iOS/macOS - none.
3rd-party PDF SDKs often also include JavaScript implementations. The spec is quite complex, so it's unlikely that you find a product implementing all of the 894 pages (including things like the Japanese Emperor calendar).
PSPDFKit supports the common JavaScript API necessary for most forms to validate correctly. An easy way to check if your forms are supported is trying it in PDF Viewer (free, ad-free app for iOS and Android)

MVC Web App via TV Display

I was planning to create a MVC web app that displays graphs and charts that Is built from LIVE data. The app would display the charts in a carousel style. 4 pages total.
My question is:
1) Is there a framework or tool that does most of this for me? If so, I would just have to create the graphs and chart
2) What hardware/Software do I need to display this on a TV monitor that is remote? (i.e monitor on a shop flop of a production plant)
3) What are other options instead of a web app? (i.e create a console app that generates a .png and spit out to a file location on a shared drive. The TV would cycle through the images when pointed to the shared folder)
Something similar to this question
Data visualization / analytics / dashboard in ASP.NET (NOT Google analytics integration)
I have a similar revolving dashboard setup that consist of the following:
1. Standard TV
2. Standard networked PC with monitor cable going to TV
3. PC configured not to go to sleep/display screen saver
4. Browser open and in full screen mode, navigated to my internal MVC website
5. MVC site using bootstrap template with NAV removed.
6. MVC site utilizes highcharts for ease of generating my dashboard components.
7. Main display page (Home controller Index view) includes js that fires off Ajax calls to controller to fetch data from my DB and responds with json to reload/refresh my highcharts displays on Ajax get response every 5 minutes on a counter.
Maybe this can point you in the right direction. When researching when I was going to do it I also considered a wpf application that functions similar to a screen saver to load dynamically created images. What won me over with my current setup was ease of use of highcharts. It's an insanely easy, free, and produces high quality graphics. That combined with twitter-bootstrap for auto screen sizing made the project a breeze. I'm sure if you can get ahold of a smart TV to negate the need for a connected PC then it may be even easier if a physical setup for you.

PDF4NET pdf's not showing the bound content when viewed on iOS default pdf reader

I am using Version 4.4.1.0 of O2S.Components.PDF4NET
I am using this in an MVC project to run through a series of 6 views and fill an object with the data required for the PDF.
When the PDF is bound and emailed in the last step it works great. all except for when it is viewed by default PDF reader on iOS devices.
My company purchased this product on the cheaper plan so the 90 support is over and I cannot access any sort of forums from there site.
I read a similar issue regarding a button not being displayed on iOS but there was no resolution other then to email the company.
I hope that there is a viable solution as I would prefer not to have to cut my losses and change to a different product over something as short sighted as not supporting/testing against one of the more common platforms people use to consume media.
I'm not sure what you mean by 'bound content' but I assume you are talking about form fields.
Forms fields and annotations are not displayed by the CGPDF API in iOS, only the main page content is displayed. It is not a limitation of PDF4NET, it is a limitation of the iOS PDF display engine. The workaround is to flatten the form fields thus making them part of the page content.
If this is not your situation, please send a mail to support and they will help you.
Disclaimer: I work for the company that develops PDF4NET.

How to implement an interactive PDF in iOS

Here im hitting my head againt the wall.
My client provided a pdf with buttons(just like buttons,when user tap on button,it will load next page and previous page etc.).
This buttons will work only when we open it in adobe reader.
I tried the QLpreviewview,quickview but it is not working,all what i can do is just to load the pdf in the webview.
Can anyone please help me in how to load an interactive pdf in iOS.
Thanks in advance.
Have a look at PSPDFKit, it is the most advanced framework I've found for PDFs in iOS. They have an impressive list of customers as well.
It is a bit pricy though, but you have the option to get the Source Code too if you need to modify anything. Could be worth it if your client need that kind of performance and other features as well.
(I am not in any way affiliated with PSPDFKit)
The limitations are due to the capabilities (or non-capabilities) of the PDF viewer used.
Currently the leading PDF viewer on iDevices is PDFExpert by Readdle. Adobe Reader for iDevices is weaker, but can deal to some extent with form elements.
For page navigation etc. you might use links instead of button fields (as far as you can live with the capabilities of links, and not use JavaScript). Links are said to be handled properly with many PDF viewers.
You may have to require certain PDF viewers on instructional level, because you don't have control over the viewer used by the actual user. And, as you noticed, many PDF viewers are simply too dumb do deal with active elements.
Another approach would be looking at PDF-to-HTML5 converters, and serve HTML5 from a server.

Is it possible to load interactive elements into an iOS app?

Does anyone have any ideas how I could package an external interactive slide that could be dynamically loaded by an iOS app? Is it at all possible?
e.g. Imagine having a presentation app on an iPad. There is a set of interactive slides held on the web somewhere, let's say they contain draggable elements.
Can I load one of these slide objects into the app and interact with it? If so, what format would the slide object be?
Thanks,
Mark
Technically it's possible to dynamically load bundles (NSBundle) components in an app. These bundles could even contain executable code, though AppStore guidelines prohibit use of dynamically loaded NSBundles in this way for security reasons.
Additionally you could just use a UIWebView to display some 'slides' on a webpage, though it will be very hard to make the app behave as if it's the same as the native slides - perhaps even impossible (due to how rendering of webpages work compared to native controls, for example).
Ok so lets say you have these "external interactive slides" on a web server somehow. Since you are not saying they are of a certain type (like powerpoint or such) I will just assume that these slides are of some rare format that is probably not supported by any existing apps or the Safari browser.
Then the answer to your question would be: Write your own iOS-app that can read, present and edit these slides. What format are they? Well it doesn't matter. Write an app that can download the slide data from the data and parse it, and present it on the phone.
Then let the user interact with it, and perhaps make the app upload the changes to the server.
You can do anything you like in your app, there are no limits. You just have to write the code for it. If there was some kind of standardised format, lets say you wanted your app to show powerpoint presentations, then you would have 3 choices. Use someone elseĀ“s app, or write your own app with a parser for the powerpoint files or make your own app that use some code that someone else wrote to do it (a third part library that you include in your app)
In your specific case, I can not tell if there are any third part librarys to interact with your slides, but my guess is that you will need to do most of it on your own. You could start with looking at how the web services that interact with the slides online works, and if you can interact with them from an iOS-app that you make yourself.
There is nothing stopping you from creating an app, read the slide data into the app, present it in any way you like, let the user change it, save it in your app, or upload the changes to a server. It's all up to you =)
Good luck!

Resources