I am using wiris plugin for tinyMCE editor in Moodle. Using the wiris editor I type some equations.
But these equations are inserted in database as
<p>«math xmlns=¨http://www.w3.org/1998/Math/MathML¨»«msup»«mi»x«/mi»«mn»4«/mn»«/msup»«/math»</p>
this format. And while display these in browser it display as same
<p>«math xmlns=¨http://www.w3.org/1998/Math/MathML¨»«msup»«mi»x«/mi»«mn»4«/mn»«/msup»«/math»</p>
But I have to display as:
How can I do this? Please help me..
EDIT
My problem is the equation generated using WIRIS is displaying in tinyMCE editor as desired, but while displaying in div/span/table etc it display as
<p>«math xmlns=¨http://www.w3.org/1998/Math/MathML¨»«msup»«mi»x«/mi»«mn»4«/mn»«/msup»«/math»</p>
Please refer the image for more details.
Once enabled, our filter automatically converts safeXML to formula images in Moodle contexts without any additional logic.
If you try creating a regular native Moodle question including a WIRIS formula and then preview it, using Moodle's default preview, the formula will show as an image.
If you are trying to display the formulas in a custom module you are building from scratch, the scenario is different.
Are you filtering the content before displaying it? You need to use format_text() so that the filter parses the text you are displaying.
Please check the code of /<moodle>/blocks/html/block_html.php and how format_text() is used. We also recommend that you check the Moodle filter documentation at https://docs.moodle.org/dev/Filters#A_note_about_performance
Please note that if you are using WIRIS in Moodle our formula images are stored in your database as what we call safeXML, which is a slight modification of MathML replacing five characters (http://wiris.com/plugins/docs/resources/encoding-attributes).
However, you don't need any additional configuration for formulas to be displayed as images in Moodle. WIRIS filter automatically converts safeXML into formula images.
Please check that you have enabled WIRIS filter as detailed on step 3 at http://www.wiris.com/plugins/docs/moodle
Related
I want to program a plugin that sets a Text-Container over a Image in Wordpress. Im using the Divi Themen. My idea: I need to find where Images are rendered and add my container where I place my text with something like "get_meta_data()". The needed field are already in the media library. I just need to find how to create the conainer and place it over every image where my text exists. Any Ideas/Tipps?
I am trying to create an editable HTML textarea component using TCPDF API library. I want to display a scrollable text box on the screen.
Can this be done?
Current TCPDF examples include these: https://tcpdf.org/examples/
I know PDFs can have editable components, but I am not sure how to create them with TCPDF, if it is at all possible.
TD;DR: how can I generate a page with a scrollable textarea using PHP + TCPDF?
Linked Answer using another library (mPDF):
Note that while How to create editable Pdf form in php may work, it does not make use of TCPDF library. My existing codebase relies heavily on TCPDF, I would like to explore the possibility of using TCPDF before I consider adding another library ...
i.e. I rather have an answer of "Not possible" than to use another library at this time.
It looks like the issue is two-fold.
First, you can use a typical form example, like here: https://tcpdf.org/examples/example_054/
However, you cannot see editable fields in a browser, at least you cannot in Mozilla Firefox 56.0.2 as the time of this writing. (https://support.mozilla.org/en-US/questions/1006115)
What you need to do is open the generated PDF in a different viewer that supports editable form fields, such as Adobe PDF reader/other.
Then you can fill out the textarea and if text size exceeds the area of the form element, it will have scroll bars added to the textarea.
I am using FPDM to auto-fill a PDF form fields from a MySQL database via a Wordpress plugin. This works well and the form is generated and filled correctly. However, if I download the generated and filled PDF and send it to other people the form fields are blank to some but not to others.
I am thinking that this is may be a font issue but can't seem to nail down the issue. The template text is Times New Roman. The fields use Times Roman which when I look at Fonts on the PDF Properties pages shows a Custom font (Times Roman) with actual font name TimesNewRomanPSMT. The page also shows TimesNewRoman as an embedded font, like so...
Filled PDF Fonts page
Has anyone else experienced this problem?
Thanks
It's likely the issue is that FPDM does not create something called "appearances" for annotations (fields are a type of annotation), it just populates the value. An appearance allows a PDF viewer that doesn't know about annotations to display their appearance without needing to understand how to use the annotation's properties. Some viewers will generate appearances if they are not present, some won't.
You can test my assertion. If you're seeing blanks by default but see a value when you try to edit the field, then what I describe above is the problem.
I'm using Wordpress to manage a newsletter with IssueM, also I need to be able to export the content of a group of articles to PDF (Keep in mind that I'm not a php hardcore developer).I'm using Advanced Custom Fields to generate some data and then creating graphs using NVD3 with javascript.
At this time, all the plugins I found to create PDF's did not work, they only "print" the title of the post(article in IssueM) and nothing else.
I need to be able to export the content, rendered graphs and tables with images, to PDF as they appear in the browser (styled via CSS in my page).
I found there is FPDF, and mPDF, also DOMPDF but they don't specify if they can render the javascript output (which are my NVD3 rendered graphs) to PDF.
Is there any tool that can acomplish this? or,
Do I have to do this by hand? If that's the case, can you tell me an approach?
Have you had a look at:
https://wordpress.org/plugins/printfriendly/
You should be able to add/remove/customize elements that print out:
http://support.printfriendly.com/publisher/developer-questions/include-exclude-content/
It should render javascript because it is using javascript (make sure you enable javascript use in the plugin):
http://support.printfriendly.com/publisher/wordpress/javascript-option/
Hope that helps!
I am going to use CKEditor to format the text while editing the content of my website. The content is saved into MySQL database, so if I use CKEditor, will the text be saved with its formats (size, color, etc) and displayed with that format in client side?
Yes and no. Not really.
Some information will be saved, yes, but some other will require the CSS of the editor page and the display page to match. They usually do, but not necessarily.
CKeditor offers several ways of customizing the HTML that's being generated. Your best option would be to use CSS classes for SPAN and DIVs, and all other tags you allow in the editor; then, define those in a separated .css file that would be imported by your CKeditor edit page as well as the site at large. This will give you as much WYSIWYG as you're going to get.
(I'll try and whip up an example later when I get access to a CKeditor on my servers; but you can also looks at CKeditor' documentation).
Yes CK editor will save the way you specify. On CK editor you have a source button if you click on it you will get the html source.