Greetings, my company is actively evaluating the purchase of Spire.Office for .NET Site Enterprise Subscription.
We are looking at the capabilities for generating a PDF from HTML, and have come up with a few questions.
1) We are currently using the PdfDocument LoadFromHTML method. When I use the following code, the PDF generated from www.google.com contains scroll bars. Does the process of converting to HTML depend on loading a web browser / rendering engine?
2) Do you have documentation or suggestions for formatting the HTML / CSS to avoid scroll bars? Is there a suggested width?
3) Is there a way to have the document rendered in Landscape (currently it is in portrait)?
4) Are there HTML tags / attributes which will help control where page breaks occur in the rendered PDF?
5) Is there a mechanism to load HTML directly into a PDF without using a URL?
6) Is there any way to pass HTTP authentication information (headers / cookies) when loading HTML from a URL?
Thanks in advance.
private void button2_Click(object sender, EventArgs e) {
PdfDocument pdf = new PdfDocument();
string url = "http://www.google.com";
pdf.LoadFromHTML(url, true, true, true);
pdf.SaveToFile(@"C:\SpireTest.pdf");
pdf.Close();
DocViewer(@"C:\SpireTest.pdf");
}
private void DocViewer(string fileName) {
try {
System.Diagnostics.Process.Start(fileName);
} catch { }
}