View 3D PDF on iOS using objective-c - ios

I have at hand a 3D PDF export using AUTOCAD, has some way to view this file in iOS?
Note that do not want to simply display a common PDF, I want to display a 3D object that is in it.
Any solution with other file formats like 3drw is already of great help.
Edit:
Note: I do not mean the applications that are in the apple store, what
I need is a way to implement the code as necessary to integrate it
into the app I'm working on.

3D PDF viewing on iOS is definitely possible. But it works a bit differently than it does on a PC. When you view a 3D PDF on a PC, Adobe Reader displays both the 2D and 3D portions of the PDF file. On iOS, the 3D portion is viewed using a separate app. CHeck out the free 3D PDF Reader from Tech Soft 3D for this:
https://itunes.apple.com/us/app/3d-pdf-reader

Related

How can I cleanly draw on a PDF both statically and dynamically on iOS?

I am currently working on an app where we would like to download a PDF from a remote server and then draw on it. We would like to draw Google Maps pin-like annotations on the PDF (the static draw part). Furthermore, we would like to detect if a user has touched a pin and then draw a calloutBox over this PDF (dynamic draw part). We obviously would like the pdf to be scrollable/zoomable. Does anyone know of a good way to achieve this?
Things I have researched:
1) Render in a UIWebView. This seems like a great solution but its not clear to me how to then implement the draw code on the PDF. I have heard people say create a transparent UIView above the UIWebView for the drawing. This seems to come with its issues, how will it handle zooming and scrolling?
2) Use Quartz 2D and generate my own PDF from the PDF I fetch from the server. As I draw my own PDF content I can draw the static marker pins. Once I have this PDF, I can then shove it in a WebView. The problem with this approach however is I still need to handle the dynamic drawing of the call-out boxes when a user taps on the pin and this then kinda takes me back to problem 1.
You're correct that Apple does not offer much in terms of this issue. There's UIWebView which can preview and show PDF documents, but it's really not suited to adding annotations, and any "solution" with views will be very fragile, if you manage to do it at all. It's meant as a black box to read PDF documents, not for annotating.
You have to go all the way back to CGContextRef and take over the scrolling, zooming and touch handling/drawing yourself. Apple's ZoomingPDFViewer example is a good start.
I have been working on this problem since 2010 and we offer a commercial solution for PDF annotating for iOS, Android and Web called PSPDFKit. We ship a custom renderer which is better and more exact than Apple's CoreGraphics renderer, but the more interesting part is that we can deal with all common PDF annotation types. You can use note annotations to represent your pins and move them around, add notes, interact/override the default tap handling (and e.g. show your own popover when people tap on them). They are also always the same size - so they can be anchored at an exact point in the PDF and then you can zoom in while they stay the same size. The best part is that this is all part of the PDF spec, so they will also work with Apple's Preview app or Adobe Acrobat, so people can save/customize the markup and then everything can be saved in the PDF. The architecture is flexible so you can also simply save everything in a database or sync it back up to your server and simply use it for touch handling.
You can also build that yourself - the basic architecture is a UIScrollView and views that are managed. It quickly gets tricky when you do zooming and have views that need to stay the same size + touch handling and maybe you also want things like multi-select or regular ink drawing. You will also want to add some sort of image caching layer, since rendering PDF documents can be quite slow on mobile devices. Oh, and if you want to make text selectable or implement search, be ready for a rabbit hole that is called the Adobe CMap and CIDFont
Files Specification.

Convert Image To Map Tiles In-App

I want to be able to convert a given image uploaded in the app and convert it to map tiles to be overplayed in a MapView. This could be a photo downloaded from the web or simply a photo taken from the device's camera.
I have so far come across GDAL2Tiles and MapTiler but I want to be able to do this in the app instead of preparing them beforehand. These are command line and desktop applications that will do the conversion, but this is all that I can find so far.
Is there a built-in feature for iOS that allows me to do this? If not, is there a third-party library that does, or is it just not possible?

