Fetching PDF file content into NSString - objective-c

I am working on iPad application in which i have to show PDF data into table. Firstly,I want to fetch PDF file content into NSString, how to achieve this. I tried a lot but i am unable to get it.
Thanks

You have to use Quartz2d.
Check this page of the Quartz 2D Programming Guide, it covers everything you need to open and parse a PDF file in iOS. Note that it is not a simple task, since there's no method to extract the full text in one line. You have to work with the data as an input stream, using a CGPDFScanner

Related

VBA Export embedded video from Powerpoint presentation

I'm trying to convert an entire presentation to HTML, extracting all the embedded content etc along the way. I've got text, audio, narrations etc all working fine but am having trouble finding out how to export video content.
Im looping through all slides in the presentation, then all shapes on the slide, looking for shapes of type msoMedia. If I find one, then I check it's MediaType. If it's ppMediaTypeMovie, then I can find the source file of an externally linked video file using Shape.LinkFormat.SourceFullName, but I can't for the life of me find out how to access EMBEDDED content.
If I find a shape with a MediaType of ppMediaTypeSound then I can use Shape.SoundFormat.Export to export the audio. Does anybody know of an equivalent for VIDEO shapes? (There's no Shape.VideoFormat) I've spent days looking through every possible data member I can but to no avail.
It appears Microsoft extract the contents of the media file to a temporary folder anyway, and embedded videos still provide a LinkFormat.SourceFullName to the extracted video:
?oshape.LinkFormat.SourceFullName
C:\Users\Alex\AppData\Local\Microsoft\Windows\Temporary Internet Files\Content.MSO\F26FF1D0.m4v
All that I need to do is fire this file through ffmpeg and I've got my video, in the format I want!
Thanks for your help :)
Note: You may find that the .Export method doesn't work for embedded sounds either in recent PPT versions.
Alex's suggestion is what I'd look into first; otherwise you can unzip the PPTX/PPSX/etc and find the videos in the media folder. Or you might try saving as an XML presentation; you might be able to parse the video out of that.

Generate Paginated PDF from UIWebView

I've got a UIWebView that I'm using to display a stylized NSString of HTML that I'm generating. I'd like to be able to email a paginated PDF of the displayed page.
Right now, I can use the iOS 4.0 printing features to print a nice, paginated representation of all the text in the UIWebView. Can I do the same, but rather than print the PDF, generate an NSData object (or a file in the sandboxed file system) from the HTML string?
I can already generate an image of the UIWebView, but this doesn't paginate easily and requires a lot more work than I think should be necessary to do this.
Thanks.

Creating a PDF table in Objective C

I've been looking for 2 days for a solution to that problem but didn't found anything yet. I need to create a PDF File with only one page which shows its content in a table (like a timetable). I'd like to fill the cells with string values, that I am getting from a XML file.
PDFKit wasn't usefull so far and Quartz 2D appears not to be a solution because it's quit complicated to draw a table which I can change easily. Are there any librarys or so to just create a one-paged-tableshowing PDF? Thanks
The easiest approach with the greatest flexibility would probably be to generate the table as HTML, use a WebView to display it and render it to PDF using NSView's dataWithPDFInsideRect: method.

How to convert html data to PDF in objective c

I want to convert html to pdf dynamically in objective c.
what is the best way to convert it, so that it maintains its look same as html.
Thanks in advance.
Prasad.
UIGraphicsBeginPDFContextToFile will help you to create a PDF file which shows your web content. Read through the documentation and create your own solution or just follow the tutorials I found:
Convert Html or UIWebView to pdf in iPhone or iPad
Making a PDF from a UIWebView
I have used this Haru open source library, it is quite simple and useful for creating pdfs http://libharu.org/wiki/Main_Page
Objective-C is a programming language, it doesn’t know anything about HTML or PDF per se. How to do this depends on the framework you’re using. I’m assuming here you’re using Cocoa on OS X.
There you can load your HTML into a WebView provided by WebKit and then use the NSView method dataWithPDFInsideRect: to render it as PDF. I haven’t tested this, but maybe you’ll have to add the web view to a window before you can query the PDF data.

QuickLook plugin displaying an image and some infos

I'm currently writing a QuickLook plugin, and I wondering how I can display an image and some information about that image at the same time, similar to http://www.code-line.com/software/sneakpeekphoto/ .
There is only one way to do so: Convert your content to an already supported one. This means either PDF or HTML. There are two options you have:
For static information you create a simple PDF preview by rendering a view into a PDF. (Use -dataWithPDFInsideRect: method of NSView)
For dynamic information create a HTML page with links and so on. QuickLook will then show it. (I think this is also the way your example does it.)
We have not found a way to create complex previews on ur own and had to stick to one of the methods, too. Keynote and Pages do the same -- they convert their presentations to multi-page PDF previews...