cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Specoop
Level: Powered On

html to pdf conversion issue

Hello Flow Community! 

 

I'm attempting to convert a .HTML to a .PDF using (Shane Young's method). Here's my flow.

1.jpg

 

When I run it, it creates a beautiful HTML (left side image below). Works perfectly.

 

My issue: When I click on the .PDF (right side image below), it gives me an incomplete table that doesn't look as expected. 

 

2.jpg

 

Full disclosure - this is my first HTML - so my HTML may be the issue...but I've tried a bunch of stull (taking out the styling etc.) and just can't get it anywhere close.

 

Any guidance would be much appreciated.

 

Here's the full Step 2 of the flow:

 

concat('<!DOCTYPE html>
<html>
<head>
<style>
table, th, td {
padding: 3px;
}
table#main {
border: 1.5px solid black;
border-collapse: collapse;
width: 85%;
}
table#main th, td {
border: 1px solid black;
border-collapse: collapse;
}

{table#signature {
width: 80%
}

</style>
</head>
<body>
<center>
<b> Monthly Inspection Report </b>
<br>
<EM>Inspection performed by certified personnel at least once per month</EM>
<br><br>
<table id="main">
<tr>
<th colspan="4">Project Information </th></tr>
<tr>
<td>Date: </td>
<td><em><center> POWERAPPS </center></em> </td>
<td>Project Name:</td>
<td><em><center> POWERAPPS </center> </em> </td></tr>
<tr>
<td colspan="4">Project Location:<em> POWERAPPS </em></td></tr>
<tr>
<th colspan="4">Inspection Observations</th>
<tr>
<td rowspan="2">Rainfall within past 24 hours (inches):</td>
<td rowspan="2"><em><center> POWERAPPS </center></em></td>
<td> Is rainfall greater than 0.5 inches?: </td>
<td><EM><center> POWERAPPS </center> </EM></td>
 
<tr>
<td> Inspection Required </td>
<td> <em><center> Yes </center> </em></td> </tr>
<tr>
<th colspan="4">Inspection Observations</th></tr>
<tr>
<td colspan="4"> Areas that have undergone final stabilization:</td></tr>
<tr>
<td colspan="3"> Are all permanent stabilization controls contained in Plan in place? </td>
<td colspan="1"> <em><center> POWERAPPS </center></em></td></tr>
<tr>
<td colspan="4"> If no, describe the location(s) of deficiencies and corrective actions that must be taken: </td></tr>
<tr>
<td colspan="4", height="70"> <em><center> POWERAPPS </center></em> </td></tr>
<tr>
<td colspan="4"> Other Observations: </td> </tr>
<tr>
<td colspan="3"> Are pollutants entering the drainage system or receiving waters? </td>
<td colspan="1"> <em><center> POWERAPPS </center></em></td> </tr>
<tr>
<td colspan="4"> If yes, describe the location(s) and the corrective actions that must be taken.</td> </tr>
<tr>
<td colspan="4", height="50"> <em><center> POWERAPPS </center></em></td></tr>
<tr>
<td colspan="3"> Are all erosion and sediment control measures operating properly? </td>
<td colspan="1"> <em><center> POWERAPPS </center></em></td></tr>
<tr>
<td colspan="4"> If no, describe the location(s) and the corrective actions that must be taken.</td></tr>
<tr>
<td colspan="4", height="50"> <em><center> POWERAPPS </center></em> </td> </tr>
<tr>
<td colspan="4"> Other Observations: <em> POWERAPPS </em> </td> </tr>
<tr>
<td colspan="4", height="70"> <em><center> POWERAPPS </center> </em> </td> </tr>
<tr>
<td colspan="2"> Is an Erosion, Sedimentation and Pollution Control Plan revision required?</td>
<td colspan="1"> <em><center> POWERAPPS </center></em> </td>
<td colspan="1"> <center> Date of Revision:<em> POWERAPPS </em></center> </td></tr>
<tr>
<td colspan="4"> Corrective Actions and Date</td></tr>
<tr>
<td colspan="4", height="70"> <em><center> POWERAPPS </center></em></td></tr>
</table>
<br> <br>

<table id="signature">
 
