I am looking for a way to print text from a TextArea using javafx 8 Printing API. So far every tutorial I come across is talking about printing NODES, which I find to be ground breaking and was wowed when I tried it, such awesome power but I need to simply print Text from a TextArea.
Thanks Inadvance
Related
I've realized that when I try to copy/paste a text from an Angular Application to any text editor software (ie Microsoft Word), all the text loses the original format.
I'm using as example the angular material website: https://material.angular.io/
When I copy the text and past in Microsoft Word:
Thats means, the pasted text lost the center alignment, the color and de font type.
Is there a way to keep the website format? I know that the font used by Angular Material is different from text editor, but there are another things that could be mantained (i.e. alignment, color, etc).
I've started a project using Angular 8 + Angular Material and I'm facing the same problem.
Well, you're not likely to get a straight copy/paste action to do what you're requesting.
Why it doesn't work as you expect:
Copy & Paste out of MS Word for example and you'll get Rich Text where all the formatting is part of the data payload. When you copy this to the clipboard all that extra styling metadata goes along with the text. If you paste that data INTO a rich text editor (not a straight text input) like Wordpress's Admin that editor package translates the text metadata that you can't see into equivalent HTML styling.
However, When you copy from HTML (in your browsers) all you're getting is the text without all the "rich" formatting. This happens because a browser uses outside context like DOM position, tag type, and CSS to style the HTML content into what is presented for you to see.
Rich text copy for just YOU
There are multiple browser plug-ins for Chrome and Firefox that will intercept your copy request, create formatting and then paste that to the clipboard. Just ask Google for recommendations.
Rich text copy for all users of a project
This, unfortunately, is more complicated. You will need to write code to do the following (this answer has a good example):
Figure out what the user is trying to copy (usually mapped to selected text).
Convert that content into rich text format. The example above simply copies the HTML but that won't get styling applied by external CSS. Packages like Quill MIGHT give you the option to get rich text back out.
Copy your converted text to the user's local clipboard. You shouldn't hijack browser commands to do this which is why you frequently see a "copy to clipboard" button to do this action. You can move content to the user's clipboard using the Clipboard API in most modern browsers.
Oh and you'll need the user's permission to do all this since proactively interacting with the user's clipboard presents a pretty massive security issue.
I want to write Book Reader Program in Qt C++, like a Book Read Mode in MS Word.
See the image
And I need to show text in pages, no any scrollbars,
So which way can I deal with text pages in Qt? The QTextEdit control has no page splitting as I know.
You can try to use QTextDocument. It supports pagination.
You can set the desired size of page and QTextDocument will process the text implicitly to calculate number of pages.
Rendering of text can be done by QTextDocument::drawContents where you limit rendering only to specific page of document by providing it's relative QRectF coordinates.
Take this text for example.
I would like to be able to display something like the text above, and let the user mouse over "text" and "example" to get two different ToolTip messages (lets say, "text: noun...definition: ...", and "example: noun...definition" respectively).
In this case, the text is static, so one option would be to put 4 different labels next to each other and style them differently. This might work in most cases, but i also need the text to word-wrap which wouldn't work with individual labels.
Can anyone recommend a solution for this?
It doesn't seem to get much love in our community, but you'll want to look at the TLF Engine. Specifically a TextFlow which has said "primitive" events (eg mouse__, roll__) for links. Style the link appropriately, and in theory you should be close to being done. Since this isn't a Flex-SDK baked-in component, it won't handle the toolTip for you, but it's easy enough to replicate. Create a new ToolTip manually - and add it to the PopUpManager.
http://help.adobe.com/en_US/flex/using/WS02f7d8d4857b1677-165a04e1126951a2d98-7ffc.html
Strange problem. Text fields in my flex simply do not work under Mac. Inputted characters do not appear within it. I do not have any specific font set (just _serif), so I don't thing it's font issue.
In what direction should I dig? Have anyone similar experience?
Try creating a completely new project with no formatting of any kind. Create a single text field and see if that shows up.
You may want to consider removing the _serif css to see if that has any effect.
See Soliant's blog for other helpful flex examples
I am having a minor issue playing with my exported Crystal Report, I can generate the reports just fine on our website, however when I attempt to export them to Word documents I don't quite get a document I can do much with.
i.e.:
I can't position the generated text anywhere in the document, it is almost 'frozen' in place. I would expect if I moved the cursor above the report text and pressed Enter a bunch of times I could remove the report down the page, however it just won't budge
All the text seems to be in its own box and I can't move it around or do anything with it.
Any thoughts? My expectation would be once it is exported to Word I could play with it like a Word document, move the text down the page, edit the document, do something with it.
Thanks!
btw, this question is similar to the one posted here, but this one wasn't tagged properly and I don't have enough karma to fix it:
https://stackoverflow.com/questions/434381/word-formatting-not-intact-when-exported-from-crystal-reoport
I'm afraid that you can't do much about it. Crystal Reports is very much orientated towards putting data in fixed positions on pages, so when it exports to Word it puts its data into text boxes because that's a similar thing that Word offers. You could make the Crystal Report page consists of a giant text field and using spaces and newlines to get the data into the right place, which will probably then give you a giant textbox in Word.