What is the best way to show html -> rich text in iOS?
The problem is that some images from this text should be available offline, so I can't use a simple UIWebView.
Ideally I want to show just html with an ability to replace some special tags with other controls (UIImageView etc). I don't need to download this images from html. Both images and html will be downloaded with issues. Just need to manage the layout.
Core Text is not suitable, because to use it I'll need to parse this html manually. It should be a simpler way.
This has to be supported by iOS 6, so I can't use anything new from iOS 7.
I've seen this question. Doesn't look like this OmniGroup framework will work for me.
RTLabel doesn't support everything, what I want to have.
DTCoreText looks good, but it's not free (don't want to show their license text).
Maybe it's another cool fremework, which I didn't find yet?
Have tryed
https://github.com/mwaterfall/MWFeedParser/blob/master/Classes/NSString%2BHTML.h
This will simply give string out of html. It might not be exactly what you are looking for but hope this will solve part of your problem.
But this will not solve your offline image viewing.
For image
https://github.com/rs/SDWebImage
Will do a async download and cache image.
Related
Quick question, that I haven't found a solid answer yet.
Is it possible to generate a PDF in iOS that includes layers, which can then be removed/separated in Photoshop?
What I'm trying to achieve is take a picture with the camera of the phone, then place text over it, submit it as pdf to a customer and then have the customer read the text and remove it.
I can do everything except the layering of the pdf and I have found some hints that this isn't possible to do with the standard iOS library, but I wanted to know if anyone has come across this before.
Thank you.
The standard iOS API for creating PDF files cannot create layers (optional content) in a PDF page.
This library IFXPDFFactory seems to be able to generate PDF files with layers.
PoDoFo and libHaru can also be used to generate PDF files on iOS but I do not know if they support layers.
Need help on rendering PDF using CGPDFContext. I am currently using UIWebView to display PDF but would like to perform much more operation rather than just reading like Highlight Text, Search PDF, Annotate PDF. Not looking for using any Framework or library.
Any help will be beneficial. For a start, code on how to render PDF using CGPDF and displaying it instead of using UIWebView.
PDF annotations are a rabbit hole. I've been working on them since 2010. The spec is thousands of pages. It's easy to get started but it takes forever to get right with all the PDFs and variations out there. Even a simple feature like bookmarks are harder than you would think.
To date there's no open source framework that implements PDF annotations. The above linked one can be a good starting point. If you don't have months/years to build something on your own, there are a few commercial options available - like PSPDFKit, available for iOS, Android and Web, which I am building.
We have a guide article listing the most important PDF spec documents.
Searching is another tricky topic. It's quite hard to convert the PDF text data to unicode. The Adobe CIDFont spec is a good starting point.
You shoud try VFReader, it is an open source project for rendering PDF files on iOS. It can be a good starting point.
I'd like my users to be able to upload an image by pasting it into a form.
Is this possible somehow with Rails?
I'd like to do this safely and limit to a single picture upload, not a completely open textarea.
UPDATE:
I'm looking for something like http://pasteboard.co/ that I can add into a form in a Rails app.
Also, with a paperclip hook like https://github.com/galetahub/ckeditor would be nice
Although I don't have a specific answer (copy & paste), I do have an answer regarding how to implement the uploading within the DOM:
JQuery
If you use something like jquery-file-upload, you'll be able to incorporate a GUI-based upload process to Rails
I think your question can be answered by taking this technology & applying to the specific element where you'd like to "copy & paste" the image
You can drag & drop images from your system into the example above. This is very similar to the copy & paste functionality you're seeking. I would personally look at this technology, and then apply it to the copy & paste procedure
WYSIWYG
You've referenced GMail as a great example of this -- but you have to remember they're allowing you to paste into a WYSIWYG editor
This is very important, as the upload image element will be handled through the WYSIWYG. You may be able to use this resource to help:
Wysiwyg with image copy/paste
My clients can enter text into textarea and have the option to use the markdown or textile filters for each textarea.
With some models (articles, newsletter, etc) they can upload images to associate with the model, which are displayed in a column next to the text of the text.
This worked fine for a while, but they have now told me that the want the ability to put the images INSIDE the text a specific positions.
What is the best way to go about this? I suppose I may have to use a wysiwyg for this, but would rather not. And how would this work for images which are not yet on the server, etc?
There are different directions you could go to:
Follow the path of Confluence, which released in their new version 4.0 a rewritten WYSIWYG editor, that stores as source XHTML, not any more wiki markup.
Leads to an update of all pages when migrating.
Was pretty difficult to implement. I do not know if they use any more the TinyMCE editor of previous versions.
Follow the format of markdown how to include images in your source format. So by typing: This is my text. !image.png! The inline image shows ..., you will have a format that is understandable.
You have to expand the interpretation, so that the !<filename>! will be mapped that is stored locally anyway.
You have to add clear-up dialogs for the images that are yet not known, so doing bulk uploads ...
You may provide a drag area on your view, that then shows the filename and gives examples how to include that inside the text area.
Go for something in between, by allowing users to drag images inside the editor. There are plugins written in Javascript that allow you to do that, e.g. UI Draggable for jquery
I have no idea how to integrate that image inside the text editor. Overlay?
So the second one is the easiest, and the user knows how to do it. If they only decide that this is the solution they want to have :-)
I think I'm going to use a combination of #2 above, and the Liquid templating engine.
I am looking to be able to open a pdf file (done) and then be able to use the touch screen to sign the pdf and then save it with the modification. From what i have read this is no easy task, and i have no idea where to begin. Any of you know any tutorials or frameworks that will help me with this ?
Also if possible being able to modify fields of a pdf file, on the desktop the pdf can have fields you can click on then type in to fill out the form, without the need to ever print. If this is possible as well that would be perfect.
Thanks.
Maybe libHaru (http://libharu.org/wiki/Main_Page) does what you want, it's worth a try.
Does your starting point have to be a PDF? steipete's suggestion of using a system to create the PDF would work if your app workflow could create the PDF (sans signature) and display it, the user "signs" it in your app, and you create the PDF again this time with the signature embedded. It depends on whether this flow is an option for your app. Often it seems easier if you treat PDF as a final document and produce the PDF in it's final form each time (final meaning that you're not going to try modifying it).