0

Hello i am new to Azure logic app. Currently i am running into problem with PDF compression.

My problem is there are few files already stored in data lake and i want to check their size and if size exceeds 20mb then i need to compress and replace original file with compressed file in the data lake.

Firstly i am fetching data from data-lake and getting the content.And then i am getting metadata of the file and from the metadata i am extracting Size. Then if the size is greater then 20 then i am compressing.

Currently i am getting this error

This is the following flow

I am using List of file size for "True". My file sizes are usually more than 150MB. I feel this is the prime factor for the failure of compressor.

1 Answers1

0

You can use 3rd party connector to do this called Compress PDF document of plumsail connector. All you need to do is just login into plumsail and get the api for creating the connection. While in the logic app flow, As per your requirement we have used When a blob is added or modified (properties only) (V2) and checking if its size is greater than 20 mb using Condition connector. If yes, then we are using plumsails Compress PDF document and then as per the requirement you can save the file in the same folder with different name or you can save it in another folder of same. For instance i'm saving in container called documents >20mb. Here are few screenshots of my logic app for your reference:-

enter image description here

Result:

enter image description here

In Storage Account before Compression

enter image description here

In Storage Account after Compression

enter image description here

Scenario when the compressed file is still more than 20mb If the file is so large that even after compression it is still greater than 20MB then you can save it in the same folder but with a different name and then delete it after the requirement is completed.

SwethaKandikonda
  • 7,513
  • 2
  • 4
  • 18