<tr>
<th colspan="2", height="20"> POWERAPPS </th>
<th colspan="2", height="20"> POWERAPPS </th> </tr>
<tr>
<th colspan="2">__________________________________ </th>
<th colspan="2">__________________________________</th> </tr>
<tr>
<th colspan="2">Signature of Certified Personnel </th>
<th colspan="2">Printed Name of Certified Personnel</th> </tr>
</table>
</center>
</body>
</html>
')

 

 

Thanks again for the support and the community.

 

Best,

Spencer

1 ACCEPTED SOLUTION

Accepted Solutions
Super User
Super User

Re: html to pdf conversion issue

Hi @Specoop

 

I managed to get your HTML closer to what you want, there were some issues with <tr> tags, though its still not perfect. For some reason the second table doesn't display when converted to the PDF.

 

<html>
	<head>
		<style>

#main {
border: 1.5px solid black;
border-collapse: collapse;
width: 85%;
margin-left: auto;
margin-right: auto;
}

#main th, #main td {
border: 1px solid black;
border-collapse: collapse;
}

#signature {
width: 80%;
margin-left: auto;
margin-right: auto;
}

		</style>
	</head>
	<body>
		<center>
			<b> Monthly Inspection Report </b>
			<br>
				<EM>Inspection performed by certified personnel at least once per month</EM>
				<br>
					<br>
						<table id="main">
							<tr>
								<th colspan="4">Project Information </th>
							</tr>
							<tr>
								<td>Date: </td>
								<td>
									<em>
										<center> POWERAPPS </center>
									</em>
								</td>
								<td>Project Name:</td>
								<td>
									<em>
										<center> POWERAPPS </center>
									</em>
								</td>
							</tr>
							<tr>
								<td colspan="4">Project Location:<em> POWERAPPS </em>
								</td>
							</tr>
							<tr>
								<th colspan="4">Inspection Observations</th>
							</tr>
							<tr>
								<td rowspan="2">Rainfall within past 24 hours (inches):</td>
								<td rowspan="2">
									<em>
										<center> POWERAPPS </center>
									</em>
								</td>
								<td> Is rainfall greater than 0.5 inches?: </td>
								<td>
									<EM>
										<center> POWERAPPS </center>
									</EM>
								</td>
							</tr>
							<tr>
								<td> Inspection Required </td>
								<td>
									<em>
										<center> Yes </center>
									</em>
								</td>
							</tr>
							<tr>
								<th colspan="4">Inspection Observations</th>
							</tr>
							<tr>
								<td colspan="4"> Areas that have undergone final stabilization:</td>
							</tr>
							<tr>
								<td colspan="3"> Are all permanent stabilization controls contained in Plan in place? </td>
								<td colspan="1">
									<em>
										<center> POWERAPPS </center>
									</em>
								</td>
							</tr>
							<tr>
								<td colspan="4"> If no, describe the location(s) of deficiencies and corrective actions that must be taken: </td>
							</tr>
							<tr>
								<td colspan="4", height="70">
									<em>
										<center> POWERAPPS </center>
									</em>
								</td>
							</tr>
							<tr>
								<td colspan="4"> Other Observations: </td>
							</tr>
							<tr>
								<td colspan="3"> Are pollutants entering the drainage system or receiving waters? </td>
								<td colspan="1">
									<em>
										<center> POWERAPPS </center>
									</em>
								</td>
							</tr>
							<tr>
								<td colspan="4"> If yes, describe the location(s) and the corrective actions that must be taken.</td>
							</tr>
							<tr>
								<td colspan="4", height="50">
									<em>
										<center> POWERAPPS </center>
									</em>
								</td>
							</tr>
							<tr>
								<td colspan="3"> Are all erosion and sediment control measures operating properly? </td>
								<td colspan="1">
									<em>
										<center> POWERAPPS </center>
									</em>
								</td>
							</tr>
							<tr>
								<td colspan="4"> If no, describe the location(s) and the corrective actions that must be taken.</td>
							</tr>
							<tr>
								<td colspan="4", height="50">
									<em>
										<center> POWERAPPS </center>
									</em>
								</td>
							</tr>
							<tr>
								<td colspan="4"> Other Observations: <em> POWERAPPS </em>
								</td>
							</tr>
							<tr>
								<td colspan="4", height="70">
									<em>
										<center> POWERAPPS </center>
									</em>
								</td>
							</tr>
							<tr>
								<td colspan="2"> Is an Erosion, Sedimentation and Pollution Control Plan revision required?</td>
								<td colspan="1">
									<em>
										<center> POWERAPPS </center>
									</em>
								</td>
								<td colspan="1">
									<center> Date of Revision:<em> POWERAPPS </em>
									</center>
								</td>
							</tr>
							<tr>
								<td colspan="4"> Corrective Actions and Date</td>
							</tr>
							<tr>
								<td colspan="4", height="70">
									<em>
										<center> POWERAPPS </center>
									</em>
								</td>
							</tr>

						</table>
						<br>
							<br>

								<table id="signature">

									<tr>
										<th colspan="2", height="20"> POWERAPPS </th>
										<th colspan="2", height="20"> POWERAPPS </th>
									</tr>

									<tr>
										<th colspan="2">__________________________________ </th>
										<th colspan="2">__________________________________</th>
									</tr>
									<tr>
										<th colspan="2">Signature of Certified Personnel </th>
										<th colspan="2">Printed Name of Certified Personnel</th>
									</tr>
									<tr>

									</table>
								</center>
							</body>
						</html>

