command line tools


A Windows command line tool for encrypting a PDF file.


                pdfMachineEncrypt /f filename.pdf /p openpass /o ownerpass /accesability y|n /print y|n /change y|n /notes y|n /copy y|n /form y|n /assemble y|n
                f  - PDF filename, required: true
                help  - Help, required: false
                o  - Password to change the PDF security settings, required: false
                p  - Password to open the PDF for viewing, required: true
                accessability  - Security setting : Accessability, required: false
                assemble  - Security setting : document assembly, required: false
                change  - Security setting : change, required: false
                copy  - Security setting : Copy and extract, required: false
                form  - Security setting : Form fill or sign, required: false
                notes  - Security setting : add notes, required: false
                print  - Security setting : print, required: false

                pdfMachineEncrypt /f x.pdf /p mypass
                pdfMachineEncrypt /f x.pdf /p mypass /o someotherpass /print n /copy n


A Windows command line tool for applying a text stamp or watermark to a PDF file.


            pdfMachineStamp /f filename.pdf /t "some text"
                 color  - Text color. Can be a name such as green, black, darkmagenta, cornflowerblue etc, or a RGB hex value such as #aabbcc
                     f  - PDF filename, required.
                  font  - Font name. Can be any Windows font.
                  help  - Help
               opacity  - Stamp opacity between 0 (transparent) and 1 (opaque)
                  page  - The page number to apply the stamp to. 0 means all pages.
                   pos  - Position: topleft, topcenter, topright, centerleft, center, centerright, bottomleft, bottomcenter, bottomright
                   rot  - Rotation in degrees
                  size  - Font size in points
                     t  - Stamp text, required.
                     x  - Position X in points. If 'pos' given is used as an offset.
                     y  - Position Y in points. If 'pos' given is used as an offset.

            pdfMachineStamp /f file.pdf /t "some text" /pos topcenter /color #fa0000
            pdfMachineStamp /f file.pdf /t "some text" /pos center /rot 45 /font "Brush Script MT" /size 50 /color green /opacity 0.5 /page 1


A Windows command line tool for digitally signing a PDF file using a certificate in the Windows certificate store.


            pdfMachineSign /f filename.pdf /sha1 thumbprint
                                 f  - PDF filename, required.
                              sha1  - SHA1 thumbprint identifying this certificate.  Use certmgr.msc to find, required.
                            reason  - Reason for signing.
                          location  - Location
                              page  - The page number to put the signature on.
                        image-file  - The image file. Can be JPEG, BMP, GIF.
                    show-cert-name  - Text appearance - show certificate name, y|n
                    show-dist-name  - Text appearance - show certificate distinguished name, y|n
                     show-location  - Text appearance - show location,  y|n
                       show-reason  - Text appearance - show reason, y|n
                    show-date-time  - Text appearance - show date time, y|n
                         show-date  - Text appearance - show date, y|n
                         show-time  - Text appearance - show time, y|n
                          position  - Valid values are: topleft, topright, bottomleft, bottomright, center, centerleft, centerright, centertop, centerbottom.
                                 x  - Horizontal position in points.  If 'position' is set, works as an offset.
                                 y  - Vertical position in points.  If 'position' is set, works as an offset.
                             width  - Width in points.
                            height  - Height in points.
                     timestamp-url  - URL of a RFC 3161 compliant timestamping server.
              certified-permission  - 0 - not certified (default), 1 - changes not allowed, 2 - changes to forms allowed, 3, - changes to annotations  allowed.
                              help  - Help
            pdfMachineSign /f file.pdf /sha1 aabbccddeeff00112233445566114455
            pdfMachineSign /f file.pdf /sha1 aabbccddeeff00112233445566114455 /image-file C:\sig\sig.jpg /show-date y /position bottomright /width 200 /height 100



