16
Views
9
Comments
Solved
pdf print in reactive page not getting full width
Question

I have tried a couple of forge widgets for reactive and if there is a table on the page being printed the table gets cut off width wise. Is there a way to do a pdf print for a reactive page that will get the full width and height of the page in the pdf print?

2021-04-09 11-42-43
assif_tiger
 
MVP
Solution

- Added CSS to local Screen 
- Since there are more coluns hence making the orientation as landscape

https://assif.outsystemscloud.com/PDFPrint/TestPrint?_ts=638817266635152602

Fixed_02_PDFPrint.oml
2021-04-09 11-42-43
assif_tiger
 
MVP

Hi @Jason Herrington
Printing the page definetly requires additonal CSS support to overcome issues while print.
You should control/structure element accordingly via css like :

@media print {

  table {  width: 100% !important;  }

  body {   zoom: 80%; /* you need to setup this as per your req */  }

}

Ref:
https://www.paperplane.app/post/print-css-basics
https://www.sitepoint.com/community/t/html-css-table-print-issue/310925

Good Luck

2017-08-09 12-12-29
Jason Herrington

You would think this is something OutSystems would have built in for a pdf print of a page without having to do extra?

2021-04-09 11-42-43
assif_tiger
 
MVP

It's all about controlling the elements on UI & Print Layout via CSS.
That's what any platform offers :)

2017-08-09 12-12-29
Jason Herrington

Ok - that worked for width. However if my table goes longer than one page it only prints out one page with a scroll bar on the right. Is there a way to make it print the whole page height?

2021-04-09 11-42-43
assif_tiger
 
MVP

Could you please share the sample OML for same...
probably it would be easy to suggest solution.

2017-08-09 12-12-29
Jason Herrington

I am making a new espace with some sample data both to have something to pass and show what is going on and to help isolate any css coming in from my main site. Will hopefully be able to post this today. Thank you for all of your help!

2017-08-09 12-12-29
Jason Herrington

Ok - attached is a very simple one page espace that bootstraps some sample data so you can see the table on the page. I don't know what changed but horizontal scaling was working to make it fit but now it isn't. The only css I have added is on the page styling on page TestPrint. The button at the top just does javascript window.print(). It is not scaling horizontally to fit the table to the printed page and anything past 1 page in height it is cutting off and just showing a vertical scroll bar on the pdf print. What I want is for it to scale the page so that all of the columns of the table show up in 1 page (yes I know with this number text is going to be small but wanted to have an example that demonstrated the issue) and then ideally as it goes from page 1 to page 2 it would break in between rows, not break in the middle of a row.

Any help is greatly appreciated!

PDFPrint.oml
2021-04-09 11-42-43
assif_tiger
 
MVP
Solution

- Added CSS to local Screen 
- Since there are more coluns hence making the orientation as landscape

https://assif.outsystemscloud.com/PDFPrint/TestPrint?_ts=638817266635152602

Fixed_02_PDFPrint.oml
2017-08-09 12-12-29
Jason Herrington
Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.