Add and Remove Watermarks from PDF Documents

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hey this is Jay from in codian So today we're going to have a look about how we can add and remove watermarks from a PDF document we're going to create a really simple flow that just shows the flow of adding and removing it's not going to be a real world scenario but it will give you the information needed to uh add and obviously remove watermarks so let's go into Power automate we create a new flow I'm just going to do an instant flow and we can just call this D Mo add and remove watermarks lovely so we've got manually triggered Pro so the first thing I'm going to need to do is configure the Trigger action um to provide a file so that's a file I'm going to pass in so I'm just going to do add an input file and that's going to be my PDF document that I pass in so the first thing I'm going to do to the flow let me just drag this over to the right is I'm going to add um an action to add a watermark to the document so we can just do water sorry add watermark in power automate and that will bring up the encoding connector so we've got various different um addition of Watermark actions if you would both word PDF and image um what I'm going to do is I'm going to add an image Watermark to the PDF document first and I should be able to pick up most of the data I need from Dynamic data so I've just click C more and I can see file name I've passed in we're going to take the file content or the content byes the actual file itself um I also need to take a watermark file name water file content so I should probably update this trigger and add another input file and we'll just call this uh image Watermark okay so now go back to this ction this time I'm going to pass in we should now see that Dynamic data as well so image water mark file name and the content byes okay so we don't need to if if I wanted to I can go and configure some of these other actions here sorry these are properties so we just click show all you can see um I've got some information in here I can override an existing Watermark if I've pass in the ID I can change the opacity so on and so forth now um I've got this orientation set horizontal so it's going to try and put it in the center of the page I think I'll just leave that as is for now the next thing we're going to do is I'm going to add another image not an image waterart this time I'm going to add a text Watermark to the document there's a reason for this so let's just go and do add a text Watermark to PDF and I'm going to pass in excuse me right F now it's really important here that I actually pass in the file and file cont sorry the file content coming from the add image Watermark action because obviously if I pass the file from the start it won't be the one that contains the image Watermark um so I'm going to do I'm going to select the file name that comes from the previous encod in action which is the image Watermark one I can select the file content again from the same um from the same action and I'm just going to do let's just do something really simple I'll just do draft and maybe let's just choose a function we'll just pop in oh sorry UTC now and that should do that oh be with me click add so now we've got draft Ty and UTC now and I can I can specify on the page how I want that to appear I'll pop it in as diagonal just as an example and if I need be I can configure some um some of the properties which govern how that that Watermark is going to appear so the font text color size so on and so forth so I'll just change it to white one two three right okay we're getting there so now we've got a flow that when executed will'll take the PDF document that's been provided it's going to generate sorry it's going to add the image Watermark and then it's going to add a text Watermark and what I'm going to do at this stage I'm going to add an action just to create the file so we can see the file at this particular stage I'll just drop it onto One Drive let's just pop it into I should have a blocks folder somewhere there we go um actually let's just change that a moment there we go PDF watermarks uh I can pass in the file name coming from the text Watermark this time because that's the last action and again the file content from that as well so that's going to now save that amended file now what I want to do at this stage is I want to remove all of the water marks uh and show you how this action works so nice and simple so this time I'm going to do remove Watermark and remove water you can see there we've got an action for word but I'm going to use the one here you'll notice the difference actually between the S here so with word can only have a single Watermark whereas with the PDF you can have as many as you've added so hence the difference there so remove watermarks from PDF I'm going to pass in the file from the last incode in action added the text Watermark so there we go and then file content okay right now I'm going to just set this at this stage to remove all of the watermarks that have just been added okay so let's just do add an action we'll do create file again so we can see those uh water marks being removed and we'll just rename that to removed I'm going to pop it into the same place into my blogs PDF watermarks folder and this I'm going to say PDF sorry uh file with watermarks removed PDF and this on file content again I'm just going to pass in the removed version okay so that's going to show so what we should now see is our original document gets pass in two water marks get added I've saved that file and then going to remove those water marks and save it again and then the last example I'm going to give you is I'm going to remove the water marks but this time I only want to going to remove a specific Watermark so how do we do that so again remove Watermark and I'm going to do remove water marks from PDF now I'm going to choose the file name not from the obviously if I pick him from remove those the water marks have already been removed so that's not what I need to do I need to pick from the last Watermark Edition action which was add text Watermark to PDF so I'll take the file name and again I'll take the file content so add text waterart to PDF take the file content now this time I'm going to do is I'm going to spec I'm going to just click there and I can see I've got this property here called Watermark IDs where I can specify one or more specific watermarks to remove and obiously I can of course configure the types where it's an image text all watermarks I'll leave it as all watermarks and I'm going to Target the text well that's actually not I'm going to Target the image Watermark so all of the um en codian addition Watermark actions for the PDF document format will provide a um let's go to the image one we'll provide a property called Watermark ID so the identify applied to the watermark so I can use that to later remove that Watermark so think of a scenario where I've created a PDF document I've put draft watermark on it and then want to remove that draft Watermark at a later stage when the document's been approved and then I want to add the approved waterm Mark so this is you know the example of how you might do this obviously you have the challenge of well where do I store The Watermark ID and I know what a lot of our customers will do they'll store that Watermark D may as as perhaps an item of metadata against the document in SharePoint or whichever document management system you're using so that you can you can do something similar so anyway I'm going to pass in the watermark ID so what I should now say for um this action it should just remove the watermark image because that's where the IDS come from and I should just see the text Watermark remaining so let's just let's just test out that theory we'll do add an action and we'll do create file whoops add an action create file and we're going to again pop into to the same directory we're going to go blogs we're going to PDF watermarks and there we go remove the water marks just the image and sorry I'm going to change that in the moment say file content and I'm going to say what did we call the other one let's just double check it so we called it file Mark we can't spell watermarks that's for sure uh right let's go back to this one and we're going to give it a file name it always does that a new UI feature should we say file with image Watermark removed so let's just okay so let's just quickly check what we've got going on here so create file removed image watermark Okay so we've got the flow being triggered we're adding an image Watermark to that PDF document we've passed in and obviously the image we've passed in as well we're adding a text Watermark we're then going to create that file and save it on one drive so we can look at it the next thing we're going to do is we're going to remove all the watermarks and save your copy of that just so we can see all of those watermarks we've added being removed and the far being saved and the last thing we're going to do is we're going to uh run the removal action again or Watermark removal action again from the same PDF but this time we're just going to take the image away and then we're going to save it so let's see if we've got this right and let's run a test right here we go so we've got our template file and then we've got our image Watermark okay and that's going to run through now as this runs through I'm going to be able to pick up these files that have been added via one drive so we can see these being popped in here as they come through okay it appears I updated the template which was not EXA the ideal thing to do but we've done that so let's just check what we've got here so that template PDF has been updated and that now contains two water marks as we can see here so we've got the image Watermark bear with me apologies for that we've got the image watermark in the background with the opacity set and then you can see we've got the diagonal text Watermark has been added as well to that document okay so let's have a look with the water marks being removed so just double click that file and we can see there's the document with the file with the water marks removed they have been removed let me just see if I can resize this window a little bit so it's a little bit easier for you to see okay there we go so there's the document that had the water marks added to it there's the file with the water marks been removed now let's just check it where we've just removed the or targeted the image Watermark and oh seems we did that the wrong way around we must have targeted the uh the text Watermark which was a bit silly but it get the idea let's just let's just double check that and we'll we'll we'll we'll just update this flow slightly and run that again okay we're back to the start let's just go into our flow so what we what I obviously made a mistake here is when I did remove just remove the image I must have passed in the ID here from the wrong action so I need to pass in the water Watermark ID coming from the image Watermark not text one so add image Watermark to PDF and let's pass in the ID of the image one click save and let's just run this through again what I might also do actually is when we do the uh create file here let's just rename this file a little bit water marks added. PDF that would have been better to do at the start and let's test this again and ready to test we can use the same trigger as before we should just watch be able to watch these as a flow runs through we should be able to have a look at these um fars as they get added so we've got far with the water marks added far with water marks removed so there's the water marks present those the water marks removed and this is the file with just the image water mark removed and there we go so we've got the text water mark that's been left in so hopefully this gives you a really good um sort of grounding of how you can work with the encoding actions both to add water marks but also to remove them later on and you can either do that by saying all water marks of a specific type or all types or of course you can pass in uh the IDS of the watermarks that you wish to review as ever if you have any questions uh you can uh email us at support encoding.com but don't forget to check out the support portal as well which is support. encoding.com there's lots of useful documentation on there which should be able to help you out as well
Info
Channel: Encodian
Views: 224
Rating: undefined out of 5
Keywords:
Id: fyfOt1c2dh8
Channel Id: undefined
Length: 14min 53sec (893 seconds)
Published: Fri Jan 12 2024
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.