Scanned Image Utility

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Hoakie
    Established Member
    • Feb 2007
    • 382
    • Iowa
    • Craftsman 21829

    #1

    Scanned Image Utility

    I recently obtained a lot of old WW mags from a friend that he was getting rid of. Since I didn't want to keep them myself, I scanned only the articles of interest. I kept them in separate directories by the title of the article but didn't rename them from image1.jpg, image2.jpg, etc. The problem I ran into is that each time i want to look at the article I have to open all the pages as separate images. This was especially cumbersome since i didn't give each one a unique name.

    Being a software developer, I decided to write a little utility that will go through a directory and pull its contents into a PDF file (it will also go through sub directories).

    If you are interested in trying it out feel free, you can get a copy of the application here Just unzip the files to a directory of your choice and run the executable. Select a source directory where your images reside and an output directory where to put the PDFs. then press the Create button. I used it to convert 62 directories into 62 PDFs in a about a minute.




    This application need Microsofts .NET framework 3.5, if you run into problems, you may need to install it as well. It can be found here


    A few other notes:

    1) I have only tested it on directories containing jpg files.
    2) the pdf file will contain all the images in the directory or sub directory
    3) the pdf file will be named the direcotry name (any spaces get converted to underscores for example c:\My WW Articles will be renamed My_WW_Articles.pdf)

    Please let me know if you find this useful or have any questions.

    Thanks
    Last edited by Hoakie; 12-30-2009, 05:21 PM.
    John
    To invent, you need a good imagination and a pile of junk. ~ Edison
  • Alex Franke
    Veteran Member
    • Feb 2007
    • 2641
    • Chapel Hill, NC
    • Ryobi BT3100

    #2
    Nice work, fellow programmer-guy!

    What tool did you use for the PDF stitching?
    online at http://www.theFrankes.com
    while ( !( succeed = try() ) ) ;
    "Life is short, Art long, Occasion sudden and dangerous, Experience deceitful, and Judgment difficult." -Hippocrates

    Comment

    • phi1l
      Senior Member
      • Oct 2009
      • 681
      • Madison, WI

      #3
      Another way to address the problem would be with one of the free bulk renaming utilities out there. I use ReNamer 5.50 http://www.den4b.com/projects.php , but there are many more as well.

      The PDF solution nice & tidy though.

      Comment

      • JSUPreston
        Veteran Member
        • Dec 2005
        • 1189
        • Montgomery, AL.
        • Delta 36-979 w/Biesemyere fence kit making it a 36-982. Previous saw was BT3100-1.

        #4
        Any way to get your .Net project files?
        "It's a dog eat dog world out there, and I'm wearing Milk-Bone underwear."- Norm (from Cheers)

        Eat beef-because the west wasn't won on salad.

        Comment

        • crokett
          The Full Monte
          • Jan 2003
          • 10627
          • Mebane, NC, USA.
          • Ryobi BT3000

          #5
          I downloaded a copy. Might be useful someday. Now... how quickly can you whip up a util for me to scan a directory tree and move all the files in the subdirectories up to the root directory? I have need of such a utility and could do the research on a perl script but I am feeling lazy.
          David

          The chief cause of failure in this life is giving up what you want most for what you want at the moment.

          Comment

          • Alex Franke
            Veteran Member
            • Feb 2007
            • 2641
            • Chapel Hill, NC
            • Ryobi BT3100

            #6
            Originally posted by crokett
            I downloaded a copy. Might be useful someday. Now... how quickly can you whip up a util for me to scan a directory tree and move all the files in the subdirectories up to the root directory? I have need of such a utility and could do the research on a perl script but I am feeling lazy.
            In windows command line, you can do something like this:

            for /r %x in (*.*) do move "%x" "c:\my destination directory"
            online at http://www.theFrankes.com
            while ( !( succeed = try() ) ) ;
            "Life is short, Art long, Occasion sudden and dangerous, Experience deceitful, and Judgment difficult." -Hippocrates

            Comment

            • Hoakie
              Established Member
              • Feb 2007
              • 382
              • Iowa
              • Craftsman 21829

              #7
              Originally posted by JSUPreston
              Any way to get your .Net project files?
              no problem, just note this is personal GIT-R-DONE with rudimentary error handling.

              Here is the source code.


              Alex, I used the opensource PDFSharp from Source Forge.
              Last edited by Hoakie; 12-31-2009, 12:13 AM.
              John
              To invent, you need a good imagination and a pile of junk. ~ Edison

              Comment

              • atgcpaul
                Veteran Member
                • Aug 2003
                • 4055
                • Maryland
                • Grizzly 1023SLX

                #8
                Originally posted by Hoakie
                no problem, just note this is personal GIT-R-DONE with rudimentary error handling.
                Thanks for sharing. When my old boss handed the over the sysadmin and
                programming reigns to me, he said to me, "You know, showing another man
                your code is like showing him your penis." I still think that's true.

                I learned perl by going through all his old code. Could never really pick it up
                from a book. How many times can you say Hello, World?

                Comment

                • crokett
                  The Full Monte
                  • Jan 2003
                  • 10627
                  • Mebane, NC, USA.
                  • Ryobi BT3000

                  #9
                  Originally posted by Alex Franke
                  In windows command line, you can do something like this:
                  Thanks Alex, I will try that. I got an MP3 player for Christmas. Off-brand but it works pretty well except for some reason all the music files have to be in the root music directory on it. So now I have to move several hundred music files out of the subdirectories.
                  David

                  The chief cause of failure in this life is giving up what you want most for what you want at the moment.

                  Comment

                  • JSUPreston
                    Veteran Member
                    • Dec 2005
                    • 1189
                    • Montgomery, AL.
                    • Delta 36-979 w/Biesemyere fence kit making it a 36-982. Previous saw was BT3100-1.

                    #10
                    Thanks for the code. I'm not much of a programmer myself, but it looks like something we could use at work. One of our young bucks is gonna peek at it later today.
                    "It's a dog eat dog world out there, and I'm wearing Milk-Bone underwear."- Norm (from Cheers)

                    Eat beef-because the west wasn't won on salad.

                    Comment

                    • Hoakie
                      Established Member
                      • Feb 2007
                      • 382
                      • Iowa
                      • Craftsman 21829

                      #11
                      No problem, most of the heavy lifting is comes from the PDFSharp tools. I just added the user interface and directory recursion. Although I haven't used it much, the PDFSharp seems to be a pretty comprehensive PDF writing solution. I'd recommend that he looks at the examples they provide. They have full source available also.
                      John
                      To invent, you need a good imagination and a pile of junk. ~ Edison

                      Comment

                      • sparkeyjames
                        Veteran Member
                        • Jan 2007
                        • 1087
                        • Redford MI.
                        • Craftsman 21829

                        #12
                        Originally posted by atgcpaul
                        I learned perl by going through all his old code. Could never really pick it up
                        from a book. How many times can you say Hello, World?
                        The answer to that.... more ways than you can count if done in perl.

                        Comment

                        • sparkeyjames
                          Veteran Member
                          • Jan 2007
                          • 1087
                          • Redford MI.
                          • Craftsman 21829

                          #13
                          Originally posted by JSUPreston
                          Thanks for the code. I'm not much of a programmer myself, but it looks like something we could use at work. One of our young bucks is gonna peek at it later today.
                          Make sure you don't pollute your closed source App with gpl or other restricted licensed code.

                          Comment

                          • JSUPreston
                            Veteran Member
                            • Dec 2005
                            • 1189
                            • Montgomery, AL.
                            • Delta 36-979 w/Biesemyere fence kit making it a 36-982. Previous saw was BT3100-1.

                            #14
                            Originally posted by sparkeyjames
                            Make sure you don't pollute your closed source App with gpl or other restricted licensed code.
                            I haven't written a line of code in over two years. Other than the OS and office suite, almost all of our apps are internally written to access out SQL servers. We don't sell or redistribute anything. Even if we wanted to, we can't since we're a "gubment" agency.
                            "It's a dog eat dog world out there, and I'm wearing Milk-Bone underwear."- Norm (from Cheers)

                            Eat beef-because the west wasn't won on salad.

                            Comment

                            • radhak
                              Veteran Member
                              • Apr 2006
                              • 3061
                              • Miramar, FL
                              • Right Tilt 3HP Unisaw

                              #15
                              That is one super-useful utility you wrote, John! I love it !

                              I ran it at first without updating my .net and it error-ed out; that .net 3.5 took a long time to download and install, but your program runs great now. I did get an 'out of memory' for one of my folders but I need to go back and check how many pics it had, or if it had any other formats.

                              I found this really useful to share pics with my parents, as I can now send them just one file instead of a whole bunch of images.

                              Thanks for the effort, and for sharing!
                              It is the mark of an educated mind to be able to entertain a thought without accepting it.
                              - Aristotle

                              Comment

                              Working...