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.
Related
After having been given the task of translating a whole "document" from german to english, I am really glad that WPML's Translation Editor makes it so easy to keep the structure intact and only change the actual text inside it.
That said, I've been running into an issue when the text comes from an Elementor Text Editor and contains links: WPML's Editor doesn't seem to offer a way to also translate a link's destination. It provides a way to mark where the text of a link is in the translation, but that's it.
And some links are language coded, like &lang=de, but since the Editor only translates the text of the link, the result then points at the wrong destination.
E.g. the english section of a text pointing to a source in german.
This is something I keep having to fix manually afterwards, because the Editor only offers translating destinations for Elementor widgets that declare the fields translateable, and even there it can be spotty, as I've found out.
Now I am wondering if there's something I could do to configure WPML to take those links inside the Text Editor element like it does with actual link elements, or if that's out of the question.
I'd really prefer to not have to routinely check the translation destinations, because as it stands do I not even know when WPML triggered an automatic translation because something about the layout changed, but no text changes happened.
So the changes to the link destinations could be just undone silently, which has happened before for a different part of the site.
I am using Google forms "Get Pre-filled linked" and fill out some text boxes automatically. Here is an example text-box filled out with with "pre-filled link":
Is there a way to format the text inside the textbox? For example:
- Have new lines in the text box.
- Make some parts of it bold.
An example desired output with new lines (which I have added manually; not sure how make parts of text bold):
Thoughts on how to format text for Google forms?
I was looking for the same functionality and all I can find on the google forums is "it doesn't support that."
My workaround is this: Create the formatted text in a google doc then take a screen grab with the Snippet tool (or SnagIt or whatever your favorite screen grabber is).
Save the image to your drive then add it to the form.
This seems like a ridiculous thing to have to do, but it does work.
I am having an issue while using the_field element from ACF. When the fields are echoed, there are squares added after the text on Windows 10 machines but the fun part is that I tried the site on a different computer with Windows 10 and Chrome and it rendered without any issues. All the fields are manually entered so encoding shouldn't have any effect on it.
<h1 class="bfold_h1"><?php the_field('home_above_title'); ?></h1>
This is how it's on the back end
https://www.dropbox.com/s/zja6tvxv9y8z3y9/Screenshot%202017-02-07%2012.39.57.png?dl=0
This is how it's rendered on Chrome in OS X
https://www.dropbox.com/s/gvfnuwvqb2uhm8t/Screenshot%202017-02-07%2012.40.48.png?dl=0
and this is how it's rendered on Windows Chrome
https://www.dropbox.com/s/bl4182ja339dyxc/Screenshot%202017-02-07%2012.43.18.png?dl=0
Any ideas appreciated, I checked phpmyadmin and the fields don't have any hidden characters. The field is simple text field.
I've been experiencing this same issue when copying text from Adobe Photoshop, and pasting it into custom fields. They only render in the Chrome browser. They appear to be some hidden characters signifying things like line breaks inside Photoshop.
In order to remove them, I've been selecting all the text in a field, pasting it into a text editor, then copying from the text editor and pasting back into the custom field.
There may be other ways to solve this, but this is what's been working for me.
These characters used to only appear in a beta version of Chrome, but in the last week or two, these changes made it into the Live version.
I need users to be able to enter text in a webform with some basic formatting options and then generate a report showing the formatted text.
The support for HTML is horrible and entering a simple bulletlist doesn't even show properly in the report.
Right now i'm using a textarea with tinyMCE but that's because i don't know what else to use.
Is there a known best-practice for showing formatted text in a Crystal Report?
Edit
I just need to show a report with a bunch of text and icons. Users need to be able to save it to PDF. I doesn't even have to be Crystal Reports but it's what i have been using and worked so far. Until i needed to show formatted text.
I wish for another solution that comes with a designer and let's me bind against a DataSet.
The solution is to convert the HTML to RTF. RTF support in CR is much better than it is for HTML. This way users can still use the tinyMCE editor and even paste Word formatted HTML.
The way i convert the HTML to RTF if using an XSL stylesheet. Basically you load the HTML as an XML document and let the XSL translate it to RTF. This way you also have a lot of freedom over the way your text will appear since you can tweak the XSL.
I used this article to achieve that, the article's attachment includes the .XSL.
I've built an ASP.net web application which allows the users to view and make notes on a list of calendar events. The notes are edited in a WYSIWYG editor that outputs to HTML text (but could also output to RTF), which is then saved as text in an MSSQL05 database.
Now I've got to add a printing function to the calendar application. Prior to this version, the printing was done through SSRS05, but now that I've added rich text notes, this method will no longer work.
I can render the whole calendar in a printer-friendly format in the web browser, but my users have two issues with that: first, I can't turn off the header and footer added during the print, and the users are a little too basic to understand how to turn it off themselves; and second, when a note gets too long, the text gets wrapped not-too-gracefully to the next page. Unfortunately, they use IE7, so the page-break-inside attribute isn't recognized, and upgrading to IE8 or using a different browser is out of the question (I already asked :P)
So with that information, what's the best way to generate a report which features rich text?
I suggest DataDynamics ActiveReports. Very powerful, lightyears ahead Crystal. Give it a try!