cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
GiovanniMugno
Regular Visitor

Issues converting HTML to PDF using Flow on the code

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
"<!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>
"
2 REPLIES 2
Anonymous
Not applicable

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
Regular Visitor

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

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Power Apps Community Call Jan. 2022 768x460.png

Power Apps Community Call

Please join us on Wednesday, January 19th, at 8a PDT. Come and learn from our amazing speakers!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Top Solution Authors
Top Kudoed Authors
Users online (2,773)