Skip to content

Commit

Permalink
Merge pull request parallax#528 from mfo/US/scaletofit
Browse files Browse the repository at this point in the history
fit(scaleToFit): add plugin that prevent scale to fit preview behaviour
  • Loading branch information
MrRio committed Feb 29, 2016
2 parents f88bef0 + b4c4bd4 commit c58ec6a
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions plugins/prevent_scale_to_fit.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
/**
* jsPDF Autoprint Plugin
*
* Licensed under the MIT License.
* http://opensource.org/licenses/mit-license
*/

(function (jsPDFAPI) {
'use strict';

jsPDFAPI.autoPrint = function () {
'use strict'
var refAutoPrintTag;

this.internal.events.subscribe('postPutResources', function () {
refAutoPrintTag = this.internal.newObject()
this.internal.write("<< /S/Named /Type/Action /N/Print >>", "endobj");
});

this.internal.events.subscribe("putCatalog", function () {
this.internal.write("/OpenAction " + refAutoPrintTag + " 0" + " R");
});
return this;
};
})(jsPDF.API);

0 comments on commit c58ec6a

Please sign in to comment.