Skip to Main Content

APEX

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Why QR Code not able to appear in PDF file but appear on screen ?

User_W8CACMar 1 2021

Hi,
I am newbie in Oracle Apex.
I create a report that display QR code in PDF file but unfortunately the QR code only display on screen but not inside PDF file. (see screen shot). Any expert can help ?
QR code display on screen
report_on_screen.jpgQR code disappear inside PDF file.
PDF_report.jpgHere is the javascript:
/*Start*/
htp.p('<style>
#PDF{
font-family: "Trebuchet MS", Arial, Helvetica, sans-serif;
border-collapse: collapse;
width: 100%
}

#pdf td, #pdf th{
border:1px solid #ddd;
padding: 8px;
}

#pdf tr:nth-child(even){background-color: #f2f2f2;}

#pdf tr:hover{background-color: #ddd;}

#pdf th {
padding-top: 12px;
padding-bottom: 12px;
text-align: left;
backgound-color:#4CAF50;
color: white;
}

</style>');

htp.p('<table id="PDF">
<tr>
<th>Training session</th>
<th>Company name</th>
<th>Contractor</th>
<th>IC</th>
<th>Passport</th>
<th>DoB</th>
<th>qrCODE</th>
</tr>');

for x in (select trainingsession,companyname,contractor,ic,passport,qrcode,dob,emailaddress from EHS_T_TRAININGCONFIRMATION)
loop

htp.p('<tr>
<td>'||htf.escape_sc(x.trainingsession)||'</td>
<td>'||htf.escape_sc(x.companyname)||'</td>
<td>'||htf.escape_sc(x.contractor)||'</td>
<td>'||htf.escape_sc(x.ic)||'</td>
<td>'||htf.escape_sc(x.passport)||'</td>
<td>'||htf.escape_sc(x.dob)||'</td>
<td><img src="https://zxing.org/w/chart?cht=qr&chs=120x120&chld=M&choe=UTF-8&chl='||htf.escape_sc(x.qrcode)||'" alt="" border=3 height=100 width=100></img></td>
</tr>');
end loop;

htp.p('</table>');

--- Button
htp.p('<input type="button" id="btnExport" value="Export" onclick="Export()" />
<script type="text/javascript"
src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.1.70/pdfmake.min.js"></script>
<script type="text/javascript"
src="https://cdnjs.cloudflare.com/ajax/libs/html2canvas/0.4.1/html2canvas.min.js"></script>');
/* End */

Comments
Post Details
Added on Mar 1 2021
2 comments
978 views