You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pdfbox.apache.org by le...@apache.org on 2009/08/09 19:05:03 UTC

svn commit: r802559 - in /incubator/pdfbox/trunk/src/main/java/org: ./ apache/pdfbox/filter/ apache/pdfbox/pdfparser/ apache/pdfbox/pdmodel/ apache/pdfbox/pdmodel/common/ apache/pdfbox/pdmodel/edit/ apache/pdfbox/pdmodel/encryption/ apache/pdfbox/pdmod...

Author: lehmi
Date: Sun Aug  9 17:05:02 2009
New Revision: 802559

URL: http://svn.apache.org/viewvc?rev=802559&view=rev
Log:
PDFBOX-464: reestablish checkstyle compliance

Modified:
    incubator/pdfbox/trunk/src/main/java/org/   (props changed)
    incubator/pdfbox/trunk/src/main/java/org/apache/pdfbox/filter/ASCII85Filter.java
    incubator/pdfbox/trunk/src/main/java/org/apache/pdfbox/filter/ASCIIHexFilter.java
    incubator/pdfbox/trunk/src/main/java/org/apache/pdfbox/filter/CCITTFaxDecodeFilter.java
    incubator/pdfbox/trunk/src/main/java/org/apache/pdfbox/filter/DCTFilter.java
    incubator/pdfbox/trunk/src/main/java/org/apache/pdfbox/filter/Filter.java
    incubator/pdfbox/trunk/src/main/java/org/apache/pdfbox/filter/LZWFilter.java
    incubator/pdfbox/trunk/src/main/java/org/apache/pdfbox/filter/RunLengthDecodeFilter.java
    incubator/pdfbox/trunk/src/main/java/org/apache/pdfbox/pdfparser/PDFStreamParser.java
    incubator/pdfbox/trunk/src/main/java/org/apache/pdfbox/pdfparser/PDFXrefStreamParser.java
    incubator/pdfbox/trunk/src/main/java/org/apache/pdfbox/pdmodel/PDDocument.java
    incubator/pdfbox/trunk/src/main/java/org/apache/pdfbox/pdmodel/PDJavascriptNameTreeNode.java
    incubator/pdfbox/trunk/src/main/java/org/apache/pdfbox/pdmodel/PDResources.java
    incubator/pdfbox/trunk/src/main/java/org/apache/pdfbox/pdmodel/common/COSArrayList.java
    incubator/pdfbox/trunk/src/main/java/org/apache/pdfbox/pdmodel/edit/PDPageContentStream.java
    incubator/pdfbox/trunk/src/main/java/org/apache/pdfbox/pdmodel/encryption/PublicKeySecurityHandler.java
    incubator/pdfbox/trunk/src/main/java/org/apache/pdfbox/pdmodel/encryption/StandardSecurityHandler.java
    incubator/pdfbox/trunk/src/main/java/org/apache/pdfbox/pdmodel/fdf/FDFAnnotationCaret.java
    incubator/pdfbox/trunk/src/main/java/org/apache/pdfbox/pdmodel/fdf/FDFAnnotationCircle.java
    incubator/pdfbox/trunk/src/main/java/org/apache/pdfbox/pdmodel/fdf/FDFAnnotationFileAttachment.java
    incubator/pdfbox/trunk/src/main/java/org/apache/pdfbox/pdmodel/fdf/FDFAnnotationFreeText.java
    incubator/pdfbox/trunk/src/main/java/org/apache/pdfbox/pdmodel/fdf/FDFAnnotationHighlight.java
    incubator/pdfbox/trunk/src/main/java/org/apache/pdfbox/pdmodel/fdf/FDFAnnotationInk.java
    incubator/pdfbox/trunk/src/main/java/org/apache/pdfbox/pdmodel/fdf/FDFAnnotationLine.java
    incubator/pdfbox/trunk/src/main/java/org/apache/pdfbox/pdmodel/fdf/FDFAnnotationPolygon.java
    incubator/pdfbox/trunk/src/main/java/org/apache/pdfbox/pdmodel/fdf/FDFAnnotationPolyline.java
    incubator/pdfbox/trunk/src/main/java/org/apache/pdfbox/pdmodel/fdf/FDFAnnotationSound.java
    incubator/pdfbox/trunk/src/main/java/org/apache/pdfbox/pdmodel/fdf/FDFAnnotationSquare.java
    incubator/pdfbox/trunk/src/main/java/org/apache/pdfbox/pdmodel/fdf/FDFAnnotationSquiggly.java
    incubator/pdfbox/trunk/src/main/java/org/apache/pdfbox/pdmodel/fdf/FDFAnnotationStamp.java
    incubator/pdfbox/trunk/src/main/java/org/apache/pdfbox/pdmodel/fdf/FDFAnnotationStrikeOut.java
    incubator/pdfbox/trunk/src/main/java/org/apache/pdfbox/pdmodel/fdf/FDFAnnotationText.java
    incubator/pdfbox/trunk/src/main/java/org/apache/pdfbox/pdmodel/fdf/FDFAnnotationUnderline.java
    incubator/pdfbox/trunk/src/main/java/org/apache/pdfbox/pdmodel/font/FontManager.java
    incubator/pdfbox/trunk/src/main/java/org/apache/pdfbox/pdmodel/font/PDFontFactory.java
    incubator/pdfbox/trunk/src/main/java/org/apache/pdfbox/pdmodel/font/PDType0Font.java
    incubator/pdfbox/trunk/src/main/java/org/apache/pdfbox/pdmodel/font/PDType1AfmPfbFont.java
    incubator/pdfbox/trunk/src/main/java/org/apache/pdfbox/pdmodel/font/PDType3Font.java

Propchange: incubator/pdfbox/trunk/src/main/java/org/
            ('svn:mergeinfo' removed)

Modified: incubator/pdfbox/trunk/src/main/java/org/apache/pdfbox/filter/ASCII85Filter.java
URL: http://svn.apache.org/viewvc/incubator/pdfbox/trunk/src/main/java/org/apache/pdfbox/filter/ASCII85Filter.java?rev=802559&r1=802558&r2=802559&view=diff
==============================================================================
--- incubator/pdfbox/trunk/src/main/java/org/apache/pdfbox/filter/ASCII85Filter.java (original)
+++ incubator/pdfbox/trunk/src/main/java/org/apache/pdfbox/filter/ASCII85Filter.java Sun Aug  9 17:05:02 2009
@@ -36,7 +36,8 @@
     /**
      * {@inheritDoc}
      */
