web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / powershell code or any...
Power Automate
Answered

powershell code or any another to convert from jpg to pdf?

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Hi,

 

I want to convert jpg files to files using powershell or any other code in PAD. Is there any available?

Please help.

 

 

 

I have the same question (0)
  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Hello @Anonymous 

     

    How about to use virtual printer called "Microsoft Print to PDF"?

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Yes, I can but i tried this

    Radhika1_0-1632491508793.png

    After this, I need to 

    1. select the specific folder

    2. Provide the file name

    3. Press save.

     

    Any ideas on how to do?

  • VJR Profile Picture
    7,635 on at

    Hi @Anonymous 

     

    You can try out the below

     

    1. Open the image in Paint application

    VJR_0-1632632395342.png

     

    2. Press Ctrl P using send keys to bring the print dialog box

    'Microsoft Print to PDF is already selected as the Default printer in Step 1.

    VJR_1-1632632508368.png

     

    3. Spy the Print button and click on it

     

    4. This will now show the Save As Dialog box

     

    Give the output folder path

    Make sure to select pdf in the save as dropdown if not already selected

     

    VJR_3-1632632806381.png

     

    5. In the destination directory you should see a PDF file with the image

     

    VJR_4-1632632905320.png

     

     






    -------------------------------------------
    Help fellow beings find relevant posts.
    Upvote to a supporting response.
    Mark as solution to an answer.

     

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    When I give the arguments as .jpg file, I am getting the error message as given below:

     

    Radhika1_0-1632670939627.png

     

    I don't know what is the mistake is. Please help

     

    Actually I missed out the double quotes, now the jpg file is getting open. But next step is to open the printer dialog box.

     

    Radhika1_1-1632673129710.png

     

    I am using the send keys to open up the printer window but actually not getting printer window open.

    Is that any mistake I am doing?

     

  • VJR Profile Picture
    7,635 on at

    Hi @Anonymous 

     

    I used the below line in the send keys and it shows up the Print dialog box

    {Control}({P})

     

    VJR_0-1632711279693.png

     

    Since you are using Sendkeys make sure to use "Focus Window" and "Wait" actions wherever applicable.

     

    Post back if you are facing any issues.

     






    -------------------------------------------
    Help fellow beings find relevant posts.
    Upvote to a supporting response.
    Mark as solution to an answer.

     

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Now I can run till Save as dialog box. Can I use "Populate text field window" for providing output folder path?

    Or any other options there for providing the folder path?

  • VJR Profile Picture
    7,635 on at

    Hi @Anonymous 

     

    Yes that will be spying the textbox and entering text into it.

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    I have two files in the loop, for the first file, it is working fine and for the second, it says 'Failed to get window'

    How to solve that?

  • Verified answer
    VJR Profile Picture
    7,635 on at

    Hi @Anonymous 

     

    Its difficult to tell without taking a look at the selectors you have chosen.

    Make sure the selectors nowhere has any information that is points to only the 1st image file or window.

     

    This is for the Print button.

    Select only the check box that says button and the 2 checkboxes to the right.

     

    VJR_0-1632802391667.png

     

    For the main window make sure you do not check the box that contains the image file name and extension 

    VJR_0-1632803900872.png

     

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Thank you so much, now it is working!

    One more thing, I want to share this flow with my colleague, if they run will it(UI elements) work for them in their system without any errors?

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Vish WR Profile Picture

Vish WR 791

#2
Valantis Profile Picture

Valantis 582

#3
Haque Profile Picture

Haque 529

Last 30 days Overall leaderboard