Skip to main content

Notifications

Power Automate - Using Connectors
Answered

html to pdf font issue

(0) ShareShare
ReportReport
Posted on by 29

Hi I'm using the cloudmersive connector trying to convert an html to pdf using css styling but for some reason the font size doesn't stay as it should, 

 

this is my code:

 

<!DOCTYPE html>
<html>
<head>
<style>
 .fondo_imagen{
background: linear-gradient(rgba(255,255,255,.7), rgba(255,255,255,.8)), url("@{dataUri(outputs('Get_file_content_Fondo')?['body'])}");
height: 99%;
background-repeat: no-repeat;
background-size: 100% 100%;
font-family: 'Ropa Sans', sans-serif;
}
table{
width: 100%;
table-layout: fixed;
align-self: center;
page-break-inside: auto;
margin: auto;
}
table.center {
width: 100%;
table-layout: fixed;
align-self: center;
page-break-inside: auto;
margin: auto;
}
th, td {
 padding: 1px 4px;
}
th {
font-size: 12px;
color: white;
font-weight: bold;
background-color:#006414;
text-align: center;
border-radius: 10px;
}
td {
border:1px solid #000000;
font-size: 10px;
color: black;
border-radius: 5px;
text-align: center;
}

tbody>tr>*:nth-last-child(3)~*{ width:33.3%}
tbody>tr>*:nth-last-child(4)~*{ width:25%}
tbody>tr>*:nth-last-child(6)~*{ width:15%}

#footer {
text-align: center;
position: fixed;
bottom: 0;
width: 100%;
font-size: 6px;
height: 10px;/* Height of the footer */
}
@media all {
.page-break { display: none; }
}
@media print {
html, body {
border: 1px solid white;
height: 99%;
page-break-after: avoid;
page-break-before: avoid;
};
.page-break { display: block; page-break-before: always; };
}
h2{
font-weight: bold;
text-align: center;
font-size: 20px;
page-break-after: auto;
}
h6{
font-weight: bold;
text-align: right;
font-size: 10px;
}
.cuerpo3{
border-right:none;
border-left:none;
border-top:none;
border-bottom:none;
font-size:12px;
text-align:left;
}
.parrafo{
font-size: 10px;
text-align: justify;
font-weight: normal;
}
</style>
</head>
<body>
<div class="fondo_imagen">
<h2>NOTA</h2>
<h6> Fecha: @{formatDateTime(outputs('Get_item')?['body/Fecha_x0020_de_x0020_Atenci_x00f'], 'dd-MM-yyyy')}</h6>
<hr />
<hr/>

<h3 class="cuerpo3">TITLE1</h3>

<p class="parrafo">@{outputs('Get_item')?['body/1']}</p>

<h3 class="cuerpo3">TITLE2</h3>

<p class="parrafo">@{outputs('Get_item')?['body/2']}</p>

<h3 class="cuerpo3">TITLE3</h3>

 <p class="parrafo"> @{outputs('Get_item')?['body/3']}</p>

<h3 class="cuerpo3">TITLE4</h3>

<p class="parrafo">@{outputs('Get_item')?['body/4']}</p>

<hr/>

</p>
</body>
<div id="footer">--</div>
</div>
<div class="page-break"></div>
</html>
using visual code should display this: 
ManuelH_0-1684879978634.png

 

but from power automate displays like this

 

ManuelH_2-1684880229133.png

 

 

  • Verified answer
    ManuelH Profile Picture
    ManuelH 29 on at
    Re: html to pdf font issue

    I had to change my code and put the h and p inside a table

  • CFernandes Profile Picture
    CFernandes 8,146 on at
    Re: html to pdf font issue

    @ManuelH - I don't have access to cloudmersive connector (Its third party) can you please try to reach out to their support https://account.cloudmersive.com/contact-support 

     

    If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

     

    P.S. take a look at my blog here and like & subscribe to my YouTube Channel thanks.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Microsoft Kickstarter Events…

Register for Microsoft Kickstarter Events…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Announcing Forum Attachment Improvements!

We're excited to announce that attachments for replies in forums and improved…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 145,508

#2
RandyHayes Profile Picture

RandyHayes 76,287

#3
Pstork1 Profile Picture

Pstork1 64,839

Leaderboard

Featured topics