_addPage = function _addPage(parmFormat, parmOrientation) {
    var dimensions, width, height;
    orientation = parmOrientation || orientation;

    if (typeof parmFormat === "string") {
      dimensions = getPageFormat(parmFormat.toLowerCase());

      if (Array.isArray(dimensions)) {
        width = dimensions[0];
        height = dimensions[1];
      }
    }

    if (Array.isArray(parmFormat)) {
      width = parmFormat[0] * scaleFactor;
      height = parmFormat[1] * scaleFactor;
    }

    if (isNaN(width)) {
      width = format[0];
      height = format[1];
    }

    if (width > 14400 || height > 14400) {
      console.warn("A page in a PDF can not be wider or taller than 14400 userUnit. jsPDF limits the width/height to 14400");
      width = Math.min(14400, width);
      height = Math.min(14400, height);
    }

    format = [width, height];

    switch (orientation.substr(0, 1)) {
      case "l":
        if (height > width) {
          format = [height, width];
        }

        break;

      case "p":
        if (width > height) {
          format = [height, width];
        }

        break;
    }

    beginPage(format); // Set line width

    setLineWidth(lineWidth); // Set draw color

    out(strokeColor); // resurrecting non-default line caps, joins

    if (lineCapID !== 0) {
      out(lineCapID + " J");
    }

    if (lineJoinID !== 0) {
      out(lineJoinID + " j");
    }

    events.publish("addPage", {
      pageNumber: page
    });
  }
Replace '/', '(', and ')' with pdf-safe versions

Doing to8bitStream does NOT make this PDF display unicode text. For that
we also need to reference a unicode font and embed it - royal pain in the rear.

There is still a benefit to to8bitStream - PDF simply cannot handle 16bit chars,
which JavaScript Strings are happy to provide. So, while we still cannot display
2-byte characters property, at least CONDITIONALLY converting (entire string containing)
16bit chars to (USC-2-BE) 2-bytes per char + BOM streams we ensure that entire PDF
is still parseable.
This will allow immediate support for unicode in document properties strings.