# Facing error while converting pdf to image

**URL:** <https://forum.uipath.com/t/facing-error-while-converting-pdf-to-image/449132>\
**Category:** Activities\
**Tags:** uipath, pdf-to-image, pdf-conversion, pdf, activities\
**Created:** [June 17, 2022, 5:35pm UTC](https://forum.uipath.com/t/facing-error-while-converting-pdf-to-image/449132 "2022-06-17T17:35:25Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Neeraj\_Pokhriyal](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/neeraj_pokhriyal/32/232068_2.png) [@Neeraj\_Pokhriyal](https://forum.uipath.com/u/Neeraj_Pokhriyal)\
**Post date:** [June 17, 2022, 5:35pm UTC](https://forum.uipath.com/t/facing-error-while-converting-pdf-to-image/449132/1 "2022-06-17T17:35:25Z")

</div>

Hi,  
I want to convert pdf to image and want to insert signature in pdf file then facing error  
using spire.pdf Means want to attach signature image into pdf

 ![image](https://global.discourse-cdn.com/uipath/original/4X/7/8/7/787ec321132bb1ad611b4c362bd7b871ff8eb33b.jpeg)  
 ![MicrosoftTeams-image](https://global.discourse-cdn.com/uipath/original/4X/3/d/f/3dfef1382f5b5fe93b526772153a8a24f7557b3e.png)

using vb code for that

doc.LoadFromFile(iFilePath)  
NumberofPages=doc.Pages.Count  
page = doc.Pages(0)  
ImagePage=PdfImage.FromFile(ImagePath)  
page.Canvas.DrawString(insertText, font, brush, 15, 25)  
pageImage=doc.Pages(NumberofPages-1)  
'pageImage.Canvas.DrawImage(ImagePage,100,650,150,50)  
result = pageImage.FindText(“Confirmed as of the date first written above:”).Finds  
For Each find In result  
rec = find.Bounds  
'image.Canvas.DrawImage(pdfimage, rec.X, rec.Y+25, 55, 55)  
pageImage.Canvas.DrawImage(ImagePage,rec.X,rec.Y+35,150,50)

Next

pageImage2=doc.Pages(NumberofPages-2)  
result2 = pageImage2.FindText(“Confirmed as of the date first written above:”).Finds  
For Each find In result2  
rec = find.Bounds  
'image.Canvas.DrawImage(pdfimage, rec.X, rec.Y+25, 55, 55)  
pageImage2.Canvas.DrawImage(ImagePage,rec.X,rec.Y+35,150,50)

Next

doc.SaveToFile(oFilePath)

can anyone please help if any other solution available to manage, its very urgent

---

<div class="post-metadata">

**Author:** ![Rahul\_Unnikrishnan](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/rahul_unnikrishnan/32/464046_2.png) [@Rahul\_Unnikrishnan](https://forum.uipath.com/u/Rahul_Unnikrishnan)\
**Post date:** [June 17, 2022, 6:30pm UTC](https://forum.uipath.com/t/facing-error-while-converting-pdf-to-image/449132/2 "2022-06-17T18:30:02Z")

</div>

Hello @Neeraj_Pokhriyal

As per the error the tool has a limitation of converting if there are more than 3 pages.

Can you try with the Uipath activity

> **[Export PDF Page As Image](https://docs.uipath.com/activities/docs/export-pdf-page-as-image)**
>
> UiPath.PDF.Activities.PDF.ExportPDFPageAsImage Creates an image from a page in a specified PDF file. Properties Common DisplayName - The display name of the activity. File FileName - The name of the PDF file you want to export as an image. This field...

---

<div class="post-metadata">

**Author:** ![Neeraj\_Pokhriyal](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/neeraj_pokhriyal/32/232068_2.png) [@Neeraj\_Pokhriyal](https://forum.uipath.com/u/Neeraj_Pokhriyal)\
**Post date:** [June 18, 2022, 5:11am UTC](https://forum.uipath.com/t/facing-error-while-converting-pdf-to-image/449132/3 "2022-06-18T05:11:29Z")

</div>

can you please help how to insert image into pdf which has more than 10 pages
