Spire.Doc is a professional Word .NET library specifically designed for developers to create, read, write, convert and print Word document files. Get free and professional technical support for Spire.Doc for .NET, Java, Android, C++, Python.

Fri Oct 19, 2018 4:01 am

Dear Admin,
I was attempt to try to convert from html to png, but display results is not incorrect with html content, it is missing
please check html in attachment file

I want to all content html display in 1 page

khiemnt
 
Posts: 1
Joined: Wed Jul 25, 2018 3:26 pm

Fri Oct 19, 2018 11:37 am

Hi,

Thanks for your inquiry.
When creating an instance Document, the default size is A4. As for your content, the size A4 is not enough to put all contents in one page. Please refer to the following code to change the size of document:
Code: Select all
Document doc = new Spire.Doc.Document(@"D:\\temp.html", FileFormat.Html);
//change size
doc.Sections[0].PageSetup.PageSize = new SizeF(1000, 1584);
doc.Sections[0].PageSetup.Orientation = PageOrientation.Landscape; 
Image image = doc.SaveToImages(0, ImageType.Bitmap);
image.Save("D:\\sample.png", ImageFormat.Png);

Besides, I noticed that the there are some problems with content format in result image. I have posted the issue to our DEV team. Once there is any update, we will let you know.

Sincerely
Anna
E- iceblue support team
User avatar

Anna.Zhang
 
Posts: 73
Joined: Thu Sep 27, 2018 3:20 am

Return to Spire.Doc