Skip to main content

Notifications

Community site session details

Community site session details

Session Id : Bes+rqyUYjGScNQuykxrai
Power Apps - Building Power Apps
Unanswered

add text and image to existing pdf in power automate desktop

Like (0) ShareShare
ReportReport
Posted on 29 Feb 2024 17:27:29 by 141

Hi,

I want to add text and image in existing pdf using power automate desktop

Tried many things but still its not working

 

tried power shell script

Set-Location C:\.nuget\packages\freespire.pdf\8.6.0\lib\net6.0\
[void] [Reflection.Assembly]::LoadFile("C:\.nuget\packages\freespire.pdf\8.6.0\lib\net6.0\Spire.Pdf.dll")


spire.pdf.pdfdocument

$pdfdocument = New-Object spire.pdf.pdfdocument
$ImagePage=New-Object spire.pdf.Graphics.PdfImage
$page=New-Object spire.pdf.PdfPageBase
$font=New-Object spire.pdf.Graphics.PdfFont
$brush=New-Object spire.pdf.Graphics.PdfSolidBrush
$pdfdocument.LoadFromFile("C:\Downloads\ESS time entry\example.pdf")
$NumberofPages=$pdfdocument.Pages.Count
$page = $pdfdocument.Pages(0)
$ImagePage=$ImagePage.PdfImage.FromFile("C:\Downloads\ESS time entry\New Bitmap Image.bmp")
$page.Canvas.DrawString("abcdef", font, brush, 15, 25)

 

but nothing works

 

can anyone please help

 

Thanks

Neeraj

Categories:
  • Resolutions Profile Picture
    125 on 29 Mar 2024 at 04:54:13
    Re: add text and image to existing pdf in power automate desktop

    It seems like you're trying to use PowerShell to manipulate PDFs using the Spire.PDF library. However, Power Automate Desktop does not directly support PowerShell scripting for PDF manipulation. Instead, you can achieve this task using Power Automate Desktop actions.

    Here's a general outline of how you can add text and an image to an existing PDF using Power Automate Desktop:

    1. **Open PDF:** Use the "Open Application" action to open the PDF file you want to modify.

    2. **Locate Insertion Point:** Use image recognition or coordinate-based actions to locate the insertion point in the PDF where you want to add the text and image.

    3. **Add Text:** Use the "Type Text" action to input the desired text at the identified insertion point.

    4. **Add Image:** Use the "Insert Image" action to insert the image at the identified insertion point.

    5. **Save PDF:** Use the appropriate action to save the modified PDF.

    6. **Close PDF Application:** Use the "Close Application" action to close the PDF application.

    Remember to adjust the actions and parameters based on your specific requirements and the PDF application you're using. Additionally, ensure that the PDF application supports automation through Power Automate Desktop.

    If you encounter specific issues or errors while implementing this workflow, feel free to provide more details, and I can assist you further.

    I hope this helps

     

    If I have answered your question, please mark your post as Solved.
    If you like my response, please give it a Thumbs Up.

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

🌸 Community Spring Festival 2025 Challenge Winners! 🌸

Congratulations to all our community participants!

Warren Belz – Community Spotlight

We are honored to recognize Warren Belz as our May 2025 Community…

Congratulations to the April Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard > Power Apps - Building Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 146 Most Valuable Professional

#2
MS.Ragavendar Profile Picture

MS.Ragavendar 81

#3
stampcoin Profile Picture

stampcoin 68

Overall leaderboard
Loading started
Loading complete