<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Kishan Panchal on Medium]]></title>
        <description><![CDATA[Stories by Kishan Panchal on Medium]]></description>
        <link>https://medium.com/@coderman401?source=rss-1c76ab62eee5------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*Xsv9DfKLMfBjMUZQrpND2Q.gif</url>
            <title>Stories by Kishan Panchal on Medium</title>
            <link>https://medium.com/@coderman401?source=rss-1c76ab62eee5------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 24 Nov 2026 16:04:41 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@coderman401/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[PPT to Image Slideshow — Node JS]]></title>
            <link>https://medium.com/swlh/ppt-to-image-slideshow-node-js-8999db8ec4e8?source=rss-1c76ab62eee5------2</link>
            <guid isPermaLink="false">https://medium.com/p/8999db8ec4e8</guid>
            <category><![CDATA[ppt]]></category>
            <category><![CDATA[nodejs]]></category>
            <category><![CDATA[ppt-to-image]]></category>
            <category><![CDATA[convertion]]></category>
            <category><![CDATA[angular]]></category>
            <dc:creator><![CDATA[Kishan Panchal]]></dc:creator>
            <pubDate>Sun, 25 Oct 2020 13:11:25 GMT</pubDate>
            <atom:updated>2021-09-06T05:54:07.995Z</atom:updated>
            <content:encoded><![CDATA[<h3>PPT to Image Slideshow — Node JS</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*9Exc3j1slhh-SJ6J" /><figcaption>Photo by <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><blockquote>If you are a developer, you must have faced a certain time when a clock is ticking over your head as your deadline approaches, and you go all out of mind in time of urgency, don’t you?</blockquote><p>well if you ever face a need in such time of urgency to extract images from a PPT file in your storage without doing so much of an effort, or facing countless ads on online conversion sites, how about having your own personal little handy tool to do your job just right! I have made that easy for the guys like you, let’s just dive in with how this thing works.</p><p>I have developed this tool using <strong>NodeJS</strong> in <em>backend</em> and a little <strong>Angular</strong> in <em>frontend</em> to provide a nice and neat <strong>material UI</strong>. Basically, the conversion process will take place in <strong>command line (CMD)</strong>. And these fancy command will be fired using NodeJS, where I have taken help of <a href="https://www.npmjs.com/package/shelljs">shelljs</a> for doing the CMD jobs and have used our old friends: <strong>callbacks</strong> and <strong>promises</strong> to maintain the whole <em>asynchronous</em> process.</p><p>Let’s talk about the basic prerequisites, so all you will need is following, It’s gonna be little easy for <strong>Ubuntu</strong> users [piece of cake], I will also provide steps for windows users here:</p><p><strong>For Ubuntu users:</strong></p><p>$ apt-get install LibreOffice<br>$ apt-get install Ghostscript</p><p><strong>For Windows users:</strong></p><p>Download and install the <a href="https://www.libreoffice.org/download/download/"><strong>LibreOffice</strong></a><strong> </strong>and <a href="https://www.ghostscript.com/download.html"><strong>Ghostscript</strong></a><strong> </strong>according to your system specification.</p><p>So, After Installing both the libraries we need to copy their path. For example, for me it is - LibreOffice: C:\Program Files\LibreOffice\program\soffice.exe,<br>Ghostscript: C:\Program Files\gs\gs9.53.2\bin\gswin64.exe (for 32 bit it will be gswin32.exe)</p><p>Now the next step will be to download and install my Github project from the repository link here: <a href="https://github.com/coderman401/ppt-to-images"><em>PPT to image conversion</em></a>, You will find everything you need to know about installing the project in the <strong>README.md</strong> file</p><p>I have divided the whole process into two steps:</p><ol><li>Convert PPT to Pdf.</li><li>Convert Pdf pages to images.</li></ol><p>here’s the core idea of the process overview in frontend (angular):</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/754267fcda0432269fd905160ac933e5/href">https://medium.com/media/754267fcda0432269fd905160ac933e5/href</a></iframe><p>The images will be stored in the upload path in backend so we get the array of images from there. We can use these stored images as per our requirements, like sending the zip of images. You can see how one use case can be to display ppt as slideshow of images.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*FpOhDeQIESKqF7tTfWHbng.gif" /></figure><p>Hope you got something to learn and a helping tool, too!</p><p>Want to know more about my work? <a href="https://coderman401.web.app/demos">Visit Here</a>.</p><p>Happy coding :)</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8999db8ec4e8" width="1" height="1" alt=""><hr><p><a href="https://medium.com/swlh/ppt-to-image-slideshow-node-js-8999db8ec4e8">PPT to Image Slideshow — Node JS</a> was originally published in <a href="https://medium.com/swlh">The Startup</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Prevent Array Mutation - Javascript]]></title>
            <link>https://medium.com/swlh/prevent-array-mutation-javascript-d8f6e5714440?source=rss-1c76ab62eee5------2</link>
            <guid isPermaLink="false">https://medium.com/p/d8f6e5714440</guid>
            <category><![CDATA[arrays]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[javascript-tips]]></category>
            <category><![CDATA[mutation]]></category>
            <category><![CDATA[array-mutation]]></category>
            <dc:creator><![CDATA[Kishan Panchal]]></dc:creator>
            <pubDate>Thu, 23 Jul 2020 12:10:45 GMT</pubDate>
            <atom:updated>2020-10-22T17:30:56.633Z</atom:updated>
            <content:encoded><![CDATA[<p>Hi, In this blog I am going to show, How to prevent array mutation.</p><p>Here, We have an array of objects countries.</p><pre>let countries = [<br>    {id: 1, name: &quot;India&quot;, image: &quot;thumb10.jpg&quot;},<br>    {id: 2, name: &quot;Africa&quot;, image: &quot;thumb11.jpg&quot;},<br>    {id: 3, name: &quot;South Africa&quot;, image: &quot;thumb12.jpg&quot;},<br>    {id: 4, name: &quot;Bolivia&quot;, image: &quot;thumb13.jpg&quot;}<br>];</pre><h4>Return specific fields from the array</h4><p>From the countries array, we want only two fields id and name. So we use the array mapping function to get the desired result.</p><pre>let output = countries.map(s =&gt; ({ id: s.id, name: s.name}));<br>console.log(countries); // <em>there will be no change in array</em><br>console.log(output); // <em>it returns only two feilds in array</em></pre><p>What if we have multiple fields in an array object and we want dynamic fields of them. i.e,</p><pre>let fieldsOfArray = [&quot;id&quot;, &quot;name&quot;, &quot;image&quot;];<br>let requiredFields = [&quot;id&quot;, &quot;name&quot;];</pre><pre>let output = countries; // assigning the countries array to output.</pre><pre>for(const i in output) {<br>    for (const x in fieldsOfArray) {<br>        if(!fieldsOfArray.includes(requiredFields[x])) {<br>            // deleting column/field from output<br>            delete output[i][fieldsOfArray[x]];<br>        }<br>    }<br>}</pre><pre>console.log(countries); //<em> [{id: 1, name: &quot;India&quot;}, {id: 2 ....}];</em><br>console.log(outpput); // <em>[{id: 1, name: &quot;India&quot;}, {id: 2 ....}];</em></pre><p>deleting fields from the assigned variable will delete same fields from the original array. So, we need to make a copy of the original array and then assign it to another variable to prevent this mutation of array.<br>There are few techniques to make a copy of array, like using the slice() method or using spread notation (...) , i.e.,</p><pre>let output = countries.slice(); // or<br>let output = [...countries];</pre><p>Using the slice() or spread notation (...) will make the shallow copy of the array. “<strong>shallow” </strong>the word says itself and it won’t work in every case as like we have an example above.</p><p>That was the realtime issue I have faced once in my project and I have tried many methods to copy the array but It was modifying the original array.<br>So, here I came up with a solution from which we can make a copy of the array to prevent modifying the original array.</p><pre><em>// make a copy of original array<br></em>function copy(obj) {<br>    var output, v, key;<br>    output = Array.isArray(obj) ? [] : {};<br>    for (key in obj) {<br>        v = obj[key];<br>        output[key] = (typeof v === &quot;object&quot;) ? copy(v) : v;<br>    }<br>    return output;<br>}</pre><pre>let countries = [<br>    {id: 1, name: &quot;India&quot;, image: &quot;thumb10.jpg&quot;},<br>    {id: 2, name: &quot;Africa&quot;, image: &quot;thumb11.jpg&quot;},<br>    {id: 3, name: &quot;South Africa&quot;, image: &quot;thumb12.jpg&quot;},<br>    {id: 4, name: &quot;Bolivia&quot;, image: &quot;thumb13.jpg&quot;}<br>];<br>let fieldsOfArray = [&quot;id&quot;, &quot;name&quot;, &quot;image&quot;];<br>let requiredFields = [&quot;id&quot;, &quot;name&quot;];</pre><pre>console.log(&#39;countries before delete&#39;, countries);</pre><pre><em>// let output = countries;</em><br><em>// let output = countries.slice();</em><br>let output = [...countries];<br><em>// let output = copy(countries);</em></pre><pre>for(const i in output) {<br>    for (const x in fieldsOfArray) {<br>        if(!fieldsOfArray.includes(requiredFields[x])) {<br><em>            // deleting column/field from output</em><br>            delete output[i][fieldsOfArray[x]];<br>        }<br>    }<br>}</pre><pre>console.log(&#39;countries data after delete process&#39;, countries);</pre><p>You can uncomment the different methods of copying an array in the above example and run the code to check the difference between all methods to copy the array.</p><p>Visit <a href="https://coderman-401.web.app/">https://coderman-401.web.app/</a> for amazing stuff.</p><p>Happy Coding :)</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d8f6e5714440" width="1" height="1" alt=""><hr><p><a href="https://medium.com/swlh/prevent-array-mutation-javascript-d8f6e5714440">Prevent Array Mutation - Javascript</a> was originally published in <a href="https://medium.com/swlh">The Startup</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>