Did I answer your question? Mark my post as a solution!

Proud to be a Flownaut!


View solution in original post

6 REPLIES 6
Community Support Team
Community Support Team

Re: html to pdf conversion issue

Hi @Specoop,

 

I am afraid that there might be something wrong with the HTML table code you are using in Step 2.

When testing with the code you provided on my side, both the html file and pdf file display the same incomplete table as you mentioned.

However, it works fine when using the following example code:

 

concat('<!DOCTYPE html>

<html>

<head>

<style>

table {

  font-family: arial, sans-serif;

  border-collapse: collapse;

  width: 100%;

}

 

td, th {

  border: 1px solid #dddddd;

  text-align: left;

  padding: 8px;

}

 

tr:nth-child(even) {

  background-color: #dddddd;

}

</style>

</head>

<body>

 

<h2>HTML Table</h2>

 

<table>

  <tr>

    <th>Company</th>

    <th>Contact</th>

    <th>Country</th>

  </tr>

  <tr>

    <td>Alfreds Futterkiste</td>

    <td>Maria Anders</td>

    <td>Germany</td>

  </tr>

  <tr>

    <td>Centro comercial Moctezuma</td>

    <td>Francisco Chang</td>

    <td>Mexico</td>

  </tr>

  <tr>

    <td>Ernst Handel</td>

    <td>Roland Mendel</td>

    <td>Austria</td>

  </tr>

  <tr>

    <td>Island Trading</td>

    <td>Helen Bennett</td>

    <td>UK</td>

  </tr>

  <tr>

    <td>Laughing Bacchus Winecellars</td>

    <td>Yoshi Tannamuri</td>

    <td>Canada</td>

  </tr>

  <tr>

    <td>Magazzini Alimentari Riuniti</td>

    <td>Giovanni Rovelli</td>

    <td>Italy</td>

  </tr>

</table>

 

</body>

</html>

')

 

Please check your HTML table code and try again with it.

 

Best regards,

Mabel

 

Community Support Team _ Mabel Mao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Specoop
Level: Powered On

Re: html to pdf conversion issue

Thank you Mabel!

 

I tried your provided example 

 

 

Here's the HTML (looks great)

3.jpg

 

Here's the PDF (missing styling)

4.jpg

Does yours lose formatting also when it converts?

 

Thanks again,

Community Support Team
Community Support Team

Re: html to pdf conversion issue

Hi @Specoop,

 

Both the HTML file and PDF file are in the same format likes below:

1.PNG 

 

Best regards,

Mabel

 

Community Support Team _ Mabel Mao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Super User
Super User

Re: html to pdf conversion issue

Hi @Specoop

 

I managed to get your HTML closer to what you want, there were some issues with <tr> tags, though its still not perfect. For some reason the second table doesn't display when converted to the PDF.

 

<html>
	<head>
		<style>

#main {
border: 1.5px solid black;
border-collapse: collapse;
width: 85%;
margin-left: auto;
margin-right: auto;
}

