<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Export to Powerpoint in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Export-to-Powerpoint/m-p/879839#M104326</link>
    <description>&lt;P&gt;I started using python-pptx for presentations.&amp;nbsp; It is pretty capable, but the documentation is a little lacking.&amp;nbsp; I like to create PowerPoint layouts and save them as a generic presentation then use JMP windows with user inputs to build my Python code.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;An example of the first part of one of my PowerPoint presentation scripts:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;pycode = Eval Insert(
	"\[from pptx import Presentation
from PIL import Image, ImageEnhance
import io
p = Presentation(r'^template_path^')
slid = p.slides[0]
mom = slid.shapes[1]
slid.shapes.title.text = '^pres^'
mom.text = '^name^'
for x in range(^Char( total_items )^):
	print("""adding placeholder slides....
    """ + str(x + 1) + ' out of ^Char( total_items )^')
	p.slides.add_slide(p.slide_layouts[6])
]\"
);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;After this it loops through folders of sample inspection images I have.&amp;nbsp; You could create your graphs and save them as jpg files.&amp;nbsp; The following code adds information from a conditions table, pulls only jpg files from the folders, and enhances some of the darker pictures before putting them into the slide.&amp;nbsp; The options are basically endless.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;For Each( {v, i}, sub_folders,
	condition = Left( Right( v, 4 ), 2 );
	pycode ||= Eval Insert(
		"slid = p.slides[^Char( i )^]
slid1 = slid.placeholders[10]
slid2 = slid.placeholders[11]
slid3 = slid.placeholders[12]
slid4 = slid.placeholders[13]
slid5 = slid.placeholders[14]
slid6 = slid.placeholders[15]
slid7 = slid.placeholders[16]
slid8 = slid.placeholders[17]
slid.shapes.title.text = \!"\!"\!"^v || Try( \!":  \!" || cond_array[condition], \!"\!" )^\!"\!"\!"\!N"
	);
	pics = Filter Each( {value, index}, Files In Directory( thefolder || v ),
		And( Ends With( Lowercase( value ), "jpg" ), !Contains( value, "_APA_" ) )
	);
	pycode ||= Eval Insert(
		"slid1.insert_picture(r'^thefolder || v || \!"/\!" || pics[1]^')
slid2.insert_picture(r'^thefolder || v || \!"/\!" || pics[3]^')
img = Image.open(r'^thefolder || v || \!"/\!" || pics[5]^')
enh = ImageEnhance.Brightness(img)
img = enh.enhance(3)
img2 = io.BytesIO()
img.save(img2, 'JPEG')
slid3.insert_picture(img2)
img = Image.open(r'^thefolder || v || \!"/\!" || pics[7]^')
enh = ImageEnhance.Brightness(img)
img = enh.enhance(2)
img2 = io.BytesIO()
img.save(img2, 'JPEG')
slid4.insert_picture(img2)
slid5.insert_picture(r'^thefolder || v || \!"/\!" || pics[2]^')
slid6.insert_picture(r'^thefolder || v || \!"/\!" || pics[4]^')
img = Image.open(r'^thefolder || v || \!"/\!" || pics[6]^')
enh = ImageEnhance.Brightness(img)
img = enh.enhance(3)
img2 = io.BytesIO()
img.save(img2, 'JPEG')
slid7.insert_picture(img2)
img = Image.open(r'^thefolder || v || \!"/\!" || pics[8]^')
enh = ImageEnhance.Brightness(img)
img = enh.enhance(2)
img2 = io.BytesIO()
img.save(img2, 'JPEG')
slid8.insert_picture(img2)
print('^Char( i )^ of ^Char( Length( sub_folders ) )^ complete....')\!N"
	);
);
pycode ||= Eval Insert( "\[p.slides.add_slide(p.slide_layouts[4])
p.save(r'^pptx_savefile^')
]\" );&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;I use placeholders to simplify image insertion, but you can directly add images and specify the size and position.&lt;/P&gt;</description>
    <pubDate>Fri, 13 Jun 2025 19:30:21 GMT</pubDate>
    <dc:creator>mmarchandFSLR</dc:creator>
    <dc:date>2025-06-13T19:30:21Z</dc:date>
    <item>
      <title>Export to Powerpoint</title>
      <link>https://community.jmp.com/t5/Discussions/Export-to-Powerpoint/m-p/879825#M104323</link>
      <description>&lt;P&gt;I've looked around to see if there's a way to have a better export of a series of JMP graphs to Powerpoint or Word.&amp;nbsp; The native export is very bland and I'd like to be able to manipulate that somehow if anyone has had success with that.&amp;nbsp; I'm able to record and modify macros in Powerpoint to do the job but I'm hoping for something better than that.&lt;/P&gt;</description>
      <pubDate>Fri, 13 Jun 2025 18:44:14 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Export-to-Powerpoint/m-p/879825#M104323</guid>
      <dc:creator>SpannerHead</dc:creator>
      <dc:date>2025-06-13T18:44:14Z</dc:date>
    </item>
    <item>
      <title>Re: Export to Powerpoint</title>
      <link>https://community.jmp.com/t5/Discussions/Export-to-Powerpoint/m-p/879839#M104326</link>
      <description>&lt;P&gt;I started using python-pptx for presentations.&amp;nbsp; It is pretty capable, but the documentation is a little lacking.&amp;nbsp; I like to create PowerPoint layouts and save them as a generic presentation then use JMP windows with user inputs to build my Python code.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;An example of the first part of one of my PowerPoint presentation scripts:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;pycode = Eval Insert(
	"\[from pptx import Presentation
from PIL import Image, ImageEnhance
import io
p = Presentation(r'^template_path^')
slid = p.slides[0]
mom = slid.shapes[1]
slid.shapes.title.text = '^pres^'
mom.text = '^name^'
for x in range(^Char( total_items )^):
	print("""adding placeholder slides....
    """ + str(x + 1) + ' out of ^Char( total_items )^')
	p.slides.add_slide(p.slide_layouts[6])
]\"
);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;After this it loops through folders of sample inspection images I have.&amp;nbsp; You could create your graphs and save them as jpg files.&amp;nbsp; The following code adds information from a conditions table, pulls only jpg files from the folders, and enhances some of the darker pictures before putting them into the slide.&amp;nbsp; The options are basically endless.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;For Each( {v, i}, sub_folders,
	condition = Left( Right( v, 4 ), 2 );
	pycode ||= Eval Insert(
		"slid = p.slides[^Char( i )^]
slid1 = slid.placeholders[10]
slid2 = slid.placeholders[11]
slid3 = slid.placeholders[12]
slid4 = slid.placeholders[13]
slid5 = slid.placeholders[14]
slid6 = slid.placeholders[15]
slid7 = slid.placeholders[16]
slid8 = slid.placeholders[17]
slid.shapes.title.text = \!"\!"\!"^v || Try( \!":  \!" || cond_array[condition], \!"\!" )^\!"\!"\!"\!N"
	);
	pics = Filter Each( {value, index}, Files In Directory( thefolder || v ),
		And( Ends With( Lowercase( value ), "jpg" ), !Contains( value, "_APA_" ) )
	);
	pycode ||= Eval Insert(
		"slid1.insert_picture(r'^thefolder || v || \!"/\!" || pics[1]^')
slid2.insert_picture(r'^thefolder || v || \!"/\!" || pics[3]^')
img = Image.open(r'^thefolder || v || \!"/\!" || pics[5]^')
enh = ImageEnhance.Brightness(img)
img = enh.enhance(3)
img2 = io.BytesIO()
img.save(img2, 'JPEG')
slid3.insert_picture(img2)
img = Image.open(r'^thefolder || v || \!"/\!" || pics[7]^')
enh = ImageEnhance.Brightness(img)
img = enh.enhance(2)
img2 = io.BytesIO()
img.save(img2, 'JPEG')
slid4.insert_picture(img2)
slid5.insert_picture(r'^thefolder || v || \!"/\!" || pics[2]^')
slid6.insert_picture(r'^thefolder || v || \!"/\!" || pics[4]^')
img = Image.open(r'^thefolder || v || \!"/\!" || pics[6]^')
enh = ImageEnhance.Brightness(img)
img = enh.enhance(3)
img2 = io.BytesIO()
img.save(img2, 'JPEG')
slid7.insert_picture(img2)
img = Image.open(r'^thefolder || v || \!"/\!" || pics[8]^')
enh = ImageEnhance.Brightness(img)
img = enh.enhance(2)
img2 = io.BytesIO()
img.save(img2, 'JPEG')
slid8.insert_picture(img2)
print('^Char( i )^ of ^Char( Length( sub_folders ) )^ complete....')\!N"
	);
);
pycode ||= Eval Insert( "\[p.slides.add_slide(p.slide_layouts[4])
p.save(r'^pptx_savefile^')
]\" );&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;I use placeholders to simplify image insertion, but you can directly add images and specify the size and position.&lt;/P&gt;</description>
      <pubDate>Fri, 13 Jun 2025 19:30:21 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Export-to-Powerpoint/m-p/879839#M104326</guid>
      <dc:creator>mmarchandFSLR</dc:creator>
      <dc:date>2025-06-13T19:30:21Z</dc:date>
    </item>
  </channel>
</rss>

