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

**URL:** <https://forums.pega.com/t/the-text-indent-not-work-when-use-activity-html-convert-to-pdf-issue/6597>\
**Category:** User Experience\
**Tags:** intelligent-document-processing, user-experience, case-management\
**Created:** [April 4, 2024, 6:04am UTC](https://forums.pega.com/t/the-text-indent-not-work-when-use-activity-html-convert-to-pdf-issue/6597 "2024-04-04T06:04:52Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Shipeng\_Tian](https://yyz2.discourse-cdn.com/pega/user_avatar/forums.pega.com/shipeng_tian/32/8015_2.png) [@Shipeng\_Tian](https://forums.pega.com/u/Shipeng_Tian)\
**Post date:** [April 4, 2024, 6:04am UTC](https://forums.pega.com/t/the-text-indent-not-work-when-use-activity-html-convert-to-pdf-issue/6597/1 "2024-04-04T06:04:52Z")

</div>

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:

```auto
*<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?

---

<div class="post-metadata">

**Author:** ![SrijitaB1](https://yyz2.discourse-cdn.com/pega/user_avatar/forums.pega.com/srijitab1/32/8849_2.png) [@SrijitaB1](https://forums.pega.com/u/SrijitaB1)\
**Post date:** [April 4, 2024, 7:50am UTC](https://forums.pega.com/t/the-text-indent-not-work-when-use-activity-html-convert-to-pdf-issue/6597/2 "2024-04-04T07:50:00Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Abhiveer\_Jatla](https://yyz2.discourse-cdn.com/pega/user_avatar/forums.pega.com/abhiveer_jatla/32/22972_2.png) [@Abhiveer\_Jatla](https://forums.pega.com/u/Abhiveer_Jatla)\
**Post date:** [April 4, 2024, 1:45pm UTC](https://forums.pega.com/t/the-text-indent-not-work-when-use-activity-html-convert-to-pdf-issue/6597/3 "2024-04-04T13:45:38Z")

</div>

@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;  
}

---

<div class="post-metadata">

**Author:** ![Shipeng\_Tian](https://yyz2.discourse-cdn.com/pega/user_avatar/forums.pega.com/shipeng_tian/32/8015_2.png) [@Shipeng\_Tian](https://forums.pega.com/u/Shipeng_Tian)\
**Post date:** [April 15, 2024, 2:24am UTC](https://forums.pega.com/t/the-text-indent-not-work-when-use-activity-html-convert-to-pdf-issue/6597/4 "2024-04-15T02:24:22Z")

</div>

@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.

> **[W3Schools.com](https://www.w3schools.com/cssref/sel_firstline.php)**
>
> W3Schools offers free online tutorials, references and exercises in all the major languages of the web. Covering popular subjects like HTML, CSS, JavaScript, Python, SQL, Java, and many, many more.

---

<div class="post-metadata">

**Author:** ![Priyanka\_Boga](https://yyz2.discourse-cdn.com/pega/user_avatar/forums.pega.com/priyanka_boga/32/3726_2.png) [@Priyanka\_Boga](https://forums.pega.com/u/Priyanka_Boga)\
**Post date:** [April 21, 2024, 11:33am UTC](https://forums.pega.com/t/the-text-indent-not-work-when-use-activity-html-convert-to-pdf-issue/6597/5 "2024-04-21T11:33:11Z")

</div>

@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 &nbsp; in the correspondence rule for getting specific indent.

Thank you.
