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
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.
WarrenBelz
146,645
Most Valuable Professional
RandyHayes
76,287
Super User 2024 Season 1
Pstork1
65,997
Most Valuable Professional