Execute JS print function(.print( )) for the generated document in MF

Hello All,   I have generated the PDF document in mendix using MF. I have a requirement when the user clicks on preview button I need to generate the PDF document and should show the print screen for the generated document.   Usually the print function prints the screen, but instead we need to generate the document and only the generated document has to be displayed in the print screen not the entire screen when the user clicks on button.   Any Idea?   Answers are really much appreciated. 
1 answers

Hi ArunKumar,

use @media Print{

add the required classes or particular div name here which you need to print aswhat are the contents you are passing in the pdf document.


You can do the stylings aswell in the particular @media print function as the styles for it only applicable when you print the document itself it wont be affected in the application.

checkout the link for the more practical knowledge.



hope this helps.