Hi,
I need convert multiple images to one word on the same page, if first image on the first page and first image’s height too big, second image can on second page.
but code can not do that, please help me, thank you!
the code ↓
private Document convertImagesToDocument(string[] base64Images)
{
var document = new Document();
var builder = new DocumentBuilder(document);
builder.PageSetup.PaperSize = PaperSize.A4;
for (var count = 0; count < base64Images.Length; count++)
{
var bytes = Convert.FromBase64String(base64Images[count]);
var ms = new MemoryStream(bytes);
var image = Image.FromStream(ms);
builder.InsertImage(image,
RelativeHorizontalPosition.Page,
0,
RelativeVerticalPosition.Page,
0,
ConvertUtil.PixelToPoint(image.Width, image.HorizontalResolution),
ConvertUtil.PixelToPoint(image.Height, image.VerticalResolution),
WrapType.None);
if (count < base64Images.Length - 1)
{
builder.InsertBreak(BreakType.SectionBreakNewPage);
}
}
return document;
}
Thanks