Is it possible to define some page size for rendering text-based files to HTML?
We are just doing a basic conversion to HTML like that:
using (var viewer = new Viewer(documentPath))
{
var options = HtmlViewOptions.ForEmbeddedResources(@"D:\output\output_viewer{0}.html");
viewer.View(options);
}
The resulting HTML has some width boundary, so the text gets wrapped properly and there also seems to be some mechanism that determines how many lines to take on a single page, depending on the line size, as each page has a different line count.
So the result is not bad, but it just does not really fit on a A4 page.
Is there maybe some option to achieve that?
For emails we are using this line, but I did not find anything similar for text-based files yet. options.EmailOptions.PageSize = PageSize.A4; Text Page Size.zip (9.1 KB)
Thank you for the detailed information and for logging this bug/feature request
I think if those values would be modifiable, we could find an approximation for A4 size.
That’s more or less the problem, yes.
But it is a bit different on our side, as we don’t print it, but display the html pages in our viewer, that has white pages for the content and gray background.
So in our case the text overflows the (hardcoded) A4 page size:
The fields MaxCharsPerRow and MaxRowsPerPage will be available as public properties starting from v21.6. We’ll notify you when the new version will be published.