Export to PDF and modify generated PDF

Export and print

by Juan Muñoz

HTML

<link rel="stylesheet" href="https://s3.amazonaws.com/flexmonster/2.3/demo.css">
<script src="https://cdn.flexmonster.com/flexmonster.js"></script>

<button onclick="pdf()">Export to PDF and modify generated PDF</button>
<div id="pivot-container">
  
  
</div>

JavaScript

var pivot = new Flexmonster({
	container: "pivot-container",
  componentFolder: "https://cdn.flexmonster.com/",
  width: "100%",
  height: 430
  
});

function pdf() {
  pivot.exportTo("pdf", { destinationType: "plain" }, function(res) {
    var pdf = res.data;
    pdf.addPage();
    pdf.text('Hello world!', 10, 10);
    pdf.save(res.filename);
  });
}