Можно отправить в HTML и CSS с помощью Angular 7, например, в pdfcrowd, чтобы создать PDF со стилем?
Теперь я отправляю только Innerhtml.
Мне нужен способраспечатать файл PDF, используя Angular 7 и .NET core.Я уже пробовал Докраптор и JSPDF.
public async Task<ActionResult> Post([FromBody] PrintModel body)
{
try
{
// create the API client instance
pdfcrowd.HtmlToPdfClient client = new pdfcrowd.HtmlToPdfClient(
"user", "password");
byte[] pdf = client.convertString(body.EmailBody);
var response = File(pdf, "application/octet-stream");
return (response);
}
catch (pdfcrowd.Error why)
{
// report the error
System.Console.Error.WriteLine("Pdfcrowd Error: " + why);
// handle the exception here or rethrow and handle it at a higher level
throw;
}
}