cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

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

Hi,

 

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

Please help.

 

 

 

2 ACCEPTED SOLUTIONS

Accepted Solutions
VJR
Super User
Super User

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

 

View solution in original post

VJR
Super User
Super User

Great, since its working for you now I do not think you would need anything on this post. If you think any of the  particular answers have helped you in completion of your task you can mark it as a solution and close the thread.

View solution in original post

13 REPLIES 13
Anonymous
Not applicable

Hello @Anonymous 

 

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

Anonymous
Not applicable

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
Super User
Super User

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.

 

Anonymous
Not applicable

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
Super User
Super User

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.

 

Anonymous
Not applicable

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
Super User
Super User

Hi @Anonymous 

 

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

Anonymous
Not applicable

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?

VJR
Super User
Super User

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

 

Anonymous
Not applicable

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?

VJR
Super User
Super User

Yes it should work unless there is nothing "specific" to one machine or something in particular.

Better to run it out and get it clarified.

Anonymous
Not applicable

Sure, I will run it and see.👍

VJR
Super User
Super User

Great, since its working for you now I do not think you would need anything on this post. If you think any of the  particular answers have helped you in completion of your task you can mark it as a solution and close the thread.

Helpful resources

Announcements
Power Automate News & Announcements

Power Automate News & Announcements

Keep up to date with current events and community announcements in the Power Automate community.

Power Automate Community Blog

Power Automate Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (2,659)