Hi John,
Thanks for your patience.
I have tried to add table at specific position using the feature of placing FloatBox but I got no success. You may check the following code snippet which I have used to achieve the functionality. It seemed that sizing the SVG image is not working (i.e highlighted part) and floating box also did not appear at expected position.
FileStream pdfReader = new FileStream(dataDir + “input.pdf”, FileMode.Open);<o:p></o:p>
string signatureFieldName = "sign1";
Document pdfDocument = new Document(pdfReader);
Field result = Array.Find(pdfDocument.Form.Fields, p => p.FullName ==
signatureFieldName);
if (result != null)
{
Rectangle sigRectangle = pdfDocument.Form[signatureFieldName].GetRectangle(false);
Aspose.Pdf.Image img = new
Aspose.Pdf.Image();
img.FileType = Aspose.Pdf.ImageFileType.Svg;
img.File = dataDir + "sample.svg";
img.FixWidth = sigRectangle.Width;
img.FixHeight = sigRectangle.Height;
Aspose.Pdf.Table table = new
Aspose.Pdf.Table();
table.ColumnWidths =
sigRectangle.Width.ToString();
Aspose.Pdf.Row row = table.Rows.Add();
Aspose.Pdf.Cell cell = row.Cells.Add();
table.ColumnAdjustment = ColumnAdjustment.Customized;
cell.Paragraphs.Add(img);
FloatingBox aBox = new FloatingBox((float)sigRectangle.Width, (float)sigRectangle.Height);
aBox.Left = 5;
aBox.Top = 5;
aBox.Border = new BorderInfo(BorderSide.All, Aspose.Pdf.Color.Red);
aBox.BackgroundColor = Aspose.Pdf.Color.Yellow;
aBox.Paragraphs.Add(table);
pdfDocument.Pages[pdfDocument.Form[signatureFieldName].PageIndex].Paragraphs.Add(aBox);
pdfDocument.Save(pdfReader);
}
Therefore I have logged issue(s) as PDFNET-42590 (SVG image size) and PDFNET-42591 (Add table at specified location) in our issue tracking system. We will further process it for investigation and keep you updated on the status of its correction. Please be patient and spare us a little time.
Furthermore as shared earlier, you may consider
Converting SVG To Raster Format using Aspose.Imaging for .NET and then use the same raster image inside PDF document using the earlier code snippet which I have shared in my early reply.
We are sorry for the inconvenience caused.
Best Regards,