<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.delarco.com.br/index.php?action=history&amp;feed=atom&amp;title=Python%3A_PDF_Image_Extractor</id>
	<title>Python: PDF Image Extractor - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.delarco.com.br/index.php?action=history&amp;feed=atom&amp;title=Python%3A_PDF_Image_Extractor"/>
	<link rel="alternate" type="text/html" href="https://wiki.delarco.com.br/index.php?title=Python:_PDF_Image_Extractor&amp;action=history"/>
	<updated>2026-08-04T15:51:08Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.38.4</generator>
	<entry>
		<id>https://wiki.delarco.com.br/index.php?title=Python:_PDF_Image_Extractor&amp;diff=30&amp;oldid=prev</id>
		<title>200.201.163.25: Created page with &quot;&lt;pre&gt; import os import sys import logging import subprocess  from PIL import Image, ImageSequence   def extract_pdf_images(filepath, directory, ghostscript_path):          cwd = r'.'     cmd = r'{gs_path} -o &quot;{directory}\p-%03d-000.png&quot; -sDEVICE=png16m -dNOSAFER -r300 {filepath}'.format(gs_path=ghostscript_path, directory=directory, filepath=filepath)     subprocess.check_output(cmd, cwd=cwd, shell=True)      #def extract_tif_images(filepath, directory): #    im = Image....&quot;</title>
		<link rel="alternate" type="text/html" href="https://wiki.delarco.com.br/index.php?title=Python:_PDF_Image_Extractor&amp;diff=30&amp;oldid=prev"/>
		<updated>2022-08-25T18:08:37Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;&amp;lt;pre&amp;gt; import os import sys import logging import subprocess  from PIL import Image, ImageSequence   def extract_pdf_images(filepath, directory, ghostscript_path):          cwd = r&amp;#039;.&amp;#039;     cmd = r&amp;#039;{gs_path} -o &amp;quot;{directory}\p-%03d-000.png&amp;quot; -sDEVICE=png16m -dNOSAFER -r300 {filepath}&amp;#039;.format(gs_path=ghostscript_path, directory=directory, filepath=filepath)     subprocess.check_output(cmd, cwd=cwd, shell=True)      #def extract_tif_images(filepath, directory): #    im = Image....&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
import os&lt;br /&gt;
import sys&lt;br /&gt;
import logging&lt;br /&gt;
import subprocess&lt;br /&gt;
&lt;br /&gt;
from PIL import Image, ImageSequence&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
def extract_pdf_images(filepath, directory, ghostscript_path):&lt;br /&gt;
    &lt;br /&gt;
    cwd = r'.'&lt;br /&gt;
    cmd = r'{gs_path} -o &amp;quot;{directory}\p-%03d-000.png&amp;quot; -sDEVICE=png16m -dNOSAFER -r300 {filepath}'.format(gs_path=ghostscript_path, directory=directory, filepath=filepath)&lt;br /&gt;
    subprocess.check_output(cmd, cwd=cwd, shell=True)&lt;br /&gt;
    &lt;br /&gt;
#def extract_tif_images(filepath, directory):&lt;br /&gt;
#    im = Image.open(filepath)&lt;br /&gt;
#    for i, page in enumerate(ImageSequence.Iterator(im)):&lt;br /&gt;
#        page.save(r'{directory}/p-{page}-000.png'.format(directory=directory, page=str(i+1).zfill(3)))&lt;br /&gt;
&lt;br /&gt;
ghostscript_path = r'C:\tools\gs\gs9.53.3\bin\gswin64c.exe'&lt;br /&gt;
filename = os.path.join('.', sys.argv[1])&lt;br /&gt;
output_directory = r'.\output'&lt;br /&gt;
&lt;br /&gt;
extract_pdf_images(filename, output_directory, ghostscript_path)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>200.201.163.25</name></author>
	</entry>
</feed>