Home » pdfbox-1.1.0-src » org.apache.pdfbox.encoding » [javadoc | source]

    1   /*
    2    * Licensed to the Apache Software Foundation (ASF) under one or more
    3    * contributor license agreements.  See the NOTICE file distributed with
    4    * this work for additional information regarding copyright ownership.
    5    * The ASF licenses this file to You under the Apache License, Version 2.0
    6    * (the "License"); you may not use this file except in compliance with
    7    * the License.  You may obtain a copy of the License at
    8    *
    9    *      http://www.apache.org/licenses/LICENSE-2.0
   10    *
   11    * Unless required by applicable law or agreed to in writing, software
   12    * distributed under the License is distributed on an "AS IS" BASIS,
   13    * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   14    * See the License for the specific language governing permissions and
   15    * limitations under the License.
   16    */
   17   package org.apache.pdfbox.encoding;
   18   
   19   import org.apache.pdfbox.cos.COSBase;
   20   import org.apache.pdfbox.cos.COSName;
   21   
   22   /**
   23    * This is an interface to a text encoder.
   24    *
   25    * @author <a href="mailto:ben@benlitchfield.com">Ben Litchfield</a>
   26    * @version $Revision: 1.10 $
   27    */
   28   public class StandardEncoding extends Encoding
   29   {
   30       /**
   31        * Constructor.
   32        */
   33       public StandardEncoding()
   34       {
   35           addCharacterEncoding( 0101, COSName.getPDFName( "A" ) );
   36           addCharacterEncoding( 0341, COSName.getPDFName( "AE" ) );
   37           addCharacterEncoding( 0102, COSName.getPDFName( "B" ) );
   38           addCharacterEncoding( 0103, COSName.getPDFName( "C" ) );
   39           addCharacterEncoding( 0104, COSName.getPDFName( "D" ) );
   40           addCharacterEncoding( 0105, COSName.getPDFName( "E" ) );
   41           addCharacterEncoding( 0106, COSName.getPDFName( "F" ) );
   42           addCharacterEncoding( 0107, COSName.getPDFName( "G" ) );
   43           addCharacterEncoding( 0110, COSName.getPDFName( "H" ) );
   44           addCharacterEncoding( 0111, COSName.getPDFName( "I" ) );
   45           addCharacterEncoding( 0112, COSName.getPDFName( "J" ) );
   46           addCharacterEncoding( 0113, COSName.getPDFName( "K" ) );
   47           addCharacterEncoding( 0114, COSName.getPDFName( "L" ) );
   48           addCharacterEncoding( 0350, COSName.getPDFName( "Lslash" ) );
   49           addCharacterEncoding( 0115, COSName.getPDFName( "M" ) );
   50           addCharacterEncoding( 0116, COSName.getPDFName( "N" ) );
   51           addCharacterEncoding( 0117, COSName.getPDFName( "O" ) );
   52           addCharacterEncoding( 0352, COSName.getPDFName( "OE" ) );
   53           addCharacterEncoding( 0351, COSName.getPDFName( "Oslash" ) );
   54           addCharacterEncoding( 0120, COSName.getPDFName( "P" ) );
   55           addCharacterEncoding( 0121, COSName.getPDFName( "Q" ) );
   56           addCharacterEncoding( 0122, COSName.getPDFName( "R" ) );
   57           addCharacterEncoding( 0123, COSName.getPDFName( "S" ) );
   58           addCharacterEncoding( 0124, COSName.getPDFName( "T" ) );
   59           addCharacterEncoding( 0125, COSName.getPDFName( "U" ) );
   60           addCharacterEncoding( 0126, COSName.getPDFName( "V" ) );
   61           addCharacterEncoding( 0127, COSName.getPDFName( "W" ) );
   62           addCharacterEncoding( 0130, COSName.getPDFName( "X" ) );
   63           addCharacterEncoding( 0131, COSName.getPDFName( "Y" ) );
   64           addCharacterEncoding( 0132, COSName.getPDFName( "Z" ) );
   65           addCharacterEncoding( 0141, COSName.getPDFName( "a" ) );
   66           addCharacterEncoding( 0302, COSName.getPDFName( "acute" ) );
   67           addCharacterEncoding( 0361, COSName.getPDFName( "ae" ) );
   68           addCharacterEncoding( 0046, COSName.getPDFName( "ampersand" ) );
   69           addCharacterEncoding( 0136, COSName.getPDFName( "asciicircum" ) );
   70           addCharacterEncoding( 0176, COSName.getPDFName( "asciitilde" ) );
   71           addCharacterEncoding( 0052, COSName.getPDFName( "asterisk" ) );
   72           addCharacterEncoding( 0100, COSName.getPDFName( "at" ) );
   73           addCharacterEncoding( 0142, COSName.getPDFName( "b" ) );
   74           addCharacterEncoding( 0134, COSName.getPDFName( "backslash" ) );
   75           addCharacterEncoding( 0174, COSName.getPDFName( "bar" ) );
   76           addCharacterEncoding( 0173, COSName.getPDFName( "braceleft" ) );
   77           addCharacterEncoding( 0175, COSName.getPDFName( "braceright" ) );
   78           addCharacterEncoding( 0133, COSName.getPDFName( "bracketleft" ) );
   79           addCharacterEncoding( 0135, COSName.getPDFName( "bracketright" ) );
   80           addCharacterEncoding( 0306, COSName.getPDFName( "breve" ) );
   81           addCharacterEncoding( 0267, COSName.getPDFName( "bullet" ) );
   82           addCharacterEncoding( 0143, COSName.getPDFName( "c" ) );
   83           addCharacterEncoding( 0317, COSName.getPDFName( "caron" ) );
   84           addCharacterEncoding( 0313, COSName.getPDFName( "cedilla" ) );
   85           addCharacterEncoding( 0242, COSName.getPDFName( "cent" ) );
   86           addCharacterEncoding( 0303, COSName.getPDFName( "circumflex" ) );
   87           addCharacterEncoding( 0072, COSName.getPDFName( "colon" ) );
   88           addCharacterEncoding( 0054, COSName.getPDFName( "comma" ) );
   89           addCharacterEncoding( 0250, COSName.getPDFName( "currency1" ) );
   90           addCharacterEncoding( 0144, COSName.getPDFName( "d" ) );
   91           addCharacterEncoding( 0262, COSName.getPDFName( "dagger" ) );
   92           addCharacterEncoding( 0263, COSName.getPDFName( "daggerdbl" ) );
   93           addCharacterEncoding( 0310, COSName.getPDFName( "dieresis" ) );
   94           addCharacterEncoding( 0044, COSName.getPDFName( "dollar" ) );
   95           addCharacterEncoding( 0307, COSName.getPDFName( "dotaccent" ) );
   96           addCharacterEncoding( 0365, COSName.getPDFName( "dotlessi" ) );
   97           addCharacterEncoding( 0145, COSName.getPDFName( "e" ) );
   98           addCharacterEncoding( 0070, COSName.getPDFName( "eight" ) );
   99           addCharacterEncoding( 0274, COSName.getPDFName( "ellipsis" ) );
  100           addCharacterEncoding( 0320, COSName.getPDFName( "emdash" ) );
  101           addCharacterEncoding( 0261, COSName.getPDFName( "endash" ) );
  102           addCharacterEncoding( 0075, COSName.getPDFName( "equal" ) );
  103           addCharacterEncoding( 0041, COSName.getPDFName( "exclam" ) );
  104           addCharacterEncoding( 0241, COSName.getPDFName( "exclamdown" ) );
  105           addCharacterEncoding( 0146, COSName.getPDFName( "f" ) );
  106           addCharacterEncoding( 0256, COSName.getPDFName( "fi" ) );
  107           addCharacterEncoding( 0065, COSName.getPDFName( "five" ) );
  108           addCharacterEncoding( 0257, COSName.getPDFName( "fl" ) );
  109           addCharacterEncoding( 0246, COSName.getPDFName( "florin" ) );
  110           addCharacterEncoding( 0064, COSName.getPDFName( "four" ) );
  111           addCharacterEncoding( 0244, COSName.getPDFName( "fraction" ) );
  112           addCharacterEncoding( 0147, COSName.getPDFName( "g" ) );
  113           addCharacterEncoding( 0373, COSName.getPDFName( "germandbls" ) );
  114           addCharacterEncoding( 0301, COSName.getPDFName( "grave" ) );
  115           addCharacterEncoding( 0076, COSName.getPDFName( "greater" ) );
  116           addCharacterEncoding( 0253, COSName.getPDFName( "guillemotleft" ) );
  117           addCharacterEncoding( 0273, COSName.getPDFName( "guillemotright" ) );
  118           addCharacterEncoding( 0254, COSName.getPDFName( "guilsinglleft" ) );
  119           addCharacterEncoding( 0255, COSName.getPDFName( "guilsinglright" ) );
  120           addCharacterEncoding( 0150, COSName.getPDFName( "h" ) );
  121           addCharacterEncoding( 0315, COSName.getPDFName( "hungarumlaut" ) );
  122           addCharacterEncoding( 0055, COSName.getPDFName( "hyphen" ) );
  123           addCharacterEncoding( 0151, COSName.getPDFName( "i" ) );
  124           addCharacterEncoding( 0152, COSName.getPDFName( "j" ) );
  125           addCharacterEncoding( 0153, COSName.getPDFName( "k" ) );
  126           addCharacterEncoding( 0154, COSName.getPDFName( "l" ) );
  127           addCharacterEncoding( 0074, COSName.getPDFName( "less" ) );
  128           addCharacterEncoding( 0370, COSName.getPDFName( "lslash" ) );
  129           addCharacterEncoding( 0155, COSName.getPDFName( "m" ) );
  130           addCharacterEncoding( 0305, COSName.getPDFName( "macron" ) );
  131           addCharacterEncoding( 0156, COSName.getPDFName( "n" ) );
  132           addCharacterEncoding( 0071, COSName.getPDFName( "nine" ) );
  133           addCharacterEncoding( 0043, COSName.getPDFName( "numbersign" ) );
  134           addCharacterEncoding( 0157, COSName.getPDFName( "o" ) );
  135           addCharacterEncoding( 0372, COSName.getPDFName( "oe" ) );
  136           addCharacterEncoding( 0316, COSName.getPDFName( "ogonek" ) );
  137           addCharacterEncoding( 0061, COSName.getPDFName( "one" ) );
  138           addCharacterEncoding( 0343, COSName.getPDFName( "ordfeminine" ) );
  139           addCharacterEncoding( 0353, COSName.getPDFName( "ordmasculine" ) );
  140           addCharacterEncoding( 0371, COSName.getPDFName( "oslash" ) );
  141           addCharacterEncoding( 0160, COSName.getPDFName( "p" ) );
  142           addCharacterEncoding( 0266, COSName.getPDFName( "paragraph" ) );
  143           addCharacterEncoding( 0050, COSName.getPDFName( "parenleft" ) );
  144           addCharacterEncoding( 0051, COSName.getPDFName( "parenright" ) );
  145           addCharacterEncoding( 0045, COSName.getPDFName( "percent" ) );
  146           addCharacterEncoding( 0056, COSName.getPDFName( "period" ) );
  147           addCharacterEncoding( 0264, COSName.getPDFName( "periodcentered" ) );
  148           addCharacterEncoding( 0275, COSName.getPDFName( "perthousand" ) );
  149           addCharacterEncoding( 0053, COSName.getPDFName( "plus" ) );
  150           addCharacterEncoding( 0161, COSName.getPDFName( "q" ) );
  151           addCharacterEncoding( 0077, COSName.getPDFName( "question" ) );
  152           addCharacterEncoding( 0277, COSName.getPDFName( "questiondown" ) );
  153           addCharacterEncoding( 0042, COSName.getPDFName( "quotedbl" ) );
  154           addCharacterEncoding( 0271, COSName.getPDFName( "quotedblbase" ) );
  155           addCharacterEncoding( 0252, COSName.getPDFName( "quotedblleft" ) );
  156           addCharacterEncoding( 0272, COSName.getPDFName( "quotedblright" ) );
  157           addCharacterEncoding( 0140, COSName.getPDFName( "quoteleft" ) );
  158           addCharacterEncoding( 0047, COSName.getPDFName( "quoteright" ) );
  159           addCharacterEncoding( 0270, COSName.getPDFName( "quotesinglbase" ) );
  160           addCharacterEncoding( 0251, COSName.getPDFName( "quotesingle" ) );
  161           addCharacterEncoding( 0162, COSName.getPDFName( "r" ) );
  162           addCharacterEncoding( 0312, COSName.getPDFName( "ring" ) );
  163           addCharacterEncoding( 0163, COSName.getPDFName( "s" ) );
  164           addCharacterEncoding( 0247, COSName.getPDFName( "section" ) );
  165           addCharacterEncoding( 0073, COSName.getPDFName( "semicolon" ) );
  166           addCharacterEncoding( 0067, COSName.getPDFName( "seven" ) );
  167           addCharacterEncoding( 0066, COSName.getPDFName( "six" ) );
  168           addCharacterEncoding( 0057, COSName.getPDFName( "slash" ) );
  169           addCharacterEncoding( 0040, COSName.getPDFName( "space" ) );
  170           addCharacterEncoding( 0243, COSName.getPDFName( "sterling" ) );
  171           addCharacterEncoding( 0164, COSName.getPDFName( "t" ) );
  172           addCharacterEncoding( 0063, COSName.getPDFName( "three" ) );
  173           addCharacterEncoding( 0304, COSName.getPDFName( "tilde" ) );
  174           addCharacterEncoding( 0062, COSName.getPDFName( "two" ) );
  175           addCharacterEncoding( 0165, COSName.getPDFName( "u" ) );
  176           addCharacterEncoding( 0137, COSName.getPDFName( "underscore" ) );
  177           addCharacterEncoding( 0166, COSName.getPDFName( "v" ) );
  178           addCharacterEncoding( 0167, COSName.getPDFName( "w" ) );
  179           addCharacterEncoding( 0170, COSName.getPDFName( "x" ) );
  180           addCharacterEncoding( 0171, COSName.getPDFName( "y" ) );
  181           addCharacterEncoding( 0245, COSName.getPDFName( "yen" ) );
  182           addCharacterEncoding( 0172, COSName.getPDFName( "z" ) );
  183           addCharacterEncoding( 0060, COSName.getPDFName( "zero" ) );
  184       }
  185   
  186       /**
  187        * Convert this standard java object to a COS object.
  188        *
  189        * @return The cos object that matches this Java object.
  190        */
  191       public COSBase getCOSObject()
  192       {
  193           return COSName.STANDARD_ENCODING;
  194       }
  195   }

Home » pdfbox-1.1.0-src » org.apache.pdfbox.encoding » [javadoc | source]