#main th, #main td {
border: 1px solid black;
border-collapse: collapse;
}

#signature {
width: 80%;
margin-left: auto;
margin-right: auto;
}

		</style>
	</head>
	<body>
		<center>
			<b> Monthly Inspection Report </b>
			<br>
				<EM>Inspection performed by certified personnel at least once per month</EM>
				<br>
					<br>
						<table id="main">
							<tr>
								<th colspan="4">Project Information </th>
							</tr>
							<tr>
								<td>Date: </td>
								<td>
									<em>
										<center> POWERAPPS </center>
									</em>
								</td>
								<td>Project Name:</td>
								<td>
									<em>
										<center> POWERAPPS </center>
									</em>
								</td>
							</tr>
							<tr>
								<td colspan="4">Project Location:<em> POWERAPPS </em>
								</td>
							</tr>
							<tr>
								<th colspan="4">Inspection Observations</th>
							</tr>
							<tr>
								<td rowspan="2">Rainfall within past 24 hours (inches):</td>
								<td rowspan="2">
									<em>
										<center> POWERAPPS </center>
									</em>
								</td>
								<td> Is rainfall greater than 0.5 inches?: </td>
								<td>
									<EM>
										<center> POWERAPPS </center>
									</EM>
								</td>
							</tr>
							<tr>
								<td> Inspection Required </td>
								<td>
									<em>
										<center> Yes </center>
									</em>
								</td>
							</tr>
							<tr>
								<th colspan="4">Inspection Observations</th>
							</tr>
							<tr>
								<td colspan="4"> Areas that have undergone final stabilization:</td>
							</tr>
							<tr>
								<td colspan="3"> Are all permanent stabilization controls contained in Plan in place? </td>
								<td colspan="1">
									<em>
										<center> POWERAPPS </center>
									</em>
								</td>
							</tr>
							<tr>
								<td colspan="4"> If no, describe the location(s) of deficiencies and corrective actions that must be taken: </td>
							</tr>
							<tr>
								<td colspan="4", height="70">
									<em>
										<center> POWERAPPS </center>
									</em>
								</td>
							</tr>
							<tr>
								<td colspan="4"> Other Observations: </td>
							</tr>
							<tr>
								<td colspan="3"> Are pollutants entering the drainage system or receiving waters? </td>
								<td colspan="1">
									<em>
										<center> POWERAPPS </center>
									</em>
								</td>
							</tr>
							<tr>
								<td colspan="4"> If yes, describe the location(s) and the corrective actions that must be taken.</td>
							</tr>
							<tr>
								<td colspan="4", height="50">
									<em>
										<center> POWERAPPS </center>
									</em>
								</td>
							</tr>
							<tr>
								<td colspan="3"> Are all erosion and sediment control measures operating properly? </td>
								<td colspan="1">
									<em>
										<center> POWERAPPS </center>
									</em>
								</td>
							</tr>
							<tr>
								<td colspan="4"> If no, describe the location(s) and the corrective actions that must be taken.</td>
							</tr>
							<tr>
								<td colspan="4", height="50">
									<em>
										<center> POWERAPPS </center>
									</em>
								</td>
							</tr>
							<tr>
								<td colspan="4"> Other Observations: <em> POWERAPPS </em>
								</td>
							</tr>
							<tr>
								<td colspan="4", height="70">
									<em>
										<center> POWERAPPS </center>
									</em>
								</td>
							</tr>
							<tr>
								<td colspan="2"> Is an Erosion, Sedimentation and Pollution Control Plan revision required?</td>
								<td colspan="1">
									<em>
										<center> POWERAPPS </center>
									</em>
								</td>
								<td colspan="1">
									<center> Date of Revision:<em> POWERAPPS </em>
									</center>
								</td>
							</tr>
							<tr>
								<td colspan="4"> Corrective Actions and Date</td>
							</tr>
							<tr>
								<td colspan="4", height="70">
									<em>
										<center> POWERAPPS </center>
									</em>
								</td>
							</tr>

						</table>
						<br>
							<br>

								<table id="signature">

									<tr>
										<th colspan="2", height="20"> POWERAPPS </th>
										<th colspan="2", height="20"> POWERAPPS </th>
									</tr>

									<tr>
										<th colspan="2">__________________________________ </th>
										<th colspan="2">__________________________________</th>
									</tr>
									<tr>
										<th colspan="2">Signature of Certified Personnel </th>
										<th colspan="2">Printed Name of Certified Personnel</th>
									</tr>
									<tr>

									</table>
								</center>
							</body>
						</html>

