forked from parallax/jsPDF
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request parallax#528 from mfo/US/scaletofit
fit(scaleToFit): add plugin that prevent scale to fit preview behaviour
- Loading branch information
Showing
1 changed file
with
25 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); |