Windows Batch

12K

Solutions

11K

Contributors

Batch files are text files containing a script of commands that are executed by the command interpreter on DOS, OS/2 and Windows systems. Most commonly, they are used to perform a series of functions that are repeated -- copying a set of files created daily with one step, for example.

Share tech news, updates, or what's on your mind.

Sign up to Post

Xpdf - PDFtoPS - Command Line Utility to Convert a PDF File to PS (PostScript)
In this tenth video of my Xpdf series, I discuss and demonstrate the PDFtoPS utility, which converts a PDF file to PostScript (PS). Also, it provides an option allowing creation of an Encapsulated PostScript (EPS) file. It performs its functions via a command line interface, making it suitable for use in programs, scripts, batch files — any place where a command line call can be made.

1. Download the software


You may have already downloaded the Xpdf tools while watching one of my earlier videos in the series, but there has since been an upgrade from Version 3 to Version 4 and there is a new download site:

https://www.xpdfreader.com/download.html

Visit that site and download the pre-compiled Windows binary ZIP archive, then unzip it.

Step1

2. Locate the documentation folder for the Xpdf utilities


Go to the folder where you unzipped the downloaded ZIP file and find the doc folder.

Step2

3. Read the documentation for the PDFtoPS tool


Go into the doc folder and find the plain text file called pdftops.txt.

Open it with any text editor, such as Notepad, and read it. This is the documentation for the PDFtoPS tool.

Step3

4. Set up a test folder


Create a test folder.

Copy pdftops.exe from the unzipped bin32 folder into your test folder.

Copy a sample PDF file into your test folder.

Step4

5. Set up a command prompt for testing


Open a command prompt window.

Navigate to your test folder.

Issue a DIR command in the command prompt to be sure that only two files are in it - the PDFtoPS executable and the sample PDF file.

Step5

6. Run the PDFtoPS utility to create the PostScript file


Issue the following command in the command prompt:

pdftops TestFileName.pdf
1
LVL 28

Expert Comment

by:Andrew Leniart
Great video and introduction to a very useful tool indeed.
0
LVL 63

Author Comment

by:Joe Winograd, Fellow 2017
Thank you, Andrew, I appreciate the compliment and the endorsement. Happy New Year! Regards, Joe
0
JavaScript Best Practices
LVL 13
JavaScript Best Practices

Save hours in development time and avoid common mistakes by learning the best practices to use for JavaScript.

Xpdf - PDFtoPPM - Command Line Utility to Convert a PDF File to PPM, PGM, PBM
In this ninth video of my Xpdf series, I discuss and demonstrate the PDFtoPPM tool, which converts a PDF file to color portable pixmap (PPM) format, grayscale portable graymap (PGM) format, or monochrome (black & white) portable bitmap (PBM) format. It creates a separate image file for each page of the PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any place where a command line call can be made.

1. Download the software


You may have already downloaded the Xpdf tools while watching one of my earlier videos in the series, but there has since been an upgrade from Version 3 to Version 4 and there is a new download site:

https://www.xpdfreader.com/download.html

Visit that site and download the pre-compiled Windows binary ZIP archive, then unzip it.

Step1

2. Locate the documentation folder for the Xpdf utilities


Go to the folder where you unzipped the downloaded ZIP file and find the doc folder.

Step2

3. Read the documentation for the PDFtoPPM tool


Go into the doc folder and find the plain text file called pdftoppm.txt.

Open it with any text editor, such as Notepad, and read it. This is the documentation for the PDFtoPPM tool.

Step3

4. Set up a test folder


Create a test folder.

Copy pdftoppm.exe from the unzipped bin32 folder into your test folder.

Copy a sample PDF file into your test folder, preferably one with numerous pages.

Step4

5. Set up a command prompt for testing


Open a command prompt window.

Navigate to your test folder.

Issue a DIR command in the command prompt to be sure that only two files are in it - the PDFtoPPM executable and the sample PDF file.

Step5
1
Xpdf - PDFtoHTML - Command Line Utility to Convert a PDF File to HTML
In this eighth video of my Xpdf series, I discuss and demonstrate the PDFtoHTML utility, which, exactly as its name says, converts a PDF file to HTML. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any place where a command line call can be made.

1. Download the software


You may have already downloaded the Xpdf tools while watching one of my earlier videos in the series, but there has since been an upgrade from Version 3 to Version 4 and there is a new download site:

https://www.xpdfreader.com/download.html

Visit that site and download the pre-compiled Windows binary ZIP archive, then unzip it.

Step1

2. Locate the documentation folder for the Xpdf utilities


Go to the folder where you unzipped the downloaded ZIP file and find the doc folder.

Step2

3. Read the documentation for the PDFtoHTML tool


Go into the doc folder and find the pdftohtml.txt file.