A Windows command line tool for splitting a PDF file into multiple files.


                pdfMachineSplit /f filename.pdf /autonum 1 /pages 1 /dir directory-to-save-to  /out output-file-pattern
                             autonum  - Seed the auto numbering, defaults to 1, required: false
                                 dir  - Directory to save files, required: true
                                   f  - PDF filename, required: true
                                help  - Help, required: false
                                 out  - Output file name pattern, see output pattern , required: true
                               pages  - Pages per PDF, defaults to 1, required: false

                pdfMachineSplit /f filename.pdf  /dir c:\tmp  /out "out.pdf"
                    - produces out1.pdf, out2.pdf ....
                pdfMachineSplit /f filename.pdf  /dir c:\tmp /autonum 100 /out "out-{AUTONUM4}.pdf"
                    - produces out-0100.pdf, out-0101.pdf ....
                pdfMachineSplit /f filename.pdf  /dir c:\tmp  /pages 2 /out "%Y-%m-%d {AUTONUM5}.pdf"
                    - produces '2018-09-25 00001.pdf', '2018-09-25 00002.pdf' ...


Perform Optical Character Recognition (OCR) on a PDF or images, inserting searchable hidden text. Optionally splitting the PDF into smaller files, based on a separator string. Also acquires images from TWAIN scanners and converts them to PDFs.


                            f       - Input PDF filename
                          out       - Output PDF file name.  Can be a pattern, see
                   image-file       - Full path to an image file, or if prefixed with @ a text file where each line is a path to an image.  The files are converted to a single PDF.
                    page-size       - To be used in conjunction with /image-file or /scanner options. e.g. A4, A3, A2, A1, A0, Letter, Legal,  Executive, Ledger, Tabloid.  If not set the image dimensions are used for the page size.
                 scanner-name       - Scanner name.
                   scanner-res      - Scanner resolution.
                scanner-pixel-type  - Pixel type: BW, GRAY, RGB, CYMK, default
                scanner-feeder      - If set, the document feeder is used.
                  scanner-list      - If set, lists all the scanners on this machine.
                        thumbs      - Generate thumbnails.  e.g. '/thumbs 200' generates images of width 200px.
                        no-ocr      - If set, no OCR is performed.
                  jpeg-quality      - The quality of JPEG encoding, between 0 - 100.  Defaults to 95 which is high quality.  Values over 95 show negligable quality improvement.
                        deskew      - If set the images are deskewed.
                       out-dir      - Directory to save files
               delete-sep-page      - If set, the separator pages are deleted.
                           sep      - Separator string. Pages containing this text mark the point the file is to be split into several files.
                       autonum      - Seed the auto numbering, defaults to 1
                          lang      - OCR language. Defaults to english (eng).  Other languages need appropriate language data files.
                        in-dir      - Will process each PDF in this directory and move each processed file to the specified output directory (/out-dir).


                pdfMachineOCR /f filename.pdf
                - applies OCR to filename.pdf

                pdfMachineOCR /f filename.pdf   /out "c:\tmp\out.pdf" /sep "*SEPARATOR*"
                - applies OCR, then splits the PDF into smaller PDFs, based on what pages include the /sep string.  produces out1.pdf, out2.pdf ....

                pdfMachineOCR /in-dir C:\tmp\scans /out-dir c:\tmp\scans-ocr
                - applies OCR to each file in C:\tmp\scans then moves that file to the C:\tmp\scans-ocr directory

                pdfMachineOCR /image-file @c:\tmp\images.txt /out c:\tmp\out.pdf  /page-size A4
                - Each line in images.txt is a file path to an image file.  The image files are placed into the PDF, one on each page. OCR is applied.

                pdfMachineOCR /scanner-list
                - list all TWAIN scanners found

                pdfMachineOCR /scanner-name "HP OfficeJet 6950 TWAIN"   /out "c:\tmp\scan %Y-%m-%d %H-%M-%S.pdf" /deskew
                - Acquire images from scanner, deskew them, apply OCR,  produce pdf with current timestamp.

                Copyright (C) Broadgun Software 2020
Please contact if you would like to use this tool.