Loop through all pdfs to convert into image

Hi Team,
Hope you are well.
I need help. I have folder with pdfs and each pdf’s has many pages. I would like to convert for e.g. page 1 from the pdf 1, page 3 from pdf 2 etc into image.

Can you please let me know how to go about this?

Thanks ,
Sri

@srinivas_pradeep

Use Export PDF page as Image activity to do that.

1 Like

@lakshman . Thank you very much. I tried with one pdf. But as i am new to this tool not sure how can i go about iterating through the pdfs and


selecting the page i need to save as image.

@srinivas_pradeep

  1. First use below expression to read all pdf files from specified folder.

    arrPdfFiles = Directory.GetFiles("Folder Path","*.pdf")
    
  2. And then use For Each loop to iterate one by one pdf file.

             For Each item in arrPdfFiles
                 Use Export PDF page as image and pass item to it
    
1 Like

@srinivas_pradeep

May I know how you will get know which page you want to convert as image for each pdf file ?

1 Like

Thank you @lakshman Really appreciate your help.
Yes its a good question. I have lots of pdfs and the information is spread across different pages in different pdfs. Mostly it comes from page1 or page 3.

Can you please share the workflow if possible so that i can replicate?

Thanks,

Certainly! To convert specific pages from multiple PDFs into images, you can use various tools and programming languages. One approach is to use a PDF library, such as PyPDF2 for Python, to extract specific pages from each PDF. Once you have the desired pages, you can use an image processing library, like Pillow (PIL), to convert them into images. Alternatively, there are online tools available where you can upload your PDFs, select the pages you want to convert, and download them as images. Depending on your familiarity with programming, you can choose the method that suits you best – whether it’s a custom script for more control or an online tool for simplicity. If you provide more details about your preferences or constraints, I can guide you further!

Moreover, you can utilize user-friendly online tools such as ilovepdf2.com or smallpdf.com for a swift and straightforward conversion. Be sure to refer to the documentation provided by your chosen solution for a detailed step-by-step guide on implementation.