It is a plain text file. Open it with any text editor, such as Notepad, and read it. This is the documentation for the PDFtoHTML tool.

Step3

4. Set up a test folder


Create a test folder.

Copy pdftohtml.exe from the unzipped bin32 folder into your test folder.

Copy a sample PDF file into your test folder, preferably one with numerous pages.

Step4

5. Set up a command prompt for testing


Open a command prompt window.

Navigate to your test folder.

Issue a DIR command in the command prompt to be sure that only two files are in it - the PDFtoHTML executable and the sample PDF file.

Step5

6. Run the PDFtoHTML utility


Issue the following command in the command prompt:

pdftohtml TestFileName.pdf HTMLfolder
2
xpdfrc - Configuration File for All Xpdf Utilities
This is the eleventh — and final — video of my Experts Exchange Micro Tutorials on the Xpdf utilities. The first video is an overview of the command line tools. The next nine videos are tutorials on all them:

PDFimages - Extract Images from PDF Files
PDFtoText - Convert PDF Files to Plain Text Files
PDFinfo - Retrieve Page Count and Other Information from PDF Files
PDFdetach - Detach Attachments from PDF Files
PDFtoPNG - Convert a Multi-page PDF File into Separate PNG Files
PDFfonts - List Fonts Used in a PDF File
PDFtoHTML - Convert a PDF File to HTML
PDFtoPPM - Convert a PDF File to PPM, PGM, PBM
PDFtoPS - Convert a PDF File to PS (PostScript)

This last video in the series discusses xpdfrc, which is the single configuration file that Xpdf uses for all nine utilities. It provides an enormous number of options, allowing extensive control of the tools, such as character mapping, font configuration, PostScript control, rasterizer settings, text control, and much more.

1. Download the software and fonts


You may have already downloaded the Xpdf tools while watching one of my earlier videos in the series, but there has since been an upgrade from Version 3 to Version 4 and there is a new download site:

https://www.xpdfreader.com/download.html

Visit that site and download the pre-compiled Windows binary ZIP archive, then unzip it.

Download the Symbol and Zapf Dingbats fonts from the same page.

Step1

2. Locate the documentation folder for the Xpdf utilities


Go to the folder where you unzipped the downloaded ZIP file and find the doc folder.

Step2
1
Xpdf - PDFfonts - Command Line Utility to List Fonts Used in a PDF File
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. In addition to the name of the font, it shows the font type and whether or not the font is embedded in the PDF file (and, if embedded, whether or not it is a subset), along with other font information that is discussed in the documentation file. It does this via a command line interface, making it suitable for use in batch files, programs, and scripts — any place where a command line call can be made.

1. Download the software


You may have already downloaded and unzipped the Xpdf tools while watching the first video in the Xpdf series, but if you haven't, then visit the Xpdf website. Click the Download link and then click the pre-compiled Windows binary ZIP archive to download the utilities for Windows.

Step1

2. Locate the documentation folder for the Xpdf utilities


Go to the folder where you unzipped the downloaded ZIP file and find the doc folder.

Step2

3. Read the documentation for the PDFfonts tool


Go into the doc folder and find the plain text file called pdffonts.txt.

Open it with any text editor, such as Notepad, and read it. This is the documentation for the PDFfonts tool.

Step3

4. Set up a test folder


Create a test folder.

Copy pdffonts.exe from the unzipped bin32 folder into your test folder.

Copy a couple of sample PDF files into your test folder, preferably ones with many different fonts.

Step4

5. Set up a command prompt for testing

2
LVL 19

Administrative Comment

by:Kyle Santos
Congratulations!  Your video has been Accepted and is now published on Experts Exchange.  Thank you for your contributions.
1
LVL 63

Author Comment

by:Joe Winograd, Fellow 2017
Hi Kyle,
Thanks for publishing and upvoting — both appreciated! Regards, Joe
1
Xpdf - PDFtoPNG - Command Line Utility to Convert a Multi-page PDF File into Separate PNG Files
In this sixth video of the Xpdf series, we discuss and demonstrate the PDFtoPNG utility, which converts a multi-page PDF file to separate color, grayscale, or monochrome PNG files, creating one PNG file for each page in the PDF. It does this via a command line interface, making it suitable for use in batch files, programs, and scripts — any place where a command line call can be made.

1. Download the software


You may have already downloaded and unzipped the Xpdf tools while watching the first video in the Xpdf series, but if you haven't, then visit the Xpdf website. Click the Download link and then click the pre-compiled Windows binary ZIP archive to download the utilities for Windows.

Step1

2. Locate the documentation folder for the Xpdf utilities


Go to the folder where you unzipped the downloaded ZIP file and find the doc folder.

Step2

3. Read the documentation for the PDFtoPNG tool


Go into the doc folder and find the plain text file called pdftopng.txt.