-    public void decode( InputStream compressedData, OutputStream result, COSDictionary options, int filterIndex ) throws IOException
+    public void decode( InputStream compressedData, OutputStream result, COSDictionary options, int filterIndex ) 
+        throws IOException
     {
         ASCII85InputStream is = null;
         try
@@ -62,7 +63,8 @@
     /**
      * {@inheritDoc}
      */
-    public void encode( InputStream rawData, OutputStream result, COSDictionary options, int filterIndex ) throws IOException
+    public void encode( InputStream rawData, OutputStream result, COSDictionary options, int filterIndex ) 
+        throws IOException
     {
         ASCII85OutputStream os = new ASCII85OutputStream(result);
         byte[] buffer = new byte[1024];

Modified: incubator/pdfbox/trunk/src/main/java/org/apache/pdfbox/filter/ASCIIHexFilter.java
URL: http://svn.apache.org/viewvc/incubator/pdfbox/trunk/src/main/java/org/apache/pdfbox/filter/ASCIIHexFilter.java?rev=802559&r1=802558&r2=802559&view=diff
==============================================================================
--- incubator/pdfbox/trunk/src/main/java/org/apache/pdfbox/filter/ASCIIHexFilter.java (original)
+++ incubator/pdfbox/trunk/src/main/java/org/apache/pdfbox/filter/ASCIIHexFilter.java Sun Aug  9 17:05:02 2009
@@ -34,7 +34,7 @@
 {
 
     /**
-     * Whitespace
+     * Whitespace.
      *   0  0x00  Null (NUL)
      *   9  0x09  Tab (HT)
      *  10  0x0A  Line feed (LF)
@@ -43,12 +43,12 @@
      *  32  0x20  Space (SP)  
      */
 
-    protected boolean isWhitespace(int c) 
+    private boolean isWhitespace(int c) 
     {
         return c == 0 || c == 9 || c == 10 || c == 12 || c == 13 || c == 32;
     }
-	   
-    protected boolean isEOD(int c) 
+    
+    private boolean isEOD(int c) 
     {
         return (c == 62); // '>' - EOD
     }
@@ -56,7 +56,8 @@
     /**
       * {@inheritDoc}
       */
-    public void decode( InputStream compressedData, OutputStream result, COSDictionary options, int filterIndex ) throws IOException 
+    public void decode( InputStream compressedData, OutputStream result, COSDictionary options, int filterIndex ) 
+        throws IOException 
     {
         int value = 0;
         int firstByte = 0;
@@ -65,16 +66,23 @@
         {
             // always after first char
             while(isWhitespace(firstByte))
+            {
                 firstByte = compressedData.read();
+            }
             if(isEOD(firstByte))
+            {
                 break;
+            }
        
             if(REVERSE_HEX[firstByte] == -1)
+            {
                 System.out.println("Invalid Hex Code; int: " + firstByte + " char: " + (char) firstByte);
+            }
             value = REVERSE_HEX[firstByte] * 16;
             secondByte = compressedData.read();
        
-            if(isEOD(secondByte)) {
+            if(isEOD(secondByte)) 
+            {
                 // second value behaves like 0 in case of EOD
                 result.write( value );
                 break;
@@ -82,7 +90,9 @@
             if(secondByte >= 0) 
             {
                 if(REVERSE_HEX[secondByte] == -1)
+                {
                     System.out.println("Invalid Hex Code; int: " + secondByte + " char: " + (char) secondByte);
+                }
                 value += REVERSE_HEX[secondByte];
             }
             result.write( value );
@@ -200,7 +210,8 @@
     /**
      * {@inheritDoc}
      */
-    public void encode( InputStream rawData, OutputStream result, COSDictionary options, int filterIndex ) throws IOException
+    public void encode( InputStream rawData, OutputStream result, COSDictionary options, int filterIndex ) 
+        throws IOException
     {
         int byteRead = 0;
         while( (byteRead = rawData.read()) != -1 )

Modified: incubator/pdfbox/trunk/src/main/java/org/apache/pdfbox/filter/CCITTFaxDecodeFilter.java
URL: http://svn.apache.org/viewvc/incubator/pdfbox/trunk/src/main/java/org/apache/pdfbox/filter/CCITTFaxDecodeFilter.java?rev=802559&r1=802558&r2=802559&view=diff
==============================================================================
--- incubator/pdfbox/trunk/src/main/java/org/apache/pdfbox/filter/CCITTFaxDecodeFilter.java (original)
+++ incubator/pdfbox/trunk/src/main/java/org/apache/pdfbox/filter/CCITTFaxDecodeFilter.java Sun Aug  9 17:05:02 2009
@@ -61,7 +61,8 @@
     /**
      * {@inheritDoc}
      */
-    public void decode(InputStream compressedData, OutputStream result, COSDictionary options, int filterIndex) throws IOException
+    public void decode(InputStream compressedData, OutputStream result, COSDictionary options, int filterIndex) 
+        throws IOException
     {
         // log.warn( "Warning: CCITTFaxDecode.decode is not implemented yet,
         // skipping this stream." );
@@ -92,7 +93,8 @@
         }
         else
         {
-            throw new IOException( "Error: Expected COSArray or COSDictionary and not " + baseObj.getClass().getName() );
+            throw new IOException( "Error: Expected COSArray or COSDictionary and not " 
+                    + baseObj.getClass().getName() );
         }
 
         int width = options.getInt("Width");
@@ -721,7 +723,8 @@
     /**
      * {@inheritDoc}
      */
-    public void encode(InputStream rawData, OutputStream result, COSDictionary options, int filterIndex ) throws IOException
+    public void encode(InputStream rawData, OutputStream result, COSDictionary options, int filterIndex ) 
+        throws IOException
     {
         System.err.println("Warning: CCITTFaxDecode.encode is not implemented yet, skipping this stream.");
     }

Modified: incubator/pdfbox/trunk/src/main/java/org/apache/pdfbox/filter/DCTFilter.java
URL: http://svn.apache.org/viewvc/incubator/pdfbox/trunk/src/main/java/org/apache/pdfbox/filter/DCTFilter.java?rev=802559&r1=802558&r2=802559&view=diff
==============================================================================
--- incubator/pdfbox/trunk/src/main/java/org/apache/pdfbox/filter/DCTFilter.java (original)
+++ incubator/pdfbox/trunk/src/main/java/org/apache/pdfbox/filter/DCTFilter.java Sun Aug  9 17:05:02 2009
@@ -34,7 +34,8 @@
     /**
      * {@inheritDoc}
      */
-    public void decode( InputStream compressedData, OutputStream result, COSDictionary options, int filterIndex ) throws IOException
+    public void decode( InputStream compressedData, OutputStream result, COSDictionary options, int filterIndex ) 
+        throws IOException
     {
         System.err.println( "Warning: DCTFilter.decode is not implemented yet, skipping this stream." );
     }
@@ -42,7 +43,8 @@
      /**
      * {@inheritDoc}
      */
-    public void encode( InputStream rawData, OutputStream result, COSDictionary options, int filterIndex ) throws IOException
+    public void encode( InputStream rawData, OutputStream result, COSDictionary options, int filterIndex ) 
+        throws IOException
     {
         System.err.println( "Warning: DCTFilter.encode is not implemented yet, skipping this stream." );
     }

Modified: incubator/pdfbox/trunk/src/main/java/org/apache/pdfbox/filter/Filter.java
URL: http://svn.apache.org/viewvc/incubator/pdfbox/trunk/src/main/java/org/apache/pdfbox/filter/Filter.java?rev=802559&r1=802558&r2=802559&view=diff
==============================================================================
--- incubator/pdfbox/trunk/src/main/java/org/apache/pdfbox/filter/Filter.java (original)
+++ incubator/pdfbox/trunk/src/main/java/org/apache/pdfbox/filter/Filter.java Sun Aug  9 17:05:02 2009
@@ -40,7 +40,8 @@
      *
      * @throws IOException If there is an error decompressing the stream.
      */
-    public void decode( InputStream compressedData, OutputStream result, COSDictionary options, int filterIndex ) throws IOException;
+    public void decode( InputStream compressedData, OutputStream result, COSDictionary options, int filterIndex ) 
+        throws IOException;
 
     /**
      * This will encode some data.
@@ -52,5 +53,6 @@
      *
      * @throws IOException If there is an error compressing the stream.
      */
-    public void encode( InputStream rawData, OutputStream result, COSDictionary options, int filterIndex ) throws IOException;
+    public void encode( InputStream rawData, OutputStream result, COSDictionary options, int filterIndex ) 
+        throws IOException;
 }

Modified: incubator/pdfbox/trunk/src/main/java/org/apache/pdfbox/filter/LZWFilter.java
URL: http://svn.apache.org/viewvc/incubator/pdfbox/trunk/src/main/java/org/apache/pdfbox/filter/LZWFilter.java?rev=802559&r1=802558&r2=802559&view=diff
==============================================================================
--- incubator/pdfbox/trunk/src/main/java/org/apache/pdfbox/filter/LZWFilter.java (original)
+++ incubator/pdfbox/trunk/src/main/java/org/apache/pdfbox/filter/LZWFilter.java Sun Aug  9 17:05:02 2009
@@ -49,7 +49,8 @@
     /**
      * {@inheritDoc}
      */
-    public void decode( InputStream compressedData, OutputStream result, COSDictionary options, int filterIndex ) throws IOException
+    public void decode( InputStream compressedData, OutputStream result, COSDictionary options, int filterIndex ) 
+        throws IOException
     {
         //log.debug("decode( )");
         NBitInputStream in = null;
@@ -121,7 +122,8 @@
     /**
      * {@inheritDoc}
      */
-    public void encode( InputStream rawData, OutputStream result, COSDictionary options, int filterIndex ) throws IOException
+    public void encode( InputStream rawData, OutputStream result, COSDictionary options, int filterIndex ) 
+        throws IOException
     {
         //log.debug("encode( )");
         PushbackInputStream input = new PushbackInputStream( rawData, 4096 );

Modified: incubator/pdfbox/trunk/src/main/java/org/apache/pdfbox/filter/RunLengthDecodeFilter.java
URL: http://svn.apache.org/viewvc/incubator/pdfbox/trunk/src/main/java/org/apache/pdfbox/filter/RunLengthDecodeFilter.java?rev=802559&r1=802558&r2=802559&view=diff
==============================================================================
--- incubator/pdfbox/trunk/src/main/java/org/apache/pdfbox/filter/RunLengthDecodeFilter.java (original)
+++ incubator/pdfbox/trunk/src/main/java/org/apache/pdfbox/filter/RunLengthDecodeFilter.java Sun Aug  9 17:05:02 2009
@@ -59,7 +59,8 @@
     /**
      * {@inheritDoc}
      */
-    public void decode( InputStream compressedData, OutputStream result, COSDictionary options, int filterIndex ) throws IOException
+    public void decode( InputStream compressedData, OutputStream result, COSDictionary options, int filterIndex ) 
+        throws IOException
     {
         int dupAmount = -1;
         byte[] buffer = new byte[128];
@@ -90,7 +91,8 @@
      /**
      * {@inheritDoc}
      */
-    public void encode( InputStream rawData, OutputStream result, COSDictionary options, int filterIndex ) throws IOException
+    public void encode( InputStream rawData, OutputStream result, COSDictionary options, int filterIndex ) 
+        throws IOException
     {
         System.err.println( "Warning: RunLengthDecodeFilter.encode is not implemented yet, skipping this stream." );
     }

Modified: incubator/pdfbox/trunk/src/main/java/org/apache/pdfbox/pdfparser/PDFStreamParser.java
URL: http://svn.apache.org/viewvc/incubator/pdfbox/trunk/src/main/java/org/apache/pdfbox/pdfparser/PDFStreamParser.java?rev=802559&r1=802558&r2=802559&view=diff
==============================================================================
--- incubator/pdfbox/trunk/src/main/java/org/apache/pdfbox/pdfparser/PDFStreamParser.java (original)
+++ incubator/pdfbox/trunk/src/main/java/org/apache/pdfbox/pdfparser/PDFStreamParser.java Sun Aug  9 17:05:02 2009
@@ -248,7 +248,9 @@
                     pdfSource.read();
 
                     if (dotNotRead && (c == '.'))
+                    {
                         dotNotRead = false;
+                    }
                 }
                 retval = COSNumber.get( buf.toString() );
                 break;

Modified: incubator/pdfbox/trunk/src/main/java/org/apache/pdfbox/pdfparser/PDFXrefStreamParser.java
URL: http://svn.apache.org/viewvc/incubator/pdfbox/trunk/src/main/java/org/apache/pdfbox/pdfparser/PDFXrefStreamParser.java?rev=802559&r1=802558&r2=802559&view=diff
==============================================================================
--- incubator/pdfbox/trunk/src/main/java/org/apache/pdfbox/pdfparser/PDFXrefStreamParser.java (original)
+++ incubator/pdfbox/trunk/src/main/java/org/apache/pdfbox/pdfparser/PDFXrefStreamParser.java Sun Aug  9 17:05:02 2009
@@ -29,13 +29,13 @@
 
 /**
  * This will parse a PDF 1.5 (or better) Xref stream and 
- * extract the xref information from the stream
+ * extract the xref information from the stream.
  * 
- * @author
- * @version
+ *  @author <a href="mailto:justinl@basistech.com">Justin LeFebvre</a>
+ *  @version $Revision: 1.0 $
  */
-public class PDFXrefStreamParser extends BaseParser {
-
+public class PDFXrefStreamParser extends BaseParser 
+{
     private COSStream stream;
 
     /**
@@ -46,25 +46,28 @@
      *
      * @throws IOException If there is an error initializing the stream.
      */
-    public PDFXrefStreamParser(COSStream strm, COSDocument doc) throws IOException{
+    public PDFXrefStreamParser(COSStream strm, COSDocument doc) throws IOException
+    {
         super(strm.getUnfilteredStream());
         setDocument(doc);
         stream = strm;
     }
 
     /**
-     * Parses through the unfiltered stream and populates the xrefTable
-     * HashMap
+     * Parses through the unfiltered stream and populates the xrefTable HashMap.
      * @throws IOException If there is an error while parsing the stream.
      */
-    public void parse() throws IOException{
-        try{
+    public void parse() throws IOException
+    {
+        try
+        {
             COSArray xrefFormat = (COSArray)stream.getDictionaryObject("W");
             COSArray indexArray = (COSArray)stream.getDictionaryObject("Index");
             /*
              * If Index doesn't exist, we will use the default values. 
              */
-            if(indexArray == null){
+            if(indexArray == null)
+            {
                 indexArray = new COSArray();
                 indexArray.add(new COSInteger(0));
                 indexArray.add(stream.getDictionaryObject("Size"));
@@ -76,10 +79,12 @@
              * Populates objNums with all object numbers available
              */
             Iterator indexIter = indexArray.iterator();
-            while(indexIter.hasNext()){
+            while(indexIter.hasNext())
+            {
                 int objID = ((COSInteger)indexIter.next()).intValue();
                 int size = ((COSInteger)indexIter.next()).intValue();
-                for(int i = 0; i < size; i++){
+                for(int i = 0; i < size; i++)
+                {
                     objNums.add(new Integer(objID + i));
                 }
             }
@@ -92,7 +97,8 @@
             int w2 = xrefFormat.getInt(2);
             int lineSize = w0 + w1 + w2;
             
-            while(pdfSource.available() > 0){
+            while(pdfSource.available() > 0)
+            {
                 byte[] currLine = new byte[lineSize];
                 pdfSource.read(currLine);
 
@@ -101,7 +107,8 @@
                  * Grabs the number of bytes specified for the first column in 
                  * the W array and stores it.
                  */
-                for(int i = 0; i < w0; i++){
+                for(int i = 0; i < w0; i++)
+                {
                     type += (currLine[i] & 0x00ff) << ((w0 - i - 1)* 8);
                 }
                 //Need to remember the current objID
@@ -109,34 +116,40 @@
                 /*
                  * 3 different types of entries. 
                  */
-                switch(type){
-                case 0:
-                    /*
-                     * Skipping free objects
-                     */
-                    break;
-                case 1:                   
-                    int offset = 0;
-                    for(int i = 0; i < w1; i++){
-                        offset += (currLine[i + w0] & 0x00ff) << ((w1 - i - 1) * 8);
-                    }
-                    int genNum = 0;
-                    for(int i = 0; i < w2; i++){
-                        genNum += (currLine[i + w0 + w1] & 0x00ff) << ((w2 - i - 1) * 8);
-                    }
-                    COSObjectKey objKey = new COSObjectKey(objID.intValue(), genNum);
-                    document.setXRef(objKey, offset);
-                    break;
-                case 2:
-                    /*
-                     * These objects are handled by the dereferenceObjects() method
-                     * since they're only pointing to object numbers
-                     */
-                    break;
+                switch(type)
+                {
+                    case 0:
+                        /*
+                         * Skipping free objects
+                         */
+                        break;
+                    case 1:                   
+                        int offset = 0;
+                        for(int i = 0; i < w1; i++)
+                        {
+                            offset += (currLine[i + w0] & 0x00ff) << ((w1 - i - 1) * 8);
+                        }
+                        int genNum = 0;
+                        for(int i = 0; i < w2; i++)
+                        {
+                            genNum += (currLine[i + w0 + w1] & 0x00ff) << ((w2 - i - 1) * 8);
+                        }
+                        COSObjectKey objKey = new COSObjectKey(objID.intValue(), genNum);
+                        document.setXRef(objKey, offset);
+                        break;
+                    case 2:
+                        /*
+                         * These objects are handled by the dereferenceObjects() method
+                         * since they're only pointing to object numbers
+                         */
+                        break;
+                    default:
+                        break;
                 }
             }
         }
-        finally{
+        finally
+        {
             pdfSource.close();
         }
     }

Modified: incubator/pdfbox/trunk/src/main/java/org/apache/pdfbox/pdmodel/PDDocument.java
URL: http://svn.apache.org/viewvc/incubator/pdfbox/trunk/src/main/java/org/apache/pdfbox/pdmodel/PDDocument.java?rev=802559&r1=802558&r2=802559&view=diff
==============================================================================
--- incubator/pdfbox/trunk/src/main/java/org/apache/pdfbox/pdmodel/PDDocument.java (original)
+++ incubator/pdfbox/trunk/src/main/java/org/apache/pdfbox/pdmodel/PDDocument.java Sun Aug  9 17:05:02 2009
@@ -597,7 +597,8 @@
      *
      * @throws IOException If there is an error reading from the stream.
      */
-    public static PDDocument load(URL url, boolean force) throws IOException{
+    public static PDDocument load(URL url, boolean force) throws IOException
+    {
         return load(url.openStream(), force);
     }
 
@@ -642,7 +643,8 @@
      *
      * @throws IOException If there is an error reading from the stream.
      */
-    public static PDDocument load(String filename, boolean force) throws IOException{
+    public static PDDocument load(String filename, boolean force) throws IOException
+    {
         return load(new FileInputStream( filename ), force);
     }
 
@@ -716,7 +718,8 @@
      *
      * @throws IOException If there is an error reading from the stream.
      */
-    public static PDDocument load(InputStream input, boolean force) throws IOException{
+    public static PDDocument load(InputStream input, boolean force) throws IOException
+    {
         return load(input, null, force);
     }
     
@@ -749,7 +752,8 @@
      *
      * @throws IOException If there is an error reading from the stream.
      */
-    public static PDDocument load(InputStream input, RandomAccess scratchFile, boolean force) throws IOException{
+    public static PDDocument load(InputStream input, RandomAccess scratchFile, boolean force) throws IOException
+    {
         PDFParser parser = new PDFParser( new BufferedInputStream( input ), scratchFile, force);
         parser.parse();
         return parser.getPDDocument();
@@ -837,26 +841,28 @@
         int rotation = page.findRotation();
         if(rotation == 90)
         {
-        	format.setOrientation( PageFormat.LANDSCAPE );
-	    }
-	    else if(rotation == 270)
-	    {
-	    	format.setOrientation( PageFormat.REVERSE_LANDSCAPE );
-	    }
-	    else
-	    {
-	    	format.setOrientation( PageFormat.PORTRAIT );
-	    }
-
-      // If there is rotation > 0, we have to exchange the pagedimension for the printer
-      if (rotation == 90 || rotation == 270) {
-        	paper.setImageableArea( 0,0,height,width);
-        	paper.setSize( height, width );
-	    }
-        else {
-        	paper.setImageableArea( 0,0,width,height);
-        	paper.setSize( width, height );
-	    }
+            format.setOrientation( PageFormat.LANDSCAPE );
+        }
+        else if(rotation == 270)
+        {
+            format.setOrientation( PageFormat.REVERSE_LANDSCAPE );
+        }
+        else
+        {
+            format.setOrientation( PageFormat.PORTRAIT );
+        }
+
+        // If there is rotation > 0, we have to exchange the pagedimension for the printer
+        if (rotation == 90 || rotation == 270) 
+        {
+            paper.setImageableArea( 0,0,height,width);
+            paper.setSize( height, width );
+        }
+        else 
+        {
+            paper.setImageableArea( 0,0,width,height);
+            paper.setSize( width, height );
+        }
         format.setPaper( paper );
         return format;
     }
@@ -930,7 +936,7 @@
      * This will send the PDF to the default printer without prompting the user
      * for any printer settings.
      *
-     * @param job A printer job definition.
+     * @param printJob A printer job definition.
      * @see PDDocument#print()
      *
      * @throws PrinterException If there is an error while printing.

Modified: incubator/pdfbox/trunk/src/main/java/org/apache/pdfbox/pdmodel/PDJavascriptNameTreeNode.java
URL: http://svn.apache.org/viewvc/incubator/pdfbox/trunk/src/main/java/org/apache/pdfbox/pdmodel/PDJavascriptNameTreeNode.java?rev=802559&r1=802558&r2=802559&view=diff
==============================================================================
--- incubator/pdfbox/trunk/src/main/java/org/apache/pdfbox/pdmodel/PDJavascriptNameTreeNode.java (original)
+++ incubator/pdfbox/trunk/src/main/java/org/apache/pdfbox/pdmodel/PDJavascriptNameTreeNode.java Sun Aug  9 17:05:02 2009
@@ -67,7 +67,8 @@
         }
         else
         {
-            throw new IOException( "Error creating Javascript object, expected either COSString or COSStream and not " + base );
+            throw new IOException( "Error creating Javascript object, expected either COSString or COSStream and not " 
+                    + base );
         }
         return stream;
     }

Modified: incubator/pdfbox/trunk/src/main/java/org/apache/pdfbox/pdmodel/PDResources.java
URL: http://svn.apache.org/viewvc/incubator/pdfbox/trunk/src/main/java/org/apache/pdfbox/pdmodel/PDResources.java?rev=802559&r1=802558&r2=802559&view=diff
==============================================================================
--- incubator/pdfbox/trunk/src/main/java/org/apache/pdfbox/pdmodel/PDResources.java (original)
+++ incubator/pdfbox/trunk/src/main/java/org/apache/pdfbox/pdmodel/PDResources.java Sun Aug  9 17:05:02 2009
@@ -26,17 +26,11 @@
 import org.apache.pdfbox.cos.COSDictionary;
 import org.apache.pdfbox.cos.COSName;
 import org.apache.pdfbox.cos.COSStream;
-
 import org.apache.pdfbox.pdmodel.common.COSDictionaryMap;
 import org.apache.pdfbox.pdmodel.common.COSObjectable;
-
-import org.apache.pdfbox.pdmodel.font.PDFont;
 import org.apache.pdfbox.pdmodel.font.PDFontFactory;
-
 import org.apache.pdfbox.pdmodel.graphics.PDExtendedGraphicsState;
-
 import org.apache.pdfbox.pdmodel.graphics.color.PDColorSpaceFactory;
-
 import org.apache.pdfbox.pdmodel.graphics.xobject.PDXObject;
 import org.apache.pdfbox.pdmodel.graphics.xobject.PDXObjectImage;
 
@@ -120,7 +114,7 @@
             if( font instanceof COSDictionary )
             {
                 COSDictionary fontDictionary = (COSDictionary)font;
-	            actuals.put( fontName.getName(), PDFontFactory.createFont( fontDictionary, fontCache ));
+                actuals.put( fontName.getName(), PDFontFactory.createFont( fontDictionary, fontCache ));
             }
         }
         return retval;

Modified: incubator/pdfbox/trunk/src/main/java/org/apache/pdfbox/pdmodel/common/COSArrayList.java
URL: http://svn.apache.org/viewvc/incubator/pdfbox/trunk/src/main/java/org/apache/pdfbox/pdmodel/common/COSArrayList.java?rev=802559&r1=802558&r2=802559&view=diff
==============================================================================
--- incubator/pdfbox/trunk/src/main/java/org/apache/pdfbox/pdmodel/common/COSArrayList.java (original)
+++ incubator/pdfbox/trunk/src/main/java/org/apache/pdfbox/pdmodel/common/COSArrayList.java Sun Aug  9 17:05:02 2009
@@ -644,7 +644,10 @@
         return actual.subList( fromIndex, toIndex );
     }
     
-        public String toString()
+    /**
+     * {@inheritDoc}
+     */
+    public String toString()
     {
         return "COSArrayList{" + array.toString() + "}";
     }

Modified: incubator/pdfbox/trunk/src/main/java/org/apache/pdfbox/pdmodel/edit/PDPageContentStream.java
URL: http://svn.apache.org/viewvc/incubator/pdfbox/trunk/src/main/java/org/apache/pdfbox/pdmodel/edit/PDPageContentStream.java?rev=802559&r1=802558&r2=802559&view=diff
==============================================================================
--- incubator/pdfbox/trunk/src/main/java/org/apache/pdfbox/pdmodel/edit/PDPageContentStream.java (original)
+++ incubator/pdfbox/trunk/src/main/java/org/apache/pdfbox/pdmodel/edit/PDPageContentStream.java Sun Aug  9 17:05:02 2009
@@ -377,8 +377,8 @@
      */
     public void setStrokingColorSpace( PDColorSpace colorSpace ) throws IOException
     {
-    	currentStrokingColorSpace = colorSpace;
-    	writeColorSpace( colorSpace );
+        currentStrokingColorSpace = colorSpace;
+        writeColorSpace( colorSpace );
         appendRawCommands( SET_STROKING_COLORSPACE );
     }
 
@@ -391,8 +391,8 @@
      */
     public void setNonStrokingColorSpace( PDColorSpace colorSpace ) throws IOException
     {
-    	currentNonStrokingColorSpace = colorSpace;
-    	writeColorSpace( colorSpace );
+        currentNonStrokingColorSpace = colorSpace;
+        writeColorSpace( colorSpace );
         appendRawCommands( SET_NON_STROKING_COLORSPACE );
     }
 

Modified: incubator/pdfbox/trunk/src/main/java/org/apache/pdfbox/pdmodel/encryption/PublicKeySecurityHandler.java
URL: http://svn.apache.org/viewvc/incubator/pdfbox/trunk/src/main/java/org/apache/pdfbox/pdmodel/encryption/PublicKeySecurityHandler.java?rev=802559&r1=802558&r2=802559&view=diff
==============================================================================
--- incubator/pdfbox/trunk/src/main/java/org/apache/pdfbox/pdmodel/encryption/PublicKeySecurityHandler.java (original)
+++ incubator/pdfbox/trunk/src/main/java/org/apache/pdfbox/pdmodel/encryption/PublicKeySecurityHandler.java Sun Aug  9 17:05:02 2009
@@ -243,7 +243,8 @@
             Security.addProvider(new BouncyCastleProvider());
 
             PDEncryptionDictionary dictionary = doc.getEncryptionDictionary();
-            if (dictionary == null) {
+            if (dictionary == null) 
+            {
                 dictionary = new PDEncryptionDictionary();
             }
 

Modified: incubator/pdfbox/trunk/src/main/java/org/apache/pdfbox/pdmodel/encryption/StandardSecurityHandler.java
URL: http://svn.apache.org/viewvc/incubator/pdfbox/trunk/src/main/java/org/apache/pdfbox/pdmodel/encryption/StandardSecurityHandler.java?rev=802559&r1=802558&r2=802559&view=diff
==============================================================================
--- incubator/pdfbox/trunk/src/main/java/org/apache/pdfbox/pdmodel/encryption/StandardSecurityHandler.java (original)
+++ incubator/pdfbox/trunk/src/main/java/org/apache/pdfbox/pdmodel/encryption/StandardSecurityHandler.java Sun Aug  9 17:05:02 2009
@@ -771,6 +771,23 @@
             }
             return matches;
         }
+    
+    /**
+     * Check if a plaintext password is the user password.
+     *
+     * @param password The plaintext password.
+     * @param u The u entry of the encryption dictionary.
+     * @param o The o entry of the encryption dictionary.
+     * @param permissions The permissions set in the the PDF.
+     * @param id The document id used for encryption.
+     * @param encRevision The revision of the encryption algorithm.
+     * @param length The length of the encryption key.
+     *
+     * @return true If the plaintext password is the user password.
+     *
+     * @throws CryptographyException If there is an error during encryption.
+     * @throws IOException If there is an error accessing data.
+     */
     public final boolean isUserPassword(
             String password,
             byte[] u,
@@ -779,10 +796,28 @@
             byte[] id,
             int encRevision,
             int length)
-            throws CryptographyException, IOException{
-		    return isUserPassword(password.getBytes(),
-			u,o,permissions, id, encRevision, length);
-	    }
+            throws CryptographyException, IOException
+            {
+                return isUserPassword(password.getBytes(),
+                        u,o,permissions, id, encRevision, length);
+            }
+
+    /**
+     * Check for owner password.
+     *
+     * @param password The owner password.
+     * @param u The u entry of the encryption dictionary.
+     * @param o The o entry of the encryption dictionary.
+     * @param permissions The set of permissions on the document.
+     * @param id The document id.
+     * @param encRevision The encryption algorithm revision.
+     * @param length The encryption key length.
+     *
+     * @return True If the ownerPassword param is the owner password.
+     *
+     * @throws CryptographyException If there is an error during encryption.
+     * @throws IOException If there is an error accessing data.
+     */
     public final boolean isOwnerPassword(
             String password,
             byte[] u,
@@ -791,10 +826,12 @@
             byte[] id,
             int encRevision,
             int length)
-            throws CryptographyException, IOException{
-		    return isOwnerPassword(password.getBytes(),
-			u,o,permissions, id, encRevision, length);
-	    }
+            throws CryptographyException, IOException
+            {
+                return isOwnerPassword(password.getBytes(),
+                        u,o,permissions, id, encRevision, length);
+            }
+
     private static final boolean arraysEqual( byte[] first, byte[] second, int count )
     {
         boolean equal = first.length >= count && second.length >= count;

Modified: incubator/pdfbox/trunk/src/main/java/org/apache/pdfbox/pdmodel/fdf/FDFAnnotationCaret.java
URL: http://svn.apache.org/viewvc/incubator/pdfbox/trunk/src/main/java/org/apache/pdfbox/pdmodel/fdf/FDFAnnotationCaret.java?rev=802559&r1=802558&r2=802559&view=diff
==============================================================================
--- incubator/pdfbox/trunk/src/main/java/org/apache/pdfbox/pdmodel/fdf/FDFAnnotationCaret.java (original)
+++ incubator/pdfbox/trunk/src/main/java/org/apache/pdfbox/pdmodel/fdf/FDFAnnotationCaret.java Sun Aug  9 17:05:02 2009
@@ -45,7 +45,7 @@
     }
 
     /**
-     * Constructor
+     * Constructor.
      *
      * @param a An existing FDF Annotation.
      */

Modified: incubator/pdfbox/trunk/src/main/java/org/apache/pdfbox/pdmodel/fdf/FDFAnnotationCircle.java
URL: http://svn.apache.org/viewvc/incubator/pdfbox/trunk/src/main/java/org/apache/pdfbox/pdmodel/fdf/FDFAnnotationCircle.java?rev=802559&r1=802558&r2=802559&view=diff
==============================================================================
--- incubator/pdfbox/trunk/src/main/java/org/apache/pdfbox/pdmodel/fdf/FDFAnnotationCircle.java (original)
+++ incubator/pdfbox/trunk/src/main/java/org/apache/pdfbox/pdmodel/fdf/FDFAnnotationCircle.java Sun Aug  9 17:05:02 2009
@@ -45,7 +45,7 @@
     }
 
     /**
-     * Constructor
+     * Constructor.
      *
      * @param a An existing FDF Annotation.
      */

Modified: incubator/pdfbox/trunk/src/main/java/org/apache/pdfbox/pdmodel/fdf/FDFAnnotationFileAttachment.java
URL: http://svn.apache.org/viewvc/incubator/pdfbox/trunk/src/main/java/org/apache/pdfbox/pdmodel/fdf/FDFAnnotationFileAttachment.java?rev=802559&r1=802558&r2=802559&view=diff
==============================================================================
--- incubator/pdfbox/trunk/src/main/java/org/apache/pdfbox/pdmodel/fdf/FDFAnnotationFileAttachment.java (original)
+++ incubator/pdfbox/trunk/src/main/java/org/apache/pdfbox/pdmodel/fdf/FDFAnnotationFileAttachment.java Sun Aug  9 17:05:02 2009
@@ -45,7 +45,7 @@
     }
 
     /**
-     * Constructor
+     * Constructor.
      *
      * @param a An existing FDF Annotation.
      */

Modified: incubator/pdfbox/trunk/src/main/java/org/apache/pdfbox/pdmodel/fdf/FDFAnnotationFreeText.java
URL: http://svn.apache.org/viewvc/incubator/pdfbox/trunk/src/main/java/org/apache/pdfbox/pdmodel/fdf/FDFAnnotationFreeText.java?rev=802559&r1=802558&r2=802559&view=diff
==============================================================================
--- incubator/pdfbox/trunk/src/main/java/org/apache/pdfbox/pdmodel/fdf/FDFAnnotationFreeText.java (original)
+++ incubator/pdfbox/trunk/src/main/java/org/apache/pdfbox/pdmodel/fdf/FDFAnnotationFreeText.java Sun Aug  9 17:05:02 2009
@@ -45,7 +45,7 @@
     }
 
     /**
-     * Constructor
+     * Constructor.
      *
      * @param a An existing FDF Annotation.
      */

Modified: incubator/pdfbox/trunk/src/main/java/org/apache/pdfbox/pdmodel/fdf/FDFAnnotationHighlight.java
URL: http://svn.apache.org/viewvc/incubator/pdfbox/trunk/src/main/java/org/apache/pdfbox/pdmodel/fdf/FDFAnnotationHighlight.java?rev=802559&r1=802558&r2=802559&view=diff
==============================================================================
--- incubator/pdfbox/trunk/src/main/java/org/apache/pdfbox/pdmodel/fdf/FDFAnnotationHighlight.java (original)
+++ incubator/pdfbox/trunk/src/main/java/org/apache/pdfbox/pdmodel/fdf/FDFAnnotationHighlight.java Sun Aug  9 17:05:02 2009
@@ -45,7 +45,7 @@
     }
 
     /**
-     * Constructor
+     * Constructor.
      *
      * @param a An existing FDF Annotation.
      */

Modified: incubator/pdfbox/trunk/src/main/java/org/apache/pdfbox/pdmodel/fdf/FDFAnnotationInk.java
URL: http://svn.apache.org/viewvc/incubator/pdfbox/trunk/src/main/java/org/apache/pdfbox/pdmodel/fdf/FDFAnnotationInk.java?rev=802559&r1=802558&r2=802559&view=diff
==============================================================================
--- incubator/pdfbox/trunk/src/main/java/org/apache/pdfbox/pdmodel/fdf/FDFAnnotationInk.java (original)
+++ incubator/pdfbox/trunk/src/main/java/org/apache/pdfbox/pdmodel/fdf/FDFAnnotationInk.java Sun Aug  9 17:05:02 2009
@@ -45,7 +45,7 @@
     }
 
     /**
-     * Constructor
+     * Constructor.
      *
      * @param a An existing FDF Annotation.
      */

Modified: incubator/pdfbox/trunk/src/main/java/org/apache/pdfbox/pdmodel/fdf/FDFAnnotationLine.java
URL: http://svn.apache.org/viewvc/incubator/pdfbox/trunk/src/main/java/org/apache/pdfbox/pdmodel/fdf/FDFAnnotationLine.java?rev=802559&r1=802558&r2=802559&view=diff
==============================================================================
--- incubator/pdfbox/trunk/src/main/java/org/apache/pdfbox/pdmodel/fdf/FDFAnnotationLine.java (original)
+++ incubator/pdfbox/trunk/src/main/java/org/apache/pdfbox/pdmodel/fdf/FDFAnnotationLine.java Sun Aug  9 17:05:02 2009
@@ -45,7 +45,7 @@
     }
 
     /**
-     * Constructor
+     * Constructor.
      *
      * @param a An existing FDF Annotation.
      */

Modified: incubator/pdfbox/trunk/src/main/java/org/apache/pdfbox/pdmodel/fdf/FDFAnnotationPolygon.java
URL: http://svn.apache.org/viewvc/incubator/pdfbox/trunk/src/main/java/org/apache/pdfbox/pdmodel/fdf/FDFAnnotationPolygon.java?rev=802559&r1=802558&r2=802559&view=diff
==============================================================================
--- incubator/pdfbox/trunk/src/main/java/org/apache/pdfbox/pdmodel/fdf/FDFAnnotationPolygon.java (original)
+++ incubator/pdfbox/trunk/src/main/java/org/apache/pdfbox/pdmodel/fdf/FDFAnnotationPolygon.java Sun Aug  9 17:05:02 2009
@@ -45,7 +45,7 @@
     }
 
     /**
-     * Constructor
+     * Constructor.
      *
      * @param a An existing FDF Annotation.
      */

Modified: incubator/pdfbox/trunk/src/main/java/org/apache/pdfbox/pdmodel/fdf/FDFAnnotationPolyline.java
URL: http://svn.apache.org/viewvc/incubator/pdfbox/trunk/src/main/java/org/apache/pdfbox/pdmodel/fdf/FDFAnnotationPolyline.java?rev=802559&r1=802558&r2=802559&view=diff
==============================================================================
--- incubator/pdfbox/trunk/src/main/java/org/apache/pdfbox/pdmodel/fdf/FDFAnnotationPolyline.java (original)
+++ incubator/pdfbox/trunk/src/main/java/org/apache/pdfbox/pdmodel/fdf/FDFAnnotationPolyline.java Sun Aug  9 17:05:02 2009
@@ -45,7 +45,7 @@
     }
 
     /**
-     * Constructor
+     * Constructor.
      *
      * @param a An existing FDF Annotation.
      */

Modified: incubator/pdfbox/trunk/src/main/java/org/apache/pdfbox/pdmodel/fdf/FDFAnnotationSound.java
URL: http://svn.apache.org/viewvc/incubator/pdfbox/trunk/src/main/java/org/apache/pdfbox/pdmodel/fdf/FDFAnnotationSound.java?rev=802559&r1=802558&r2=802559&view=diff
==============================================================================
--- incubator/pdfbox/trunk/src/main/java/org/apache/pdfbox/pdmodel/fdf/FDFAnnotationSound.java (original)
+++ incubator/pdfbox/trunk/src/main/java/org/apache/pdfbox/pdmodel/fdf/FDFAnnotationSound.java Sun Aug  9 17:05:02 2009
@@ -45,7 +45,7 @@
     }
 
     /**
-     * Constructor
+     * Constructor.
      *
      * @param a An existing FDF Annotation.
      */

Modified: incubator/pdfbox/trunk/src/main/java/org/apache/pdfbox/pdmodel/fdf/FDFAnnotationSquare.java
URL: http://svn.apache.org/viewvc/incubator/pdfbox/trunk/src/main/java/org/apache/pdfbox/pdmodel/fdf/FDFAnnotationSquare.java?rev=802559&r1=802558&r2=802559&view=diff
==============================================================================
--- incubator/pdfbox/trunk/src/main/java/org/apache/pdfbox/pdmodel/fdf/FDFAnnotationSquare.java (original)
+++ incubator/pdfbox/trunk/src/main/java/org/apache/pdfbox/pdmodel/fdf/FDFAnnotationSquare.java Sun Aug  9 17:05:02 2009
@@ -45,7 +45,7 @@
     }
 
     /**
-     * Constructor
+     * Constructor.
      *
      * @param a An existing FDF Annotation.
      */

Modified: incubator/pdfbox/trunk/src/main/java/org/apache/pdfbox/pdmodel/fdf/FDFAnnotationSquiggly.java
URL: http://svn.apache.org/viewvc/incubator/pdfbox/trunk/src/main/java/org/apache/pdfbox/pdmodel/fdf/FDFAnnotationSquiggly.java?rev=802559&r1=802558&r2=802559&view=diff
==============================================================================
--- incubator/pdfbox/trunk/src/main/java/org/apache/pdfbox/pdmodel/fdf/FDFAnnotationSquiggly.java (original)
+++ incubator/pdfbox/trunk/src/main/java/org/apache/pdfbox/pdmodel/fdf/FDFAnnotationSquiggly.java Sun Aug  9 17:05:02 2009
@@ -45,7 +45,7 @@
     }
 
     /**
-     * Constructor
+     * Constructor.
      *
      * @param a An existing FDF Annotation.
      */

Modified: incubator/pdfbox/trunk/src/main/java/org/apache/pdfbox/pdmodel/fdf/FDFAnnotationStamp.java
URL: http://svn.apache.org/viewvc/incubator/pdfbox/trunk/src/main/java/org/apache/pdfbox/pdmodel/fdf/FDFAnnotationStamp.java?rev=802559&r1=802558&r2=802559&view=diff
==============================================================================
--- incubator/pdfbox/trunk/src/main/java/org/apache/pdfbox/pdmodel/fdf/FDFAnnotationStamp.java (original)
+++ incubator/pdfbox/trunk/src/main/java/org/apache/pdfbox/pdmodel/fdf/FDFAnnotationStamp.java Sun Aug  9 17:05:02 2009
@@ -45,7 +45,7 @@
     }
 
     /**
-     * Constructor
+     * Constructor.
      *
      * @param a An existing FDF Annotation.
      */

Modified: incubator/pdfbox/trunk/src/main/java/org/apache/pdfbox/pdmodel/fdf/FDFAnnotationStrikeOut.java
URL: http://svn.apache.org/viewvc/incubator/pdfbox/trunk/src/main/java/org/apache/pdfbox/pdmodel/fdf/FDFAnnotationStrikeOut.java?rev=802559&r1=802558&r2=802559&view=diff
==============================================================================
--- incubator/pdfbox/trunk/src/main/java/org/apache/pdfbox/pdmodel/fdf/FDFAnnotationStrikeOut.java (original)
+++ incubator/pdfbox/trunk/src/main/java/org/apache/pdfbox/pdmodel/fdf/FDFAnnotationStrikeOut.java Sun Aug  9 17:05:02 2009
@@ -45,7 +45,7 @@
     }
 
     /**
-     * Constructor
+     * Constructor.
      *
      * @param a An existing FDF Annotation.
      */

Modified: incubator/pdfbox/trunk/src/main/java/org/apache/pdfbox/pdmodel/fdf/FDFAnnotationText.java
URL: http://svn.apache.org/viewvc/incubator/pdfbox/trunk/src/main/java/org/apache/pdfbox/pdmodel/fdf/FDFAnnotationText.java?rev=802559&r1=802558&r2=802559&view=diff
==============================================================================
--- incubator/pdfbox/trunk/src/main/java/org/apache/pdfbox/pdmodel/fdf/FDFAnnotationText.java (original)
+++ incubator/pdfbox/trunk/src/main/java/org/apache/pdfbox/pdmodel/fdf/FDFAnnotationText.java Sun Aug  9 17:05:02 2009
@@ -45,7 +45,7 @@
     }
 
     /**
-     * Constructor
+     * Constructor.
      *
      * @param a An existing FDF Annotation.
      */

Modified: incubator/pdfbox/trunk/src/main/java/org/apache/pdfbox/pdmodel/fdf/FDFAnnotationUnderline.java
URL: http://svn.apache.org/viewvc/incubator/pdfbox/trunk/src/main/java/org/apache/pdfbox/pdmodel/fdf/FDFAnnotationUnderline.java?rev=802559&r1=802558&r2=802559&view=diff
==============================================================================
--- incubator/pdfbox/trunk/src/main/java/org/apache/pdfbox/pdmodel/fdf/FDFAnnotationUnderline.java (original)
+++ incubator/pdfbox/trunk/src/main/java/org/apache/pdfbox/pdmodel/fdf/FDFAnnotationUnderline.java Sun Aug  9 17:05:02 2009
@@ -45,7 +45,7 @@
     }
 
     /**
-     * Constructor
+     * Constructor.
      *
      * @param a An existing FDF Annotation.
      */

Modified: incubator/pdfbox/trunk/src/main/java/org/apache/pdfbox/pdmodel/font/FontManager.java
URL: http://svn.apache.org/viewvc/incubator/pdfbox/trunk/src/main/java/org/apache/pdfbox/pdmodel/font/FontManager.java?rev=802559&r1=802558&r2=802559&view=diff
==============================================================================
--- incubator/pdfbox/trunk/src/main/java/org/apache/pdfbox/pdmodel/font/FontManager.java (original)
+++ incubator/pdfbox/trunk/src/main/java/org/apache/pdfbox/pdmodel/font/FontManager.java Sun Aug  9 17:05:02 2009
@@ -25,16 +25,18 @@
 
 /**
  *  This class is used as font manager.
- *
+ *  @author <a href="mailto:andreas@lehmi.de">Andreas Lehmkühler</a>
+ *  @version $Revision: 1.0 $
  */
 
-public class FontManager {
+public class FontManager 
+{
 
-	// HashMap with all known fonts
+    // HashMap with all known fonts
     private static HashMap envFonts = new HashMap();
-	// the standard font
+    // the standard font
     private static String standardFont = null;
-	private static Properties fontMapping = new Properties(); 
+    private static Properties fontMapping = new Properties(); 
     
     static {
         try
@@ -46,197 +48,251 @@
             io.printStackTrace();
             throw new RuntimeException( "Error loading font mapping" );
         }
-    	loadFonts();
-    	// There could be some recursive mappings in the fontmapping, so that we have to 
-    	// read the list until no more additional mapping is added to it 
-    	while (loadFontMapping() > 0) 
-    		; 
-    	loadBasefontMapping();
-    	setStandardFont();
+        loadFonts();
+        loadFontMapping();
+        loadBasefontMapping();
+        setStandardFont();
     }
     
+    private FontManager() 
+    {
+    }
     /**
-     * Get the standard font from the environment, usually Arial or Times New Roman  
+     * Get the standard font from the environment, usually Arial or Times New Roman. 
      *
      * @return The standard font 
      * 
      */
-    public static java.awt.Font getStandardFont() {
-    	if (standardFont != null)
-    		return getAwtFont(standardFont);
-    	return null;
+    public static java.awt.Font getStandardFont() 
+    {
+        if (standardFont != null)
+        {
+            return getAwtFont(standardFont);
+        }
+        return null;
     }
     
     /**
-     * Get the font for the given fontname
+     * Get the font for the given fontname.
      *
      * @param font The name of the font.
      *
      * @return The font we are looking for or a similar font or null if nothing is found.
      * 
      */
-    public static java.awt.Font getAwtFont(String font) {
-   	 
-    	String fontname = normalizeFontname(font);
-	    if (envFonts.containsKey(fontname)) 
-	    	return (java.awt.Font)envFonts.get(fontname);
-    	return null;
+    public static java.awt.Font getAwtFont(String font) 
+    {
+        String fontname = normalizeFontname(font);
+        if (envFonts.containsKey(fontname))
+        {
+            return (java.awt.Font)envFonts.get(fontname);
+        }
+        return null;
     }
 
     /**
-     * Load all available fonts from the environment
-     */
-    private static void loadFonts() {
-    	java.awt.Font[] allFonts = java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment().getAllFonts();
-		int numberOfFonts = allFonts.length;
-		for (int i=0;i<numberOfFonts;i++) {
-			java.awt.Font font = allFonts[i];
-			String family = normalizeFontname(font.getFamily());
-			if (isBoldItalic(font)) {
-				envFonts.put(family+"bolditalic", font);
-			}
-			else if (isBold(font)) {
-				envFonts.put(family+"bold", font);
-			}
-			else if (isItalic(font)) {
-				envFonts.put(family+"italic", font);
-			}
-			else { 
-				envFonts.put(family, font);
-			}
-		}
-    }
-
-    private static void setStandardFont() {
-		// One of the following fonts will be the standard-font 
-		if (envFonts.containsKey("arial"))
-			standardFont = "arial";
-		else if (envFonts.containsKey("timesnewroman"))
-			standardFont = "timesnewroman";
+     * Load all available fonts from the environment.
+     */
+    private static void loadFonts() 
+    {
+        java.awt.Font[] allFonts = java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment().getAllFonts();
+        int numberOfFonts = allFonts.length;
+        for (int i=0;i<numberOfFonts;i++) 
+        {
+            java.awt.Font font = allFonts[i];
+            String family = normalizeFontname(font.getFamily());
+            if (isBoldItalic(font)) 
+            {
+                envFonts.put(family+"bolditalic", font);
+            }
+            else if (isBold(font)) 
+            {
+                envFonts.put(family+"bold", font);
+            }
+            else if (isItalic(font)) 
+            {
+                envFonts.put(family+"italic", font);
+            }
+            else 
+            { 
+                envFonts.put(family, font);
+            }
+        }
+    }
+
+    private static void setStandardFont() 
+    {
+        // One of the following fonts will be the standard-font 
+        if (envFonts.containsKey("arial"))
+        {
+            standardFont = "arial";
+        }
+        else if (envFonts.containsKey("timesnewroman"))
+        {
+            standardFont = "timesnewroman";
+        }
     }
     
     /**
-     * Normalize the fontname
+     * Normalize the fontname.
      *
      * @param fontname The name of the font.
      *
      * @return The normalized name of the font.
      * 
      */
-    private static String normalizeFontname(String fontname) {
-    	// Terminate all whitespaces, commas and hyphens
-    	String normalizedFontname = fontname.toLowerCase().replaceAll(" ","").replaceAll(",","").replaceAll("-","");
-    	// Terminate trailing characters up to the "+".
-    	// As far as I know, these characters are used in names of embedded fonts
-    	// If the embedded font can't be read, we'll try to find it here
-    	if (normalizedFontname.indexOf("+") > -1)
-    		normalizedFontname = normalizedFontname.substring(normalizedFontname.indexOf("+")+1);
-    	// normalize all kinds of fonttypes. There are several possible version which have to be normalized
-    	// e.g. Arial,Bold Arial-BoldMT Helevtica-oblique ...
-    	boolean isBold = normalizedFontname.indexOf("bold") > -1;
-		boolean isItalic = normalizedFontname.indexOf("italic") > -1 || normalizedFontname.indexOf("oblique") > -1;
-		normalizedFontname = normalizedFontname.toLowerCase().replaceAll("bold" , "").replaceAll("italic" , "").replaceAll("oblique" , "");
-    	if (isBold)
-    		normalizedFontname += "bold";
-    	if (isItalic)
-    		normalizedFontname += "italic";
-		return normalizedFontname;
+    private static String normalizeFontname(String fontname) 
+    {
+        // Terminate all whitespaces, commas and hyphens
+        String normalizedFontname = fontname.toLowerCase().replaceAll(" ","").replaceAll(",","").replaceAll("-","");
+        // Terminate trailing characters up to the "+".
+        // As far as I know, these characters are used in names of embedded fonts
+        // If the embedded font can't be read, we'll try to find it here
+        if (normalizedFontname.indexOf("+") > -1)
+        {
+            normalizedFontname = normalizedFontname.substring(normalizedFontname.indexOf("+")+1);
+        }
+        // normalize all kinds of fonttypes. There are several possible version which have to be normalized
+        // e.g. Arial,Bold Arial-BoldMT Helevtica-oblique ...
+        boolean isBold = normalizedFontname.indexOf("bold") > -1;
+        boolean isItalic = normalizedFontname.indexOf("italic") > -1 || normalizedFontname.indexOf("oblique") > -1;
+        normalizedFontname = normalizedFontname.toLowerCase().replaceAll("bold" , "")
+            .replaceAll("italic" , "").replaceAll("oblique" , "");
+        if (isBold)
+        {
+            normalizedFontname += "bold";
+        }
+        if (isItalic)
+        {
+            normalizedFontname += "italic";
+        }
+        return normalizedFontname;
     }
     
     
     /**
-     * Add a font-mapping
+     * Add a font-mapping.
      *
      * @param font The name of the font.
      *
      * @param mappedName The name of the mapped font.
      * 
      */
-    private static boolean addFontMapping(String font, String mappedName) {
-    	String fontname = normalizeFontname(font);
-    	// is there already a font mapping ?
-    	if (envFonts.containsKey(fontname))
-    		return false;
-    	String mappedFontname = normalizeFontname(mappedName);
-    	// is the mapped font available ?
-    	if (!envFonts.containsKey(mappedFontname))
-    		return false;
-    	envFonts.put(fontname, envFonts.get(mappedFontname));
-    	return true;
+    private static boolean addFontMapping(String font, String mappedName) 
+    {
+        String fontname = normalizeFontname(font);
+        // is there already a font mapping ?
+        if (envFonts.containsKey(fontname))
+        {
+            return false;
+        }
+        String mappedFontname = normalizeFontname(mappedName);
+        // is the mapped font available ?
+        if (!envFonts.containsKey(mappedFontname))
+        {
+            return false;
+        }
+        envFonts.put(fontname, envFonts.get(mappedFontname));
+        return true;
     }
     
     /**
-     * Load the mapping for the well knwon font-substitutions
+     * Load the mapping for the well knwon font-substitutions.
      *
      */
-    private static int loadFontMapping() {
-        Enumeration keys = fontMapping.keys();
-        int counter = 0;
-        while (keys.hasMoreElements()) {
-        	String key = (String)keys.nextElement();
-        	if (addFontMapping(key,(String)fontMapping.get(key)))
-        		counter++;
+    private static void loadFontMapping() 
+    {
+        boolean addedMapping = true;
+        // There could be some recursive mappings in the fontmapping, so that we have to 
+        // read the list until no more additional mapping is added to it 
+        while (addedMapping) 
+        {
+            int counter = 0;
+            Enumeration keys = fontMapping.keys();
+            while (keys.hasMoreElements()) 
+            {
+                String key = (String)keys.nextElement();
+                if (addFontMapping(key,(String)fontMapping.get(key)))
+                {
+                    counter++;
+                }
+            }
+            if (counter == 0)
+            {
+                addedMapping = false;
+            }
         }
-        return counter;
     }
 
     /**
-     * Mapping for the basefonts
+     * Mapping for the basefonts.
      */
-    private static void loadBasefontMapping() {
-    	addFontMapping("Times-Roman","TimesNewRoman");
-    	addFontMapping("Times-Bold","TimesNewRoman,Bold");
-    	addFontMapping("Times-Italic","TimesNewRoman,Italic");
-    	addFontMapping("Times-BoldItalic","TimesNewRoman,Bold,Italic");
-    	addFontMapping("Helvetica-Oblique","Helvetica,Italic");
-    	addFontMapping("Helvetica-BoldOblique","Helvetica,Bold,Italic");
-    	addFontMapping("Courier-Oblique","Courier,Italic");
-    	addFontMapping("Courier-BoldOblique","Courier,Bold,Italic");
+    private static void loadBasefontMapping() 
+    {
+        addFontMapping("Times-Roman","TimesNewRoman");
+        addFontMapping("Times-Bold","TimesNewRoman,Bold");
+        addFontMapping("Times-Italic","TimesNewRoman,Italic");
+        addFontMapping("Times-BoldItalic","TimesNewRoman,Bold,Italic");
+        addFontMapping("Helvetica-Oblique","Helvetica,Italic");
+        addFontMapping("Helvetica-BoldOblique","Helvetica,Bold,Italic");
+        addFontMapping("Courier-Oblique","Courier,Italic");
+        addFontMapping("Courier-BoldOblique","Courier,Bold,Italic");
     }
 
     /**
-     * Try to determine if the font has both a BOLD and an ITALIC-type
+     * Try to determine if the font has both a BOLD and an ITALIC-type.
      *
      * @param name The font.
      *
      * @return font has BOLD and ITALIC-type or not
      */
-    private static boolean isBoldItalic(java.awt.Font font) {
-    	return isBold(font) && isItalic(font);
+    private static boolean isBoldItalic(java.awt.Font font) 
+    {
+        return isBold(font) && isItalic(font);
     }
     
     /**
-     * Try to determine if the font has a BOLD-type
+     * Try to determine if the font has a BOLD-type.
      *
      * @param name The font.
      *
      * @return font has BOLD-type or not
      */
-    private static boolean isBold(java.awt.Font font) {
-    	String name = font.getName().toLowerCase();
-    	if (name.indexOf("bold") > -1)
-    		return true;
-    	String psname = font.getPSName().toLowerCase();
-    	if (psname.indexOf("bold") > -1)
-    		return true;
-    	return false;
+    private static boolean isBold(java.awt.Font font) 
+    {
+        String name = font.getName().toLowerCase();
+        if (name.indexOf("bold") > -1)
+        {
+            return true;
+        }
+        String psname = font.getPSName().toLowerCase();
+        if (psname.indexOf("bold") > -1)
+        {
+            return true;
+        }
+        return false;
     }
     
     /**
-     * Try to determine if the font has an ITALIC-type
+     * Try to determine if the font has an ITALIC-type.
      *
      * @param name The font.
      *
      * @return font has ITALIC-type or not
      */
-    private static boolean isItalic(java.awt.Font font) {
-    	String name = font.getName().toLowerCase();
-    	// oblique is the same as italic
-    	if (name.indexOf("italic") > -1 || name.indexOf("oblique") > -1)
-    		return true;
-    	String psname = font.getPSName().toLowerCase();
-    	if (psname.indexOf("italic") > -1 || psname.indexOf("oblique") > -1)
-    		return true;
-    	return false;
+    private static boolean isItalic(java.awt.Font font) 
+    {
+        String name = font.getName().toLowerCase();
+        // oblique is the same as italic
+        if (name.indexOf("italic") > -1 || name.indexOf("oblique") > -1)
+        {
+            return true;
+        }
+        String psname = font.getPSName().toLowerCase();
+        if (psname.indexOf("italic") > -1 || psname.indexOf("oblique") > -1)
+        {
+            return true;
+        }
+        return false;
     }
 }

Modified: incubator/pdfbox/trunk/src/main/java/org/apache/pdfbox/pdmodel/font/PDFontFactory.java
URL: http://svn.apache.org/viewvc/incubator/pdfbox/trunk/src/main/java/org/apache/pdfbox/pdmodel/font/PDFontFactory.java?rev=802559&r1=802558&r2=802559&view=diff
==============================================================================
--- incubator/pdfbox/trunk/src/main/java/org/apache/pdfbox/pdmodel/font/PDFontFactory.java (original)
+++ incubator/pdfbox/trunk/src/main/java/org/apache/pdfbox/pdmodel/font/PDFontFactory.java Sun Aug  9 17:05:02 2009
@@ -50,21 +50,29 @@
      */
     public static PDFont createFont(COSDictionary dic, Map fontCache) throws IOException
     {
-    	PDFont retval = null;
-        if (fontCache != null) {
-            String fontKey = dic.getNameAsString(COSName.BASE_FONT) + dic.getNameAsString(COSName.NAME)+dic.getNameAsString(COSName.SUBTYPE);
-        	if (dic.getItem(COSName.ENCODING) != null)
-        		fontKey += dic.getItem(COSName.ENCODING).toString();
+        PDFont retval = null;
+        if (fontCache != null) 
+        {
+            String fontKey = dic.getNameAsString(COSName.BASE_FONT) + dic.getNameAsString(COSName.NAME)
+                                + dic.getNameAsString(COSName.SUBTYPE);
+            if (dic.getItem(COSName.ENCODING) != null)
+            {
+                fontKey += dic.getItem(COSName.ENCODING).toString();
+            }
             if (fontCache.containsKey(fontKey))
-            	retval = (PDFont)fontCache.get(fontKey);
+            {
+                retval = (PDFont)fontCache.get(fontKey);
+            }
             else 
             {
-            	retval = PDFontFactory.createFont( dic );
-            	fontCache.put(fontKey, retval);
+                retval = PDFontFactory.createFont( dic );
+                fontCache.put(fontKey, retval);
             }
         }
         else
-        	retval = PDFontFactory.createFont( dic );
+        {
+            retval = PDFontFactory.createFont( dic );
+        }
         return retval;
     }
 

Modified: incubator/pdfbox/trunk/src/main/java/org/apache/pdfbox/pdmodel/font/PDType0Font.java
URL: http://svn.apache.org/viewvc/incubator/pdfbox/trunk/src/main/java/org/apache/pdfbox/pdmodel/font/PDType0Font.java?rev=802559&r1=802558&r2=802559&view=diff
==============================================================================
--- incubator/pdfbox/trunk/src/main/java/org/apache/pdfbox/pdmodel/font/PDType0Font.java (original)
+++ incubator/pdfbox/trunk/src/main/java/org/apache/pdfbox/pdmodel/font/PDType0Font.java Sun Aug  9 17:05:02 2009
@@ -35,8 +35,8 @@
 public class PDType0Font extends /*PDFont following is a hack ...*/ PDType1Font
 {
 
-	private PDFont descendentFont;
-	/**
+    private PDFont descendentFont;
+    /**
      * Constructor.
      */
     public PDType0Font()
@@ -58,7 +58,8 @@
     /**
      * {@inheritDoc}
      */
-    public void drawString( String string, Graphics g, float fontSize, AffineTransform at, float x, float y ) throws IOException
+    public void drawString( String string, Graphics g, float fontSize, AffineTransform at, float x, float y ) 
+        throws IOException
     {
         //throw new RuntimeException( "Not yet implemented" );
         super.drawString(string, g, fontSize, at, x, y);
@@ -92,11 +93,11 @@
     {
         if (descendentFont == null) 
         {
-	    	COSArray descendantFontArray =
-	            (COSArray)font.getDictionaryObject( COSName.DESCENDANT_FONTS );
-	
-	        COSDictionary descendantFontDictionary = (COSDictionary)descendantFontArray.getObject( 0 );
-	        descendentFont = PDFontFactory.createFont( descendantFontDictionary );
+            COSArray descendantFontArray =
+                (COSArray)font.getDictionaryObject( COSName.DESCENDANT_FONTS );
+            
+            COSDictionary descendantFontDictionary = (COSDictionary)descendantFontArray.getObject( 0 );
+            descendentFont = PDFontFactory.createFont( descendantFontDictionary );
         }
         return descendentFont.getFontWidth( c, offset, length );
     }
@@ -116,11 +117,11 @@
     {
         if (descendentFont == null) 
         {
-	    	COSArray descendantFontArray =
-	            (COSArray)font.getDictionaryObject( COSName.DESCENDANT_FONTS );
-	
-	        COSDictionary descendantFontDictionary = (COSDictionary)descendantFontArray.getObject( 0 );
-	        descendentFont = PDFontFactory.createFont( descendantFontDictionary );
+            COSArray descendantFontArray =
+                (COSArray)font.getDictionaryObject( COSName.DESCENDANT_FONTS );
+            
+            COSDictionary descendantFontDictionary = (COSDictionary)descendantFontArray.getObject( 0 );
+            descendentFont = PDFontFactory.createFont( descendantFontDictionary );
         }
         return descendentFont.getFontHeight( c, offset, length );
     }
@@ -134,14 +135,14 @@
      */
     public float getAverageFontWidth() throws IOException
     {
-    	if (descendentFont == null) 
-    	{
-	    	COSArray descendantFontArray =
-	            (COSArray)font.getDictionaryObject( COSName.DESCENDANT_FONTS );
-	
-	        COSDictionary descendantFontDictionary = (COSDictionary)descendantFontArray.getObject( 0 );
-	        descendentFont = PDFontFactory.createFont( descendantFontDictionary );
-    	}
+        if (descendentFont == null) 
+        {
+            COSArray descendantFontArray =
+                (COSArray)font.getDictionaryObject( COSName.DESCENDANT_FONTS );
+            
+            COSDictionary descendantFontDictionary = (COSDictionary)descendantFontArray.getObject( 0 );
+            descendentFont = PDFontFactory.createFont( descendantFontDictionary );
+        }
         return descendentFont.getAverageFontWidth();
     }
 }

Modified: incubator/pdfbox/trunk/src/main/java/org/apache/pdfbox/pdmodel/font/PDType1AfmPfbFont.java
URL: http://svn.apache.org/viewvc/incubator/pdfbox/trunk/src/main/java/org/apache/pdfbox/pdmodel/font/PDType1AfmPfbFont.java?rev=802559&r1=802558&r2=802559&view=diff
==============================================================================
--- incubator/pdfbox/trunk/src/main/java/org/apache/pdfbox/pdmodel/font/PDType1AfmPfbFont.java (original)
+++ incubator/pdfbox/trunk/src/main/java/org/apache/pdfbox/pdmodel/font/PDType1AfmPfbFont.java Sun Aug  9 17:05:02 2009
@@ -31,11 +31,16 @@
 
 import org.apache.fontbox.pfb.PfbParser;
 
-import org.apache.pdfbox.encoding.*;
+import org.apache.pdfbox.encoding.AFMEncoding;
+import org.apache.pdfbox.encoding.DictionaryEncoding;
+import org.apache.pdfbox.encoding.Encoding;
 import org.apache.pdfbox.pdmodel.PDDocument;
 import org.apache.pdfbox.pdmodel.common.PDRectangle;
 import org.apache.pdfbox.pdmodel.common.PDStream;
-import org.apache.pdfbox.cos.*;
+import org.apache.pdfbox.cos.COSArray;
+import org.apache.pdfbox.cos.COSDictionary;
+import org.apache.pdfbox.cos.COSName;
+import org.apache.pdfbox.cos.COSNumber;
 /**
  * This is implementation of the Type1 Font
  * with a afm and a pfb file.
@@ -172,30 +177,44 @@
                     // StandardEncoding = 0373 = 251
                     // WinANSIEncoding = 0337 = 223
                     if (m.getName().equals("germandbls") && n != 223)
+                    {
                         widths.set(0337,new Float(width));
+                    }
                 }
             }
-            else {
-            	// my AFMPFB-Fonts has no character-codes for german umlauts
-            	// so that I've to add them here by hand
-            	if (m.getName().equals("adieresis"))
+            else 
+            {
+                // my AFMPFB-Fonts has no character-codes for german umlauts
+                // so that I've to add them here by hand
+                if (m.getName().equals("adieresis"))
+                {
                     widths.set(0344,(Float)widths.get(encoding.getCode(COSName.getPDFName( "a" ))));
-            	else if (m.getName().equals("odieresis"))
+                }
+                else if (m.getName().equals("odieresis"))
+                {
                     widths.set(0366,(Float)widths.get(encoding.getCode(COSName.getPDFName( "o" ))));
-            	else if (m.getName().equals("udieresis"))
+                }
+                else if (m.getName().equals("udieresis"))
+                {
                     widths.set(0374,(Float)widths.get(encoding.getCode(COSName.getPDFName( "u" ))));
-            	else if (m.getName().equals("Adieresis"))
+                }
+                else if (m.getName().equals("Adieresis"))
+                {
                     widths.set(0304,(Float)widths.get(encoding.getCode(COSName.getPDFName( "A" ))));
-            	else if (m.getName().equals("Odieresis"))
+                }
+                else if (m.getName().equals("Odieresis"))
+                {
                     widths.set(0326,(Float)widths.get(encoding.getCode(COSName.getPDFName( "O" ))));
-            	else if (m.getName().equals("Udieresis"))
+                }
+                else if (m.getName().equals("Udieresis"))
+                {
                     widths.set(0334,(Float)widths.get(encoding.getCode(COSName.getPDFName( "U" ))));
+                }
             }
-
         }
-	      setFirstChar(0);
-	      setLastChar(255);
-	      setWidths(widths);
+        setFirstChar(0);
+        setLastChar(255);
+        setWidths(widths);
     }
 
     /*
@@ -204,27 +223,29 @@
      *  I've copied the code from the pdfbox-forum posted by V0JT4 and made some additions concerning german umlauts
      *  see also https://sourceforge.net/forum/message.php?msg_id=4705274
      */
-    private DictionaryEncoding afmToDictionary(AFMEncoding encoding) throws java.io.IOException {
-    	COSArray array = new COSArray();
-    	array.add(COSNumber.ZERO);
-    	for (int i = 0; i < 256; i++) {
-    		array.add(encoding.getName(i));
-    	}
-    	// my AFMPFB-Fonts has no character-codes for german umlauts
-    	// so that I've to add them here by hand
-    	array.set( 0337+1, COSName.getPDFName("germandbls"));
-    	array.set( 0344+1, COSName.getPDFName("adieresis"));
-    	array.set( 0366+1, COSName.getPDFName("odieresis"));
-    	array.set( 0374+1, COSName.getPDFName("udieresis"));
-    	array.set( 0304+1, COSName.getPDFName("Adieresis"));
-    	array.set( 0326+1, COSName.getPDFName("Odieresis"));
-    	array.set( 0334+1, COSName.getPDFName("Udieresis"));
-
-    	COSDictionary dictionary = new COSDictionary();
-    	dictionary.setItem(COSName.NAME, COSName.ENCODING);
-    	dictionary.setItem(COSName.DIFFERENCES, array);
-    	dictionary.setItem(COSName.BASE_ENCODING, COSName.STANDARD_ENCODING);
-    	return new DictionaryEncoding(dictionary);
+    private DictionaryEncoding afmToDictionary(AFMEncoding encoding) throws java.io.IOException 
+    {
+        COSArray array = new COSArray();
+        array.add(COSNumber.ZERO);
+        for (int i = 0; i < 256; i++) 
+        {
+            array.add(encoding.getName(i));
+        }
+        // my AFMPFB-Fonts has no character-codes for german umlauts
+        // so that I've to add them here by hand
+        array.set( 0337+1, COSName.getPDFName("germandbls"));
+        array.set( 0344+1, COSName.getPDFName("adieresis"));
+        array.set( 0366+1, COSName.getPDFName("odieresis"));
+        array.set( 0374+1, COSName.getPDFName("udieresis"));
+        array.set( 0304+1, COSName.getPDFName("Adieresis"));
+        array.set( 0326+1, COSName.getPDFName("Odieresis"));
+        array.set( 0334+1, COSName.getPDFName("Udieresis"));
+
+        COSDictionary dictionary = new COSDictionary();
+        dictionary.setItem(COSName.NAME, COSName.ENCODING);
+        dictionary.setItem(COSName.DIFFERENCES, array);
+        dictionary.setItem(COSName.BASE_ENCODING, COSName.STANDARD_ENCODING);
+        return new DictionaryEncoding(dictionary);
     }
 
 

Modified: incubator/pdfbox/trunk/src/main/java/org/apache/pdfbox/pdmodel/font/PDType3Font.java
URL: http://svn.apache.org/viewvc/incubator/pdfbox/trunk/src/main/java/org/apache/pdfbox/pdmodel/font/PDType3Font.java?rev=802559&r1=802558&r2=802559&view=diff
==============================================================================
--- incubator/pdfbox/trunk/src/main/java/org/apache/pdfbox/pdmodel/font/PDType3Font.java (original)
+++ incubator/pdfbox/trunk/src/main/java/org/apache/pdfbox/pdmodel/font/PDType3Font.java Sun Aug  9 17:05:02 2009
@@ -90,17 +90,10 @@
     }
 
     /**
-     * This will draw a string on a canvas using the font.
-     *
-     * @param string The string to draw.
-     * @param g The graphics to draw onto.
-     * @param fontSize The size of the font to draw.
-     * @param x The x coordinate to draw at.
-     * @param y The y coordinate to draw at.
-     *
-     * @throws IOException If there is an error drawing the image on the screen.
+     * {@inheritDoc}
      */
-    public void drawString( String string, Graphics g, float fontSize, AffineTransform at, float x, float y ) throws IOException
+    public void drawString( String string, Graphics g, float fontSize, AffineTransform at, float x, float y ) 
+        throws IOException
     {
         //if( string.equals( "V" )|| string.equals( "o" ) )
         {