Copy link to clipboard
Copied
i have a text editor .while saving content in text editor i have to draw or write the content in an image.(text in image).I used
<cfset ImageDrawText(myImage1, text1, 0, 50,attr)> function,But while usinf text editor some leters wil be bold some with other color and font so i can't use this function ...
if my text is like this
<cfset text1 = "The <b>position</b> of the image is represented by (x,y). Each coordinates multiply with above ratio to fit the image in A6 vertical paper size .">
how can i paste this text position bold and other are normal fonts in an image?
any one plz help
plz refer my image
Copy link to clipboard
Copied
one more example text
<cfset text1 = "<h2 class="h2nobreak">Image functions</h2><h2 class="h2nobreak">ColdFusio<font size="2">n provides more than fifty <samp class="codeph">Image</samp> functions that expand on the functionality of the <samp class="codeph">cfimage</samp> tag. You can pass images created with the <samp class="codeph">cfimage</samp> tag to <samp class="codeph">Image</samp><samp class="codeph">ImageNew</samp> function. The following table groups the <samp class="codeph">Image</samp> functions by category:</font> functions or create images with the </h2>">
Copy link to clipboard
Copied
ColdFusion image functions do not have a rich text renderer, so that is something completely unsupported.
One solution would (have) be(en) trying ColdFusion's PDF functionality, since it can render rich text. Then you would want to create an image of the PDF, and paste it into your original image with imagePaste().
However, Adobe has been careful not to allow you to do this. You cannot convert PDFs to images. The thumbnails CFPDF creates are way too small. In addition, CFDOCUMENTs "scale" attribute keeps the text rendered very small, not allowing values over 100. Third, creating transparent thumbnails doesn't work for me at least - the white default background is always there.
Suggestions:
* Ditch the idea about rendering rich text. Write headers and text separately with different font style, and leave it there.
* Find an external third party component for this. ImageMagick is free, and can convert PDFs into images. You might have still problems with the image transparency and anti-aliasing.
* Use a third party RTF-to-image renderer. Commercial applications (at least for Windows) exist.
--
-Fernis - fernis.net - ColdFusion Developer For Hire