Did I answer your question? Mark my post as a solution!

Proud to be a Flownaut!


View solution in original post

Specoop
Level: Powered On

Re: html to pdf conversion issue

Thank you both!

LeeHarris, you're updated code got me there (or at least really darn close).  I really appreciate the help.

 

See below for final code on second table that appeared in both the HTML and PDF.

 

You're awesome! Sending you a PM.

 

<table id="signature">

<tr>

<th> POWERAPPS </th>

<th> POWERAPPS </th>

</tr>

<tr><th>__________________________________ </th>                                                                                                                                                <th>__________________________________</th>

</tr>

<tr>

<th>Signature of Certified Personnel </th>

<th>Printed Name of Certified Personnel</th>

</tr>

</table>

</center>

</body>

</html>

Jcole429
Level: Powered On

Re: html to pdf conversion issue

I'm experiencing a similar issue. I can't get one of my rowspans to format properly when converted to a pdf through flow. It looks perfectly fine when using an online html viewer

 

Here is the resulting code from my powerapp

<style>
    table,
    th,
    td {
        border-style: solid;
        border-width: 1px;
        text-align: left;
        border-collapse: collapse;
        padding: 10px 5px;
    }
    
    .noborder {
        border-style: none;
    }
</style>
<h1>T-Mobile</h1>
<h2>DRIVER'S VEHICLE INSPECTION REPORT</h2>
<div>AS REQUIRED BY THE D.O.T FEDERAL MOTOR CARRIER SAFETY REGULATIONS</div>
<br>
<div><b>MARKET LOCATION: </b>AL</div>
<div><b>DRIVER'S NAME: </b>Justin Cole</div>
<div><b>Date: </b>7/10/2019<b> Time: </b>15:02</div>
<div><b>Truck/SUV NO.: </b>51651<b> ODOMETER READING: </b>6541</div>
<div><font SIZE='.1'>CHECK ANY DEFECTIVE ITEM AND GIVE DETAILS UNDER 'REMARKS'</font></div>
<table class='tg'>
    <tr>
        <td></td>
        <td>Air Compressor</td>
        <td></td>
        <td>Front Axle</td>
        <td rowspan='6'></td>
        <td rowspan='6'>Safety Equipment
            <ul>
                <li>Fire Extinguisher</li>
                <li>Flags - Flares - Fuses</li>
                <li>Reflective Triangles</li>
                <li>Spare Bulbs and Fuses</li>
                <li>Spare Seal Beam</li>
            </ul>
        </td>
    </tr>
    <tr>
        <td></td>
        <td>Air Lines</td>
        <td></td>
        <td>Fuel Tanks</td>
    </tr>
    <tr>
        <td></td>
        <td>Battery</td>
        <td></td>
        <td>Horn</td>
    </tr>
    <tr>
        <td></td>
        <td>Belts and Hoses</td>
        <td rowspan='5'></td>
        <td rowspan='5'>Lights
            <ul>
                <li>Head/Stop</li>
                <li>Tail/Dash</li>
                <li>Turn Indicators</li>
                <li>Clearance/Marker</li>
            </ul>
        </td>
    </tr>
    <tr>
        <td></td>
        <td>Body</td>
    </tr>
    <tr>
        <td></td>
        <td>Brake Accessories</td>
    </tr>
    <tr>
        <td>X</td>
        <td>Brakes, Parking</td>
        <td></td>
        <td>Starter</td>
    </tr>
    <tr>
        <td></td>
        <td>Brakes, Service</td>
        <td>X</td>
        <td>Steering</td>
    </tr>
    <tr>
        <td></td>
        <td>Clutch</td>
        <td></td>
        <td>Mirrors</td>
        <td></td>
        <td>Suspension System</td>
    </tr>
    <tr>
        <td></td>
        <td>Coupling Devices</td>
        <td></td>
        <td>Muffler</td>
        <td></td>
        <td>Tire Chains</td>
    </tr>
    <tr>
        <td></td>
        <td>Defroster/Heater</td>
        <td></td>
        <td>Oil Pressure</td>
        <td></td>
        <td>Tires</td>
    </tr>
    <tr>
        <td></td>
        <td>Drive Line</td>
        <td>X</td>
        <td>radiator</td>
        <td>X</td>
        <td>Transmission</td>
    </tr>
    <tr>
        <td>X</td>
        <td>Engine</td>
        <td></td>
        <td>Rear End</td>
        <td></td>
        <td>Trip Recorder</td>
    </tr>
    <tr>
        <td></td>
        <td>Exhaust</td>
        <td></td>
        <td>Reflectors</td>
        <td></td>
        <td>Wheels and Rims</td>
    </tr>
    <tr>
        <td></td>
        <td>Fifth Wheel</td>
        <td></td>
        <td></td>
        <td></td>
        <td>Windows</td>
    </tr>
    <tr>
        <td></td>
        <td>Fluid Levels</td>
        <td></td>
        <td></td>
        <td>X</td>
        <td>Windshield Wipers</td>
    </tr>
    <tr>
        <td></td>
        <td>Frame and Assembly</td>
        <td></td>
        <td></td>
        <td></td>
        <td>Other</td>
    </tr>
