The text-indent not work when use activity HTML Convert to PDF Issue

We are plan to upgrade our pega platform to a latest one. Now we facing a issue on convert HTML to PDF.

The issue is the css attribute text-indent was not work when we call the activity “HTMLtoPDF”.

The html like this:



*<style type="text/css">*
<em>
p {</em>
<em>
  text-indent: 40px;</em>
<em>
  text-align: justify;</em>
<em>
}</em>

*</style>*
<em>
</head></em>
<em>
<body></em>

*</div>*
<em>
<p>This is a test. This is a test. This is a test. This is a test. This is a test. This is a test. This is a test. This is a test. This is a test 123123121312312312312.</p></em>
<em>
</div></em>
<em>
</body></em>
<em>
</html></em>

What we expected was as below:

This is a test. This is a test. This is a test. This is a test. This is a test. This is a test. This is a test. This is a test. This is a test 123123121312312312312.

But what we getted was:

This is a test. This is a test. This is a test. This is a test. This is a test. This is a test. This is a test. This is a test. This is a test 123123121312312312312.

Our pega version is:

  • Pega Platform Infinity '23
  • Pega Foundation for Financial Services
  • Pega Customer Service (UI Kit) '23
  • Pega Customer Service for Financial Services

The pd4ml version used in the Pega platform is:v4.0.13fx8.

Does there are anybody have facing the similar issue or not?

This is a bug or not?

Hi @Shipeng_Tian,

If text-indent is not working then you can try to use the following:

.p { position: relative; padding-left: 20px; /* Adjust as needed /} .p::first-line { position: relative; left: -20px; / Equal to negative padding to maintain spacing */}

Alternatively you can also consider using other css attributes like padding-left or margin-left.

@Shipeng_Tian I tried the same in my system also using HTMLToPDF activity and facing the same issue. Even with pxCreatePDF activity with the HTML code placed into section rule using non auto generated format, I am facing the same issue.

Find my pega version details.

Pega Infinity 23.1

Theme-Cosmos: 04.01

The pd4ml version is v4.0.17

But instead of using text-indent, I tried with left padding and it was also achieve the same. Check if the below code be any use for your usecase.
p {
padding-left: 40px;
text-align: justify;
}

@SrijitaB

Thanks for your reply.

Our target to set only the indent for the first line, so the padding-left or margin-left could not meet our requriement.

I tried to use the ::first-line as you mentioned, it was not work in our environment.

And I also checked first-line on the web.

It looks like the css attributes like margein-left; text-indent not work in first-line.

@Shipeng_Tian

  • Its a issue from PD4ML tool which is a third party tool which Pega is using for generating the PDF. Even in latest version of PD4ML jar 4.0.19 we have this issue.

  • As a work around make use of   in the correspondence rule for getting specific indent.

Thank you.