Use UIDocumentInteractionController in Delphi XE - ios

I have a Delphi XE5 app which downloads and stores PDFs locally on the device. I have a TWebBrowser on the form to view the PDFs and it works perfectly.
I now wish to share the PDF with other applications (eg Safari, Mail, etc) but am really struggling! I have looked at the TShowShareAction action (on the Action List control) but this caters for a Bitmap (photo) to be shared.
I have seen a lot of posts explaining that one should use UIDocumentInteractionController but I cannot find examples of how to use this from within Delphi. I have looked at Apple.Utils but to no avail.
Has anyone used the UIDocumentInteractionController functionality from within a Delphi application to share a file? Any example would be much appreciated!

I have solved this problem by installing D.P.F. Delphi iOS Native Components
I then added a DPFQLPreviewController to my form and open the PDF with the following code:
DPFQLPreviewController1.ShowDoc(filename, false);
This opens the PDF in the standard iOS previewer and this has a button enabling one to share the file with other installed apps that can read the file (eg a PDF app, email, send to printer, etc)
This is by far the simplest solution I have found and works perfectly on the simulator and an actual device.

Related

How to display a .pdf on BrowserField in Blackberry 7

I'm trying to display a .pdf file on a browserfield but somehow it's not opening in my app however it works fine with .txt files.
I'm reading .pdf file from local storage and using
browser_field.displayContent(fileinbytes, "application/pdf", "");
but it's displaying a player like image on the screen and not actual result.
If anyone has any idea about the same, i'm all ears.
As far as I can tell this isn't possible (browserfield doesn't even fully support javascript).
This post suggests that you can view it via Google, which wouldn't be from local storage.
(Un)luckily blackberry is very similar to Java ME, so you can often use those libraries as is. Apparently JPedal can render pdf files for J2ME, and might be worth a look.
Other than that, I don't think you'll have much hope. Good luck

Display offline html5 website

For my business I need to be able to show a potential client a website I generate with a program called Pano2VR, which is a virtual tour program. This program takes some panoramic photos linked with each other and can generate a virtual tour out of them (as example: www.casas-fotoart.de/virtualtours ). The output this App gives can be either HTML5, Flash or both (flash if available and html5 for mobile devices, for example).
I need to be able to show that on my iPad while offline. i haven't found any solution for that so I tried to build a easy App for that, which I thought it wouldn't be complicated.
I generated a html5-only virtual tour and I droped the output into the "Suporting Files" group on the Xcode project. I added a UIWebView and on viewDidLoad I set it so it loads the html file.
The files I'm droping are like these (these inside the ipad folder):
The html file loads into the webView, but it just displays "This content requires HTML5/CSS3, WebGL, or Adobe Flash Player Version 9 or higher.", even though when loading these files from the net, it loads perfectly. I know this message comes from the html file.
Any idea on how to make it work will be much appreciated. Thanks in advance.
Your problem is this probably - XCode is mangling the JS files, I assume because it's trying to compile them

How to export interactive PDF for iOs?

I have an interactive PDF, a catalog, where you have to click on a image to go to a specific page. All images are converted in buttons with the option "Go to destination". On Windows and Mac it works perfectly. But on iPad all the links, all the images, are not showing.
I've already read on many forums about this common problem between iOs and interactive PDF's. But I have some old PDF's, with the same principle, and those are working great on iPad. The images are showed, the links works...
That's why I'm wondering if it's not my fault or maybe I export the PDF in a wrong way.
The links to the PDF's.
m.hconline.eu/Baby%20Catalogue.pdf
m.hconline.eu/LA Catalog 2013.pdf
"Buttons" are not compatible with most pdf readers (except Acrobat reader and a few others). Such buttons are not recognized on the standard pdf reader on the iPad. I have checked the old file on the iPad, it does not work as well.
What you need to do is to use regular pdf links instead of buttons. In order to do so, you can use Acrobat Pro, delete your buttons, and create new links using the chain icon. You can specify the area of the link, so the user experience will be the same.
This is an old issue, but I did find more information regarding this. (I'd add a comment to the accepted answer, but alas, i do not have 50 points.)
According to George Johnson, "The problem with InDesign is in using the Go To Next/Previous Page options in InDesign[buttons], it creates an Execute a Menu Item action when exported to PDF, and since Reader for iOS doesn’t have menu items or interprets such actions otherwise, they are just ignored." - https://forums.adobe.com/thread/1142056?tstart=0
As for work arounds, I found a tutorial by Steve Werner, outlining the method of changing your work flow around, and adding your buttons in Adobe Acrobat instead, as kind of a post production linking process. - http://indesignsecrets.com/navigation-button-tricks-for-interactive-pdf-on-an-ipad.php

non-flash swf on iphone

I want to display a list of swfs and allow the user to click on one and have it display. I wanted to use PDF, but need a little more interaction for the user. I've searched around for some swf -> iphone converters, but I want to just display the swf as PART of an app.
Any recommendations?
SWF used to be short for Shockwave/Flash. It is not an "open" file type and requires a huge framework to work correctly, one of which is support for ActionScript. There doesn't seem to be such a framework right now, even Skyfire doesn't do the rendering natively but tries to convert it through a server.
This is possible via CS5->IOS export. It's not the most smooth, but it will allow you to load external swfs. The only gotcya is that the external swfs cannot contain any actionscript (bummer).
Here's a simple example of flash to ios.

PDF Previewing and viewing

I'm creating a document viewing web application. You log in and it takes you to a screen where you have all your docs listed on the left. I want to make it so that when you roll over a document a preview of the document shows up on the right. From there you can click on it for a full view and printing capabilities. I'm not asking how to do all that but I'm wondering what the best way would be to go about rendering the preview of the document. The documents are all going to be pdfs and stored on a server. I'm working in asp.net 3.5 mvc in visual studios 2008.
For creating the PDF preview, first have a look at some other discussions on the subject on StackOverflow:
How can I take preview of documents?
Get a preview jpeg of a pdf on windows?
If these don't answer your question, you can try a couple more things:
You can get a commercial renderer (PDFViewForNet, PDFRasterizer.NET, ABCPDF, ActivePDF, ...).
Most are fairly expensive though, especially if all you care about is making thumbnails.
There is a CodeProject article that shows how to use the Adobe ActiveX, but it may be out of date, easily broken by new releases and its legality is murky.
Install GhostScript on the server and request rendered thumbnails of any page from it.
I did a small project that you will find on the Developer Express forums as an attachment.
Be careful of the license requirements for GhostScript through.
I use it for an internal software and it's working pretty well.
Hope this helps.
Here
I render the jpeg thumbnails of the first page of the pdf document when a file is uploaded.
When the user clicks he can download the document (or open them direcly in the browser) to read and print them.
Update: to create the thumbnails I used a .net component called PDFView4NET from O2Solutions

Resources