File tree Expand file tree Collapse file tree 5 files changed +44
-3
lines changed Expand file tree Collapse file tree 5 files changed +44
-3
lines changed Original file line number Diff line number Diff line change
1
+ # Summary
2
+
3
+ * [ Getting Started] ( docs/getting_started.md )
4
+
Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " jspdf" ,
3
- "version" : " 1.1.135" ,
4
3
"homepage" : " https://github.com/mrrio/jspdf" ,
5
4
"description" : " PDF Document creation from JavaScript" ,
6
5
"main" : " dist/jspdf.debug.js" ,
Original file line number Diff line number Diff line change
1
+ # Getting Started
2
+
3
+ We're currently updating our documentation. Watch this space!
4
+
5
+ http://mrrio.github.io/jsPDF/doc/symbols/jsPDF.html
Original file line number Diff line number Diff line change 413
413
* Async method using Blob and FileReader could be best, but i'm not sure how to fit it into the flow?
414
414
*/
415
415
jsPDFAPI . arrayBufferToBinaryString = function ( buffer ) {
416
+ if ( 'TextDecoder' in window ) {
417
+ var decoder = new TextDecoder ( 'ascii' ) ;
418
+ return decoder . decode ( buffer ) ;
419
+ }
420
+
416
421
if ( this . isArrayBuffer ( buffer ) )
417
422
buffer = new Uint8Array ( buffer ) ;
418
423
586
591
* to TypedArray - or should we just leave and process as string?
587
592
*/
588
593
if ( this . supportsArrayBuffer ( ) ) {
589
- dataAsBinaryString = imageData ;
590
- imageData = this . binaryStringToUint8Array ( imageData ) ;
594
+ // no need to convert if imageData is already uint8array
595
+ if ( ! ( imageData instanceof Uint8Array ) ) {
596
+ dataAsBinaryString = imageData ;
597
+ imageData = this . binaryStringToUint8Array ( imageData ) ;
598
+ }
591
599
}
592
600
593
601
info = this [ 'process' + format . toUpperCase ( ) ] (
Original file line number Diff line number Diff line change
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 ) ;
You can’t perform that action at this time.
0 commit comments