web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Issues converting HTML...
Power Apps
Unanswered

Issues converting HTML to PDF using Flow on the code

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

My problem is that I tried to make a HTML to pass it to PDF with a flow based on shane's young,  the thing is, i need to separate some bars from anothers to give the PDF a more appealing look, and to center all the tables in the middle, aditional, i need to put a logo on top of the PDF, i know the problem is in my HTML code, because the .html file that generates in my onedrive it's totally fine and looks like i wants to:

1.jpg








And it's totally fine (the width of the table it's because it's set on 80% but on paper it should look just fine), the problem comes when it converts to PDF:

2.jpg
It just sticks to the left, don't center in the paper,  and the <br/> doesn't work, on top of that, if i put an <img> to put the logo on the beggining of the PDF, it shows the image missing (i mean, the white box with a red X on it), so, summarizing, i need to:

  • Center all the tables.
  • Put a space between each <th> (the blue titles).
  • Put a image on top of the tables.

This is the HTML im using:

Spoiler (Highlight to read)
"<!DOCTYPE html>
<html>
<head>
<style>
table, th, td {
 border: 0px solid black;
}
th{
background-color:#00b0f0;
}
tr{
background-color: blue;
}
td{
width: 50%;
background-color: #92d050;
}
table{
width: 80%;
background-color: black;
margin: 0 auto; 
}
</style>
</head>
<body>
<br/>
<p align=center> </p>
<center>
<table align=center>
<tr>
 <th>" & Sede_PDF & " " & Ubicacion_PDF & "</th>
</tr>
</table>

<table align=center>
<br/>
<tr>
 <th colspan=""2"">CPU</th>
</tr>
 <tr>
 <td>Código</td>
 <td style='background-color:white'>" & CPC & "</td>
 </tr>
 <tr>
 <td>Marca</td>
 <td style='background-color:white'>" & Marca_PDF & "</td>
 </tr>
 <tr>
 <td>Procesador</td>
 <td style='background-color:white'>" & Procesador_PDF & "</td>
 </tr>
 <tr>
 <td>RAM</td>
 <td style='background-color:white'>" & RAM_PDF & "</td>
 </tr>
 <tr>
 <td>Unidad DVD</td>
 <td style='background-color:white'>" & Marca_PDF & "</td>
 </tr>
 <tr>
 <td>Windows</td>
 <td style='background-color:white'>" & 'S.O_PDF' & "</td>
 </tr>
 <tr>
 <td>Office</td>
 <td style='background-color:white'>" & Office_PDF & "</td>
 </tr>
 <tr>
 <td >Disco duro</td>
 <td style='background-color:white'>" & Disco_duro_PDF & "</td>
 </tr>
</table>

<table align=center>
<br/>
 <tr>
 <th colspan=""2"">Monitor</th>
 </tr>
 <tr>
 <td>Marca</td>
 <td style='background-color:white'>" & Marca_Monitor_PDF & "</td>
 </tr>
 <tr>
 <td>Serial</td>
 <td style='background-color:white'>" & Monitor_PDF & "</td>
 </tr>
</table>

<table align=center>
<br/>
 <tr>
 <th colspan=""2"">Teclado</th>
 </tr>
 <tr>
 <td>Marca</td>
 <td style='background-color:white'>" & Marca_Teclado_PDF & "</td>
 </tr>
 <tr>
 <td>Serial</td>
 <td style='background-color:white'>" & Teclado_PDF & "</td>
 </tr>
</table>

<table align=center>
<br/>
 <tr>
 <th colspan=""2"">Mouse</th>
 </tr>
 <tr>
 <td>Marca</td>
 <td style='background-color:white'>" & Marca_Mouse_PDF & "</td>
 </tr>
 <tr>
 <td>Serial</td>
 <td style='background-color:white'>" & Mouse_PDF & "</td>
 </tr>
</table>
</center>
<br/>
</body>
</html>
"
"<!DOCTYPE html> <html> <head> <style> table, th, td { border: 0px solid black; } th{ background-color:#00b0f0; } tr{ background-color: blue; } td{ width: 50%; background-color: #92d050; } table{ width: 80%; background-color: black; margin: 0 auto; } </style> </head> <body> <br/> <p align=center> </p> <center> <table align=center> <tr> <th>" & Sede_PDF & " " & Ubicacion_PDF & "</th> </tr> </table> <table align=center> <br/> <tr> <th colspan=""2"">CPU</th> </tr> <tr> <td>Código</td> <td style='background-color:white'>" & CPC & "</td> </tr> <tr> <td>Marca</td> <td style='background-color:white'>" & Marca_PDF & "</td> </tr> <tr> <td>Procesador</td> <td style='background-color:white'>" & Procesador_PDF & "</td> </tr> <tr> <td>RAM</td> <td style='background-color:white'>" & RAM_PDF & "</td> </tr> <tr> <td>Unidad DVD</td> <td style='background-color:white'>" & Marca_PDF & "</td> </tr> <tr> <td>Windows</td> <td style='background-color:white'>" & 'S.O_PDF' & "</td> </tr> <tr> <td>Office</td> <td style='background-color:white'>" & Office_PDF & "</td> </tr> <tr> <td >Disco duro</td> <td style='background-color:white'>" & Disco_duro_PDF & "</td> </tr> </table> <table align=center> <br/> <tr> <th colspan=""2"">Monitor</th> </tr> <tr> <td>Marca</td> <td style='background-color:white'>" & Marca_Monitor_PDF & "</td> </tr> <tr> <td>Serial</td> <td style='background-color:white'>" & Monitor_PDF & "</td> </tr> </table> <table align=center> <br/> <tr> <th colspan=""2"">Teclado</th> </tr> <tr> <td>Marca</td> <td style='background-color:white'>" & Marca_Teclado_PDF & "</td> </tr> <tr> <td>Serial</td> <td style='background-color:white'>" & Teclado_PDF & "</td> </tr> </table> <table align=center> <br/> <tr> <th colspan=""2"">Mouse</th> </tr> <tr> <td>Marca</td> <td style='background-color:white'>" & Marca_Mouse_PDF & "</td> </tr> <tr> <td>Serial</td> <td style='background-color:white'>" & Mouse_PDF & "</td> </tr> </table> </center> <br/> </body> </html> "
Categories:
I have the same question (0)
  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    don't, just don't.

     

    the pdf converter shane uses is not far enough for nice creation of pdf's.

    i spend a lot of time to it, but it isn't really stable..

     

    If you can/must, try to use an email or other platform (excel whatever) instead.

  • vamorris Profile Picture
    4 on at

    Hi, I also was habving issues generating the PDF.

    I found that the HTML has to be REALLY well formed for the PDF converter to work - so check your hmtl result file in an HTML checker...

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 534

#2
WarrenBelz Profile Picture

WarrenBelz 416 Most Valuable Professional

#3
Valantis Profile Picture

Valantis 306

Last 30 days Overall leaderboard