Skip to main content

Notifications

Community site session details

Community site session details

Session Id : 0Dj3BoZRwsUk/VzlTn/F27
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 🌸

WIN Power Platform Community Conference 2025 tickets!

Markus Franz – Community Spotlight

We are honored to recognize Markus Franz as our April 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,645 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 65,997 Most Valuable Professional

Leaderboard
Loading started