123
Views
2
Comments
Solved
[Ultimate PDF] Ultimate pdf : export without blank page ?
ultimate-pdf
Reactive icon
Forge asset by Leonardo Fernandes
Application Type
Reactive

Hi Team,


Does Ultimate PDF allow to export HTML into PDT but "without blank page" ?

Due to some business rules, some of my HTML fields are empty and I want to avoid printing unecessary blank pages.


Regards,

Pierre

2023-08-28 09-08-29
Venkatesh Sundarajan
Solution

Hi Pierre, 

As per my understanding from your query, 

Let's say you have 3 page PDF to print, in that 2nd page might be having a blank values in the fields, this should not get printed. 

I think this component will print the content exactly in the screen which we are passing as input to the "PrintToPDF" action. 

1.In this case, I suggest please try using the below classes, 

@media print{

. dontshowonpdf{

display:none;

}}

Here, inside media print query we have created a class as "dontshowonpdf".

You can put this whole thing on the Screen CSS which you want to print and will pass as input to the Ultimate PDF action.

2. Now you can use this class on the styleclasses property of the elements (fields) you don't want to print on PDF, based on the condition eg:isempty Or isnull - use this "dontshowonpdf" Class as mentioned. 

This might automatically adjust the contents without reserving the space in PDF for this element. 

This way we can control the content visibility on UI and PDF.

I have used this css class to hide and show certain elements on UI and PDF, but in your case also same approach should work. 

Kindly try this and let me know if this works, this may help you. 

Thanks.

UserImage.jpg
Pierre Mas

Thank you Venkatesh

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