Compressing automatically with PDF24 Creator

Home › Forums › PDF24 Creator › Compressing automatically with PDF24 Creator

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #4526
    PDF24
    Guest

    Can I do automatically the compression of one pdf file?

    I need to Compress a pdf file automatically. I´ve tried with the command line but my best result is pdf24-compress FileName to open the window with the file that I want to compress.
    I need to set PPP, imagen quality, the output path, and compress it automatically.
    Is it possible?
    Thanks a lot!

    #6151
    Stefan Ziegler
    Keymaster

    Yes, that is possible, but you should not use the the pdf24 compression tool here. This tool can not be used on the command line for now.

    You should go into the output profiles dialog and there you should create a new profile that fits your needs. Change the DPI and image compression values. DPI of 144 is OK but you can set what you like. Our online PDF compression tool used these 144 DPI by default and this value is often good. Lower DPI values and lower JPG quality values results in smaller PDF files.

    After you have create your profile, use the pdf24-doctool.exe. This tool has a command line interface and there you have to use the -applyProfile command. Use you newly created profile here. Read the command line description to get more information about it. Command line description can be printed by calling this tool without arguments.

    There are also flags for output file name.

    #63556
    ingeman
    Participant

    exe = Environ("ProgramW6432") & "\PDF24\Pdf24-DocTool.exe"

    q = """"
    outPDF = q & outPDF & q

    's = exe & " -join -profile ""default/good"" -outPutFile " & outPDF & " "
    s = exe & " -join -profile -compress ""default/good"" -noProgress -outPutFile " & outPDF & " "

    For I = LBound(a) To UBound(a)
    a(I) = q & a(I) & q
    Next I

    s = s & Join(a, " ")
    'Debug.Print s

    Shell s, vbHide

    How to avoid the popup on every time call

    #64446
    Stefan Ziegler
    Keymaster

    Which popup do you mean? File selection UI?

    -outPutFile should be -outputFile

    -join -profile -compress ""default/good"" seems to be wrong too. -join command syntax is like this:

    pdf24-DocTool.exe -join [-sort] [-bookmarks bookmarksCmd] [-profile profileId] [-outputDir dir] [-outputFile file] file1 [file2] ...

    #63561
    ingeman
    Participant

    Udklip.JPG

    The above pupup

    Stil the same - popup

    exe = Environ("ProgramW6432") & "\PDF24\Pdf24-DocTool.exe"

    s = exe & " -join -profile -compress ""default/good"" -noProgress -outputFile " & outPDF & " "

    #63720
    malshan
    Participant

    Hi,
    how to avoid this output profile popup?
    I use this coding

    set exe=F:\PDF24\Pdf24-DocTool.exe
    set inPDF=C:\Documents\large_file.pdf
    set outPDF=C:\Documents\Compressed\compressed_file.pdf

    "%exe%" -join -profile -compress "default/good" -Medium -outputFile "%outPDF%" -inputFile "%inPDF%"

    #65365
    PDF24 Support
    Moderator

    Hello,

    the dialog "Select an output profile" appears because -profile takes the next word as the profile ID. In your command this is -compress, which is not a profile, so the DocTool asks for one. -Medium and -inputFile are not options either; the input files are simply listed at the end. Profile IDs look like default/medium or default/good, not like the names in the dialog.

    For compressing you need neither -join nor a profile. Use the command -compress with the values for the images. One file:

    "F:\PDF24\pdf24-DocTool.exe" -compress -dpi 144 -imageQuality 75 -outputFile "C:\Documents\Compressed\compressed_file.pdf" -silent "C:\Documents\large_file.pdf"

    All PDF files of an input folder into an output folder:

    "F:\PDF24\pdf24-DocTool.exe" -compress -dpi 144 -imageQuality 75 -expandDirs -includeFileExtensions .pdf -outputDir "C:\Documents\Compressed" -silent "C:\Documents\Input"
    • Lower values for -dpi and -imageQuality give smaller files and lower image quality; 144 and 75 are the defaults.
    • With -outputDir the files get a suffix with the values, e.g. large_file_144dpi_75%.pdf.
    • -silent (since version 11.31.0) shows no windows and reports errors with an exit code, so the command can run unattended from a batch file or a scheduled task. With an older version, please update first.

    The options are described here:

    Without the command line: PDF24 Compress (pdf24-Compress.exe in the PDF24 installation folder) has a Hot folder setting (since version 11.31.0). PDF files placed in this folder are compressed automatically and saved next to the original with the Save file suffix. This works only while Compress is open, and the files are saved in the same folder, not in a separate output folder.

    Compressing single files also works online: https://tools.pdf24.org/en/compress-pdf

Viewing 7 posts - 1 through 7 (of 7 total)
  • You must be logged in to reply to this topic.