Hi All ,
I'm trying to export to pdf with pdfjs library a value field of a custom entity, But i was getting error "Xrm.Page.getAttribute(...) is not a function at pdf.html. Somenone can help me?
This is my code:
<!DOCTYPE html>
<html>
<head>
<script src="cdnjs.cloudflare.com/.../jspdf.min.js" integrity="sha384-B3ZwMLt/CqFLkq5omwYXeXs+qquHvXKcwP56Ue+09Fet7TmYmwk/35GWwejM5vWg" crossorigin="anonymous"></script>
<script src="cdn.static.runoob.com/.../jquery.min.js"></script>
<script src="cdnjs.cloudflare.com/.../jspdf.debug.js" integrity="sha384-THVO/sM0mFD9h7dfSndI6TS0PgAGavwKvB5hAxRRvc0o9cPLohB0wb/PTA7LdUHs" crossorigin="anonymous"></script>
<script type="text/javascript" src="../ClientGlobalContext.js.aspx"></script>
</head>
<body>
<div>
<button id="savepdf">
savepdf
</button>
</div>
<script>
const doc = new jsPDF();
let button = document.querySelector('button');
button.addEventListener('click', printPdf)
function printPdf()
{
var reasons = Xrm.Page.getAttribute("cdm_managereasons").getValue();
doc.text(10,10,'${reasons}$');
doc.save();
}
</script>
</body>
</html>
*This post is locked for comments
I have the same question (0)