How to perform a HTML download for a web page and save it as pdf?

Hi,

I have a string in html format, i have to download that html web page and save as pdf.

Thank you.

@nagaabhishekreddy.c

Save the html string to a notepad…using write text file and avae the fie with extension html…then use start process and pass chrome executable and the argument as the saves html…

This will open the html page as web page…then you can use pront command and save as pdf

Hope this helps

Cheers

Thanks for the reply, but i need it as a background process

@nagaabhishekreddy.c

Can you share what string you have…and you want to save the html data as pdf or the original data that is seen when html is opened?

Cheers

@nagaabhishekreddy.c

You can try using http request activity…save the
Html as .html file …then pass the filepath as request uri and you have an option called file name to response attachment…can try giving the pdf filepath there and that might work as well

Cheers

table {
font-family: arial, sans-serif;
border-collapse: collapse;
width: 100%;
}

td, th {
border: 1px solid #dddddd;
text-align: left;
padding: 8px;

}

tr:nth-child(odd) {
background-color: #dddddd;
}

Indiviual report
From Date To Date. Proposal Date Part Number
@{items('Apply_to_each')?['scheme_period_from_date']} @{items('Apply_to_each')?['proposal_date']} @{items('Apply_to_each')?['scheme_period_to_date']} @{items('Apply_to_each')?['part_no']}
<tr>
Part No @{items('Apply_to_each')?['part_no']} Date Signature

it is showing invalid URI when html file is passed

Maybe some packages from the marketplace will serve e.g.:

thanks all, found a c# code which can be used in invoke code

var p = new System.Diagnostics.Process()
{
StartInfo =
{
FileName = “C:/Program Files (x86)/Google/Chrome/Application/chrome.exe”,
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();

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