Good 3D , OpenGL engine to work with .dae (Collada) objects in iOS

I've been using NinevehGL 3D engine in my present project, but it no longer support iOS 6, iOS 7 (I cant take screenshot,in iOS 7 device it simply disappear ).
The project specifically is:-
"It is 3D sofa builder. I have .dae files of each part of sofa. 3D engine just selects particular part of sofa (.dae) objects and attach it with sofa. User could change colors or shades of sofa as well also use can rotate it into 3D space "
So i have done bit of research and found Unity 3D engine. I learned that it is compatible with .dae objects but its expensive also it is for creating complex games rather then simple 3D interface which required in my project (description given above).
I checked Cocoa 3D also, not sure it support .dae files?
if somebody has experience using other engines or these above ones and suggest me, it would be much appreciated.

Three.JS model viewer feasible in phonegap?

I'm trying to make a very simple 3D model viewer in a phonegap app for use on an iPhone 4. I'm using three.js which is working fine when I make a simple website. The problem is that when I try it out on the phone the 3D object doesn't appear. Simple geometrical shapes like a cube and cylinder will load on the canvas but obj files won't.
I use an objLoader to bring in the .obj file and have all relevant files in the same directory in the app just in case. I think the problem might lie with using webGL on iOS but I'm not really sure.
Thanks very much for your help. If anyone has any suggestions for building a model viewer in phonegap for display in iOS I'd be delighted to hear them.
As very few mobile browsers support WebGL at the moment I opted to use the canvas to render the 3D models. I used a simple web 3D object viewer called JSC3D to create a model viewer in PhoneGap on iOS. It can use webGL but I just went with rendering using the 2D canvas.
I tested my app on an iPhone 4 and the result was that the model took between 2 and 5 seconds to load up and when you go to rotate the object it takes some time to redraw it depending on how complex it is. While not the most satisfactory result it did do the job. I'm going to try it out on a more advanced phone in Android and I'll let you know the result.
I suggest you try use XDK Intel if you are packaging for iphone but for android use AIDE Phonegap. Make sure you use only var renderer = new THREE.CanvasRenderer();and avoid using
Anything that has to do with WebGL for its not supported on most devices except BB Playbook and BB 10.
I think IOS render ability is better than Android, some scene renders well in IOS, but not in the Android.
Usually the movile have more render ability, than tha mobile app. I use the firefox to render the three.js obj demo, it works well. But when I use the webview in the app, it renders nothing.
I've make an Android app to render stl models. First when I use the mobile browser to render the scene, it not render the full scene, and when I remove the shadow effect, it renders. Then I try to use webview with WebGlRenderer or CanvasRenderer, no works. Last I refer to the XWalkView of crosswalk a web engine which can used as an addin of the app, to replace the webview, I also close the shadow effect, I renders well.
You can refer this answer for more info.
Here is the render result.
You definitely should not use WebGL renderer of three.js as it's not supported on iOS. Try Canvas or SVG renderer.

Apple iPad and PDF support

I have few questions related to the PDF and its use on the Apple iPad:
1) Does the iPad support all Quartz PDF functions (i.e. all CGPDFxxx functions/classes)?
2) Does the iPad support the PDF Kit?
3) Is it possible with any of one of both APIs, based on the coordinates of the finger touch to detect the underlying PDF item (e.g. article, text, annotations) ?
4) What is the difference between the Quartz PDF functions and PDF Kit?
Thanks a lot
Regards,
STeN
1) Yes, at least, I haven't come across any unsupported functions.
2) No.
3) Not natively but you may be able to inspect the PDF (in the docs somewhere) and determine position/size/type of various elements and create an overlay or use hitTest.
4) PDF Kit includes an PDF specific UIView subclass (usable in IB) and tons of methods for easily interacting with the content of the PDF including images, text selection, annotation, etc. Essentially it's just a bunch of features built on top of Quartz for your convenience.

Resources