You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pdfbox.apache.org by ju...@apache.org on 2008/08/05 12:51:26 UTC
svn commit: r682665 [3/21] - in /incubator/pdfbox/trunk/src: org/pdfbox/
org/pdfbox/ant/ org/pdfbox/cos/ org/pdfbox/encoding/ org/pdfbox/encryption/
org/pdfbox/examples/ org/pdfbox/examples/fdf/ org/pdfbox/examples/pdmodel/
org/pdfbox/examples/persiste...
Modified: incubator/pdfbox/trunk/src/org/pdfbox/encoding/DictionaryEncoding.java
URL: http://svn.apache.org/viewvc/incubator/pdfbox/trunk/src/org/pdfbox/encoding/DictionaryEncoding.java?rev=682665&r1=682664&r2=682665&view=diff
==============================================================================
--- incubator/pdfbox/trunk/src/org/pdfbox/encoding/DictionaryEncoding.java (original)
+++ incubator/pdfbox/trunk/src/org/pdfbox/encoding/DictionaryEncoding.java Tue Aug 5 03:51:13 2008
@@ -1,18 +1,18 @@
/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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.
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.
*/
package org.pdfbox.encoding;
@@ -85,7 +85,7 @@
}
}
}
-
+
/**
* Convert this standard java object to a COS object.
*
Propchange: incubator/pdfbox/trunk/src/org/pdfbox/encoding/DictionaryEncoding.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: incubator/pdfbox/trunk/src/org/pdfbox/encoding/Encoding.java
URL: http://svn.apache.org/viewvc/incubator/pdfbox/trunk/src/org/pdfbox/encoding/Encoding.java?rev=682665&r1=682664&r2=682665&view=diff
==============================================================================
--- incubator/pdfbox/trunk/src/org/pdfbox/encoding/Encoding.java (original)
+++ incubator/pdfbox/trunk/src/org/pdfbox/encoding/Encoding.java Tue Aug 5 03:51:13 2008
@@ -1,18 +1,18 @@
/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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.
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.
*/
package org.pdfbox.encoding;
@@ -235,4 +235,4 @@
}
return character;
}
-}
\ No newline at end of file
+}
Propchange: incubator/pdfbox/trunk/src/org/pdfbox/encoding/Encoding.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: incubator/pdfbox/trunk/src/org/pdfbox/encoding/EncodingManager.java
URL: http://svn.apache.org/viewvc/incubator/pdfbox/trunk/src/org/pdfbox/encoding/EncodingManager.java?rev=682665&r1=682664&r2=682665&view=diff
==============================================================================
--- incubator/pdfbox/trunk/src/org/pdfbox/encoding/EncodingManager.java (original)
+++ incubator/pdfbox/trunk/src/org/pdfbox/encoding/EncodingManager.java Tue Aug 5 03:51:13 2008
@@ -1,18 +1,18 @@
/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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.
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.
*/
package org.pdfbox.encoding;
@@ -69,4 +69,4 @@
}
return encoding;
}
-}
\ No newline at end of file
+}
Propchange: incubator/pdfbox/trunk/src/org/pdfbox/encoding/EncodingManager.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: incubator/pdfbox/trunk/src/org/pdfbox/encoding/MacRomanEncoding.java
URL: http://svn.apache.org/viewvc/incubator/pdfbox/trunk/src/org/pdfbox/encoding/MacRomanEncoding.java?rev=682665&r1=682664&r2=682665&view=diff
==============================================================================
--- incubator/pdfbox/trunk/src/org/pdfbox/encoding/MacRomanEncoding.java (original)
+++ incubator/pdfbox/trunk/src/org/pdfbox/encoding/MacRomanEncoding.java Tue Aug 5 03:51:13 2008
@@ -1,18 +1,18 @@
/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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.
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.
*/
package org.pdfbox.encoding;
@@ -240,7 +240,7 @@
addCharacterEncoding( 0172, COSName.getPDFName( "z" ) );
addCharacterEncoding( 060, COSName.getPDFName( "zero" ) );
}
-
+
/**
* Convert this standard java object to a COS object.
*
@@ -250,4 +250,4 @@
{
return COSName.MAC_ROMAN_ENCODING;
}
-}
\ No newline at end of file
+}
Propchange: incubator/pdfbox/trunk/src/org/pdfbox/encoding/MacRomanEncoding.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: incubator/pdfbox/trunk/src/org/pdfbox/encoding/PdfDocEncoding.java
URL: http://svn.apache.org/viewvc/incubator/pdfbox/trunk/src/org/pdfbox/encoding/PdfDocEncoding.java?rev=682665&r1=682664&r2=682665&view=diff
==============================================================================
--- incubator/pdfbox/trunk/src/org/pdfbox/encoding/PdfDocEncoding.java (original)
+++ incubator/pdfbox/trunk/src/org/pdfbox/encoding/PdfDocEncoding.java Tue Aug 5 03:51:13 2008
@@ -1,18 +1,18 @@
/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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.
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.
*/
package org.pdfbox.encoding;
@@ -262,7 +262,7 @@
addCharacterEncoding( 0236, COSName.getPDFName( "zcaron" ) );
addCharacterEncoding( 060, COSName.getPDFName( "zero" ) );
}
-
+
/**
* Convert this standard java object to a COS object.
*
@@ -272,4 +272,4 @@
{
return COSName.PDF_DOC_ENCODING;
}
-}
\ No newline at end of file
+}
Propchange: incubator/pdfbox/trunk/src/org/pdfbox/encoding/PdfDocEncoding.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: incubator/pdfbox/trunk/src/org/pdfbox/encoding/StandardEncoding.java
URL: http://svn.apache.org/viewvc/incubator/pdfbox/trunk/src/org/pdfbox/encoding/StandardEncoding.java?rev=682665&r1=682664&r2=682665&view=diff
==============================================================================
--- incubator/pdfbox/trunk/src/org/pdfbox/encoding/StandardEncoding.java (original)
+++ incubator/pdfbox/trunk/src/org/pdfbox/encoding/StandardEncoding.java Tue Aug 5 03:51:13 2008
@@ -1,18 +1,18 @@
/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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.
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.
*/
package org.pdfbox.encoding;
@@ -182,7 +182,7 @@
addCharacterEncoding( 0172, COSName.getPDFName( "z" ) );
addCharacterEncoding( 0060, COSName.getPDFName( "zero" ) );
}
-
+
/**
* Convert this standard java object to a COS object.
*
@@ -192,4 +192,4 @@
{
return COSName.STANDARD_ENCODING;
}
-}
\ No newline at end of file
+}
Propchange: incubator/pdfbox/trunk/src/org/pdfbox/encoding/StandardEncoding.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: incubator/pdfbox/trunk/src/org/pdfbox/encoding/WinAnsiEncoding.java
URL: http://svn.apache.org/viewvc/incubator/pdfbox/trunk/src/org/pdfbox/encoding/WinAnsiEncoding.java?rev=682665&r1=682664&r2=682665&view=diff
==============================================================================
--- incubator/pdfbox/trunk/src/org/pdfbox/encoding/WinAnsiEncoding.java (original)
+++ incubator/pdfbox/trunk/src/org/pdfbox/encoding/WinAnsiEncoding.java Tue Aug 5 03:51:13 2008
@@ -1,18 +1,18 @@
/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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.
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.
*/
package org.pdfbox.encoding;
@@ -254,7 +254,7 @@
addCharacterEncoding( 0236, COSName.getPDFName( "zcaron" ) );
addCharacterEncoding( 060, COSName.getPDFName( "zero" ) );
}
-
+
/**
* Convert this standard java object to a COS object.
*
@@ -264,4 +264,4 @@
{
return COSName.WIN_ANSI_ENCODING;
}
-}
\ No newline at end of file
+}
Propchange: incubator/pdfbox/trunk/src/org/pdfbox/encoding/WinAnsiEncoding.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: incubator/pdfbox/trunk/src/org/pdfbox/encryption/ARCFour.java
URL: http://svn.apache.org/viewvc/incubator/pdfbox/trunk/src/org/pdfbox/encryption/ARCFour.java?rev=682665&r1=682664&r2=682665&view=diff
==============================================================================
--- incubator/pdfbox/trunk/src/org/pdfbox/encryption/ARCFour.java (original)
+++ incubator/pdfbox/trunk/src/org/pdfbox/encryption/ARCFour.java Tue Aug 5 03:51:13 2008
@@ -1,18 +1,18 @@
/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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.
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.
*/
package org.pdfbox.encryption;
@@ -165,4 +165,4 @@
write( data[i], output );
}
}
-}
\ No newline at end of file
+}
Propchange: incubator/pdfbox/trunk/src/org/pdfbox/encryption/ARCFour.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: incubator/pdfbox/trunk/src/org/pdfbox/encryption/DocumentEncryption.java
URL: http://svn.apache.org/viewvc/incubator/pdfbox/trunk/src/org/pdfbox/encryption/DocumentEncryption.java?rev=682665&r1=682664&r2=682665&view=diff
==============================================================================
--- incubator/pdfbox/trunk/src/org/pdfbox/encryption/DocumentEncryption.java (original)
+++ incubator/pdfbox/trunk/src/org/pdfbox/encryption/DocumentEncryption.java Tue Aug 5 03:51:13 2008
@@ -1,18 +1,18 @@
/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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.
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.
*/
package org.pdfbox.encryption;
@@ -46,9 +46,9 @@
*
* @author <a href="mailto:ben@benlitchfield.com">Ben Litchfield</a>
* @version $Revision: 1.13 $
- *
+ *
* @deprecated use the new security API instead.
- *
+ *
* @see org.pdfbox.pdmodel.encryption.StandardSecurityHandler
*/
public class DocumentEncryption
@@ -60,7 +60,7 @@
private PDFEncryption encryption = new PDFEncryption();
private Set objects = new HashSet();
-
+
/**
* A set that contains potential signature dictionaries. This is used
* because the Contents entry of the signature is not encrypted.
@@ -157,11 +157,11 @@
encParameters.setOwnerKey( o );
encParameters.setUserKey( u );
-
+
document.setEncryptionDictionary( encParameters.getCOSDictionary() );
}
-
-
+
+
/**
* This will decrypt the document.
@@ -223,10 +223,10 @@
throw new InvalidPasswordException( "Error: The supplied password does not match " +
"either the owner or user password in the document." );
}
-
+
COSDictionary trailer = document.getTrailer();
COSArray fields = (COSArray)trailer.getObjectFromPath( "Root/AcroForm/Fields" );
-
+
//We need to collect all the signature dictionaries, for some
//reason the 'Contents' entry of signatures is not really encrypted
if( fields != null )
@@ -246,7 +246,7 @@
}
document.setEncryptionDictionary( null );
}
-
+
private void addDictionaryAndSubDictionary( Set set, COSDictionary dic )
{
set.add( dic );
@@ -357,8 +357,8 @@
Object value = dictionary.getItem( key );
//if we are a signature dictionary and contain a Contents entry then
//we don't decrypt it.
- if( !(key.getName().equals( "Contents" ) &&
- value instanceof COSString &&
+ if( !(key.getName().equals( "Contents" ) &&
+ value instanceof COSString &&
potentialSignatures.contains( dictionary )))
{
decrypt( value, objNum, genNum );
@@ -408,4 +408,4 @@
decrypt( array.get( i ), objNum, genNum );
}
}
-}
\ No newline at end of file
+}
Propchange: incubator/pdfbox/trunk/src/org/pdfbox/encryption/DocumentEncryption.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: incubator/pdfbox/trunk/src/org/pdfbox/encryption/PDFEncryption.java
URL: http://svn.apache.org/viewvc/incubator/pdfbox/trunk/src/org/pdfbox/encryption/PDFEncryption.java?rev=682665&r1=682664&r2=682665&view=diff
==============================================================================
--- incubator/pdfbox/trunk/src/org/pdfbox/encryption/PDFEncryption.java (original)
+++ incubator/pdfbox/trunk/src/org/pdfbox/encryption/PDFEncryption.java Tue Aug 5 03:51:13 2008
@@ -1,18 +1,18 @@
/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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.
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.
*/
package org.pdfbox.encryption;
@@ -32,9 +32,9 @@
*
* @author <a href="mailto:ben@benlitchfield.com">Ben Litchfield</a>
* @version $Revision: 1.15 $
- *
+ *
* @deprecated use the new security layer instead
- *
+ *
* @see org.pdfbox.pdmodel.encryption.StandardSecurityHandler
*/
public final class PDFEncryption
@@ -188,12 +188,12 @@
result.write( dataToEncrypt, 0, dataToEncrypt.length );
*/
byte[] iterationKey = new byte[ rc4Key.length ];
-
-
- byte[] otemp = new byte[ o.length ]; //sm
+
+
+ byte[] otemp = new byte[ o.length ]; //sm
System.arraycopy( o, 0, otemp, 0, o.length ); //sm
rc4.write( o, result);//sm
-
+
for( int i=19; i>=0; i-- )
{
System.arraycopy( rc4Key, 0, iterationKey, 0, rc4Key.length );
@@ -204,7 +204,7 @@
rc4.setKey( iterationKey );
result.reset(); //sm
rc4.write( otemp, result ); //sm
- otemp = result.toByteArray(); //sm
+ otemp = result.toByteArray(); //sm
}
}
@@ -586,4 +586,4 @@
System.arraycopy( ENCRYPT_PADDING, 0, padded, bytesBeforePad, ENCRYPT_PADDING.length-bytesBeforePad );
return padded;
}
-}
\ No newline at end of file
+}
Propchange: incubator/pdfbox/trunk/src/org/pdfbox/encryption/PDFEncryption.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: incubator/pdfbox/trunk/src/org/pdfbox/examples/AbstractExample.java
URL: http://svn.apache.org/viewvc/incubator/pdfbox/trunk/src/org/pdfbox/examples/AbstractExample.java?rev=682665&r1=682664&r2=682665&view=diff
==============================================================================
--- incubator/pdfbox/trunk/src/org/pdfbox/examples/AbstractExample.java (original)
+++ incubator/pdfbox/trunk/src/org/pdfbox/examples/AbstractExample.java Tue Aug 5 03:51:13 2008
@@ -1,18 +1,18 @@
/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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.
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.
*/
package org.pdfbox.examples;
@@ -108,4 +108,4 @@
writer.close();
}
}
-}
\ No newline at end of file
+}
Propchange: incubator/pdfbox/trunk/src/org/pdfbox/examples/AbstractExample.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: incubator/pdfbox/trunk/src/org/pdfbox/examples/fdf/PrintFields.java
URL: http://svn.apache.org/viewvc/incubator/pdfbox/trunk/src/org/pdfbox/examples/fdf/PrintFields.java?rev=682665&r1=682664&r2=682665&view=diff
==============================================================================
--- incubator/pdfbox/trunk/src/org/pdfbox/examples/fdf/PrintFields.java (original)
+++ incubator/pdfbox/trunk/src/org/pdfbox/examples/fdf/PrintFields.java Tue Aug 5 03:51:13 2008
@@ -1,18 +1,18 @@
/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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.
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.
*/
package org.pdfbox.examples.fdf;
@@ -43,7 +43,7 @@
* This will print all the fields from the document.
*
* @param pdfDocument The PDF to get the fields from.
- *
+ *
* @throws IOException If there is an error getting the fields.
*/
public void printFields( PDDocument pdfDocument ) throws IOException
@@ -52,8 +52,8 @@
PDAcroForm acroForm = docCatalog.getAcroForm();
List fields = acroForm.getFields();
Iterator fieldsIter = fields.iterator();
-
- System.out.println(new Integer(fields.size()).toString() + " top-level fields were found on the form");
+
+ System.out.println(new Integer(fields.size()).toString() + " top-level fields were found on the form");
while( fieldsIter.hasNext())
{
@@ -61,10 +61,10 @@
processField(field, "|--", field.getPartialName());
}
}
-
+
private void processField(PDField field, String sLevel, String sParent) throws IOException
{
- List kids = field.getKids();
+ List kids = field.getKids();
if(kids != null)
{
Iterator kidsIter = kids.iterator();
@@ -81,12 +81,12 @@
{
PDField kid = (PDField)pdfObj;
processField(kid, "| " + sLevel, sParent);
- }
+ }
}
}
else
{
- String outputString = sLevel + sParent + "." + field.getPartialName() + " = " + field.getValue() +
+ String outputString = sLevel + sParent + "." + field.getPartialName() + " = " + field.getValue() +
", type=" + field.getClass().getName();
System.out.println(outputString);
@@ -146,4 +146,4 @@
{
System.err.println( "usage: org.pdfbox.examples.fdf.PrintFields <pdf-file>" );
}
-}
\ No newline at end of file
+}
Propchange: incubator/pdfbox/trunk/src/org/pdfbox/examples/fdf/PrintFields.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: incubator/pdfbox/trunk/src/org/pdfbox/examples/fdf/SetField.java
URL: http://svn.apache.org/viewvc/incubator/pdfbox/trunk/src/org/pdfbox/examples/fdf/SetField.java?rev=682665&r1=682664&r2=682665&view=diff
==============================================================================
--- incubator/pdfbox/trunk/src/org/pdfbox/examples/fdf/SetField.java (original)
+++ incubator/pdfbox/trunk/src/org/pdfbox/examples/fdf/SetField.java Tue Aug 5 03:51:13 2008
@@ -1,18 +1,18 @@
/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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.
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.
*/
package org.pdfbox.examples.fdf;
@@ -111,4 +111,4 @@
{
System.err.println( "usage: org.pdfbox.examples.fdf.SetField <pdf-file> <field-name> <field-value>" );
}
-}
\ No newline at end of file
+}
Propchange: incubator/pdfbox/trunk/src/org/pdfbox/examples/fdf/SetField.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: incubator/pdfbox/trunk/src/org/pdfbox/examples/pdmodel/AddImageToPDF.java
URL: http://svn.apache.org/viewvc/incubator/pdfbox/trunk/src/org/pdfbox/examples/pdmodel/AddImageToPDF.java?rev=682665&r1=682664&r2=682665&view=diff
==============================================================================
--- incubator/pdfbox/trunk/src/org/pdfbox/examples/pdmodel/AddImageToPDF.java (original)
+++ incubator/pdfbox/trunk/src/org/pdfbox/examples/pdmodel/AddImageToPDF.java Tue Aug 5 03:51:13 2008
@@ -1,18 +1,18 @@
/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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.
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.
*/
package org.pdfbox.examples.pdmodel;
@@ -61,16 +61,16 @@
try
{
doc = PDDocument.load( inputFile );
-
+
//we will add the image to the first page.
PDPage page = (PDPage)doc.getDocumentCatalog().getAllPages().get( 0 );
-
+
PDXObjectImage ximage = null;
if( image.toLowerCase().endsWith( ".jpg" ) )
{
ximage = new PDJpeg(doc, new FileInputStream( image ) );
}
- else if (image.toLowerCase().endsWith(".tif") || image.toLowerCase().endsWith(".tiff"))
+ else if (image.toLowerCase().endsWith(".tif") || image.toLowerCase().endsWith(".tiff"))
{
ximage = new PDCcitt(doc, new RandomAccessFile(new File(image),"r"));
}
@@ -81,9 +81,9 @@
throw new IOException( "Image type not supported:" + image );
}
PDPageContentStream contentStream = new PDPageContentStream(doc, page, true, true);
-
+
contentStream.drawImage( ximage, 20, 20 );
-
+
contentStream.close();
doc.save( outputFile );
}
@@ -130,4 +130,4 @@
{
System.err.println( "usage: " + this.getClass().getName() + " <input-pdf> <image> <output-pdf>" );
}
-}
\ No newline at end of file
+}
Propchange: incubator/pdfbox/trunk/src/org/pdfbox/examples/pdmodel/AddImageToPDF.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: incubator/pdfbox/trunk/src/org/pdfbox/examples/pdmodel/AddJavascript.java
URL: http://svn.apache.org/viewvc/incubator/pdfbox/trunk/src/org/pdfbox/examples/pdmodel/AddJavascript.java?rev=682665&r1=682664&r2=682665&view=diff
==============================================================================
--- incubator/pdfbox/trunk/src/org/pdfbox/examples/pdmodel/AddJavascript.java (original)
+++ incubator/pdfbox/trunk/src/org/pdfbox/examples/pdmodel/AddJavascript.java Tue Aug 5 03:51:13 2008
@@ -1,18 +1,18 @@
/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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.
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.
*/
package org.pdfbox.examples.pdmodel;
@@ -33,7 +33,7 @@
{
//static class, should not be instantiated.
}
-
+
/**
* This will print the documents data.
*
@@ -53,7 +53,7 @@
try
{
document = PDDocument.load( args[0] );
- PDActionJavaScript javascript = new PDActionJavaScript(
+ PDActionJavaScript javascript = new PDActionJavaScript(
"app.alert( {cMsg: 'PDFBox rocks!', nIcon: 3, nType: 0, cTitle: 'PDFBox Javascript example' } );");
document.getDocumentCatalog().setOpenAction( javascript );
if( document.isEncrypted() )
@@ -79,4 +79,4 @@
{
System.err.println( "Usage: java org.pdfbox.examples.pdmodel.AddJavascript <input-pdf> <output-pdf>" );
}
-}
\ No newline at end of file
+}
Propchange: incubator/pdfbox/trunk/src/org/pdfbox/examples/pdmodel/AddJavascript.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: incubator/pdfbox/trunk/src/org/pdfbox/examples/pdmodel/AddMessageToEachPage.java
URL: http://svn.apache.org/viewvc/incubator/pdfbox/trunk/src/org/pdfbox/examples/pdmodel/AddMessageToEachPage.java?rev=682665&r1=682664&r2=682665&view=diff
==============================================================================
--- incubator/pdfbox/trunk/src/org/pdfbox/examples/pdmodel/AddMessageToEachPage.java (original)
+++ incubator/pdfbox/trunk/src/org/pdfbox/examples/pdmodel/AddMessageToEachPage.java Tue Aug 5 03:51:13 2008
@@ -1,18 +1,18 @@
/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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.
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.
*/
package org.pdfbox.examples.pdmodel;
@@ -65,11 +65,11 @@
try
{
doc = PDDocument.load( file );
-
+
List allPages = doc.getDocumentCatalog().getAllPages();
PDFont font = PDType1Font.HELVETICA_BOLD;
float fontSize = 12.0f;
-
+
for( int i=0; i<allPages.size(); i++ )
{
PDPage page = (PDPage)allPages.get( i );
@@ -84,8 +84,8 @@
contentStream.endText();
contentStream.close();
}
-
-
+
+
doc.save( outfile );
}
finally
@@ -131,4 +131,4 @@
{
System.err.println( "usage: " + this.getClass().getName() + " <input-file> <Message> <output-file>" );
}
-}
\ No newline at end of file
+}
Propchange: incubator/pdfbox/trunk/src/org/pdfbox/examples/pdmodel/AddMessageToEachPage.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: incubator/pdfbox/trunk/src/org/pdfbox/examples/pdmodel/AddMetadataFromDocInfo.java
URL: http://svn.apache.org/viewvc/incubator/pdfbox/trunk/src/org/pdfbox/examples/pdmodel/AddMetadataFromDocInfo.java?rev=682665&r1=682664&r2=682665&view=diff
==============================================================================
--- incubator/pdfbox/trunk/src/org/pdfbox/examples/pdmodel/AddMetadataFromDocInfo.java (original)
+++ incubator/pdfbox/trunk/src/org/pdfbox/examples/pdmodel/AddMetadataFromDocInfo.java Tue Aug 5 03:51:13 2008
@@ -1,18 +1,18 @@
/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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.
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.
*/
package org.pdfbox.examples.pdmodel;
@@ -37,12 +37,12 @@
* @version $Revision: 1.4 $
*/
public class AddMetadataFromDocInfo
-{
+{
private AddMetadataFromDocInfo()
{
//utility class
}
-
+
/**
* This will print the documents data.
*
@@ -59,7 +59,7 @@
else
{
PDDocument document = null;
-
+
try
{
document = PDDocument.load( args[0] );
@@ -70,28 +70,28 @@
}
PDDocumentCatalog catalog = document.getDocumentCatalog();
PDDocumentInformation info = document.getDocumentInformation();
-
+
XMPMetadata metadata = new XMPMetadata();
-
+
XMPSchemaPDF pdfSchema = metadata.addPDFSchema();
pdfSchema.setKeywords( info.getKeywords() );
pdfSchema.setProducer( info.getProducer() );
-
+
XMPSchemaBasic basicSchema = metadata.addBasicSchema();
basicSchema.setModifyDate( info.getModificationDate() );
basicSchema.setCreateDate( info.getCreationDate() );
basicSchema.setCreatorTool( info.getCreator() );
basicSchema.setMetadataDate( new GregorianCalendar() );
-
+
XMPSchemaDublinCore dcSchema = metadata.addDublinCoreSchema();
dcSchema.setTitle( info.getTitle() );
dcSchema.addCreator( "PDFBox" );
dcSchema.setDescription( info.getSubject() );
-
+
PDMetadata metadataStream = new PDMetadata(document);
metadataStream.importXMPMetadata( metadata );
catalog.setMetadata( metadataStream );
-
+
document.save( args[1] );
}
finally
@@ -111,4 +111,4 @@
{
System.err.println( "Usage: java org.pdfbox.examples.pdmodel.AddMetadataFromDocInfo <input-pdf> <output-pdf>" );
}
-}
\ No newline at end of file
+}
Propchange: incubator/pdfbox/trunk/src/org/pdfbox/examples/pdmodel/AddMetadataFromDocInfo.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: incubator/pdfbox/trunk/src/org/pdfbox/examples/pdmodel/Annotation.java
URL: http://svn.apache.org/viewvc/incubator/pdfbox/trunk/src/org/pdfbox/examples/pdmodel/Annotation.java?rev=682665&r1=682664&r2=682665&view=diff
==============================================================================
--- incubator/pdfbox/trunk/src/org/pdfbox/examples/pdmodel/Annotation.java (original)
+++ incubator/pdfbox/trunk/src/org/pdfbox/examples/pdmodel/Annotation.java Tue Aug 5 03:51:13 2008
@@ -1,18 +1,18 @@
/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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.
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.
*/
package org.pdfbox.examples.pdmodel;
@@ -45,7 +45,7 @@
{
//utility class, should not be instantiated.
}
-
+
/**
* This will create a doucument showing various annotations.
*
@@ -62,7 +62,7 @@
else
{
PDDocument document = new PDDocument();
-
+
try
{
PDPage page = new PDPage();
@@ -71,7 +71,7 @@
// Setup some basic reusable objects/constants
// Annotations themselves can only be used once!
-
+
float inch = 72;
PDGamma colourRed = new PDGamma();
colourRed.setR(1);
@@ -82,53 +82,53 @@
PDBorderStyleDictionary borderThick = new PDBorderStyleDictionary();
borderThick.setWidth(inch/12); // 12th inch
PDBorderStyleDictionary borderThin = new PDBorderStyleDictionary();
- borderThin.setWidth(inch/72); // 1 point
+ borderThin.setWidth(inch/72); // 1 point
PDBorderStyleDictionary borderULine = new PDBorderStyleDictionary();
borderULine.setStyle(PDBorderStyleDictionary.STYLE_UNDERLINE);
- borderULine.setWidth(inch/72); // 1 point
+ borderULine.setWidth(inch/72); // 1 point
+
-
float pw = page.getMediaBox().getUpperRightX();
float ph = page.getMediaBox().getUpperRightY();
-
-
+
+
// First add some text, two lines we'll add some annotations to this later
-
-
+
+
PDFont font = PDType1Font.HELVETICA_BOLD;
-
+
PDPageContentStream contentStream = new PDPageContentStream(document, page);
contentStream.beginText();
contentStream.setFont( font, 18 );
- contentStream.moveTextPositionByAmount( inch, ph-inch-18);
+ contentStream.moveTextPositionByAmount( inch, ph-inch-18);
contentStream.drawString( "PDFBox" );
contentStream.moveTextPositionByAmount( 0,-(inch/2));
contentStream.drawString( "Click Here" );
contentStream.endText();
-
+
contentStream.close();
-
+
// Now add the markup annotation, a highlight to PDFBox text
PDAnnotationTextMarkup txtMark = new PDAnnotationTextMarkup(PDAnnotationTextMarkup.SUB_TYPE_HIGHLIGHT);
txtMark.setColour(colourBlue);
txtMark.setConstantOpacity((float)0.2); // Make the highlight 20% transparent
-
+
// Set the rectangle containing the markup
float textWidth = (font.getStringWidth( "PDFBox" )/1000) * 18;
PDRectangle position = new PDRectangle();
- position.setLowerLeftX(inch);
- position.setLowerLeftY( ph-inch-18 );
- position.setUpperRightX(72 + textWidth);
- position.setUpperRightY(ph-inch);
+ position.setLowerLeftX(inch);
+ position.setLowerLeftY( ph-inch-18 );
+ position.setUpperRightX(72 + textWidth);
+ position.setUpperRightY(ph-inch);
txtMark.setRectangle(position);
-
+
// work out the points forming the four corners of the annotations
// set out in anti clockwise form (Completely wraps the text)
// OK, the below doesn't match that description.
// It's what acrobat 7 does and displays properly!
- float[] quads = new float[8];
-
+ float[] quads = new float[8];
+
quads[0] = position.getLowerLeftX(); // x1
quads[1] = position.getUpperRightY()-2; // y1
quads[2] = position.getUpperRightX(); // x2
@@ -137,48 +137,48 @@
quads[5] = position.getLowerLeftY()-2; // y3
quads[6] = quads[2]; // x4
quads[7] = quads[5]; // y5
-
+
txtMark.setQuadPoints(quads);
txtMark.setContents("Highlighted since it's important");
-
+
annotations.add(txtMark);
-
+
// Now add the link annotation, so the clickme works
PDAnnotationLink txtLink = new PDAnnotationLink();
txtLink.setBorderStyle(borderULine);
-
+
// Set the rectangle containing the link
textWidth = (font.getStringWidth( "Click Here" )/1000) * 18;
position = new PDRectangle();
- position.setLowerLeftX(inch);
- position.setLowerLeftY( ph-(float)(1.5*inch)-20); // down a couple of points
- position.setUpperRightX(72 + textWidth);
- position.setUpperRightY(ph-(float)(1.5*inch));
+ position.setLowerLeftX(inch);
+ position.setLowerLeftY( ph-(float)(1.5*inch)-20); // down a couple of points
+ position.setUpperRightX(72 + textWidth);
+ position.setUpperRightY(ph-(float)(1.5*inch));
txtLink.setRectangle(position);
-
+
// add an action
PDActionURI action = new PDActionURI();
action.setURI("http://www.pdfbox.org");
txtLink.setAction(action);
-
+
annotations.add(txtLink);
-
-
+
+
// Now draw a few more annotations
-
- PDAnnotationSquareCircle aCircle =
+
+ PDAnnotationSquareCircle aCircle =
new PDAnnotationSquareCircle( PDAnnotationSquareCircle.SUB_TYPE_CIRCLE);
aCircle.setContents("Circle Annotation");
- aCircle.setInteriorColour(colourRed); // Fill in circle in red
+ aCircle.setInteriorColour(colourRed); // Fill in circle in red
aCircle.setColour(colourBlue); // The border itself will be blue
aCircle.setBorderStyle(borderThin);
// Place the annotation on the page, we'll make this 1" round
// 3" down, 1" in on the page
-
+
position = new PDRectangle();
- position.setLowerLeftX(inch);
+ position.setLowerLeftX(inch);
position.setLowerLeftY(ph-(3*inch)-inch); // 1" height, 3" down
position.setUpperRightX(2*inch); // 1" in, 1" width
position.setUpperRightY(ph-(3*inch)); // 3" down
@@ -186,18 +186,18 @@
// add to the annotations on the page
annotations.add(aCircle);
-
+
// Now a square annotation
-
- PDAnnotationSquareCircle aSquare =
+
+ PDAnnotationSquareCircle aSquare =
new PDAnnotationSquareCircle( PDAnnotationSquareCircle.SUB_TYPE_SQUARE);
aSquare.setContents("Square Annotation");
aSquare.setColour(colourRed); // Outline in red, not setting a fill
aSquare.setBorderStyle(borderThick);
-
+
// Place the annotation on the page, we'll make this 1" (72points) square
// 3.5" down, 1" in from the right on the page
-
+
position = new PDRectangle(); // Reuse the variable, but note it's a new object!
position.setLowerLeftX(pw-(2*inch)); // 1" in from right, 1" wide
position.setLowerLeftY(ph-(float)(3.5*inch) - inch); // 1" height, 3.5" down
@@ -207,24 +207,24 @@
// add to the annotations on the page
annotations.add(aSquare);
-
+
// Now we want to draw a line between the two, one end with an open arrow
-
+
PDAnnotationLine aLine = new PDAnnotationLine();
-
+
aLine.setEndPointEndingStyle( PDAnnotationLine.LE_OPEN_ARROW );
- aLine.setContents("Circle->Square");
+ aLine.setContents("Circle->Square");
aLine.setCaption(true); // Make the contents a caption on the line
-
+
// Set the rectangle containing the line
-
+
position = new PDRectangle(); // Reuse the variable, but note it's a new object!
position.setLowerLeftX(2*inch); // 1" in + width of circle
position.setLowerLeftY(ph-(float)(3.5*inch)-inch); // 1" height, 3.5" down
position.setUpperRightX(pw-inch-inch); // 1" in from right, and width of square
position.setUpperRightY(ph-(3*inch)); // 3" down (top of circle)
aLine.setRectangle(position);
-
+
// Now set the line position itself
float[] linepos = new float[4];
linepos[0] = 2*inch; // x1 = rhs of circle
@@ -232,17 +232,17 @@
linepos[2] = pw-(2*inch); // x2 = lhs of square
linepos[3] = ph-(4*inch); // y2 halfway down square
aLine.setLine(linepos);
-
+
aLine.setBorderStyle(borderThick);
aLine.setColour(colourBlack);
-
+
// add to the annotations on the page
annotations.add(aLine);
-
-
+
+
// Finally all done
-
-
+
+
document.save( args[0] );
}
finally
@@ -259,4 +259,4 @@
{
System.err.println( "Usage: java org.pdfbox.examples.pdmodel.Annotation <output-pdf>" );
}
-}
\ No newline at end of file
+}
Propchange: incubator/pdfbox/trunk/src/org/pdfbox/examples/pdmodel/Annotation.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: incubator/pdfbox/trunk/src/org/pdfbox/examples/pdmodel/CreateBlankPDF.java
URL: http://svn.apache.org/viewvc/incubator/pdfbox/trunk/src/org/pdfbox/examples/pdmodel/CreateBlankPDF.java?rev=682665&r1=682664&r2=682665&view=diff
==============================================================================
--- incubator/pdfbox/trunk/src/org/pdfbox/examples/pdmodel/CreateBlankPDF.java (original)
+++ incubator/pdfbox/trunk/src/org/pdfbox/examples/pdmodel/CreateBlankPDF.java Tue Aug 5 03:51:13 2008
@@ -1,18 +1,18 @@
/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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.
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.
*/
package org.pdfbox.examples.pdmodel;
@@ -91,4 +91,4 @@
{
System.err.println( "usage: java org.pdfbox.examples.pdmodel.CreateBlankPDF <outputfile.pdf>" );
}
-}
\ No newline at end of file
+}
Propchange: incubator/pdfbox/trunk/src/org/pdfbox/examples/pdmodel/CreateBlankPDF.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: incubator/pdfbox/trunk/src/org/pdfbox/examples/pdmodel/CreateBookmarks.java
URL: http://svn.apache.org/viewvc/incubator/pdfbox/trunk/src/org/pdfbox/examples/pdmodel/CreateBookmarks.java?rev=682665&r1=682664&r2=682665&view=diff
==============================================================================
--- incubator/pdfbox/trunk/src/org/pdfbox/examples/pdmodel/CreateBookmarks.java (original)
+++ incubator/pdfbox/trunk/src/org/pdfbox/examples/pdmodel/CreateBookmarks.java Tue Aug 5 03:51:13 2008
@@ -1,18 +1,18 @@
/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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.
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.
*/
package org.pdfbox.examples.pdmodel;
@@ -39,7 +39,7 @@
{
//utility class
}
-
+
/**
* This will print the documents data.
*
@@ -82,7 +82,7 @@
}
pagesOutline.openNode();
outline.openNode();
-
+
document.save( args[1] );
}
finally
@@ -102,4 +102,4 @@
{
System.err.println( "Usage: java org.pdfbox.examples.pdmodel.CreateBookmarks <input-pdf> <output-pdf>" );
}
-}
\ No newline at end of file
+}
Propchange: incubator/pdfbox/trunk/src/org/pdfbox/examples/pdmodel/CreateBookmarks.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: incubator/pdfbox/trunk/src/org/pdfbox/examples/pdmodel/EmbeddedFiles.java
URL: http://svn.apache.org/viewvc/incubator/pdfbox/trunk/src/org/pdfbox/examples/pdmodel/EmbeddedFiles.java?rev=682665&r1=682664&r2=682665&view=diff
==============================================================================
--- incubator/pdfbox/trunk/src/org/pdfbox/examples/pdmodel/EmbeddedFiles.java (original)
+++ incubator/pdfbox/trunk/src/org/pdfbox/examples/pdmodel/EmbeddedFiles.java Tue Aug 5 03:51:13 2008
@@ -1,18 +1,18 @@
/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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.
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.
*/
package org.pdfbox.examples.pdmodel;
@@ -68,11 +68,11 @@
try
{
doc = new PDDocument();
-
+
PDPage page = new PDPage();
doc.addPage( page );
PDFont font = PDType1Font.HELVETICA_BOLD;
-
+
PDPageContentStream contentStream = new PDPageContentStream(doc, page);
contentStream.beginText();
contentStream.setFont( font, 12 );
@@ -80,17 +80,17 @@
contentStream.drawString( "Go to Document->File Attachments to View Embedded Files" );
contentStream.endText();
contentStream.close();
-
+
//embedded files are stored in a named tree
PDEmbeddedFilesNameTreeNode efTree = new PDEmbeddedFilesNameTreeNode();
-
-
+
+
//first create the file specification, which holds the embedded file
PDComplexFileSpecification fs = new PDComplexFileSpecification();
fs.setFile( "Test.txt" );
//create a dummy file stream, this would probably normally be a FileInputStream
byte[] data = "This is the contents of the embedded file".getBytes();
- ByteArrayInputStream fakeFile =
+ ByteArrayInputStream fakeFile =
new ByteArrayInputStream( data );
PDEmbeddedFile ef = new PDEmbeddedFile(doc, fakeFile );
//now lets some of the optional parameters
@@ -98,7 +98,7 @@
ef.setSize( data.length );
ef.setCreationDate( new GregorianCalendar() );
fs.setEmbeddedFile( ef );
-
+
//now add the entry to the embedded file tree and set in the document.
Map efMap = new HashMap();
efMap.put( "My first attachment", fs );
@@ -106,8 +106,8 @@
PDDocumentNameDictionary names = new PDDocumentNameDictionary( doc.getDocumentCatalog() );
names.setEmbeddedFiles( efTree );
doc.getDocumentCatalog().setNames( names );
-
-
+
+
doc.save( file );
}
finally
@@ -153,4 +153,4 @@
{
System.err.println( "usage: " + this.getClass().getName() + " <output-file>" );
}
-}
\ No newline at end of file
+}
Propchange: incubator/pdfbox/trunk/src/org/pdfbox/examples/pdmodel/EmbeddedFiles.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: incubator/pdfbox/trunk/src/org/pdfbox/examples/pdmodel/GoToSecondBookmarkOnOpen.java
URL: http://svn.apache.org/viewvc/incubator/pdfbox/trunk/src/org/pdfbox/examples/pdmodel/GoToSecondBookmarkOnOpen.java?rev=682665&r1=682664&r2=682665&view=diff
==============================================================================
--- incubator/pdfbox/trunk/src/org/pdfbox/examples/pdmodel/GoToSecondBookmarkOnOpen.java (original)
+++ incubator/pdfbox/trunk/src/org/pdfbox/examples/pdmodel/GoToSecondBookmarkOnOpen.java Tue Aug 5 03:51:13 2008
@@ -1,18 +1,18 @@
/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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.
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.
*/
package org.pdfbox.examples.pdmodel;
@@ -39,7 +39,7 @@
{
//utility class
}
-
+
/**
* This will print the documents data.
*
@@ -64,7 +64,7 @@
System.err.println( "Error: Cannot add bookmark destination to encrypted documents." );
System.exit( 1 );
}
-
+
List pages = document.getDocumentCatalog().getAllPages();
if( pages.size() < 2 )
{
@@ -77,10 +77,10 @@
}
PDOutlineItem item = bookmarks.getFirstChild().getNextSibling();
PDDestination dest = item.getDestination();
- PDActionGoTo action = new PDActionGoTo();
- action.setDestination(dest);
- document.getDocumentCatalog().setOpenAction(action);
-
+ PDActionGoTo action = new PDActionGoTo();
+ action.setDestination(dest);
+ document.getDocumentCatalog().setOpenAction(action);
+
document.save( args[1] );
}
finally
@@ -100,4 +100,4 @@
{
System.err.println( "Usage: java org.pdfbox.examples.pdmodel.GoToSecondBookmarkOnOpen <input-pdf> <output-pdf>" );
}
-}
\ No newline at end of file
+}
Propchange: incubator/pdfbox/trunk/src/org/pdfbox/examples/pdmodel/GoToSecondBookmarkOnOpen.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: incubator/pdfbox/trunk/src/org/pdfbox/examples/pdmodel/HelloWorld.java
URL: http://svn.apache.org/viewvc/incubator/pdfbox/trunk/src/org/pdfbox/examples/pdmodel/HelloWorld.java?rev=682665&r1=682664&r2=682665&view=diff
==============================================================================
--- incubator/pdfbox/trunk/src/org/pdfbox/examples/pdmodel/HelloWorld.java (original)
+++ incubator/pdfbox/trunk/src/org/pdfbox/examples/pdmodel/HelloWorld.java Tue Aug 5 03:51:13 2008
@@ -1,18 +1,18 @@
/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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.
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.
*/
package org.pdfbox.examples.pdmodel;
@@ -63,11 +63,11 @@
try
{
doc = new PDDocument();
-
+
PDPage page = new PDPage();
doc.addPage( page );
PDFont font = PDType1Font.HELVETICA_BOLD;
-
+
PDPageContentStream contentStream = new PDPageContentStream(doc, page);
contentStream.beginText();
contentStream.setFont( font, 12 );
@@ -120,4 +120,4 @@
{
System.err.println( "usage: " + this.getClass().getName() + " <output-file> <Message>" );
}
-}
\ No newline at end of file
+}
Propchange: incubator/pdfbox/trunk/src/org/pdfbox/examples/pdmodel/HelloWorld.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: incubator/pdfbox/trunk/src/org/pdfbox/examples/pdmodel/HelloWorldTTF.java
URL: http://svn.apache.org/viewvc/incubator/pdfbox/trunk/src/org/pdfbox/examples/pdmodel/HelloWorldTTF.java?rev=682665&r1=682664&r2=682665&view=diff
==============================================================================
--- incubator/pdfbox/trunk/src/org/pdfbox/examples/pdmodel/HelloWorldTTF.java (original)
+++ incubator/pdfbox/trunk/src/org/pdfbox/examples/pdmodel/HelloWorldTTF.java Tue Aug 5 03:51:13 2008
@@ -1,18 +1,18 @@
/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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.
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.
*/
package org.pdfbox.examples.pdmodel;
@@ -33,7 +33,7 @@
* @author <a href="mailto:m.g.n@gmx.de">Michael Niedermair</a>
* @version $Revision: 1.2 $
*/
-public class HelloWorldTTF
+public class HelloWorldTTF
{
/**
@@ -47,12 +47,12 @@
* @throws COSVisitorException If there is an error writing the PDF.
*/
public void doIt(final String file, final String message,
- final String fontfile) throws IOException, COSVisitorException
+ final String fontfile) throws IOException, COSVisitorException
{
// the document
PDDocument doc = null;
- try
+ try
{
doc = new PDDocument();
@@ -70,10 +70,10 @@
contentStream.close();
doc.save(file);
System.out.println(file + " created!");
- }
- finally
+ }
+ finally
{
- if (doc != null)
+ if (doc != null)
{
doc.close();
}
@@ -88,22 +88,22 @@
*
* @param args Command line arguments.
*/
- public static void main(String[] args)
+ public static void main(String[] args)
{
HelloWorldTTF app = new HelloWorldTTF();
- try
+ try
{
- if (args.length != 3)
+ if (args.length != 3)
{
app.usage();
- }
- else
+ }
+ else
{
app.doIt(args[0], args[1], args[2]);
}
- }
- catch (Exception e)
+ }
+ catch (Exception e)
{
e.printStackTrace();
}
@@ -112,9 +112,9 @@
/**
* This will print out a message telling how to use this example.
*/
- private void usage()
+ private void usage()
{
System.err.println("usage: " + this.getClass().getName()
+ " <output-file> <Message> <ttf-file>");
}
-}
\ No newline at end of file
+}
Propchange: incubator/pdfbox/trunk/src/org/pdfbox/examples/pdmodel/HelloWorldTTF.java
------------------------------------------------------------------------------
svn:eol-style = native