I want to change the page orientation to landscape for pages with wide tables. Can I use "named pages" to change page orientation?
I would like to change page orientation with @page CSS but it is not working.
The following document mentions that I can change page orientation with @page CSS but it is not in my example.
https://www.essentialobjects.com/doc/pdf/htmltopdf/page_size.aspxHere is my HTML:
Code: HTML/ASPX
<!DOCTYPE html>
<html>
<head>
<style>
h1 {
color: blue;
}
@media print {
h1 {
color: red;
}
@page {
size: landscape;
margin: 0;
}
}
</style>
</head>
<body>
<h1>
test
</h1>
</body>
</html>
Here is my converter code
Code: C#
MemoryStream ms = new MemoryStream();
HtmlToPdf.Options.UsePrintMedia = true;
var conversion = HtmlToPdf.ConvertHtml(htmlString, ms);
return ms.ToArray();