pdfbox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From msahy...@apache.org
Subject svn commit: r1667289 - in /pdfbox/trunk/examples/src/main/java/org/apache/pdfbox/examples: pdmodel/AddImageToPDF.java pdmodel/ImageToPDF.java signature/CreateVisibleSignature.java util/PDFHighlighter.java
Date Tue, 17 Mar 2015 12:29:56 GMT
Author: msahyoun
Date: Tue Mar 17 12:29:55 2015
New Revision: 1667289

URL: http://svn.apache.org/r1667289
Log:
PDFBOX-2712 remove commented out lines

Modified:
    pdfbox/trunk/examples/src/main/java/org/apache/pdfbox/examples/pdmodel/AddImageToPDF.java
    pdfbox/trunk/examples/src/main/java/org/apache/pdfbox/examples/pdmodel/ImageToPDF.java
    pdfbox/trunk/examples/src/main/java/org/apache/pdfbox/examples/signature/CreateVisibleSignature.java
    pdfbox/trunk/examples/src/main/java/org/apache/pdfbox/examples/util/PDFHighlighter.java

Modified: pdfbox/trunk/examples/src/main/java/org/apache/pdfbox/examples/pdmodel/AddImageToPDF.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/examples/src/main/java/org/apache/pdfbox/examples/pdmodel/AddImageToPDF.java?rev=1667289&r1=1667288&r2=1667289&view=diff
==============================================================================
--- pdfbox/trunk/examples/src/main/java/org/apache/pdfbox/examples/pdmodel/AddImageToPDF.java
(original)
+++ pdfbox/trunk/examples/src/main/java/org/apache/pdfbox/examples/pdmodel/AddImageToPDF.java
Tue Mar 17 12:29:55 2015
@@ -81,9 +81,10 @@ public class AddImageToPDF
             }
             PDPageContentStream contentStream = new PDPageContentStream(doc, page, true,
true);
 
-            //contentStream.drawImage(ximage, 20, 20 );
+            // contentStream.drawImage(ximage, 20, 20 );
             // better method inspired by http://stackoverflow.com/a/22318681/535646
-            float scale = 1f; // reduce this value if the image is too large
+            // reduce this value if the image is too large
+            float scale = 1f;
             contentStream.drawImage(ximage, 20, 20, ximage.getWidth()*scale, ximage.getHeight()*scale);
 
             contentStream.close();

Modified: pdfbox/trunk/examples/src/main/java/org/apache/pdfbox/examples/pdmodel/ImageToPDF.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/examples/src/main/java/org/apache/pdfbox/examples/pdmodel/ImageToPDF.java?rev=1667289&r1=1667288&r2=1667289&view=diff
==============================================================================
--- pdfbox/trunk/examples/src/main/java/org/apache/pdfbox/examples/pdmodel/ImageToPDF.java
(original)
+++ pdfbox/trunk/examples/src/main/java/org/apache/pdfbox/examples/pdmodel/ImageToPDF.java
Tue Mar 17 12:29:55 2015
@@ -86,8 +86,8 @@ public class ImageToPDF
             // draw the image at full size at (x=20, y=20)
             contents.drawImage(pdImage, 20, 20);
             
-            // draw the image at half size at (x=20, y=20)
-            //contents.drawImage(pdImage, 20, 20, pdImage.getWidth() / 2, pdImage.getHeight()
/ 2);
+            // to draw the image at half size at (x=20, y=20) use
+            // contents.drawImage(pdImage, 20, 20, pdImage.getWidth() / 2, pdImage.getHeight()
/ 2);
             
             contents.close();
             doc.save(pdfPath);

Modified: pdfbox/trunk/examples/src/main/java/org/apache/pdfbox/examples/signature/CreateVisibleSignature.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/examples/src/main/java/org/apache/pdfbox/examples/signature/CreateVisibleSignature.java?rev=1667289&r1=1667288&r2=1667289&view=diff
==============================================================================
--- pdfbox/trunk/examples/src/main/java/org/apache/pdfbox/examples/signature/CreateVisibleSignature.java
(original)
+++ pdfbox/trunk/examples/src/main/java/org/apache/pdfbox/examples/signature/CreateVisibleSignature.java
Tue Mar 17 12:29:55 2015
@@ -150,8 +150,6 @@ public class CreateVisibleSignature impl
             {
                 options = new SignatureOptions();
                 options.setVisualSignature(signatureProperties);
-                // options.setPage(signatureProperties.getPage());
-                // options.setPreferedSignatureSize(signatureProperties.getPreferredSize());
                 doc.addSignature(signature, this, options);
             }
             finally

