<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>images Archives - Linux Windows and android Tutorials</title>
	<atom:link href="https://www.osradar.com/tag/images/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.osradar.com</link>
	<description>tutorials and news and Seurity</description>
	<lastBuildDate>Tue, 04 May 2021 14:22:18 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=5.8.12</generator>
	<item>
		<title>Convert a PDF to images on Linux</title>
		<link>https://www.osradar.com/convert-pdf-images-linux/</link>
					<comments>https://www.osradar.com/convert-pdf-images-linux/#respond</comments>
		
		<dc:creator><![CDATA[angeloma]]></dc:creator>
		<pubDate>Wed, 05 May 2021 23:21:00 +0000</pubDate>
				<category><![CDATA[Desktop]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Tools]]></category>
		<category><![CDATA[images]]></category>
		<category><![CDATA[pdf]]></category>
		<category><![CDATA[tools]]></category>
		<category><![CDATA[Tutorial]]></category>
		<guid isPermaLink="false">https://www.osradar.com/?p=29846</guid>

					<description><![CDATA[<p>Hello, friends. In this short but useful post, you will learn how to convert PDF to images on Linux. While this may seem complicated at first glance, the reality is that it is not. So let’s get to it. The process of converting PDF to images is simple because we will do it using the [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://www.osradar.com/convert-pdf-images-linux/">Convert a PDF to images on Linux</a> appeared first on <a rel="nofollow" href="https://www.osradar.com">Linux  Windows and android  Tutorials</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p>Hello, friends. In this short but useful post, you will learn how to convert PDF to images on Linux. While this may seem complicated at first glance, the reality is that it is not. So let’s get to it.</p>



<p>The process of converting PDF to images is simple because we will do it using the <code>pdftoppm</code> tool that is run through the terminal.</p>



<p>According to the <a href="https://linux.die.net/man/1/pdftoppm"><code>pdftoppm</code> man page</a>:</p>



<blockquote class="wp-block-quote"><p>Pdftoppm converts Portable Document Format (PDF) files to color image files in Portable Pixmap (PPM) format, grayscale image files in Portable Graymap (PGM) format, or monochrome image files in Portable Bitmap (PBM) format.</p></blockquote>



<p>However, it can also be used to generate PNG or JPEG files.</p>



<h2 id="the-pdftoppm-command"><a href="#the-pdftoppm-command" name="the-pdftoppm-command"></a>The pdftoppm command</h2>



<p>This command is generally not installed by default on all Linux distributions. So we have to install it before using it.</p>



<p>So, for Debian and Ubuntu-based distributions, install the tool with the following command</p>



<pre class="wp-block-preformatted">sudo apt install poppler-utils</pre>



<p>For CentOS, AlmaLinux, RockyLinux, and Fedora, you can install it using:</p>



<pre class="wp-block-preformatted">sudo dnf install poppler-utils</pre>



<p>And for Arch Linux based distributions, you can run it with:</p>



<pre class="wp-block-preformatted">sudo pacman -S poppler</pre>



<p>The use of the command is quite simple and has the following syntax:</p>



<pre class="wp-block-preformatted">pdftoppm [options] [PDF-FILE] [Output] [PDF-FILE] [PDF-FILE] [Output]</pre>



<p>Also, like any command, you have options that modify the behavior of the command. Some of these options are:</p>



<ul><li>-f number: Specifies the first page to convert</li><li>-l number: Specifies the last page to convert.</li><li>-r number: Specifies the X and Y resolution, in DPI. The default is 150 DPI.</li><li>-rx number: Specifies the X resolution, in DPI. The default is 150 DPI.</li><li>-ry number: Specifies the Y resolution, in DPI. The default is 150 DPI.</li><li>-scale-to number: Scales each page to fit in scale-to*scale-to pixel box.</li><li>-scale-to-x number: Scales each page horizontally to fit in scale-to-x pixels.</li><li>-scale-to-y number: Scales each page vertically to fit in scale-to-y pixels.</li><li>-x number: Specifies the x-coordinate of the crop area top left corner</li><li>-y number: Specifies the y-coordinate of the crop area top left corner</li></ul>



<h2 id="convert-pdf-to-images"><a href="#convert-pdf-to-images" name="convert-pdf-to-images"></a>Convert PDF to Images</h2>



<p>For this post, I have a PDF called <code>sample.pdf</code> with a large number of pages.</p>



<pre class="wp-block-preformatted">ls
sample.pdf</pre>



<p>If you want a JPEG file to be generated for each of the pages, you can use the following command:</p>



<pre class="wp-block-preformatted">pdftoppm -jpeg sample.pdf exmple.jpeg</pre>



<p>In this case, an image will be generated for each page and in this screenshot, you can see it better.</p>



<figure class="wp-block-image size-large"><img loading="lazy" width="1024" height="254" src="https://www.osradar.com/wp-content/uploads/2021/05/1-3-1024x254.png" alt="1.- PDF to images on Linux" class="wp-image-29887" srcset="https://www.osradar.com/wp-content/uploads/2021/05/1-3-1024x254.png 1024w, https://www.osradar.com/wp-content/uploads/2021/05/1-3-300x74.png 300w, https://www.osradar.com/wp-content/uploads/2021/05/1-3-768x190.png 768w, https://www.osradar.com/wp-content/uploads/2021/05/1-3-696x172.png 696w, https://www.osradar.com/wp-content/uploads/2021/05/1-3-1068x265.png 1068w, https://www.osradar.com/wp-content/uploads/2021/05/1-3.png 1364w" sizes="(max-width: 1024px) 100vw, 1024px" /><figcaption>1.- PDF to images on Linux</figcaption></figure>



<p>Also, you can define a range of pages to generate the images with the options <code>-f</code> and <code>-l</code> which define the first and the last page. For example:</p>



<pre class="wp-block-preformatted">pdftoppm -jpeg -f 2 -l 4 sample.pdf file.jpeg</pre>



<p>In this case, only images of pages 2, 3, and 4 are generated.</p>



<p>As you can see the process is very simple and useful.</p>
<p>The post <a rel="nofollow" href="https://www.osradar.com/convert-pdf-images-linux/">Convert a PDF to images on Linux</a> appeared first on <a rel="nofollow" href="https://www.osradar.com">Linux  Windows and android  Tutorials</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.osradar.com/convert-pdf-images-linux/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
