Underlined text in iPhone TextView - iphone

I have the following text in my RTF file..
"The possibility of an attack on Indian Point, a nuclear power plant, has caused local governmental officials to plan evaluation routes, build shelters, and offering citizens potassium pills so there will be fewer casualties in case of a leak."
In that text "plan evaluation routes, build shelters, and offering citizens potassium pills so there will be" is underlined text. When I am copying this text into sqlite database and displaying on Simulator using TextView, I am Not Getting UnderLine... How to get it in iPhone..? From Which Format (word,pdf..) of documents i want to copy to get the exact text...

UITextView does not support any text attributes. You could use a UIWebview with some html to do that (the easy way) or write your own text field using Coretext and NSAttributedString. This site has quite some info about the later: http://www.raywenderlich.com/4147/how-to-create-a-simple-magazine-app-with-core-text

TextView does not support underline text because its have single font behavior and does not support multiFont and text attributes. You can use web view inside text view for RTF File.
Try this link,it have lot of HTMl,which is easily understand.
http://kiefermat.com/2011/09/30/using-uiwebview-for-displaying-rich-text/

Related

How can I autogenerate Code128 in Adobe Forms once I have the font?

I am trying to get Adobe Form to autogenerate a Code128 in a text field by its self when text is input in another text field. I know there is Code128 font, and I have found a bunch of postscript stuff. I am just wondering IF I have to purchase the font and why? (I see something about the license) I just worry I spend this money on a Coding font and I still can't do what I'm wanting by "changing the font" for the "barcode" text field. I don't know any coding, closest is I took an HTML web design class in high school YEARS ago. I appreciate any help. Just to show the one line of code I found (gosh I don't even have a clue HOW) is
'''event.value = this.getField("Size In HP").value;'''
I don't even know if I am using it in the proper "script" box option in Adobe, I just place it and change it to what box I want. hoping it works. -_- (side note the ''' are around the code because below this typing window it shows to do that?)
If you are not planning on a separate program for calculating the checksum, you should stay away from Code128, as the font won't generate the checksum for you. Code39 does not require a checksum, therefore, no calculation.
As long as all you need is capital letters and numbers, Code39 is much easier to work with.

get PDF page title

Is it possible to get page title via iText?
The PdfTextExtractor returns all text from the page but I don't know what line is title. Also, title may contain more than one line
I don't know coordinates of title thus I can't use RegionTextRenderFilter
I can try to analyze the font size and take the line(s) with biggest font but TextRenderInfo doesn't provide public access to gs (private final GraphicsState gs)
Any other ideas?
Pages within a PDF don't have titles, they just have text that happens to be bold or in a large font and appears in an area you consider to be "more top" than other pieces of text. It sounds like you know this already, I just needed to be clear on this.
See my post here which shows how to get font information by subclassing ITextExtractionStrategy. My sample targets iTextSharp which is the .Net port of iText but they match pretty much feature-to-feature. The biggest differences is that Java uses getXXX and setXXX whereas .Net just uses XXX for both. Otherwise everything should port just fine.
The moral of the story is that you are going to have to write some arbitrary rules defining what you think of as a "title" and then parse based on those rules.

Swedish text Localization on iphone

I want to know about localization.The exact requirement is copy/paste text should be changed to swedish text accordingly while entering the text in UITextField.Can any one have source code or example link for this?
I meant the copy/paste tip text appears when editing the UITextfied.How to change this to swdish text?
I'm not sure if you can have dynamic text in localization, i guess you should call google translator so it translates the copied text, you'll get a json response for that.
Take a look here for example:
http://www.raywenderlich.com/1448/how-to-translate-text-with-google-translate-and-json-on-the-iphone

Too many problems on tables in Tinymce?

im working on a CMS it is almost finished
but im struggling serious unfamiliar problems in WYSIWYG editor.
i was first using ckeditor but after experiencing problems with it i switched to tinymce.
some problems are solved but this time someother problems showed up.
problems occuring especially on tables.
1-Anchor element underline removal not working
2-Duplicating Phone numbers
--->might be due to skype phone number converting toolbar
3-too many s how to clean those why even those are there?
4-how to convert
<p>text</p>
back into just
text
because tinymce converting some texts into p element *automatically if it's not the client doing it unknowingly.
*=even though i did that force_paragraph:false setting.
5-As client reports : sometimes cursor turns into loading cursor and wysiwyg editor causes browser to stuck.not even allowing to click links outside of the editor.
6-as i experience sometimes it really does stuck and not allow you to edit anything at all.
here is that problematic page created with tiny_mce and causing lots of errors in process of editing:
Here some answers
2-Duplicating Phone numbers --->might be due to skype phone number converting toolbar
Might be - this cannot ba a tinymce related problem.
3-too many & nbsp;s how to clean those why even those are there?
Browsers will show several spaces (character code 32) as a single one. Thus & nbsp;s are inserted alternating instead of natural spaces.
4-how to convert
text
back into just text
Tinymce is a rte editor and will generate html code. In order to be able to style editor content, the content need to be wrapped inside a block element - eighter ps or divs. You may use server side code to remove tags.
6-as i experience sometimes it really does stuck and not allow you to edit anything at all.
Please describe a bit more in detail - there needs to be a reason for this.

Cocoa Touch: Displaying a structured document

I'm fairly new to Cocoa and am having trouble Googling for the best way to design my iPhone app.
This app is for viewing a stageplay. It should pretty print the script such that character headings are centered and in small caps, say, and stage directions are in italics etc. It should also allow one character's lines to be highlighted (i.e. dynamic formatting).
Looking at this question it looks like NSTextView/NSTextStorage will provide the formatting requirements I want, I'm just confused as to how to construct the view from the underlying data.
I'm thinking at the moment my source will be XML in the following form:
<script>
<dialogue character="bob">Hello Sue!</dialogue>
<stageDirection>He moves to the table</stageDirection>
<dialogue character="sue">Hello Bob!</dialogue>
</script>
Which would output something similar to the following:
BOB
Hello Sue!
He moves to the table
SUE
Hello Bob!
How do I go from a document model (XML / CoreData / ...) to a view containing pretty formatted text?
Any advice or pointers would be great; I just can't get my head around this problem!
If interactivity isn't required then the most easy way I can think of is to generate HTML and render it with UIWebView. Dynamic highlighting can be done with stringByEvaluatingJavaScriptFromString:
UPDATE
Next relatively easy option is to compose styled text with individual UILabels. Basically you have an array of text entries (cues, stage directions etc.), each with it's own style. We create an array of corresponding UILabels with styles applied and then layout them on "script view". After that we can put this "script view" in UIScrollView and that's it. Size of label required to fit particular text can be determined with sizeWithFont:constrainedToSize:lineBreakMode: of NSString.
There are also CoreText services available, but this is much more advanced option.