Most annotations, even unsupported ones, render just fine in PDF.js because of their appearance stream. However, there exist PDF files with annotations that do not have an appearance stream (even though this is a deprecated practice). In the latter case, PDF.js displays nothing. We need to have a fallback to a default appearance stream in that case, or create an appearance stream ourselves using the data present for the annotation (such as quad points and color). Below is a list of known PDF files that contain annotations without appearance streams, for which the types are listed.
- <s>http://pdfkit.org/docs/guide.pdf (Underline, Highlight and StrikeOut)</s>
- <s>http://www.plpdf.com/examples/PLPDF-SDK/Simple_Examples/37_Markup_annotation/markup.pdf (Underline, Highlight and StrikeOut)</s>
- <s>https://drive.google.com/file/d/0B6YhVF9p-y2AU0RlYjRKakFQRjQ/view?usp=sharing (Highlight, from #6382)</s>
- https://drive.google.com/open?id=0B6YhVF9p-y2Ad3VsWDRHRkRxY2c (FreeText, from #6246)
- https://drive.google.com/file/d/0B-_5BgJGB33Ea2dQZnpUY2FvYkk/view (FreeText, from #6564)
- http://mirrors.rit.edu/CTAN/macros/latex/contrib/pdfcomment/doc/example.pdf (practically all annotation types, from #1973)

/* Copyright 2012 Mozilla Foundation
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http:www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
import {
  AnnotationActionEventType,
  AnnotationBorderStyleType,
  AnnotationFieldFlag,
  AnnotationFlag,
  AnnotationReplyType,
  AnnotationType,
  assert,
  escapeString,
  getModificationDate,
  isArrayEqual,
  isAscii,
  isString,