Open it with any text editor, such as Notepad, and read it. This is the documentation for the PDFtoPNG tool.

Step3

4. Set up a test folder


Create a test folder.

Copy pdftopng.exe from the unzipped bin32 folder into your test folder.

Copy a sample PDF file into your test folder. Of course, it will work fine with a one-page PDF file, but it is more instructive to test it with a multi-page PDF.

Step4

5. Set up a command prompt for testing


Open a command prompt window.

Navigate to your test folder.

Issue a DIR command in the command prompt to be sure that only two files are in it - the PDFtoPNG executable and the sample PDF file.

Step5

6. Run the PDFtoPNG utility

1
LVL 63

Author Comment

by:Joe Winograd, Fellow 2017
Kyle,
Thanks for the fast publishing and the compliment — both appreciated! Regards, Joe
1
LVL 63

Author Comment

by:Joe Winograd, Fellow 2017
Hi Tia Henderson,
I'm sure that you meant to endorse this video (rather than Kyle's comment that it was Accepted and my comment thanking Kyle). To endorse the video, you must click the thumbs-up icon that is right underneath the video steps (before this Comments section begins). Thanks, Joe
0
How to use the Windows Task Scheduler - An Introduction
The Task Scheduler is a powerful tool that is built into Windows. It allows you to schedule tasks (actions) on a recurring basis, such as hourly, daily, weekly, monthly, at log on, at startup, on idle, etc. This video Micro Tutorial is a brief introduction to the Task Scheduler. It was inspired by a recent question here at Experts Exchange from a member who wants to play a different song at four different times during the day (every day). The video uses that as the example, but the intention of the video is to explain the general creation of periodic tasks that can cover a broad range of user requirements. The video was produced in Windows 10, but the Task Scheduler user interface is nearly the same in Windows Vista, Windows 7, and Windows 8 (the Task Scheduler exists in Windows XP with similar functionality, but the user interface is different).

1. Run the Task Scheduler


In Windows 10, click the Start button and start typing task scheduler. By the time you get to the letter "k", you should see the Task Scheduler choice — click it.

There are different ways to run the Task Scheduler. For example, in Windows 7:
Start
All Programs
Accessories
System Tools
Task Scheduler


Step1

2. Create a new folder for your own tasks


Make sure Task Scheduler Library is selected/highlighted in the left pane (it should already be).

Click New Folder... in the Actions pane on the right, then give the new folder a name.

Step2

3. Create a new task in your new folder


Expand the Task Scheduler Library and select/highlight your new folder.

Click Create Task... in the Actions
18

Expert Comment

by:Michael Okopedeghe
Thanks very Helpful and easy to follow.
Mike
0
LVL 63

Author Comment

by:Joe Winograd, Fellow 2017
You're welcome, Mike. And thanks to you for joining EE today, watching my video, and endorsing it — much appreciated! Regards, Joe
1
Xpdf - PDFdetach - Command Line Utility to Detach Attachments from PDF Files
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable for use in batch files, programs, and scripts — any place where a command line call can be made.

1. Download the software.


You may have already downloaded and unzipped the Xpdf tools while watching the first video in the Xpdf series, but if you haven't, then visit the Xpdf website. Click the Download link and then click the pre-compiled Windows binary ZIP archive to download the utilities for Windows.

Step1

2. Locate the documentation folder for the Xpdf utilities.


Go to the folder where you unzipped the downloaded ZIP file and find the <doc> folder.

Step2

3. Read the documentation for the PDFdetach tool.


Go into the <doc> folder and find the plain text file called <pdfdetach.txt>.

Open it with any text editor, such as Notepad, and read it. This is the documentation for the PDFdetach tool.

Step3

4. Set up a test folder.


Create a test folder.

Copy <pdfdetach.exe> from the unzipped <bin32> folder into your test folder.

Copy a sample PDF file that has attachments into your test folder (in the video and the screenshots below, the file is called test.pdf, which is a PDF file created from my EE article, Windows 10 uses YOUR computer to help distribute itself, but with some attachments added to it).

Step4

5. Set up a command prompt for testing.

4
LVL 28

Expert Comment

by:NVIT
Hi Joe...

> A way to achieve that is to extract first with PDFdetach and then print the file to a PDF print driver.

That would work for me. Thanks!

Mahalo
1
LVL 63

Author Comment

