On April 27, 2024, our Sign-in and Create Account options will be unavailable from 9am-12pm ET. During this maintenance window, developer account access and free trial registration will be unavailable.
inline base64 image in html output
The beforeFactory script reads a image url and base 64 encodes the image. It then creates an image src tag
A text item is then added to the report with the following expression.
importPackage(Packages.javax.imageio); importPackage(Packages.java.io); importPackage(Packages.java.net); importPackage(Packages.java.lang); importPackage(Packages.org.apache.commons.codec.binary) importPackage(Packages.java.lang); var myurl = URL("http://tomcat.apache.org/images/tomcat.gif"); var img = ImageIO.read(myurl); bas = new ByteArrayOutputStream(); ImageIO.write(img, "gif", bas); bas.flush(); encodedimga = Base64.encodeBase64(bas.toByteArray()); encodedimg = new String( encodedimga, "utf-8"); bas.close(); imgsrc = "data:image/gif;base64,"+encodedimg+"\"";<br />
A text item is then added to the report with the following expression.
<img src=<VALUE-OF>imgsrc</VALUE-OF> +" alt="what ever" />
Categories
- All Categories
- Cloud Editions
- 1 Thrust Services
- cat as link
- 1 Core SaaS Application development
- 10 Developer Announcements
- 15 General Questions
- 33.4K TeamSite
- 141 Application Governance & Archiving
- 15.2K Designing Analytics Reports
- 1K DevShare Downloads
- Core SaaS Applications
- nested parent
- 4.3K Developing Analytics Applications
- 8.8K Documentum Developer Forum
- Media Management developer
- 159 Transactional Content Processing (TCP)
- 1.7K Web Experience Management
- 55 Tempo Social
- 1 XM Fax