[Ultimate PDF] Need help in exporting entire webpage to PDF
Forge component by Leonardo Fernandes
Application Type
Traditional Web

Hi, 

I want to export my whole web page to PDF and for that I am using "Ultimate PDF" forge component. 

But when I request then it only converts only 1st page not remaining one. My web page contains 9 pages but it only displays 1st one. In Print Preview also browser shows only one page if I try to "Save to PDF"

Please help me here. 

Thanks

Solution

Hello @Shaun11,

Could you please add the following to your CSS in your Reactive app and let us know if that helps?

/* 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;
}

The above code is a suggestion by Josh Herron for Ultimate PDF to effectively export all pages in a Reactive web app. The original post is -> https://www.outsystems.com/forums/discussion/65541/ultimatepdf-with-reactive-web-only-getting-the-first-page-of-content/

Hope this solves your issue,

Regards,

AJ

Hi AJ,

Thanks a lot. My issue is solved and I got the expected output.

mvp_badge
MVP
Solution


The component is for Traditional. You are calling a reactive page from a traditional module? That may be an issue. I never tried that!

Can you create the page in Traditional, in the module that does the Ultimate PDF invocation?

Hi Shaun,

Have you followed the implementation on the Demo App provided ? There are some web blocks that needs to used in order to generate a PDF successfully using Ultimate PDF.


Also, if possible can you provide a sample oml. 

Thank you

mvp_badge
MVP

Hi Shaun.

Just to be sure, how do you know the size of the page? Or you mean that there are 9 web pages and only one is exported? (that would mean you are not exporting it correctly)

I used the component to export dozens of pages with success. Please share the oml. It is easier to spot a mistake than to guess.

Hi Nuno, I want to export only single page in PDF and the same page I have lot of content. Like Text, Images etc. When I press CTRL + P it shows me only 1 page there. Why I don't know. But All the content whichever available on that page I want to export it in PDF
mvp_badge
MVP

Ctrl+P is a browser function, not OutSsytems.

To export as PDF you need to call that page in Ultimate PDF (pass the URL as a parameter).



Hi,

Yes I know ctrl + p is browser's functionality I just give an example to understand how many pages i can see there. 

I am using this component in Reactive Web App. Is it any problem? 

I used the same which you mentioned in your screen shot @Nuno.

mvp_badge
MVP
Solution


The component is for Traditional. You are calling a reactive page from a traditional module? That may be an issue. I never tried that!

Can you create the page in Traditional, in the module that does the Ultimate PDF invocation?

Hi Nuno,

Created new Traditional web app and used "PrintToPDF"  like you shown. But still I am getting only single page not entire page.

Solution

Hello @Shaun11,

Could you please add the following to your CSS in your Reactive app and let us know if that helps?

/* 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;
}

The above code is a suggestion by Josh Herron for Ultimate PDF to effectively export all pages in a Reactive web app. The original post is -> https://www.outsystems.com/forums/discussion/65541/ultimatepdf-with-reactive-web-only-getting-the-first-page-of-content/

Hope this solves your issue,

Regards,

AJ

Hi AJ,

Thanks a lot. My issue is solved and I got the expected output.

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