Merge pull request #312 from kkujala/master
Correct the coding style according to gjslint.
This commit is contained in:
		
						commit
						b628d06e9d
					
				
							
								
								
									
										114
									
								
								fonts.js
									
									
									
									
									
								
							
							
						
						
									
										114
									
								
								fonts.js
									
									
									
									
									
								
							@ -19,46 +19,46 @@ var kMaxWaitForFontFace = 1000;
 | 
				
			|||||||
 * fonts and their acronyms.
 | 
					 * fonts and their acronyms.
 | 
				
			||||||
 */
 | 
					 */
 | 
				
			||||||
var stdFontMap = {
 | 
					var stdFontMap = {
 | 
				
			||||||
  "Arial":                        "Helvetica",
 | 
					  'Arial':                        'Helvetica',
 | 
				
			||||||
  "Arial_Bold":                   "Helvetica-Bold",
 | 
					  'Arial_Bold':                   'Helvetica-Bold',
 | 
				
			||||||
  "Arial_BoldItalic":             "Helvetica-BoldOblique",
 | 
					  'Arial_BoldItalic':             'Helvetica-BoldOblique',
 | 
				
			||||||
  "Arial_Italic":                 "Helvetica-Oblique",
 | 
					  'Arial_Italic':                 'Helvetica-Oblique',
 | 
				
			||||||
  "Arial_BoldItalicMT":           "Helvetica-BoldOblique",
 | 
					  'Arial_BoldItalicMT':           'Helvetica-BoldOblique',
 | 
				
			||||||
  "Arial_BoldMT":                 "Helvetica-Bold",
 | 
					  'Arial_BoldMT':                 'Helvetica-Bold',
 | 
				
			||||||
  "Arial_ItalicMT":               "Helvetica-Oblique",
 | 
					  'Arial_ItalicMT':               'Helvetica-Oblique',
 | 
				
			||||||
  "ArialMT":                      "Helvetica",
 | 
					  'ArialMT':                      'Helvetica',
 | 
				
			||||||
  "Courier_Bold":                 "Courier-Bold",
 | 
					  'Courier_Bold':                 'Courier-Bold',
 | 
				
			||||||
  "Courier_BoldItalic":           "Courier-BoldOblique",
 | 
					  'Courier_BoldItalic':           'Courier-BoldOblique',
 | 
				
			||||||
  "Courier_Italic":               "Courier-Oblique",
 | 
					  'Courier_Italic':               'Courier-Oblique',
 | 
				
			||||||
  "CourierNew":                   "Courier",
 | 
					  'CourierNew':                   'Courier',
 | 
				
			||||||
  "CourierNew_Bold":              "Courier-Bold",
 | 
					  'CourierNew_Bold':              'Courier-Bold',
 | 
				
			||||||
  "CourierNew_BoldItalic":        "Courier-BoldOblique",
 | 
					  'CourierNew_BoldItalic':        'Courier-BoldOblique',
 | 
				
			||||||
  "CourierNew_Italic":            "Courier-Oblique",
 | 
					  'CourierNew_Italic':            'Courier-Oblique',
 | 
				
			||||||
  "CourierNewPS_BoldItalicMT":    "Courier-BoldOblique",
 | 
					  'CourierNewPS_BoldItalicMT':    'Courier-BoldOblique',
 | 
				
			||||||
  "CourierNewPS_BoldMT":          "Courier-Bold",
 | 
					  'CourierNewPS_BoldMT':          'Courier-Bold',
 | 
				
			||||||
  "CourierNewPS_ItalicMT":        "Courier-Oblique",
 | 
					  'CourierNewPS_ItalicMT':        'Courier-Oblique',
 | 
				
			||||||
  "CourierNewPSMT":               "Courier",
 | 
					  'CourierNewPSMT':               'Courier',
 | 
				
			||||||
  "Helvetica_Bold":               "Helvetica-Bold",
 | 
					  'Helvetica_Bold':               'Helvetica-Bold',
 | 
				
			||||||
  "Helvetica_BoldItalic":         "Helvetica-BoldOblique",
 | 
					  'Helvetica_BoldItalic':         'Helvetica-BoldOblique',
 | 
				
			||||||
  "Helvetica_Italic":             "Helvetica-Oblique",
 | 
					  'Helvetica_Italic':             'Helvetica-Oblique',
 | 
				
			||||||
  "Symbol_Bold":                  "Symbol",
 | 
					  'Symbol_Bold':                  'Symbol',
 | 
				
			||||||
  "Symbol_BoldItalic":            "Symbol",
 | 
					  'Symbol_BoldItalic':            'Symbol',
 | 
				
			||||||
  "Symbol_Italic":                "Symbol",
 | 
					  'Symbol_Italic':                'Symbol',
 | 
				
			||||||
  "TimesNewRoman":                "Times-Roman",
 | 
					  'TimesNewRoman':                'Times-Roman',
 | 
				
			||||||
  "TimesNewRoman_Bold":           "Times-Bold",
 | 
					  'TimesNewRoman_Bold':           'Times-Bold',
 | 
				
			||||||
  "TimesNewRoman_BoldItalic":     "Times-BoldItalic",
 | 
					  'TimesNewRoman_BoldItalic':     'Times-BoldItalic',
 | 
				
			||||||
  "TimesNewRoman_Italic":         "Times-Italic",
 | 
					  'TimesNewRoman_Italic':         'Times-Italic',
 | 
				
			||||||
  "TimesNewRomanPS":              "Times-Roman",
 | 
					  'TimesNewRomanPS':              'Times-Roman',
 | 
				
			||||||
  "TimesNewRomanPS_Bold":         "Times-Bold",
 | 
					  'TimesNewRomanPS_Bold':         'Times-Bold',
 | 
				
			||||||
  "TimesNewRomanPS_BoldItalic":   "Times-BoldItalic",
 | 
					  'TimesNewRomanPS_BoldItalic':   'Times-BoldItalic',
 | 
				
			||||||
  "TimesNewRomanPS_BoldItalicMT": "Times-BoldItalic",
 | 
					  'TimesNewRomanPS_BoldItalicMT': 'Times-BoldItalic',
 | 
				
			||||||
  "TimesNewRomanPS_BoldMT":       "Times-Bold",
 | 
					  'TimesNewRomanPS_BoldMT':       'Times-Bold',
 | 
				
			||||||
  "TimesNewRomanPS_Italic":       "Times-Italic",
 | 
					  'TimesNewRomanPS_Italic':       'Times-Italic',
 | 
				
			||||||
  "TimesNewRomanPS_ItalicMT":     "Times-Italic",
 | 
					  'TimesNewRomanPS_ItalicMT':     'Times-Italic',
 | 
				
			||||||
  "TimesNewRomanPSMT":            "Times-Roman",
 | 
					  'TimesNewRomanPSMT':            'Times-Roman',
 | 
				
			||||||
  "TimesNewRomanPSMT_Bold":       "Times-Bold",
 | 
					  'TimesNewRomanPSMT_Bold':       'Times-Bold',
 | 
				
			||||||
  "TimesNewRomanPSMT_BoldItalic": "Times-BoldItalic",
 | 
					  'TimesNewRomanPSMT_BoldItalic': 'Times-BoldItalic',
 | 
				
			||||||
  "TimesNewRomanPSMT_Italic":     "Times-Italic"
 | 
					  'TimesNewRomanPSMT_Italic':     'Times-Italic'
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
var FontMeasure = (function FontMeasure() {
 | 
					var FontMeasure = (function FontMeasure() {
 | 
				
			||||||
@ -76,14 +76,14 @@ var FontMeasure = (function FontMeasure() {
 | 
				
			|||||||
        if (!(measureCache = sizes[size]))
 | 
					        if (!(measureCache = sizes[size]))
 | 
				
			||||||
          measureCache = sizes[size] = Object.create(null);
 | 
					          measureCache = sizes[size] = Object.create(null);
 | 
				
			||||||
      } else {
 | 
					      } else {
 | 
				
			||||||
        measureCache = null
 | 
					        measureCache = null;
 | 
				
			||||||
      }
 | 
					      }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
      var name = font.loadedName;
 | 
					      var name = font.loadedName;
 | 
				
			||||||
      var bold = font.bold ? "bold" : "normal";
 | 
					      var bold = font.bold ? 'bold' : 'normal';
 | 
				
			||||||
      var italic = font.italic ? "italic" : "normal";
 | 
					      var italic = font.italic ? 'italic' : 'normal';
 | 
				
			||||||
      size *= kScalePrecision;
 | 
					      size *= kScalePrecision;
 | 
				
			||||||
      var rule = bold + " " + italic + " " + size + 'px "' + name + '"';
 | 
					      var rule = bold + ' ' + italic + ' ' + size + 'px "' + name + '"';
 | 
				
			||||||
      ctx.font = rule;
 | 
					      ctx.font = rule;
 | 
				
			||||||
    },
 | 
					    },
 | 
				
			||||||
    measureText: function fonts_measureText(text) {
 | 
					    measureText: function fonts_measureText(text) {
 | 
				
			||||||
@ -402,9 +402,9 @@ var Font = (function Font() {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    if (!file) {
 | 
					    if (!file) {
 | 
				
			||||||
      var fontName = stdFontMap[name];
 | 
					      var fontName = stdFontMap[name];
 | 
				
			||||||
      this.bold = (fontName.indexOf("Bold") != -1);
 | 
					      this.bold = (fontName.indexOf('Bold') != -1);
 | 
				
			||||||
      this.italic = (fontName.indexOf("Oblique") != -1);
 | 
					      this.italic = (fontName.indexOf('Oblique') != -1);
 | 
				
			||||||
      this.loadedName = fontName.split("-")[0];
 | 
					      this.loadedName = fontName.split('-')[0];
 | 
				
			||||||
      this.loading = false;
 | 
					      this.loading = false;
 | 
				
			||||||
      return;
 | 
					      return;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
@ -838,7 +838,7 @@ var Font = (function Font() {
 | 
				
			|||||||
            encodingID: int16(font.getBytes(2)),
 | 
					            encodingID: int16(font.getBytes(2)),
 | 
				
			||||||
            offset: int32(font.getBytes(4))
 | 
					            offset: int32(font.getBytes(4))
 | 
				
			||||||
          });
 | 
					          });
 | 
				
			||||||
        };
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        var encoding = properties.encoding;
 | 
					        var encoding = properties.encoding;
 | 
				
			||||||
        var charset = properties.charset;
 | 
					        var charset = properties.charset;
 | 
				
			||||||
@ -1005,11 +1005,11 @@ var Font = (function Font() {
 | 
				
			|||||||
        ((hmtx.length - numOfHMetrics * 4) >> 1);
 | 
					        ((hmtx.length - numOfHMetrics * 4) >> 1);
 | 
				
			||||||
      if (numMissing > 0) {
 | 
					      if (numMissing > 0) {
 | 
				
			||||||
        font.pos = (font.start ? font.start : 0) + hmtx.offset;
 | 
					        font.pos = (font.start ? font.start : 0) + hmtx.offset;
 | 
				
			||||||
        var metrics = "";
 | 
					        var metrics = '';
 | 
				
			||||||
        for (var i = 0; i < hmtx.length; i++)
 | 
					        for (var i = 0; i < hmtx.length; i++)
 | 
				
			||||||
          metrics += String.fromCharCode(font.getByte());
 | 
					          metrics += String.fromCharCode(font.getByte());
 | 
				
			||||||
        for (var i = 0; i < numMissing; i++)
 | 
					        for (var i = 0; i < numMissing; i++)
 | 
				
			||||||
          metrics += "\x00\x00";
 | 
					          metrics += '\x00\x00';
 | 
				
			||||||
        hmtx.data = stringToArray(metrics);
 | 
					        hmtx.data = stringToArray(metrics);
 | 
				
			||||||
      }
 | 
					      }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -1272,7 +1272,7 @@ var Font = (function Font() {
 | 
				
			|||||||
        // XXX assuming CIDFonts are two-byte - later need to extract the correct byte encoding
 | 
					        // XXX assuming CIDFonts are two-byte - later need to extract the correct byte encoding
 | 
				
			||||||
        //     according to the PDF spec
 | 
					        //     according to the PDF spec
 | 
				
			||||||
        str = '';
 | 
					        str = '';
 | 
				
			||||||
        var multiByteStr = "";
 | 
					        var multiByteStr = '';
 | 
				
			||||||
        var length = chars.length;
 | 
					        var length = chars.length;
 | 
				
			||||||
        for (var i = 0; i < length; i++) {
 | 
					        for (var i = 0; i < length; i++) {
 | 
				
			||||||
          var byte1 = chars.charCodeAt(i++) & 0xFF;
 | 
					          var byte1 = chars.charCodeAt(i++) & 0xFF;
 | 
				
			||||||
@ -2089,7 +2089,7 @@ var Type2CFF = (function() {
 | 
				
			|||||||
    this.properties = properties;
 | 
					    this.properties = properties;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    // Other classes expect this.data to be a Javascript array
 | 
					    // Other classes expect this.data to be a Javascript array
 | 
				
			||||||
    var data = []
 | 
					    var data = [];
 | 
				
			||||||
    for (var i = 0, ii = bytes.length; i < ii; ++i)
 | 
					    for (var i = 0, ii = bytes.length; i < ii; ++i)
 | 
				
			||||||
      data.push(bytes[i]);
 | 
					      data.push(bytes[i]);
 | 
				
			||||||
    this.data = data;
 | 
					    this.data = data;
 | 
				
			||||||
@ -2283,7 +2283,7 @@ var Type2CFF = (function() {
 | 
				
			|||||||
    },
 | 
					    },
 | 
				
			||||||
    getStrings: function cff_getstrings(stringIndex) {
 | 
					    getStrings: function cff_getstrings(stringIndex) {
 | 
				
			||||||
      function bytesToString(bytesArr) {
 | 
					      function bytesToString(bytesArr) {
 | 
				
			||||||
        var s = "";
 | 
					        var s = '';
 | 
				
			||||||
        for (var i = 0, ii = bytesArr.length; i < ii; ++i)
 | 
					        for (var i = 0, ii = bytesArr.length; i < ii; ++i)
 | 
				
			||||||
          s += String.fromCharCode(bytesArr[i]);
 | 
					          s += String.fromCharCode(bytesArr[i]);
 | 
				
			||||||
        return s;
 | 
					        return s;
 | 
				
			||||||
@ -2306,7 +2306,7 @@ var Type2CFF = (function() {
 | 
				
			|||||||
        ++offset;
 | 
					        ++offset;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
      if (offset != 0) {
 | 
					      if (offset != 0) {
 | 
				
			||||||
        warning("cff data is shifted");
 | 
					        warning('cff data is shifted');
 | 
				
			||||||
        bytes = bytes.subarray(offset);
 | 
					        bytes = bytes.subarray(offset);
 | 
				
			||||||
        this.bytes = bytes;
 | 
					        this.bytes = bytes;
 | 
				
			||||||
      }
 | 
					      }
 | 
				
			||||||
@ -2314,7 +2314,7 @@ var Type2CFF = (function() {
 | 
				
			|||||||
      return {
 | 
					      return {
 | 
				
			||||||
        endPos: bytes[2],
 | 
					        endPos: bytes[2],
 | 
				
			||||||
        offsetSize: bytes[3]
 | 
					        offsetSize: bytes[3]
 | 
				
			||||||
      }
 | 
					      };
 | 
				
			||||||
    },
 | 
					    },
 | 
				
			||||||
    parseDict: function cff_parseDict(dict) {
 | 
					    parseDict: function cff_parseDict(dict) {
 | 
				
			||||||
      var pos = 0;
 | 
					      var pos = 0;
 | 
				
			||||||
@ -2345,7 +2345,7 @@ var Type2CFF = (function() {
 | 
				
			|||||||
      };
 | 
					      };
 | 
				
			||||||
 | 
					
 | 
				
			||||||
      function parseFloatOperand() {
 | 
					      function parseFloatOperand() {
 | 
				
			||||||
        var str = "";
 | 
					        var str = '';
 | 
				
			||||||
        var eof = 15;
 | 
					        var eof = 15;
 | 
				
			||||||
        var lookup = ['0', '1', '2', '3', '4', '5', '6', '7', '8',
 | 
					        var lookup = ['0', '1', '2', '3', '4', '5', '6', '7', '8',
 | 
				
			||||||
            '9', '.', 'E', 'E-', null, '-'];
 | 
					            '9', '.', 'E', 'E-', null, '-'];
 | 
				
			||||||
@ -2421,8 +2421,8 @@ var Type2CFF = (function() {
 | 
				
			|||||||
        },
 | 
					        },
 | 
				
			||||||
        length: count,
 | 
					        length: count,
 | 
				
			||||||
        endPos: end
 | 
					        endPos: end
 | 
				
			||||||
 | 
					      };
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    },
 | 
					 | 
				
			||||||
  };
 | 
					  };
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  return constructor;
 | 
					  return constructor;
 | 
				
			||||||
 | 
				
			|||||||
							
								
								
									
										52
									
								
								pdf.js
									
									
									
									
									
								
							
							
						
						
									
										52
									
								
								pdf.js
									
									
									
									
									
								
							@ -50,7 +50,7 @@ function backtrace() {
 | 
				
			|||||||
    throw new Error();
 | 
					    throw new Error();
 | 
				
			||||||
  } catch (e) {
 | 
					  } catch (e) {
 | 
				
			||||||
    stackStr = e.stack;
 | 
					    stackStr = e.stack;
 | 
				
			||||||
  };
 | 
					  }
 | 
				
			||||||
  return stackStr.split('\n').slice(1).join('\n');
 | 
					  return stackStr.split('\n').slice(1).join('\n');
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -2983,7 +2983,7 @@ var Page = (function() {
 | 
				
			|||||||
      create: Date.now(),
 | 
					      create: Date.now(),
 | 
				
			||||||
      compile: 0.0,
 | 
					      compile: 0.0,
 | 
				
			||||||
      fonts: 0.0,
 | 
					      fonts: 0.0,
 | 
				
			||||||
      render: 0.0,
 | 
					      render: 0.0
 | 
				
			||||||
    };
 | 
					    };
 | 
				
			||||||
    this.xref = xref;
 | 
					    this.xref = xref;
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
@ -3037,7 +3037,7 @@ var Page = (function() {
 | 
				
			|||||||
      return shadow(this, 'height', height);
 | 
					      return shadow(this, 'height', height);
 | 
				
			||||||
    },
 | 
					    },
 | 
				
			||||||
    get rotate() {
 | 
					    get rotate() {
 | 
				
			||||||
      var rotate = this.inheritPageProp("Rotate") || 0;
 | 
					      var rotate = this.inheritPageProp('Rotate') || 0;
 | 
				
			||||||
      // Normalize rotation so it's a multiple of 90 and between 0 and 270
 | 
					      // Normalize rotation so it's a multiple of 90 and between 0 and 270
 | 
				
			||||||
      if (rotate % 90 != 0) {
 | 
					      if (rotate % 90 != 0) {
 | 
				
			||||||
        rotate = 0;
 | 
					        rotate = 0;
 | 
				
			||||||
@ -3646,7 +3646,7 @@ var PartialEvaluator = (function() {
 | 
				
			|||||||
    eval: function(stream, xref, resources, fonts) {
 | 
					    eval: function(stream, xref, resources, fonts) {
 | 
				
			||||||
      resources = xref.fetchIfRef(resources) || new Dict();
 | 
					      resources = xref.fetchIfRef(resources) || new Dict();
 | 
				
			||||||
      var xobjs = xref.fetchIfRef(resources.get('XObject')) || new Dict();
 | 
					      var xobjs = xref.fetchIfRef(resources.get('XObject')) || new Dict();
 | 
				
			||||||
      var patterns = xref.fetchIfRef(resources.get("Pattern")) || new Dict(); 
 | 
					      var patterns = xref.fetchIfRef(resources.get('Pattern')) || new Dict();
 | 
				
			||||||
      var parser = new Parser(new Lexer(stream), false);
 | 
					      var parser = new Parser(new Lexer(stream), false);
 | 
				
			||||||
      var args = [], argsArray = [], fnArray = [], obj;
 | 
					      var args = [], argsArray = [], fnArray = [], obj;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -3665,7 +3665,7 @@ var PartialEvaluator = (function() {
 | 
				
			|||||||
              var pattern = xref.fetchIfRef(patterns.get(patternName.name));
 | 
					              var pattern = xref.fetchIfRef(patterns.get(patternName.name));
 | 
				
			||||||
              if (pattern) {
 | 
					              if (pattern) {
 | 
				
			||||||
                var dict = IsStream(pattern) ? pattern.dict : pattern;
 | 
					                var dict = IsStream(pattern) ? pattern.dict : pattern;
 | 
				
			||||||
                var typeNum = dict.get("PatternType");
 | 
					                var typeNum = dict.get('PatternType');
 | 
				
			||||||
                if (typeNum == 1) {
 | 
					                if (typeNum == 1) {
 | 
				
			||||||
                  patternName.code = this.eval(pattern, xref,
 | 
					                  patternName.code = this.eval(pattern, xref,
 | 
				
			||||||
                      dict.get('Resources'), fonts);
 | 
					                      dict.get('Resources'), fonts);
 | 
				
			||||||
@ -3785,9 +3785,9 @@ var PartialEvaluator = (function() {
 | 
				
			|||||||
          if (IsName(encoding)) {
 | 
					          if (IsName(encoding)) {
 | 
				
			||||||
            // Encoding is a predefined CMap
 | 
					            // Encoding is a predefined CMap
 | 
				
			||||||
            if (encoding.name == 'Identity-H') {
 | 
					            if (encoding.name == 'Identity-H') {
 | 
				
			||||||
              TODO ('Need to create an identity cmap')
 | 
					              TODO('Need to create an identity cmap');
 | 
				
			||||||
            } else {
 | 
					            } else {
 | 
				
			||||||
              TODO ('Need to support predefined CMaps see PDF 32000-1:2008 9.7.5.2 Predefined CMaps')
 | 
					              TODO('Need to support predefined CMaps see PDF 32000-1:2008 9.7.5.2 Predefined CMaps');
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
          } else {
 | 
					          } else {
 | 
				
			||||||
            TODO('Need to support encoding streams see PDF 32000-1:2008  9.7.5.3');
 | 
					            TODO('Need to support encoding streams see PDF 32000-1:2008  9.7.5.3');
 | 
				
			||||||
@ -3959,7 +3959,7 @@ var PartialEvaluator = (function() {
 | 
				
			|||||||
        file: fontFile,
 | 
					        file: fontFile,
 | 
				
			||||||
        properties: properties
 | 
					        properties: properties
 | 
				
			||||||
      };
 | 
					      };
 | 
				
			||||||
    },
 | 
					    }
 | 
				
			||||||
  };
 | 
					  };
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  return constructor;
 | 
					  return constructor;
 | 
				
			||||||
@ -4145,7 +4145,7 @@ var CanvasGraphics = (function() {
 | 
				
			|||||||
    stroke: function() {
 | 
					    stroke: function() {
 | 
				
			||||||
      var ctx = this.ctx;
 | 
					      var ctx = this.ctx;
 | 
				
			||||||
      var strokeColor = this.current.strokeColor;
 | 
					      var strokeColor = this.current.strokeColor;
 | 
				
			||||||
      if (strokeColor && strokeColor.type === "Pattern") {
 | 
					      if (strokeColor && strokeColor.type === 'Pattern') {
 | 
				
			||||||
        // for patterns, we transform to pattern space, calculate
 | 
					        // for patterns, we transform to pattern space, calculate
 | 
				
			||||||
        // the pattern, call stroke, and restore to user space
 | 
					        // the pattern, call stroke, and restore to user space
 | 
				
			||||||
        ctx.save();
 | 
					        ctx.save();
 | 
				
			||||||
@ -4166,7 +4166,7 @@ var CanvasGraphics = (function() {
 | 
				
			|||||||
      var ctx = this.ctx;
 | 
					      var ctx = this.ctx;
 | 
				
			||||||
      var fillColor = this.current.fillColor;
 | 
					      var fillColor = this.current.fillColor;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
      if (fillColor && fillColor.type === "Pattern") {
 | 
					      if (fillColor && fillColor.type === 'Pattern') {
 | 
				
			||||||
        ctx.save();
 | 
					        ctx.save();
 | 
				
			||||||
        ctx.fillStyle = fillColor.getPattern(ctx);
 | 
					        ctx.fillStyle = fillColor.getPattern(ctx);
 | 
				
			||||||
        ctx.fill();
 | 
					        ctx.fill();
 | 
				
			||||||
@ -4186,7 +4186,7 @@ var CanvasGraphics = (function() {
 | 
				
			|||||||
      var ctx = this.ctx;
 | 
					      var ctx = this.ctx;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
      var fillColor = this.current.fillColor;
 | 
					      var fillColor = this.current.fillColor;
 | 
				
			||||||
      if (fillColor && fillColor.type === "Pattern") {
 | 
					      if (fillColor && fillColor.type === 'Pattern') {
 | 
				
			||||||
        ctx.save();
 | 
					        ctx.save();
 | 
				
			||||||
        ctx.fillStyle = fillColor.getPattern(ctx);
 | 
					        ctx.fillStyle = fillColor.getPattern(ctx);
 | 
				
			||||||
        ctx.fill();
 | 
					        ctx.fill();
 | 
				
			||||||
@ -4196,7 +4196,7 @@ var CanvasGraphics = (function() {
 | 
				
			|||||||
      }
 | 
					      }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
      var strokeColor = this.current.strokeColor;
 | 
					      var strokeColor = this.current.strokeColor;
 | 
				
			||||||
      if (strokeColor && strokeColor.type === "Pattern") {
 | 
					      if (strokeColor && strokeColor.type === 'Pattern') {
 | 
				
			||||||
        ctx.save();
 | 
					        ctx.save();
 | 
				
			||||||
        ctx.strokeStyle = strokeColor.getPattern(ctx);
 | 
					        ctx.strokeStyle = strokeColor.getPattern(ctx);
 | 
				
			||||||
        ctx.stroke();
 | 
					        ctx.stroke();
 | 
				
			||||||
@ -4285,9 +4285,9 @@ var CanvasGraphics = (function() {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
        size = (size <= kRasterizerMin) ? size * kScalePrecision : size;
 | 
					        size = (size <= kRasterizerMin) ? size * kScalePrecision : size;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        var bold = fontObj.bold ? "bold" : "normal";
 | 
					        var bold = fontObj.bold ? 'bold' : 'normal';
 | 
				
			||||||
        var italic = fontObj.italic ? "italic" : "normal";
 | 
					        var italic = fontObj.italic ? 'italic' : 'normal';
 | 
				
			||||||
        var rule = bold + " " + italic + " " + size + 'px "' + name + '"';
 | 
					        var rule = bold + ' ' + italic + ' ' + size + 'px "' + name + '"';
 | 
				
			||||||
        this.ctx.font = rule;
 | 
					        this.ctx.font = rule;
 | 
				
			||||||
      }
 | 
					      }
 | 
				
			||||||
    },
 | 
					    },
 | 
				
			||||||
@ -4673,7 +4673,7 @@ var CanvasGraphics = (function() {
 | 
				
			|||||||
    },
 | 
					    },
 | 
				
			||||||
    restoreFillRule: function(rule) {
 | 
					    restoreFillRule: function(rule) {
 | 
				
			||||||
      this.ctx.mozFillRule = rule;
 | 
					      this.ctx.mozFillRule = rule;
 | 
				
			||||||
    },
 | 
					    }
 | 
				
			||||||
  };
 | 
					  };
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  return constructor;
 | 
					  return constructor;
 | 
				
			||||||
@ -4820,7 +4820,7 @@ var ColorSpace = (function() {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
var SeparationCS = (function() {
 | 
					var SeparationCS = (function() {
 | 
				
			||||||
  function constructor(base, tintFn) {
 | 
					  function constructor(base, tintFn) {
 | 
				
			||||||
    this.name = "Separation";
 | 
					    this.name = 'Separation';
 | 
				
			||||||
    this.numComps = 1;
 | 
					    this.numComps = 1;
 | 
				
			||||||
    this.defaultColor = [1];
 | 
					    this.defaultColor = [1];
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -5061,7 +5061,7 @@ var Pattern = (function() {
 | 
				
			|||||||
    // Output: the appropriate fillStyle or strokeStyle
 | 
					    // Output: the appropriate fillStyle or strokeStyle
 | 
				
			||||||
    getPattern: function pattern_getStyle(ctx) {
 | 
					    getPattern: function pattern_getStyle(ctx) {
 | 
				
			||||||
      error('Should not call Pattern.getStyle');
 | 
					      error('Should not call Pattern.getStyle');
 | 
				
			||||||
    },
 | 
					    }
 | 
				
			||||||
  };
 | 
					  };
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  constructor.parse = function pattern_parse(args, cs, xref, res, ctx) {
 | 
					  constructor.parse = function pattern_parse(args, cs, xref, res, ctx) {
 | 
				
			||||||
@ -5069,15 +5069,15 @@ var Pattern = (function() {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    var patternName = args[length - 1];
 | 
					    var patternName = args[length - 1];
 | 
				
			||||||
    if (!IsName(patternName))
 | 
					    if (!IsName(patternName))
 | 
				
			||||||
      error("Bad args to getPattern");
 | 
					      error('Bad args to getPattern');
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    var patternRes = xref.fetchIfRef(res.get("Pattern"));
 | 
					    var patternRes = xref.fetchIfRef(res.get('Pattern'));
 | 
				
			||||||
    if (!patternRes)
 | 
					    if (!patternRes)
 | 
				
			||||||
      error("Unable to find pattern resource");
 | 
					      error('Unable to find pattern resource');
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    var pattern = xref.fetchIfRef(patternRes.get(patternName.name));
 | 
					    var pattern = xref.fetchIfRef(patternRes.get(patternName.name));
 | 
				
			||||||
    var dict = IsStream(pattern) ? pattern.dict : pattern;
 | 
					    var dict = IsStream(pattern) ? pattern.dict : pattern;
 | 
				
			||||||
    var typeNum = dict.get("PatternType");
 | 
					    var typeNum = dict.get('PatternType');
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    switch (typeNum) {
 | 
					    switch (typeNum) {
 | 
				
			||||||
    case 1:
 | 
					    case 1:
 | 
				
			||||||
@ -5201,9 +5201,9 @@ var RadialAxialShading = (function() {
 | 
				
			|||||||
      } else if (type == 3) {
 | 
					      } else if (type == 3) {
 | 
				
			||||||
        var p0 = [coordsArr[0], coordsArr[1]];
 | 
					        var p0 = [coordsArr[0], coordsArr[1]];
 | 
				
			||||||
        var p1 = [coordsArr[3], coordsArr[4]];
 | 
					        var p1 = [coordsArr[3], coordsArr[4]];
 | 
				
			||||||
        var r0 = coordsArr[2], r1 = coordsArr[5]
 | 
					        var r0 = coordsArr[2], r1 = coordsArr[5];
 | 
				
			||||||
      } else {
 | 
					      } else {
 | 
				
			||||||
        error()
 | 
					        error();
 | 
				
			||||||
      }
 | 
					      }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
      var matrix = this.matrix;
 | 
					      var matrix = this.matrix;
 | 
				
			||||||
@ -5258,7 +5258,7 @@ var TilingPattern = (function() {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
      TODO('TilingType');
 | 
					      TODO('TilingType');
 | 
				
			||||||
 | 
					
 | 
				
			||||||
      this.matrix = dict.get("Matrix");
 | 
					      this.matrix = dict.get('Matrix');
 | 
				
			||||||
      this.curMatrix = ctx.mozCurrentTransform;
 | 
					      this.curMatrix = ctx.mozCurrentTransform;
 | 
				
			||||||
      this.invMatrix = ctx.mozCurrentTransformInverse;
 | 
					      this.invMatrix = ctx.mozCurrentTransformInverse;
 | 
				
			||||||
      this.ctx = ctx;
 | 
					      this.ctx = ctx;
 | 
				
			||||||
@ -5272,7 +5272,7 @@ var TilingPattern = (function() {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
      var topLeft = [x0, y0];
 | 
					      var topLeft = [x0, y0];
 | 
				
			||||||
      // we want the canvas to be as large as the step size
 | 
					      // we want the canvas to be as large as the step size
 | 
				
			||||||
      var botRight = [x0 + xstep, y0 + ystep]
 | 
					      var botRight = [x0 + xstep, y0 + ystep];
 | 
				
			||||||
 | 
					
 | 
				
			||||||
      var width = botRight[0] - topLeft[0];
 | 
					      var width = botRight[0] - topLeft[0];
 | 
				
			||||||
      var height = botRight[1] - topLeft[1];
 | 
					      var height = botRight[1] - topLeft[1];
 | 
				
			||||||
 | 
				
			|||||||
@ -41,15 +41,15 @@ var PDFView = {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
  set page(val) {
 | 
					  set page(val) {
 | 
				
			||||||
    var pages = this.pages;
 | 
					    var pages = this.pages;
 | 
				
			||||||
    var input = document.getElementById("pageNumber");
 | 
					    var input = document.getElementById('pageNumber');
 | 
				
			||||||
    if (val <= 0 || val > pages.length) {
 | 
					    if (val <= 0 || val > pages.length) {
 | 
				
			||||||
      input.value = this.page;
 | 
					      input.value = this.page;
 | 
				
			||||||
      return;
 | 
					      return;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    document.location.hash = val;
 | 
					    document.location.hash = val;
 | 
				
			||||||
    document.getElementById("previous").disabled = (val == 1);
 | 
					    document.getElementById('previous').disabled = (val == 1);
 | 
				
			||||||
    document.getElementById("next").disabled = (val == pages.length);
 | 
					    document.getElementById('next').disabled = (val == pages.length);
 | 
				
			||||||
    if (input.value == val)
 | 
					    if (input.value == val)
 | 
				
			||||||
      return;
 | 
					      return;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -62,7 +62,7 @@ var PDFView = {
 | 
				
			|||||||
  },
 | 
					  },
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  open: function(url, scale) {
 | 
					  open: function(url, scale) {
 | 
				
			||||||
    if (url.indexOf("http") == 0)
 | 
					    if (url.indexOf('http') == 0)
 | 
				
			||||||
      return;
 | 
					      return;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    document.title = url;
 | 
					    document.title = url;
 | 
				
			||||||
@ -106,7 +106,7 @@ var PDFView = {
 | 
				
			|||||||
      var page = pdf.getPage(i);
 | 
					      var page = pdf.getPage(i);
 | 
				
			||||||
      pages.push(new PageView(container, page, i, page.width, page.height, page.stats));
 | 
					      pages.push(new PageView(container, page, i, page.width, page.height, page.stats));
 | 
				
			||||||
      thumbnails.push(new ThumbnailView(sidebar, pages[i - 1]));
 | 
					      thumbnails.push(new ThumbnailView(sidebar, pages[i - 1]));
 | 
				
			||||||
    };
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    this.scale = (scale || kDefaultScale);
 | 
					    this.scale = (scale || kDefaultScale);
 | 
				
			||||||
    this.page = parseInt(document.location.hash.substring(1)) || 1;
 | 
					    this.page = parseInt(document.location.hash.substring(1)) || 1;
 | 
				
			||||||
@ -136,7 +136,7 @@ var PDFView = {
 | 
				
			|||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    return visiblePages;
 | 
					    return visiblePages;
 | 
				
			||||||
  },
 | 
					  }
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
var PageView = function(container, content, id, width, height, stats) {
 | 
					var PageView = function(container, content, id, width, height, stats) {
 | 
				
			||||||
@ -270,11 +270,11 @@ window.addEventListener('scroll', function(evt) {
 | 
				
			|||||||
    PDFView.page = firstPage.id;
 | 
					    PDFView.page = firstPage.id;
 | 
				
			||||||
}, true);
 | 
					}, true);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
window.addEventListener("hashchange", function(evt) {
 | 
					window.addEventListener('hashchange', function(evt) {
 | 
				
			||||||
  PDFView.page = PDFView.page;
 | 
					  PDFView.page = PDFView.page;
 | 
				
			||||||
});
 | 
					});
 | 
				
			||||||
 | 
					
 | 
				
			||||||
window.addEventListener("change", function(evt) {
 | 
					window.addEventListener('change', function(evt) {
 | 
				
			||||||
  var files = evt.target.files;
 | 
					  var files = evt.target.files;
 | 
				
			||||||
  if (!files || files.length == 0)
 | 
					  if (!files || files.length == 0)
 | 
				
			||||||
    return;
 | 
					    return;
 | 
				
			||||||
@ -300,7 +300,7 @@ window.addEventListener("change", function(evt) {
 | 
				
			|||||||
  document.location.hash = 1;
 | 
					  document.location.hash = 1;
 | 
				
			||||||
}, true);
 | 
					}, true);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
window.addEventListener("transitionend", function(evt) {
 | 
					window.addEventListener('transitionend', function(evt) {
 | 
				
			||||||
  var pageIndex = 0;
 | 
					  var pageIndex = 0;
 | 
				
			||||||
  var pagesCount = PDFView.pages.length;
 | 
					  var pagesCount = PDFView.pages.length;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user