57
Views
1
Comments
Outsystem: Export HTML or MHTML file by javascript

Hello everyone!

I am making a business card generator application and I want to download this page preview to HTML or MHTML file using Javascript in OS component but cannot then I changed the way by generating html file and using java script in OS change some fields in there but it seems that is not possible. Can someone tell me if OS can do it?

Thanks a lot.

UserImage.jpg
#YASH

To export HTML or MHTML (MIME HTML) files using JavaScript in an OutSystems application, you can utilize the FileSaver.js library. 

 step-by-step :

(1)Include FileSaver.js: Download the FileSaver.js library from https://github.com/eligrey/FileSaver.js/ and include it in your OutSystems application's JavaScript dependencies.

(2)Generate the HTML or MHTML content: Use JavaScript to generate the desired HTML or MHTML content that you want to export. 

(3)You can store it in a variable or retrieve it from the DOM.Create a Blob: Create a Blob object using the generated content.

(4) In the case of HTML, you can use the text/html MIME type, and for MHTML, you can use the application/x-mimearchive MIME type.

(5) you can export HTML or MHTML files in an OutSystems application using JavaScript and the FileSaver.js library.

 Remember to include the FileSaver.js library in your application and adapt the code according to your specific requirements.

Regards,

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.