jspdf.plugin.autoprint.js 483 B

123456789101112131415161718
  1. (function (jsPDFAPI) {
  2. 'use strict';
  3. jsPDFAPI.autoPrint = function () {
  4. 'use strict'
  5. var refAutoPrintTag;
  6. this.internal.events.subscribe('postPutResources', function () {
  7. refAutoPrintTag = this.internal.newObject()
  8. this.internal.write("<< /S/Named /Type/Action /N/Print >>", "endobj");
  9. });
  10. this.internal.events.subscribe("putCatalog", function () {
  11. this.internal.write("/OpenAction " + refAutoPrintTag + " 0" + " R");
  12. });
  13. return this;
  14. };
  15. })(jsPDF.API);