Printing from the command line

Home › Forums › PDF24 Creator › Printing from the command line

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #4430
    PDF24
    Guest

    how can I send a PDF file directly to a printer, in the command line

    I need to print a pdf file, to a specific printer without open the file, and invoke the print from the command line in windows

    #4431
    Anonymous
    Guest

    I want also this feature!

    #4432
    Anonymous
    Guest

    You can use the pdf24-docTool.exe. You can see the command line description of this tool by calling the doctool without arguments.

    To send a file to a printer you have to use the following command:

    pdf24-docTool.exe -shellPrint –printerName "PRINTER_NAME" "YOUR_FILE"

    #60453
    rennaroberto72
    Participant

    Hi, I have pretty similar issue. I want to use the export function. I woul like to send directly the pages I wanto to export, but i cannot see the option to use in order to export only some pages.

    I am able to get to the dialog to choose the document to export, but i still cannot perform the action in a single command:

    "C:\Program Files\PDF24\pdf24-doctool.exe" -extractPages  "...\Documents\pdfdocument.pdf"

    where should I define the pages I want to export and where is the command to define the exported filename?

    Thank you

    #65982
    PDF24 Support
    Moderator

    Hello,

    sorry for the late reply. -extractPages of the DocTool only opens the dialog, it has no options for a page list or an output file name. Without a dialog, the PDF24 Toolbox can do this with a job file (-processJob):

    1. Create a job file, e.g. C:\Data\job.json (write backslashes in paths twice):
    { "action": "sortPdfPages", "pagesInfos": [
      { "fileInfo": { "file": "C:\\Users\\name\\Documents\\pdfdocument.pdf", "name": "extract.pdf" }, "pages": [2, 3, 5] }
    ] }

    name is the name of the new file, pages the pages to take over, in this order (write ranges as single pages). You can add more entries for further files.

    1. Run the job:
    "C:\Program Files\PDF24\pdf24-Toolbox.exe" -processJob C:\Data\job.json C:\Data\result.json
    1. In result.json, outputFiles lists for each new PDF the path in the temp folder %TEMP%\PDF24 (file) and the intended name (name). Copy the files from there to your folder.

    Description of -processJob: https://creator.pdf24.org/manual/11/#912-process-a-job

    Printing a file to a specific printer without opening it still works as described above: pdf24-DocTool.exe -shellPrint -printerName "PRINTER_NAME" "YOUR_FILE" (https://creator.pdf24.org/manual/11/#11114-execute-the-print-command-using-shellexecute).

    Single extracts also work online: https://tools.pdf24.org/en/extract-pdf-pages

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