How to convert PDF file to .doc format in Objective-C? - objective-c

right now i am working on one ipad application where i am giving facility of opening the pdf file and also to customize it,now i want to add one functionality like i want to convert that pdf file in .doc format.
I researched but did not get any way around. Can anybody help me out?
Thanking you in advance.

I wrote an article on PDF to text conversion issues. If you look at some of the existing PDF to Word conversion tools (ie BCL) you will see what is realistically possible with a lot of work.

It’s not possible to convert a generic PDF back into a text format. I guess you could render the PDF into images and create a DOC from those, but that doesn’t sound very useful.

Related

Open pdf file in Microsoft Word using OLE

I am looking for the method (of Word ole-object) which can open pdf in the Microsoft Word.
I want to copy all pages of pdf into doc/docx and add there footers.
Could anybody give the cue how to import pdf?
PS: any sample code for this problem would be great.
Thanks,
Lilya
You need OCR (Optical Character Recognition) engine for converting PDF to document. PDF is generic format and it can include text as image. So it is very hard to convert PDF to document. SAP hasn't got any OCR function for doing this. Maybe OpenText (if customer using it) has this functionality, I haven't got detail information about opentext. You need third party tools for this. You can use online services or command line utilities to converting PDF files to text files easelly if PDF included text, otherwise you need professional SDKs (for example Abbyy Finereader) for doing this.
I used FoxIT PDF Reader to save the PDF file into text file and make a macro to read the text file. Of course, by doing so, you can only get the text, but nothing else.

How to generate PDF file using X++?

Can I create simple pdf file in x++? In this pdf I would like to have for example select from one table or simple static text.
MorphX reports can be saved to PDF by using the proper print settings beforehand.
SSRS reports can do this also using similar tricks.
Another way is to generate RTF, then let Word do the PDF creation. Silly, but maybe the PDF is smaller or better looking.
It is possible, but not simple, to generate PDF directly by using third party .Net components.
Some weeks ago, I used the Evo HTML to PDF library http://www.evopdf.com/ to convert simple HTML templates to PDF and it worked great. It can convert plain text as well, so maybe it could be useful for you.
Natively, AX hasn't anything to create PDF files.

Get text from a pdf in NSString

I am trying to make an iOS app which would extract plain text from a pdf file and display it in a UITextView. Its simply not a pdf reader to view a pdf file but i would later wish to perform certain operations on that text.
I have already googled a lot but still not able to get an exact solution.
i already tried using https://github.com/zachron/pdfiphone
but the files are using ARMV6 architecture which seems obsolete with xcode 4.5
And if anyone can suggest some exact and non-confusing code using Quartz-2d framework of iOS then it would be great.
Here is An Sample code to Extract text from PDF Hope this Might Help You.
https://github.com/zachron/pdfiphone
This is a library to get the text out of a PDF for the iPhone.
Another Demo is there Which uses OCR technology find the link below
https://github.com/nolanbrown/Tesseract-iPhone-Demo
Also 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
Two Other Libraries
https://github.com/KurtCode/PDFKitten/
https://github.com/mobfarm/FastPdfKit
This question comes up all the time. It is VERY hard to extract text from PDF in general. The PDF specification is not designed with text extraction in mind. There are many libraries that try to do the job, essentially by reconstructing the text from the geometric placement of the individual glyphs. These libraries have varying degrees of success, but will all fail on certain PDF documents. In fact, some PDF documents have Glyphs but no way to associate the glyph with a character. For these documents it is simply not possible to extract text, short of using some kind of OCR approach.
PDF is designed as a read-only format that is portable in the sense that a PDF document will be rendered identically on any platform. That is what it is best at, and what it should be used for.
If text is to be edited, do not use PDF.
Here (Extracting text from pdf using objective-c), I found an answer to your question and it works. But not so fine as i need it :(
it can extract only ascii
it return me only one paragraph
Good luck.

Is there a way to convert submittable/fillable PDF (containing JS) to HTML?

I have a huge set of PDF files which use forms and JavaScript to submit them. I'm wondering if there's a way of converting such PDFs into HTML (or any other format except Flash which would allow for opening the page in a Web browser and submitting it).
After research on the topic I was able to find several pieces of software that would convert PDF to HTML but even if there are any fields left after conversion there's no JS apparently and all the buttons are missing.
Edit: The number of documents to convert is roughly 500... so "by hand" method is out unless it's a bit of "by hand" and then in bulk
I'm not sure whether this PDF converter will help. It can convert PDF to html, however, I'm not sure whether it will preserve your buttons and js. Maybe you can have a try. Hope this helps.

How to create and save a .rtf, .doc, .docx in Objective-C for iOS

I am looking to create and save either a rtf, doc or docx file on an iPad (iOS).
The scenario is that we'd like to assist a user in creating content on their iPad and then let them email this as an editable document cross-platform (OS X, WIN).
I am open to other solutions besides the rtf, doc or docx file format.
Thanks,
James
RTF is going to be the easiest, because it's a plain text format. It's kind of like HTML, but without closing tags. Here is a class for writing an RTF, but it requires a lot of dependencies from elsewhere in the framework.
DOCX would be rather difficult. It's actually a zip file, containing a few XML files. You can examine the format yourself by changing the .docx extension to .zip and unzipping it. But even though XML is a fairly easy to write format, the way the text attributes are organized is still rather complicated. Also, I recall that it has to be zipped in a very specific way to be read properly.
As for DOC, it will be very difficult because it's such a complex format. You could look into some open source projects, like Abiword or Word2x. Be careful using their code because the licenses may not agree with the App Store rules.
I've seen doc & docx readers for iPhone (App store entry linked here), but I don't know of any open source frameworks you can make use of.
RTF format should be pretty simple to write, if you're up to the challenge. There is no built in framework support for it (here's a related question, b.t.w.).
Maybe you could write out something in a regular TEXT format and e-mail that?
Docmosis has a cloud service that you can reach from iOS. You can ask it to render a doc in various formats (doc, rtf, pdf, odt etc) and email it off or stream it back - though you have to be connected. Previewing DOC on iOS is possible but a little flaky. One option is to stream PDF back for display on iOS and email editable document (which can be done in one call).