Hi,
I noticed that images(svg/jpeg) do not work with the table AutoFitToContent property. The images are unreadable. All the columns are getting collapsed.
Here is a code sample with the attached images I was testing with:
Debug.zip (38.5 KB)
Document doc = new Document();
Page page = doc.Pages.Add();
page.PageInfo.Width = PageSize.PageLetter.Width;
page.PageInfo.Height = PageSize.PageLetter.Height;
page.PageInfo.Margin = new MarginInfo(27, 47, 27, 27);
using (var checkStream = new FileStream(@"check.svg", FileMode.Open))
using (var svgChartStream = new FileStream(@"chart.svg", FileMode.Open))
using (var jpgChartStream = new FileStream(@"chart.jpeg", FileMode.Open))
{
checkStream.Position = 0;
svgChartStream.Position = 0;
jpgChartStream.Position = 0;
var checkSvg = new Aspose.Pdf.Image
{
FileType = ImageFileType.Svg,
ImageStream = checkStream,
FixHeight = 12,
FixWidth = 12
};
var svgChart = new Aspose.Pdf.Image{
FileType = ImageFileType.Svg,
ImageStream = svgChartStream
};
var jpgChart = new Aspose.Pdf.Image
{
FileType = ImageFileType.Unknown,
ImageStream = jpgChartStream,
FixWidth = 300,
FixHeight = 350
};
var wideTable = new Table
{
ColumnAdjustment = ColumnAdjustment.AutoFitToContent,
DefaultCellBorder = new BorderInfo(BorderSide.All, 1f),
Broken = TableBroken.Vertical
};
page.Paragraphs.Add(wideTable);
var wideRow = wideTable.Rows.Add();
var cell4 = wideRow.Cells.Add();
cell4.Paragraphs.Add(checkSvg);
var cell5 = wideRow.Cells.Add();
cell5.Paragraphs.Add(jpgChart);
var cell6 = wideRow.Cells.Add();
cell6.Paragraphs.Add(svgChart);
doc.ProcessParagraphs();
doc.Save("AutoFitToContentSvgs.pdf");
}