</table>
<div><b>Trailer Num: </b>84916</div>
<table class='tg'>
    <tr>
        <td></td>
        <td>Brake Connections</td>
        <td></td>
        <td>Hitch</td>
        <td></td>
        <td>Suspension System</td>
    </tr>
    <tr>
        <td></td>
        <td>Brakes</td>
        <td></td>
        <td>Landing Gear</td>
        <td>X</td>
        <td>Tarpaulin</td>
    </tr>
    <tr>
        <td>X</td>
        <td>Coupling Devices</td>
        <td></td>
        <td>Lights - All</td>
        <td></td>
        <td>Tires</td>
    </tr>
    <tr>
        <td></td>
        <td>Coupling (King) Pin</td>
        <td>X</td>
        <td>Reflectors/Reflective Tape</td>
        <td></td>
        <td>Wheels and Rims</td>
    </tr>
    <tr>
        <td></td>
        <td>Doors</td>
        <td></td>
        <td>Roof</td>
        <td></td>
        <td>Other</td>
    </tr>
</table>
<div><b>REMARKS: </b>These are my remarks</div>
<div>
    <table class='noborder'>
        <tr class='noborder'>
            <td class='noborder'>
                <table>
                    <tr>
                        <td></td>
                    </tr>
                </table>
            </td>
            <td class='noborder'>CONDITION OF THE ABOVE VEHICLE IS SATISFACTORY</td>
    </table>
</div>
<div><b>Driver's Signature:</b>_______________________________________</div>
<div>
    <table class='noborder'>
        <tr class='noborder'>
            <td class='noborder'>
                <table>
                    <tr>
                        <td>X</td>
                    </tr>
                </table>
            </td>
            <td class='noborder'> ABOVE DEFECTS CORRECTED</td>
    </table>
</div>
<div>
    <table class='noborder'>
        <tr class='noborder'>
            <td class='noborder'>
                <table>
                    <tr>
                        <td></td>
                    </tr>
                </table>
            </td>
            <td class='noborder'>ABOVE DEFECTS NEED NOT BE CORRECTED FOR SAFE OPERATION OF VEHICLE</td>
    </table>
</div>
<div><b>Mechanic's Signature:</b>____________________________<b>Date:</b>__________</div>
<div><b>Driver's Signature:</b>______________________________<b>Date:</b>__________</div>

Helpful resources

Announcements
thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

firstImage

Incoming: New and improved badges!

We've given our badges an overhaul and also added some brand new ones!

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

sixthImage

Power Platform World Tour

Find out where you can attend!

seventhimage

Webinars & Video Gallery

Watch & learn from the Power Automate Community Video Gallery!

Top Kudoed Authors
Users Online
Currently online: 445 members 6,583 guests
Please welcome our newest community members: