How can i print automatically an inovice?

I want make a inovice for a order. And i want a button to print automatically or direct the inovice. 

For format A6

What is the best option to do that?

Hi K A

   You can use the forge component 

and you can try this link solution

Hope this will help you


Ashutosh Soni

I did use ultimate, but I don't want to create a pdf then printing.  I want to create a button that immediately prints the PDF.


You can use JavaScript for that on a button  action flow

code -


I hope this helps 


Thank for answer.

But i dont want print the window. I want button that can direct print the inovice.


Check this if it help

Or please share oml or picture of what you want to achive from what you have.

Hi, K A 

Use this forge component

It provide a button to print your content anything you want just provide Id of the content .

It take two input parameter  

        1 =  ContainerId

        2 = FileName

For containerId you provide container name + .Id

Ex: if my container name is MyContainer   

  then,            ContainerId =  MyContainer.Id

above image    ContainerId =Invoice.Id

It print only you want to need not anything else on entire screen.

Attach demo URL please check it :

and also attach .oml file:


Thank you for your answer. 

only one thing i miss, is : when i click on print button, i dont what get i page for printing. i want when i click on print button, the inovice is printed immediately.

I want make it automatic, because it is a cash register system. Is there any solution?

I don't want to get this page, if I can do it in the backend. I don't want the user to be able to do this.


You need to make some changes in your JS widget,

Delete the Existing JavaScript Code and replace by this JavaScript code attached below in blue.

Code Snipet - 

var element = document.getElementById($parameters.ContainerId);var opt = {    image: { type: 'png', quality: 1 },    margin: $parameters.Margin,    filename: $parameters.Filename};html2pdf().set(opt).from(element).toContainer().save()        .then(function(){          var doc = $('.html2pdf__container');          doc.find('.show-on-export').show(); // show content hide by CSS.        })

You need to make these changes in ReactivePrintPDFButton Application Forge that you have downloaded

the just publish and refresh the dependencies in your consumer module.

I hope this helps


I can't do what i want to do with javascript i guess

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