Requirement :
- Read PDF files one by one
- Capture the PDF File name
3.Replace the text next to “Credit Card number” text with ***** - save as PDF again (same file name)
PS: Attached Sample PDF
PDFSample1.pdf (206.0 KB)
Requirement :
PS: Attached Sample PDF
PDFSample1.pdf (206.0 KB)
I’ve successfully replicated your scenario and generated the solution file. You can find it attached below.
Read PDF file and replace the text next to particular text and save as PDF again.zip (307.0 KB)
Here’s a breakdown of the steps I took to create the workflow:
Hope it helps you out!
Sequence
PDFFilePath = “path_to_your_PDF_file”
PDFContent = Read PDF Text (PDFFilePath)
FileNameWithoutExtension = Path.GetFileNameWithoutExtension(PDFFilePath)
ModifiedContent = Regex.Replace(PDFContent, “(?<=Credit Card number:\s*)(\d{4}\s\d{4}\s\d{4}\s\d{4})”, “**** **** **** ****”)
Write Text File (FileNameWithoutExtension + “_Modified.pdf”, ModifiedContent)
Sorry the input pdf file is Scanned PDF… Is this logic will work?
I am able to read scanned pdf using read pdf ocr… but the format is changing after saved as text file.
Is it possible to keep the output PDF as same as input pdf file format?
Yes you can implement it using "Read PDF with OCR " activity
Please find the below workflow updated according to your requirement
Read PDF file and replace the text next to particular text and save as PDF again.zip (429.2 KB)
Hope it helps you out!
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.