1569
Views
20
Comments
Solved
[Ultimate PDF] UltimatePDF with Reactive web- Only getting the first page of content
Question
ultimate-pdf
Reactive icon
Forge asset by Leonardo Fernandes

I am using UltimatePDF with a reactive web application.   When I attempt to use ScreenshotToPNG or PrintToPDF_Advanced it works and I get the file download, however I only get the first page of that file.   My web screen contains web blocks that render my data and has a horizontal scroll.  I am getting maybe 1/3rd of the screen in my PDF/PNG file.   Any idea what could be causing this?  


UserImage.jpg
Josh Herron
Solution

Try adding this to your CSS and see if it corrects your problem.


/* CSS for Reactive Printing */

@media all {
  .page-break {
    display: none;
  }
}
 
@media print {
  html, body {
    height: initial !important;
    overflow: initial !important;
    -webkit-print-color-adjust: exact;
  }
}
 
@media print {
  .page-break {
    margin-top: 1rem;
    display: block;
    page-break-before: auto;
  }
}
 
@page {
  size: auto;
  margin: 20mm;
}
UserImage.jpg
Ignaz Schels

It works! You saved my day, thanks a lot!

UserImage.jpg
Krishanu Deb Roy

We had the same problem with our reactive app. What's more weird was, the same component works fine in dev and test, but not in uat or prod environments.

This css fixed the issue, thanks a lot.

2021-08-11 17-58-13
Heidi Silva

This script fixed it for me too, thanks.

2022-10-14 05-49-10
maheswarlu madugundu

The script is fixed it for me too. You saved my day. Thanks a lot. I think this can be marked as a solution.

2019-07-08 11-04-35
Leonardo Fernandes
 
MVP


FYI this issue won't happen if you use the PrintLayout block, as it will override the styles to allow multiple pages on your screen.

If you don't use PrintLayout, then some of the styles included by OutSystems UI will cause the entire screen to be rendered in the first page.

UserImage.jpg
Hugo Pires

Tried many things, but this was what fixed it for me. Thanks

UserImage.jpg
mathias somville

I seem to have the same problem. I tested the same function in traditional web and it works there.
Any fix for the reactive variant?


Kind regards,

Mathias

UserImage.jpg
mathias somville

Josh Herron wrote:

I am using UltimatePDF with a reactive web application.   When I attempt to use ScreenshotToPNG or PrintToPDF_Advanced it works and I get the file download, however I only get the first page of that file.   My web screen contains web blocks that render my data and has a horizontal scroll.  I am getting maybe 1/3rd of the screen in my PDF/PNG file.   Any idea what could be causing this?  


 

 It is not compatible with reactive. My fix to "solve" this is to make a tradional web component and send the data there to make the pdf. 

UserImage.jpg
Ignaz Schels

Hi Mathias,
can you give more details on your fix? Does the source page (the one that gets converted) have to be traditional web or can you convert a reactive page once Ultimate Pdf is running in traditional web?

How do you call the component from your reactive app and how do you receive the output?

Thanks a lot - Ignaz

UserImage.jpg
Ignaz Schels

I have the same problem. The strange thing is that it used to work back in August.
It's the same reactive app and I was able to create a pdf with 3 pages. All of a sudden it only gets the first page...

UserImage.jpg
Josh Herron

I'm fairly certain a new Reactive version broke this functionality.   It worked for me as well and then suddenly stopped.   The CSS below corrected it for me though.

UserImage.jpg
Josh Herron
Solution

Try adding this to your CSS and see if it corrects your problem.


/* CSS for Reactive Printing */

@media all {
  .page-break {
    display: none;
  }
}
 
@media print {
  html, body {
    height: initial !important;
    overflow: initial !important;
    -webkit-print-color-adjust: exact;
  }
}
 
@media print {
  .page-break {
    margin-top: 1rem;
    display: block;
    page-break-before: auto;
  }
}
 
@page {
  size: auto;
  margin: 20mm;
}
UserImage.jpg
Ignaz Schels

It works! You saved my day, thanks a lot!

UserImage.jpg
Krishanu Deb Roy

We had the same problem with our reactive app. What's more weird was, the same component works fine in dev and test, but not in uat or prod environments.

This css fixed the issue, thanks a lot.

2021-08-11 17-58-13
Heidi Silva

This script fixed it for me too, thanks.

2022-10-14 05-49-10
maheswarlu madugundu

The script is fixed it for me too. You saved my day. Thanks a lot. I think this can be marked as a solution.

2019-07-08 11-04-35
Leonardo Fernandes
 
MVP


FYI this issue won't happen if you use the PrintLayout block, as it will override the styles to allow multiple pages on your screen.

If you don't use PrintLayout, then some of the styles included by OutSystems UI will cause the entire screen to be rendered in the first page.

UserImage.jpg
Hugo Pires

Tried many things, but this was what fixed it for me. Thanks

UserImage.jpg
Julien Crepin

Hello I'm currently facing the same issue. I used the CSS but didn't work on my case. Maybe it because the size of the page I'm using is A3 portrait.  

I can't have the second page printed when needed. 

2021-11-18 18-03-41
AJ.

Hello Julien,

My I suggest opening a new post for your particular issue, so that when it is resolved, you will be able to pick the solution that worked for you and close it out. You can always reference posts like the current thread in your own post.

Best regards,

AJ

2021-07-21 10-26-16
Vani Mankad

Hi All,

Please see attached oml and see if this idea works for all ultimatePDF related issues w.r.t reactive.

This is basically designing your screen in traditional web app and then call that screen url by passing all the inputs from reactive application.

Please let me know if it helps !

Thanks,

Vani


UltimatePDFIssue.zip
2021-07-21 10-26-16
Vani Mankad

HI Julien Crepin,

If the issue is resolved then please share your solution to help community.

Thanks,

Vani


UserImage.jpg
vishnu shankar

How to remove page break in generating pdf file using ultimate pdf. I need a solution for this immediately,Please help me.


UserImage.jpg
Donna Williams

The CSS worked for me. Thank you!

2023-10-30 06-03-17
Gowtham

Getting timeout error when using ultimate_PDF in y reactive application. How to fix the issue?

Thanks,

Gowtham

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