Modified: pdfbox/trunk/examples/src/main/java/org/apache/pdfbox/examples/util/PDFHighlighter.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/examples/src/main/java/org/apache/pdfbox/examples/util/PDFHighlighter.java?rev=1667289&r1=1667288&r2=1667289&view=diff
==============================================================================
--- pdfbox/trunk/examples/src/main/java/org/apache/pdfbox/examples/util/PDFHighlighter.java
(original)
+++ pdfbox/trunk/examples/src/main/java/org/apache/pdfbox/examples/util/PDFHighlighter.java
Tue Mar 17 12:29:55 2015
@@ -41,7 +41,6 @@ import org.apache.pdfbox.text.PDFTextStr
 public class PDFHighlighter extends PDFTextStripper
 {
     private Writer highlighterOutput = null;
-    //private Color highlightColor = Color.YELLOW;
 
     private String[] searchedWords;
     private ByteArrayOutputStream textOS = null;
@@ -90,10 +89,6 @@ public class PDFHighlighter extends PDFT
         highlighterOutput = xmlOutput;
         searchedWords = sWords;
         highlighterOutput.write("<XML>\n<Body units=characters " +
-                                //color and mode are not implemented by the highlight spec
-                                //so don't include them for now
-                                //" color=#" + getHighlightColorAsString() +
-                                //" mode=active " + */
                                 " version=2>\n<Highlight>\n");
         textOS = new ByteArrayOutputStream();
         textWriter = new OutputStreamWriter( textOS, ENCODING);
@@ -111,10 +106,6 @@ public class PDFHighlighter extends PDFT
 
         String page = new String( textOS.toByteArray(), ENCODING );
         textOS.reset();
-        //page = page.replaceAll( "\n", "" );
-        //page = page.replaceAll( "\r", "" );
-        //page = CCRStringUtil.stripChar(page, '\n');
-        //page = CCRStringUtil.stripChar(page, '\r');
 
         // Traitement des listes � puces (caract�res sp�ciaux)
         if (page.indexOf('a') != -1)
@@ -178,52 +169,4 @@ public class PDFHighlighter extends PDFT
         System.err.println( "usage: java " + PDFHighlighter.class.getName() + " <pdf file>
word1 word2 word3 ..." );
         System.exit( 1 );
     }
-
-
-    /**
-     * Get the color to highlight the strings with.  Default is Color.YELLOW.
-     *
-     * @return The color to highlight strings with.
-     */
-    /*public Color getHighlightColor()
-    {
-        return highlightColor;
-    }**/
-
-    /**
-     * Get the color to highlight the strings with.  Default is Color.YELLOW.
-     *
-     * @param color The color to highlight strings with.
-     */
-    /*public void setHighlightColor(Color color)
-    {
-        this.highlightColor = color;
-    }**/
-
-    /**
-     * Set the highlight color using HTML like rgb string.  The string must be 6 characters
long.
-     *
-     * @param color The color to use for highlighting.  Should be in the format of "FF0000".
-     */
-    /*public void setHighlightColor( String color )
-    {
-        highlightColor = Color.decode( color );
-    }**/
-
-    /**
-     * Get the highlight color as an HTML like string.  This will return a string of six
characters.
-     *
-     * @return The current highlight color.  For example FF0000
-     */
-    /*public String getHighlightColorAsString()
-    {
-        //BJL: kudos to anyone that has a cleaner way of doing this!
-        String red = Integer.toHexString( highlightColor.getRed() );
-        String green = Integer.toHexString( highlightColor.getGreen() );
-        String blue = Integer.toHexString( highlightColor.getBlue() );
-
-        return (red.length() < 2 ? "0" + red : red) +
-               (green.length() < 2 ? "0" + green : green) +
-               (blue.length() < 2 ? "0" + blue : blue);
-    }**/
 }



Mime
View raw message