24
Views
20
Comments
Automated Printing of Form-Filled PDF from OutSystems

I was told something like, okay, I have an HTML and CSS created in OutSystems. With this, I would fill out something like a registration form with fields like name, age, date of birth, city, ZIP code, etc. Once I've filled out everything, there would be a 'Print' button (I have a base PDF to fill it out). Then, it would go to automatic printing with that PDF base. Is it possible? 

Hi Antony, I hope you are well.

Yes, it is possible for you to create a PDF with either customizable HTML or CSS, and for example, in this PDF collect the data that was filled in the form.

To generate the PDF and print it, you can use the "UltimatePDF" component, available on forge:
https://www.outsystems.com/forge/component-overview/5641/ultimate-pdf

This component is an extremely strong and useful tool for generating and manipulating PDFs in OutSystems.

Opa Lucas vou indo bem, então eu acho que não especifiquei muito bem, perdão, mas a questão era que eu precisava imprimir os dados do formulario que ja estão no structures.

 
MVP

Hi, please use English in the forums.

"Hey Lucas, I'm doing well, so I don't think I specified it very well, sorry, but the issue was that I needed to print the form data that is already in structures."


Did you mean, the page is having textbox, then after you fill the data, you press Print button and this will print right ?

 
MVP

There is a few way to do this.

IDK if this the best, but this is my idea.

First you need to create similar screen with your input screen, but change the textbox with expression. Let say you screen is called "UserForm", then called this screen "UserFormPrint" and set input parameters on that "UserFormPrint"  screen.

On the "UserForm" print action, you called html to pdf plugin (ie : https://www.outsystems.com/forge/component-overview/209/html2pdfconverter), and put url of "UserFormPrint" with parameter input from "UserForm".

I'll prepare an oml file on monday if you still need example.


But I didn't want to convert an html to pdf, I wanted to take the data that's in the structure that's locally, and with that data generate an impression

 
MVP


I don't understand.

"and with that data generate an impression" 

Do you only need to print what on screen and print it (without anything with pdf ?)


When I publish this project and type there, it is stored in these structures, right? So I wanted to get this data that is there, and be able to print it the moment he clicks the confirm button


Hi Antony,

If you are storing data in Structure and trying to print on another page then it won't work.

either you need to save the data and query the data on print.

you can use same page for generating the pdf and design ur page as per pdf and then perform print. if there is no requirement to save.

check sample oml.

Hope this work,

Regards,

Shoeb

Test.oml

Hi, so this OML file you sent has a GetBookmarkableURL() it pulls this from where? How do I get my structures data saved and I query it?

and this question it is generating is a screenshot of the website, and I didn't want that, I wanted the information, so later I would create a PDF model for the data to automatically go there


Hi Antony,

In that case you need to save data in database  then need to render as and when you required on screen and give that screen url to print a pdf.

Hope this help.


Regards,

Shoeb



Honestly this work that they gave me, about taking the data that was put in the form and with that on the print button it is already printing with a model made with the information placed, this seems a little complicated to me, and even more so me who is starting in the outsystem

Hi Antony,

Its not that complicated as you think but i would suggest to go through OutSystems Training video its very well explained.

I will try to provide some sample code to you if I will get sometime.


Regards,

Shoeb

Hi @Antony Kauã ,

Create 2 exact same pages with form, the only difference will be on first page the data entered by user will be stored in structure type variable like you r doing now and on 2nd page it will be input variables like I can see on screenshot there are 6 fields so 6 input variables will be there and those 6 variables will the input variables for the input fields.

Now after user fills the form on page1 and clicks on print button pass the url of page2 to printpdf action of ultimate pdf with values of input variable in URL which will there is structure variable of page1

this way you will get a pdf with data entered by user on form.

So on the second page, would I create the PDF template with the data filled in by the user? 

Hi Antony,

Passing value in parameters will work but if you have large form to fill so it can lead to an issue.

Please check the Sample oml it will give you some idea.


Regards,

Shoeb

Test.oml

Like with the example you sent me, I entered the information into the input fields, and when I clicked print, it was the same screen as a screenshot. Is it possible, for example, that I have these PDFs, blank ones, and I imported them into OutSystems, with fields for people to fill in virtually, instead of doing it manually, and when they fill out the form and click print, it kind of recreates that PDF template with the entered information, without the need to take a screenshot of the screen? 


Is it not possible to do this in JavaScript? Or even create a report with the information entered in the input fields? 

Hi Antony,

Apologies.... I Shared the old version with you, please check the updated one.

Also regarding the above pdf you need to design the page in order to align the text.


Regards,

Shoeb

Test.oml


Is there an option in the Outsystem that has a control key to P to perform the printing? An alternative too

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