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

Generating PDFs from PowerApps Error

Dears, 
 I Saw this link https://kumopartners.com/generating-pdfs-from-powerapps/ .. 
when i try to run my flow ,

  20000.PNG40000.PNG

and this is my code : 

Set(tablehtml,"
<!DOCTYPE html>
<html>

<style>
table, tr, td {
border: 1px solid black;
border-collapse: collapse;
}
div {
font-weight:bold;
}


th, td {
padding: 5px;
text-align: center;

body {
height: 842px;
width: 595px;
/* to centre page on screen*/
margin-left: auto;
margin-right: auto;
}
page {
background: white;
display: block;
margin: 0 auto;
margin-bottom: 0.5cm;
box-shadow: 0 0 0.5cm rgba(0,0,0,0.5);
}
page[size=A4page] {
background: white;
display: block;
margin: 0 auto;
margin-bottom: 0.5cm;
box-shadow: 0 0 0.5cm rgba(0,0,0,0.5);
}
page[size='A4'] {
width: 21cm;
height: 29.7cm;
}
page[size='A4'][layout='landscape'] {
width: 29.7cm;
height: 21cm;
}
] {
width: 21cm;
height: 29.7cm;
}
page[size='A4'][layout='landscape'] {
width: 29.7cm;
height: 21cm;
}
@page :right {
margin-left: 4cm;
}
p.thicker {
font-weight: 900;
}
</style>
<page size='A4'></page>

<body>
<p align='center' style='margin-bottom: 0in; direction: center; line-height: 2px; widows: 2; orphans: 2; margin-top: 0.10in;'><span style='text-Align:center;' class='sd-abs-pos' style='position: center; width: 356px;'><img src='https://img.techpowerup.org/200910/tamkeen-removebg-preview.png' name='Picture 46' width='356' height='128' border='0'></span></p>
</div>
<p><br></p>

<p dir='RTL'>&nbsp;</p>

<p dir='RTL' style='text-align: center;'><strong><u>نموذج طلب مستلزمات</u></strong></p>
<p dir='RTL'>&nbsp;</p>
<p dir='RTL'>&nbsp;</p>
<p dir='RTL' class='thicker'>مقدم الطلب : "& ComboBox3_7.Selected.DisplayName &"&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; التاريخ: &nbsp; &nbsp; &nbsp;"& DatePicker1.SelectedDate &" &nbsp; &nbsp; &nbsp;&nbsp;</p>
<p dir='RTL'>&nbsp;</p>
<p dir='RTL' class='thicker' >الوظيفة : "& TextInput1.Text &" &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;الدائرة / الفرع / المكتب: "& TextInput1_1.Text &"</p>
<p dir='RTL'>&nbsp;</p>
<p dir='RTL'>&nbsp;</p>
<p dir='RTL' class='thicker' >السادة / دائرة الشؤون الإدارية المحترمين ،،،</p>
<p dir='RTL'>&nbsp;</p>
<p dir='RTL'>&nbsp;</p>
<p dir='RTL' class='thicker'>يرجى من حضرتكم توفير المستلزمات التالية:</p>
<p dir='RTL'>&nbsp;</p>
<p dir='RTL'>&nbsp;</p>
<div align='right'>

<table dir='rtl' class='thicker' text-align: 'center' width='100%' border = '1' width = '400' height = '150' cellpadding='5' style='border:1px solid black; padding: 20px; border-collapse:collapse'>" &
"<tr style='background-color:#efefef'>
<th> الوصف </th><th> الكمية </th><th> سبب الحاجة </th>
</tr>

<tr>" &
"<td>" & Dropdown2.Selected.ITEM_NAME & " </td>
<td>" & TextInput1_2.Text & " </td>
<td>" & TextInput1_3.Text & " </td></tr>

 


</table>

</body>

 

<div align='right'>


<p dir='RTL'>موافقة مدير الدائرة /الفرع / المكتب </p>

<P dir='rtl' class='RIGHT' style='margin-bottom: 0in' CLASS='western' STYLE='margin-bottom: 0in'><BR>
</P>
<p dir='RTL'>&nbsp;</p>
<TABLE WIDTH=648 CELLPADDING=7 CELLSPACING=0>
<COL WIDTH=400>
<TR>
<TD WIDTH=400 HEIGHT=63 VALIGN=TOP STYLE='border: 1px solid #00000a; padding-top: 0in; padding-bottom: 0in; padding-left: 0.08in; padding-right: 0.08in'>
<P dir='rtl' class='RIGHT' style='margin-bottom: 0in' CLASS='western' STYLE='margin-bottom: 0in'><BR>
</P>
<P dir='rtl' class='RIGHT' style='margin-bottom: 0in' CLASS='western' STYLE='margin-bottom: 0in'><FONT FACE='Angsana New'><FONT SIZE=3><SPAN LANG='ar-SA'><FONT FACE='Simplified Arabic'><FONT SIZE=4><B>السيد:
</B></FONT></FONT></SPAN></FONT></FONT><FONT FACE='Simplified Arabic, serif'><FONT SIZE=4><B>/
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;


</B></FONT></FONT><FONT FACE='Angsana New'><FONT SIZE=3><SPAN LANG='ar-SA'><FONT FACE='Simplified Arabic'><FONT SIZE=4><B>التوقيع</B></FONT></FONT></SPAN></FONT></FONT><FONT FACE='Simplified Arabic, serif'><FONT SIZE=4><B>:</B></FONT></FONT></P>

<P CLASS='western' STYLE='margin-bottom: 0in'><BR>
</P>
<P CLASS='western'><BR>
</P>
</TD>
</TR>
</TABLE>

</html>

");

Set(pdf,Downlod.Run(tablehtml));
Download(pdf.pdfreport)


Give this Error 
dsdddddd.PNG
Can anyone help me I just need to print a pdf report? 

regards 

1 REPLY 1
Advocate V
Advocate V

Greetings,

If you used a 3rd-party source to create your flow, I would start with them. It would not hurt to cast your fishing line into two spots.

 

Helpful resources

Announcements
Microsoft Ignite

Microsoft Ignite

Join digitally, March 2–4, 2021 to explore new tech that's ready to implement. Experience the keynote in mixed reality through AltspaceVR!

New Super Users

Meet the Power Automate Super Users!

Many congratulations to the Season 1 2021 Flownaut Crew!

Microsoft Ignite

Microsoft Power Platform: 2021 Release Wave 1 Plan

Power Platform release plan for the 2021 release wave 1 describes all new features releasing from April through September 2021.

MPA Community Blog

Power Automate Community Blog

Check out the community blog page where you can find valuable learning material from community and product team members!

Users online (22,328)