6 Replies Latest reply on Jun 7, 2009 8:26 PM by Praful_Jain

    changing file format for images

    sneedhearn Level 1

      To save on memory, my boss wants me to change my images from bitmaps to png files. Should I go imto the project folder and open each file and re-save it, then make sure the link has the right extension. Any thoughts on the best way to do this?

        • 1. Re: changing file format for images
          Peter Grainge Adobe Community Professional

          Changing the image type will save on space and could improve load times but are they sufficiently large to be an issue worth the effort?


          If you convert, you will need some software that converts the image type. You could open them in RoboScreenCapture and resave them or you could use a batch tool. Either way, you will need to relink to the images.


          See www.grainge.org for RoboHelp and Authoring tips

          • 2. Re: changing file format for images
            Praful_Jain Level 3



            There are many ways to handle this scenario, but all require RoboHelp 8 and some knowledge of scripting feature provided in RoboHelp 8.


            I am giving you a simple solution to the problem. Before going ahead, please backup your project folder.


            I am assuming here that you want to change the image file from .bmp to .png.


            1. Go to any image editing software and change all the images in the project folder from .bmp to .png. Please donot change the image file name just change the extension. so if you have an image with name sun.bmp change create a new file with name sun.png, in the same folder where sun.bmp is present.
            2. Create a script file using the Extendscript feature provided with RoboHelp 8. I am attaching a script file which does the job for you. Please click here to download the script filehttps://share.acrobat.com/adc/document.do?docid=355276bf-f114-406a-8d48-19ffe177846c
            3. Download the script file on your machine. Open the project in RoboHelp 8, open Script explorer pod and import the script file you have downloaded.
            4. Select the script file and click on run or right click script file and select run.
            5. The script file will read all the topics and snippet files present in your project and read the image tag. if there is an image file with .bmp extension, it will change that image file extension to .png and update the topic file.
            6. You are done with updating your project with new image extensions.


            Again RoboHelp 8 has many more scripting features.


            Hope this helps



            Adobe RoboHelp Team.

            • 3. Re: changing file format for images
              Praful_Jain Level 3


              For batch conversion of Image files, you have plenty of options, First option is Adobe Photoshop, provided you have the license. Adobe Photoshop provides many batch image conversion options.

              In case, if you are looking for some free alternative then there are many batch image conversion tools available. One of them is lead tools command line tool. http://www.leadtools.com/Utilities/Cmd-Line/File-Converter/ you can search for many more batch image conversion tools.


              You just need to install this tool and run the command LFC.exe C:\myprojectfolder  /f=FILE_PNG /L"c:\conversion.log" /S


              This will convert all the images in myprojectfolder to png and also create a log file at c:\conversion.log.


              Again after you are done with conversion of images using any batch tool. just run the script file  and your project should be up and running.



              • 4. Re: changing file format for images
                RoboColum(n) Level 5

                FYI if Praful or anyone else posts a script to the forums I add them to my Scripts page on my blog.


                Read the RoboColum(n) for mutterings on RoboHelp, Technical Communication Suite and technical communication.

                • 5. Re: changing file format for images
                  Captiv8r Adobe Community Professional & MVP

                  Hi all... Simple Simon here...


                  I'm wondering if we are suggesting using a 500 Megaton Nuclear Warhead to get rid of the fly on the wall.


                  Don't get me wrong here, Scripting is great and it's amazing with what it can do and I always appreciate seeing posts from Praful that address issues. I think that's wonderful. I really do.


                  But why isn't this as simple as using the Multi-file find and replace tool to locate .BMP inside the files and replace it with .PNG?


                  Am I missing something? I must be.


                  Cheers... Rick



                  • 6. Re: changing file format for images
                    Praful_Jain Level 3



                    I totally agree with you that F&R tool is much simple and easier way to carry out the work, but Again, if there is a customized solution required for some problem, then scripting feature in RH8 can come for rescue.


                    Just for the sack of clarity, lets assume a user wanted to make changes in a project having 100 topics. One way is to use find and replace tool and replace all instance of .bmp to .png, but again, there are chances where F&R tool will change some text you had not expected.


                    for example if there is a text <p> Check this link .....bmp </p> in some topic.


                    The F&R tool will just replace each instance of .bmp with .png inculding the one in the paragrah tag. But that is not what was expected outcome. User only wanted to change the image tag source attribute from .bmp to .png in the source file.


                    Other way is to carefully open all the 100 topics in the project and use F&R tool to modify them.


                    One other way is to use some customized script file, and run that file .