I’m using an older version of your great product to convert documents. It’s the version 17.3 and I’m using the Viewer for conversion although the Conversion component may do it better.
Anyway, what I want to achieve works with the Viewer as well. But I have some questions in detail to better control the result.
My programming language is C# and I develop with Visual Studio 2019
So here we are.
I have an html-file which I want to convert to a jpg-File.
For this I instantiate the class ViewerImageHandler with an instance of ViewerConfig.
for the ImageOption instance I set these properties
imgOpt.ConvertImageFileType = ConvertImageFileType.JPG;
imgOpt.Height = 2970;
imgOpt.Width = 2100;
and finally I call GetPages of ViewerImageHandler like this
List Pages = imageHandler.GetPages(FilePath, imgOpt) ;
now I get a List of PageImage objects depending on the length of the html file.
From each PageImage I call CopyTo from the Stream property and convert it to a byte array. With this byte array I create an Image of namespace System.Drawing and store it on disk.
This works perfect so far.
An here are my questions:
How can I set the pagesize the number of pages depends on ?
An html-file has normally no pagesize information in it. It’s just an endless list of html elements. So when does a pagebreak happen ?
And also what about the marginvalues for left, right, top, border ?
Especiall left/right determines when a linebreak happens.
Here are two files where you see what currently happen.
The html-file is packed to MailSample.zip and PageImage_1.jpg is the jpg of the firs page.
Thanks for your support