by:Joe Winograd, Fellow 2017
A`ole pilikia!
0
Xpdf - PDFinfo - Command Line Utility to Retrieve Page Count and Other Information from PDF Files
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF file's Info Dictionary, as well as some other information (metadata), including the page count. We show how to isolate the page count in a plain text file, and the same method may be used to isolate other metadata fields, such as the Author and PDF Producer. PDFinfo provides a command line interface, making it suitable for use in batch files, programs, and scripts — any place where a command line call can be made.

1. Download the software.


You may have already downloaded and unzipped the Xpdf tools while watching the first video in the Xpdf series, but if you haven't, then visit the Xpdf website. Click the Download link and then click the pre-compiled Windows binary ZIP archive to download the utilities for Windows.

Step1

2. Locate the documentation folder for the Xpdf utilities.


Go to the folder where you unzipped the downloaded ZIP file and find the <doc> folder.

Step2

3. Read the documentation for the PDFinfo tool.


Go into the <doc> folder and find the plain text file called <pdfinfo.txt>.

Open it with any text editor, such as Notepad, and read it. This is the documentation for the PDFinfo tool.

Step3

4. Set up a test folder.


Create a test folder.

Copy <pdfinfo.exe> from the unzipped <bin32> folder into your test folder.

Copy a sample PDF file into your test folder (in the video and the screenshots below, the file is called test.pdf, which is a PDF file created from my EE article, Windows 10 uses YOUR computer to help distribute itself).

Step4

5. Set up a command prompt for testing.

3
Xpdf - PDFtoText - Convert PDF Files to Plain Text Files
This third video of my Xpdf series discusses and demonstrates the PDFtoText utility, which converts PDF files into plain text files. It does this via a command line interface, making it suitable for use in batch files, programs, and scripts — any place where a command line call can be made.

You'll see that this video says it is "Part 3 of 3". However, after publishing the first three tutorials, I decided to do one for each of the other tools, as well as one for the Xpdf configuration file (xpdfrc). Links to all of the videos are in the first video in this series.

1. Download and install the software.

You may have already downloaded and installed the Xpdf tools while watching the first  or second video in the Xpdf series , but if you haven't, then visit the Xpdf website at:

http://www.foolabs.com/xpdf/

Click the Download link and then click the pre-compiled Windows binary ZIP archive to download the Xpdf utilities for Windows.
precompiled binaries

2. Locate the documentation folder for the Xpdf utilities.

Go to the folder where you unzipped the downloaded ZIP file and find the <doc> folder.
documentation folder

3. Read the documentation for the PDFtoText tool.

Go into the <doc> folder and find the plain text file called <pdftotext.txt>.

Open it with any text editor, such as Notepad, and read it. This is the documentation for the PDFtoText tool.
read me

4. Set up a test folder.

Create a test folder.

Copy <pdftotext.exe> from the unzipped <bin32> folder into your test folder.

Copy a sample PDF file into your test folder (in the video and the screenshots below, the file is called <RMP.pdf>).
test folder

5. Set up a command prompt for testing.

10
LVL 28

Expert Comment

by:Andrew Leniart
Great tutorial series. This will be very handy for me!
0
LVL 63

Author Comment

by:Joe Winograd, Fellow 2017
Hi Andrew,
I'm glad to hear that my Xpdf series will be useful for you. This particular one, PDFtoText, is the one that I use the most in my custom programs. Cheers, Joe
P.S. Thanks for the endorsement!
0
Xpdf - Command Line Utilities for PDF Files
This first video Micro Tutorial in my Xpdf series introduces and describes Xpdf, a library containing nine command line utilities that perform various functions on PDF files. This video shows where the library is located and how to download it, discusses its licensing provisions, and provides a brief description of each of the nine modules.

Since all the utilities offer a command line interface, they are suitable for use in batch files, programs, and scripts — any place where a command line call can be made. For example, I have written many programs in the AutoHotkey scripting language that call the various Xpdf utilities via the AutoHotkey RunWait command.

This first video sets the stage for subsequent Micro Tutorials in the Xpdf series. You'll see that this video says it is "Part 1 of 3" (the second says, "Part 2 of 3"; the third, "Part 3 of 3"). However, after publishing the first three tutorials, I decided to do one for each of the other tools, as well as one for the Xpdf configuration file (xpdfrc), which is common to all nine utilities. Here are links to the other 10 five-minute video Micro Tutorials at Experts Exchange:

Xpdf - PDFimages - Command Line Utility to Extract Images from PDF Files
Xpdf - PDFtoText - Command Line Utility to Convert PDF Files to Plain Text Files
Xpdf - PDFinfo - Command Line Utility to Retrieve Page Count and Other Information from PDF Files
Xpdf - PDFdetach - Command Line Utility to Detach Attachments from PDF Files
7
LVL 28

Expert Comment

by:Andrew Leniart
Great video Joe! Excellent tool I had no idea existed.
0
LVL 63

Author Comment

by:Joe Winograd, Fellow 2017
Thanks, Andrew, I appreciate the compliment...and the endorsement! Regards, Joe
0

Windows Batch

12K

Solutions

11K

Contributors

Batch files are text files containing a script of commands that are executed by the command interpreter on DOS, OS/2 and Windows systems. Most commonly, they are used to perform a series of functions that are repeated -- copying a set of files created daily with one step, for example.