How to edit some fields in the pdf file

How to edit some fields in the pdf file.

Use Case Description

Hi UiPath Family,

How to achieve this topic where I want to edit some fields in the pdf (example: Certificate no, Effective date, etc.) and attach in the mail. This process I has to do in the loop based on datarow wise.
Note: There is only one page contain in the pdf of template where m adding fields data as a string.

There are some other ways I was trying to achieve this,
1: I created a html page same as PDF file and m reading this with help of read text activity and updating the required fields using “Replace Function” and converting html file as pdf file but I can’t able to find the best way to convert the html to pdf is there any way we can achieve this ?

AS-IS WORKFLOW, TO-BE WORKFLOW

HF_Part1.pdf

Other information about the use case

Industry categories for this use case:

Skill level required: Advanced

UiPath Products that were used:

Other applications that were used: -

Other resources: -

What is the top ROI driver for this use case?: Increase employee engagement

@salman_shaikh1

You can print the page after opening the html page in browser

cheers

Hey Anil,

Thanks replying, I have tried this also but here I want a best use case where I don’t have to use Ui activities such as Click type and all.

Please let me know is there any way I can use code or custom activity etc.

@salman_shaikh1

Try to pass the html file path in http request and give a path in file response in the activity and check if that works

or you can use this invoke code

cheers

Thanks Anil,

ill check this and come back.

1 Like

as an alternate Strategy

  • change the PDF to a Form PDF
  • set the Form fields by a PDF Library And/or Form Data XML

Hi peter,
I have tried this but its manipulating the pdf format and m not getting the output as expected.
Anything else if i can try please guys let me know.

Hi Anil,

Can you please help me with the C# code which you have mentioned before, I have doubt regarding the same how will i assign a input parameter in this and how will i get output as PDF?

@salman_shaikh1

In the link shared you have the c# code already…use it in invoke code and in invoke code you can add input and output arguments

cheers

what was done in detail?

I have corrected the code as per the UiPath and syntax in C# code,

Arguments,

1: Input html file= html
2: Output pdf file= pdf
3: Google exe file: Google_str

Code:

var p = new System.Diagnostics.Process()
{
StartInfo =
{
FileName = Google_str,
Arguments = $@“/C --headless --disable-gpu --run-all-compositor-stages-before-draw --print-to-pdf-no-header --print-to-pdf=”“{pdf}”" “”{html}“”",
}
};

p.Start();
p.WaitForExit(60000);
int returnCode = p.ExitCode;
p.Close();

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.