Hi,
Hi there,
Thanks. It works for me.
Hi Iris,
Pdf pdf1 = new Pdf();<o:p></o:p>
//Create the section in the Pdf object
Aspose.Pdf.Generator.Section sec1 = pdf1.Sections.Add();
Aspose.Pdf.Generator.Table headerTable = new Aspose.Pdf.Generator.Table();
//Add the table in paragraphs collection of the desired section
sec1.Paragraphs.Add(headerTable);
headerTable.ColumnWidths = "100%";
var row1 = headerTable.Rows.Add();
row1.DefaultCellTextInfo.Alignment = Aspose.Pdf.Generator.AlignmentType.Center;
row1.DefaultCellTextInfo.FontName = "Helvetica-Bold";
row1.DefaultCellTextInfo.FontSize = 16;
var cell1 = row12.Cells.Add("Title");
cell1.VerticalAlignment = Aspose.Pdf.Generator.VerticalAlignmentType.Center;
var row2 = headerTable.Rows.Add();
row2.FixedRowHeight = 600;
Aspose.Pdf.Generator.Cell cell2 = row2.Cells.Add("");
cell2.VerticalAlignment = Aspose.Pdf.Generator.VerticalAlignmentType.Center;
Aspose.Pdf.Generator.Image logo = new Aspose.Pdf.Generator.Image();
logo.ImageInfo.File = myDir + "sunset.jpg";
logo.ImageInfo.ImageFileType = ImageFileType.Jpeg;
logo.ImageInfo.FixHeight = row2.FixedRowHeight;
logo.ImageInfo.FixWidth = sec1.PageInfo.PageWidth - sec1.PageInfo.Margin.Left - sec1.PageInfo.Margin.Right;
Text imageContainer = new Text();
Segment imageSegment = new Segment();
imageSegment.InlineParagraph = logo;
imageContainer.Segments.Add(imageSegment);
cell2.Paragraphs.Add(imageContainer);
pdf1.Save(myDir+"Table_ImageGen.pdf");
Please feel free to contact us for any further assistance.
Best Regards,
Thanks for your reply.
Hi Iris,
Hi Iris,
…
…
// to find
remaining space in page for image height deduct page top margin, page bottom margin,<o:p></o:p>
//table height, table top margin, pagerBorderMaring top and bottom from page height
logo.ImageInfo.FixHeight = sec1.PageInfo.PageHeight - sec1.PageInfo.Margin.Top - sec1.PageInfo.Margin.Bottom
- headerTable.GetHeight(pdf1) - headerTable.Margin.Top- sec1.PageInfo.PageBorderMargin.Top - sec1.PageInfo.PageBorderMargin.Bottom;
logo.ImageInfo.FixWidth = sec1.PageInfo.PageWidth - sec1.PageInfo.Margin.Left - sec1.PageInfo.Margin.Right;
.....
.....
Please feel free to contact us for any further assistance.
Best Regards,