Skip to content

Commit b4c4bd4

Browse files
mfomfo
authored andcommitted
fit(scaleToFit): add plugin that prevent scale to fit preview behaviour
1 parent 653f94a commit b4c4bd4

1 file changed

Lines changed: 25 additions & 0 deletions

File tree

plugins/prevent_scale_to_fit.js

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
/**
2+
* jsPDF Autoprint Plugin
3+
*
4+
* Licensed under the MIT License.
5+
* http://opensource.org/licenses/mit-license
6+
*/
7+
8+
(function (jsPDFAPI) {
9+
'use strict';
10+
11+
jsPDFAPI.autoPrint = function () {
12+
'use strict'
13+
var refAutoPrintTag;
14+
15+
this.internal.events.subscribe('postPutResources', function () {
16+
refAutoPrintTag = this.internal.newObject()
17+
this.internal.write("<< /S/Named /Type/Action /N/Print >>", "endobj");
18+
});
19+
20+
this.internal.events.subscribe("putCatalog", function () {
21+
this.internal.write("/OpenAction " + refAutoPrintTag + " 0" + " R");
22+
});
23+
return this;
24+
};
25+
})(jsPDF.API);

0 commit comments

Comments
 (0)